| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 .setDisabled(styleSheet->disabled()) | 1209 .setDisabled(styleSheet->disabled()) |
| 1210 .setSourceURL(finalURL()) | 1210 .setSourceURL(finalURL()) |
| 1211 .setTitle(styleSheet->title()) | 1211 .setTitle(styleSheet->title()) |
| 1212 .setFrameId(m_pageAgent->frameId(frame)); | 1212 .setFrameId(m_pageAgent->frameId(frame)); |
| 1213 | 1213 |
| 1214 return result.release(); | 1214 return result.release(); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 static PassRefPtr<TypeBuilder::Array<String> > selectorsFromSource(const CSSRule
SourceData* sourceData, const String& sheetText) | 1217 static PassRefPtr<TypeBuilder::Array<String> > selectorsFromSource(const CSSRule
SourceData* sourceData, const String& sheetText) |
| 1218 { | 1218 { |
| 1219 DEFINE_STATIC_LOCAL(RegularExpression, comment, ("/\\*[^]*?\\*/", TextCaseSe
nsitive, MultilineEnabled)); | 1219 RegularExpression comment("/\\*[^]*?\\*/", TextCaseSensitive, MultilineEnabl
ed); |
| 1220 RefPtr<TypeBuilder::Array<String> > result = TypeBuilder::Array<String>::cre
ate(); | 1220 RefPtr<TypeBuilder::Array<String> > result = TypeBuilder::Array<String>::cre
ate(); |
| 1221 const SelectorRangeList& ranges = sourceData->selectorRanges; | 1221 const SelectorRangeList& ranges = sourceData->selectorRanges; |
| 1222 for (size_t i = 0, size = ranges.size(); i < size; ++i) { | 1222 for (size_t i = 0, size = ranges.size(); i < size; ++i) { |
| 1223 const SourceRange& range = ranges.at(i); | 1223 const SourceRange& range = ranges.at(i); |
| 1224 String selector = sheetText.substring(range.start, range.length()); | 1224 String selector = sheetText.substring(range.start, range.length()); |
| 1225 | 1225 |
| 1226 // We don't want to see any comments in the selector components, only th
e meaningful parts. | 1226 // We don't want to see any comments in the selector components, only th
e meaningful parts. |
| 1227 int matchLength; | 1227 int matchLength; |
| 1228 int offset = 0; | 1228 int offset = 0; |
| 1229 while ((offset = comment.match(selector, offset, &matchLength)) >= 0) | 1229 while ((offset = comment.match(selector, offset, &matchLength)) >= 0) |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 | 1775 |
| 1776 RefPtr<StylePropertySet> tempDeclaration = StylePropertySet::create(); | 1776 RefPtr<StylePropertySet> tempDeclaration = StylePropertySet::create(); |
| 1777 OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDat
aList()); | 1777 OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDat
aList()); |
| 1778 StyleSheetHandler handler(m_styleText, ruleSourceDataResult.get()); | 1778 StyleSheetHandler handler(m_styleText, ruleSourceDataResult.get()); |
| 1779 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get
(), m_styleText, &handler, m_element->document()->elementSheet()->contents()); | 1779 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get
(), m_styleText, &handler, m_element->document()->elementSheet()->contents()); |
| 1780 return ruleSourceDataResult->first().release(); | 1780 return ruleSourceDataResult->first().release(); |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 } // namespace WebCore | 1783 } // namespace WebCore |
| 1784 | 1784 |
| OLD | NEW |