Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Unified Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 1182933004: Split up inspector interfaces to CSSParser::parse(Sheet/DeclarationList) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/parser/CSSParserImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorStyleSheet.cpp
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index b4f6829789ea98155415b282047c2ecdc936f45e..1b3de94f2553f97be8bec26370ff25c577fc5a09 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -289,8 +289,7 @@ void StyleSheetHandler::observeComment(unsigned startOffset, unsigned endOffset)
RuleSourceDataList sourceData;
StyleSheetHandler handler(commentText, m_document, &sourceData);
- RefPtrWillBeRawPtr<MutableStylePropertySet> tempMutableStyle = MutableStylePropertySet::create();
- CSSParser::parseDeclarationList(parserContextForDocument(m_document), tempMutableStyle.get(), commentText, &handler);
+ CSSParser::parseDeclarationListForInspector(parserContextForDocument(m_document), commentText, handler);
WillBeHeapVector<CSSPropertySourceData>& commentPropertyData = sourceData.first()->styleSourceData->propertyData;
if (commentPropertyData.size() != 1)
return;
@@ -407,7 +406,7 @@ bool ParsedStyleSheet::ensureSourceData()
OwnPtrWillBeRawPtr<RuleSourceDataList> result = adoptPtrWillBeNoop(new RuleSourceDataList());
StyleSheetHandler handler(text(), m_pageStyleSheet->ownerDocument(), result.get());
- CSSParser::parseSheet(parserContextForDocument(m_pageStyleSheet->ownerDocument()), nullptr, text(), &handler);
+ CSSParser::parseSheetForInspector(parserContextForDocument(m_pageStyleSheet->ownerDocument()), text(), handler);
setSourceData(result.release());
return hasSourceData();
}
@@ -519,11 +518,10 @@ PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> > Insp
bool InspectorStyle::verifyPropertyText(const String& propertyText, bool canOmitSemicolon)
{
DEFINE_STATIC_LOCAL(String, bogusPropertyName, ("-webkit-boguz-propertee"));
- RefPtrWillBeRawPtr<MutableStylePropertySet> tempMutableStyle = MutableStylePropertySet::create();
RuleSourceDataList sourceData;
String declarationText = propertyText + (canOmitSemicolon ? ";" : " ") + bogusPropertyName + ": none";
StyleSheetHandler handler(declarationText, ownerDocument(), &sourceData);
- CSSParser::parseDeclarationList(parserContextForDocument(ownerDocument()), tempMutableStyle.get(), declarationText, &handler);
+ CSSParser::parseDeclarationListForInspector(parserContextForDocument(ownerDocument()), declarationText, handler);
WillBeHeapVector<CSSPropertySourceData>& propertyData = sourceData.first()->styleSourceData->propertyData;
unsigned propertyCount = propertyData.size();
@@ -1143,7 +1141,7 @@ bool InspectorStyleSheet::verifyRuleText(const String& ruleText)
RuleSourceDataList sourceData;
String text = ruleText + " div { " + bogusPropertyName + ": none; }";
StyleSheetHandler handler(text, ownerDocument(), &sourceData);
- CSSParser::parseSheet(parserContextForDocument(ownerDocument()), nullptr, text, &handler);
+ CSSParser::parseSheetForInspector(parserContextForDocument(ownerDocument()), text, handler);
unsigned ruleCount = sourceData.size();
// Exactly two rules should be parsed.
@@ -1174,7 +1172,7 @@ bool InspectorStyleSheet::verifySelectorText(const String& selectorText)
RuleSourceDataList sourceData;
String text = selectorText + " { " + bogusPropertyName + ": none; }";
StyleSheetHandler handler(text, ownerDocument(), &sourceData);
- CSSParser::parseSheet(parserContextForDocument(ownerDocument()), nullptr, text, &handler);
+ CSSParser::parseSheetForInspector(parserContextForDocument(ownerDocument()), text, handler);
// Exactly one rule should be parsed.
unsigned ruleCount = sourceData.size();
@@ -1200,7 +1198,7 @@ bool InspectorStyleSheet::verifyMediaText(const String& mediaText)
RuleSourceDataList sourceData;
String text = "@media " + mediaText + " { div { " + bogusPropertyName + ": none; } }";
StyleSheetHandler handler(text, ownerDocument(), &sourceData);
- CSSParser::parseSheet(parserContextForDocument(ownerDocument()), nullptr, text, &handler);
+ CSSParser::parseSheetForInspector(parserContextForDocument(ownerDocument()), text, handler);
// Exactly one media rule should be parsed.
unsigned ruleCount = sourceData.size();
@@ -1927,7 +1925,7 @@ PassRefPtrWillBeRawPtr<CSSRuleSourceData> InspectorStyleSheetForInlineStyle::get
RuleSourceDataList ruleSourceDataResult;
StyleSheetHandler handler(m_styleText, &m_element->document(), &ruleSourceDataResult);
- CSSParser::parseDeclarationList(parserContextForDocument(&m_element->document()), nullptr, m_styleText, &handler);
+ CSSParser::parseDeclarationListForInspector(parserContextForDocument(&m_element->document()), m_styleText, handler);
return ruleSourceDataResult.first().release();
}
« no previous file with comments | « Source/core/css/parser/CSSParserImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698