Title: [125371] trunk
Revision
125371
Author
[email protected]
Date
2012-08-12 04:38:09 -0700 (Sun, 12 Aug 2012)

Log Message

webkit fails IETC namespaces/prefix-007.xml
https://bugs.webkit.org/show_bug.cgi?id=86137

Patch by Takashi Sakamoto <[email protected]> on 2012-08-12
Reviewed by Eric Seidel.

Source/WebCore:

If a namespace prefix or default namespace is declared more than once
only the last declaration shall be used.

parseAddNamespace doesn't check return value of WTF::HashMap<>::add.
If the return value's isNewEntry is true, the new entry is added with
the specified value. However, if isNewEntry is false, it is required
to update the store value.

No new tests. ietestcenter/css3/namespaces/prefix-007.xml and
ietestcenter/css3/namespaces/prefix-010.xml covers this change.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAddNamespace):
Modified to check m_namespaces.add's return value.
If the result says not a new entry, updated the value stored in
m_namespaces by using iterator in the result.

LayoutTests:

* platform/chromium/TestExpectations:
Enabled the layout tests, ietestcenter/css3/namespaces/prefix-007.xml
and ietestcenter/css3/namespaces/prefix-010.xml.
* platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt: Removed.
* platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt: Removed.
Removed old expectations.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125370 => 125371)


--- trunk/LayoutTests/ChangeLog	2012-08-12 11:29:29 UTC (rev 125370)
+++ trunk/LayoutTests/ChangeLog	2012-08-12 11:38:09 UTC (rev 125371)
@@ -1,3 +1,17 @@
+2012-08-12  Takashi Sakamoto  <[email protected]>
+
+        webkit fails IETC namespaces/prefix-007.xml
+        https://bugs.webkit.org/show_bug.cgi?id=86137
+
+        Reviewed by Eric Seidel.
+
+        * platform/chromium/TestExpectations:
+        Enabled the layout tests, ietestcenter/css3/namespaces/prefix-007.xml
+        and ietestcenter/css3/namespaces/prefix-010.xml.
+        * platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt: Removed.
+        * platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt: Removed.
+        Removed old expectations.
+
 2012-08-11  Jon Lee  <[email protected]>
 
         webarchive/ignore-noscript-if-scripting.html expected results should use .webarchive extension

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (125370 => 125371)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-08-12 11:29:29 UTC (rev 125370)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-08-12 11:38:09 UTC (rev 125371)
@@ -3129,8 +3129,6 @@
 BUGWK85308 RELEASE : ietestcenter/css3/valuesandunits/units-000.htm = IMAGE
 BUGWK85310 : ietestcenter/css3/valuesandunits/units-010.htm = IMAGE
 // IETC namespace failures
-BUGWK86137 : ietestcenter/css3/namespaces/prefix-007.xml = IMAGE
-BUGWK86139 : ietestcenter/css3/namespaces/prefix-010.xml = IMAGE
 BUGWK86142 : ietestcenter/css3/namespaces/syntax-021.xml = IMAGE
 
 BUGWK84432 WIN : fast/filesystem/op-restricted-names.html = TEXT

Deleted: trunk/LayoutTests/platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt (125370 => 125371)


--- trunk/LayoutTests/platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt	2012-08-12 11:29:29 UTC (rev 125370)
+++ trunk/LayoutTests/platform/win/ietestcenter/css3/namespaces/prefix-007-expected.txt	2012-08-12 11:38:09 UTC (rev 125371)
@@ -1,12 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x84
-  RenderBlock {root} at (0,0) size 800x84
-    RenderBody {body} at (8,16) size 784x52
-      RenderBlock {p} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 419x18
-          text run at (0,0) width 419: "Test passes if the \"Filler Text\" text below has a green background."
-      RenderBlock {p} at (0,34) size 784x18
-        RenderInline {t2} at (0,0) size 66x18 [bgcolor=#FF0000]
-          RenderText {#text} at (0,0) size 66x18
-            text run at (0,0) width 66: "Filler Text"

Deleted: trunk/LayoutTests/platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt (125370 => 125371)


--- trunk/LayoutTests/platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt	2012-08-12 11:29:29 UTC (rev 125370)
+++ trunk/LayoutTests/platform/win/ietestcenter/css3/namespaces/prefix-010-expected.txt	2012-08-12 11:38:09 UTC (rev 125371)
@@ -1,16 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x118
-  RenderBlock {root} at (0,0) size 800x118
-    RenderBody {body} at (8,16) size 784x86
-      RenderBlock {p} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 419x18
-          text run at (0,0) width 419: "Test passes if the \"Filler Text\" text below has a green background."
-      RenderBlock {p} at (0,34) size 784x18
-        RenderInline {t2} at (0,0) size 66x18 [bgcolor=#FF0000]
-          RenderText {#text} at (0,0) size 66x18
-            text run at (0,0) width 66: "Filler Text"
-      RenderBlock {p} at (0,68) size 784x18
-        RenderInline {t2} at (0,0) size 66x18 [bgcolor=#00FF00]
-          RenderText {#text} at (0,0) size 66x18
-            text run at (0,0) width 66: "Filler Text"

Modified: trunk/Source/WebCore/ChangeLog (125370 => 125371)


--- trunk/Source/WebCore/ChangeLog	2012-08-12 11:29:29 UTC (rev 125370)
+++ trunk/Source/WebCore/ChangeLog	2012-08-12 11:38:09 UTC (rev 125371)
@@ -1,3 +1,27 @@
+2012-08-12  Takashi Sakamoto  <[email protected]>
+
+        webkit fails IETC namespaces/prefix-007.xml
+        https://bugs.webkit.org/show_bug.cgi?id=86137
+
+        Reviewed by Eric Seidel.
+
+        If a namespace prefix or default namespace is declared more than once
+        only the last declaration shall be used.
+
+        parseAddNamespace doesn't check return value of WTF::HashMap<>::add.
+        If the return value's isNewEntry is true, the new entry is added with
+        the specified value. However, if isNewEntry is false, it is required
+        to update the store value.
+
+        No new tests. ietestcenter/css3/namespaces/prefix-007.xml and
+        ietestcenter/css3/namespaces/prefix-010.xml covers this change.
+
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::parserAddNamespace):
+        Modified to check m_namespaces.add's return value.
+        If the result says not a new entry, updated the value stored in
+        m_namespaces by using iterator in the result.
+
 2012-08-12  Benjamin Poulain  <[email protected]>
 
         Move CSS's propertyNameStrings[] to from the header to the cpp file

Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (125370 => 125371)


--- trunk/Source/WebCore/css/StyleSheetContents.cpp	2012-08-12 11:29:29 UTC (rev 125370)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp	2012-08-12 11:38:09 UTC (rev 125371)
@@ -250,7 +250,10 @@
 {
     if (uri.isNull() || prefix.isNull())
         return;
-    m_namespaces.add(prefix, uri);
+    PrefixNamespaceURIMap::AddResult result = m_namespaces.add(prefix, uri);
+    if (result.isNewEntry)
+        return;
+    result.iterator->second = uri;
 }
 
 const AtomicString& StyleSheetContents::determineNamespace(const AtomicString& prefix)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to