Title: [98714] trunk
Revision
98714
Author
[email protected]
Date
2011-10-28 02:43:30 -0700 (Fri, 28 Oct 2011)

Log Message

Web Inspector: CSS background-image applied inline shows a warning, but still works.
https://bugs.webkit.org/show_bug.cgi?id=70325

Reviewed by Antti Koivisto.

Source/WebCore:

This change eliminates the "non-parsed property" warning displayed next to any
"background-image" property of an element's inline style.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseDeclaration):
* css/CSSParser.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):

LayoutTests:

* inspector/styles/styles-new-API-expected.txt:
* inspector/styles/styles-new-API.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98713 => 98714)


--- trunk/LayoutTests/ChangeLog	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/LayoutTests/ChangeLog	2011-10-28 09:43:30 UTC (rev 98714)
@@ -1,3 +1,13 @@
+2011-10-19  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: CSS background-image applied inline shows a warning, but still works.
+        https://bugs.webkit.org/show_bug.cgi?id=70325
+
+        Reviewed by Antti Koivisto.
+
+        * inspector/styles/styles-new-API-expected.txt:
+        * inspector/styles/styles-new-API.html:
+
 2011-10-28  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: CallStackSidebarPane should remove discarded Placards from RawSourceCode listeners list

Modified: trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt (98713 => 98714)


--- trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt	2011-10-28 09:43:30 UTC (rev 98714)
@@ -87,7 +87,8 @@
 style
 raw style
 ['font-weight':'normal'] @[0-20] active
-['width':'85%'] @[21-31] active
+['width':'85%'] @[21-32] active
+['background-image':'url(bar.png)'] @[33-63] active
 
 === Attribute styles for table ===
 Attribute: width

Modified: trunk/LayoutTests/inspector/styles/styles-new-API.html (98713 => 98714)


--- trunk/LayoutTests/inspector/styles/styles-new-API.html	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/LayoutTests/inspector/styles/styles-new-API.html	2011-10-28 09:43:30 UTC (rev 98714)
@@ -350,7 +350,7 @@
 </style>
 </head>
 
-<body id="mainBody" class="main1 main2 mainpage" _onload_="runTest()" style="font-weight: normal; width: 85%">
+<body id="mainBody" class="main1 main2 mainpage" _onload_="runTest()" style="font-weight: normal; width: 85%; background-image: url(bar.png)">
 <p>
 Tests that InspectorCSSAgent API methods work as expected.
 </p>

Modified: trunk/Source/WebCore/ChangeLog (98713 => 98714)


--- trunk/Source/WebCore/ChangeLog	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/Source/WebCore/ChangeLog	2011-10-28 09:43:30 UTC (rev 98714)
@@ -1,3 +1,20 @@
+2011-10-19  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: CSS background-image applied inline shows a warning, but still works.
+        https://bugs.webkit.org/show_bug.cgi?id=70325
+
+        Reviewed by Antti Koivisto.
+
+        This change eliminates the "non-parsed property" warning displayed next to any
+        "background-image" property of an element's inline style.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseDeclaration):
+        * css/CSSParser.h:
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyle::setPropertyText):
+        (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
+
 2011-10-28  Adam Barth  <[email protected]>
 
         Attempt to fixenate Qt.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (98713 => 98714)


--- trunk/Source/WebCore/css/CSSParser.cpp	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2011-10-28 09:43:30 UTC (rev 98714)
@@ -546,12 +546,15 @@
     ASSERT(dummyStyleSheet->hasOneRef());
 }
 
-bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string, RefPtr<CSSStyleSourceData>* styleSourceData)
+bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string, RefPtr<CSSStyleSourceData>* styleSourceData, CSSStyleSheet* contextStyleSheet)
 {
     // Length of the "@-webkit-decls{" prefix.
     static const unsigned prefixLength = 15;
 
-    setStyleSheet(declaration->parentStyleSheet());
+    if (contextStyleSheet)
+        setStyleSheet(contextStyleSheet);
+    else
+        setStyleSheet(declaration->parentStyleSheet());
     if (styleSourceData) {
         m_currentRuleData = CSSRuleSourceData::create();
         m_currentRuleData->styleSourceData = CSSStyleSourceData::create();

Modified: trunk/Source/WebCore/css/CSSParser.h (98713 => 98714)


--- trunk/Source/WebCore/css/CSSParser.h	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/Source/WebCore/css/CSSParser.h	2011-10-28 09:43:30 UTC (rev 98714)
@@ -70,7 +70,7 @@
     static bool parseSystemColor(RGBA32& color, const String&, Document*);
     PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(int propId, CSSParserValue*);
     bool parseColor(CSSMutableStyleDeclaration*, const String&);
-    bool parseDeclaration(CSSMutableStyleDeclaration*, const String&, RefPtr<CSSStyleSourceData>* styleSourceData = 0);
+    bool parseDeclaration(CSSMutableStyleDeclaration*, const String&, RefPtr<CSSStyleSourceData>* = 0, CSSStyleSheet* contextStyleSheet = 0);
     bool parseMediaQuery(MediaList*, const String&);
 
     Document* document() const;

Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (98713 => 98714)


--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2011-10-28 09:36:43 UTC (rev 98713)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2011-10-28 09:43:30 UTC (rev 98714)
@@ -189,9 +189,9 @@
 
     if (propertyText.stripWhiteSpace().length()) {
         RefPtr<CSSMutableStyleDeclaration> tempMutableStyle = CSSMutableStyleDeclaration::create();
+        RefPtr<CSSStyleSourceData> sourceData = CSSStyleSourceData::create();
         CSSParser p;
-        RefPtr<CSSStyleSourceData> sourceData = CSSStyleSourceData::create();
-        p.parseDeclaration(tempMutableStyle.get(), propertyText + " " + bogusPropertyName + ": none", &sourceData);
+        p.parseDeclaration(tempMutableStyle.get(), propertyText + " " + bogusPropertyName + ": none", &sourceData, m_style->parentStyleSheet());
         Vector<CSSPropertySourceData>& propertyData = sourceData->propertyData;
         unsigned propertyCount = propertyData.size();
 
@@ -1196,7 +1196,7 @@
 
     RefPtr<CSSMutableStyleDeclaration> tempDeclaration = CSSMutableStyleDeclaration::create();
     CSSParser p;
-    p.parseDeclaration(tempDeclaration.get(), m_styleText, result);
+    p.parseDeclaration(tempDeclaration.get(), m_styleText, result, m_element->document()->elementSheet());
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to