Title: [131685] trunk
Revision
131685
Author
[email protected]
Date
2012-10-17 18:02:35 -0700 (Wed, 17 Oct 2012)

Log Message

StyleRareNonInheritedData::contentDataEquivalent only looks at the first ContentData
https://bugs.webkit.org/show_bug.cgi?id=99560

Patch by Elliott Sprehn <[email protected]> on 2012-10-17
Reviewed by Eric Seidel.

Source/WebCore:

Previously we only compared the first ContentData in the linked
list of ContentData's which meant that if the resolved style
for content had the same prefix we wouldn't update the content.

This patch adds a loop to compare each of the ContentData objects
in the linked list.

Test: fast/css-generated-content/content-property-change.html

* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::contentDataEquivalent):

LayoutTests:

Test that when the content CSS property changes we update the displayed content.

* fast/css-generated-content/content-property-change-expected.html: Added.
* fast/css-generated-content/content-property-change.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (131684 => 131685)


--- trunk/LayoutTests/ChangeLog	2012-10-18 00:59:39 UTC (rev 131684)
+++ trunk/LayoutTests/ChangeLog	2012-10-18 01:02:35 UTC (rev 131685)
@@ -1,3 +1,15 @@
+2012-10-17  Elliott Sprehn  <[email protected]>
+
+        StyleRareNonInheritedData::contentDataEquivalent only looks at the first ContentData
+        https://bugs.webkit.org/show_bug.cgi?id=99560
+
+        Reviewed by Eric Seidel.
+
+        Test that when the content CSS property changes we update the displayed content.
+
+        * fast/css-generated-content/content-property-change-expected.html: Added.
+        * fast/css-generated-content/content-property-change.html: Added.
+
 2012-10-17  Dirk Pranke  <[email protected]>
 
         Clone baselines from platform/mac to platform/chromium [1 of 7]

Added: trunk/LayoutTests/fast/css-generated-content/content-property-change-expected.html (0 => 131685)


--- trunk/LayoutTests/fast/css-generated-content/content-property-change-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/content-property-change-expected.html	2012-10-18 01:02:35 UTC (rev 131685)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+
+<p>
+    The below two lines should look identical.
+</p>
+<div>x-y</div>
+<div>x-y</div>

Added: trunk/LayoutTests/fast/css-generated-content/content-property-change.html (0 => 131685)


--- trunk/LayoutTests/fast/css-generated-content/content-property-change.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-generated-content/content-property-change.html	2012-10-18 01:02:35 UTC (rev 131685)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+
+<style>
+    #actual:before {
+        content: "x";
+        quotes: "-" "-";
+    }
+
+    #actual.change:before {
+        content: "x" open-quote "y";
+    }
+</style>
+
+<p>
+    The below two lines should look identical.
+</p>
+<div id="actual"></div>
+<div id="expected">x-y</div>
+
+<script>
+    var div = document.getElementById('actual');
+    div.offsetTop;
+    div.className = 'change';
+</script>

Modified: trunk/Source/WebCore/ChangeLog (131684 => 131685)


--- trunk/Source/WebCore/ChangeLog	2012-10-18 00:59:39 UTC (rev 131684)
+++ trunk/Source/WebCore/ChangeLog	2012-10-18 01:02:35 UTC (rev 131685)
@@ -1,5 +1,24 @@
 2012-10-17  Elliott Sprehn  <[email protected]>
 
+        StyleRareNonInheritedData::contentDataEquivalent only looks at the first ContentData
+        https://bugs.webkit.org/show_bug.cgi?id=99560
+
+        Reviewed by Eric Seidel.
+
+        Previously we only compared the first ContentData in the linked
+        list of ContentData's which meant that if the resolved style
+        for content had the same prefix we wouldn't update the content.
+
+        This patch adds a loop to compare each of the ContentData objects
+        in the linked list.
+
+        Test: fast/css-generated-content/content-property-change.html
+
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
+
+2012-10-17  Elliott Sprehn  <[email protected]>
+
         Remove StyleContentType since it's not used anymore
         https://bugs.webkit.org/show_bug.cgi?id=99659
 

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (131684 => 131685)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2012-10-18 00:59:39 UTC (rev 131684)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2012-10-18 01:02:35 UTC (rev 131685)
@@ -256,13 +256,15 @@
 
 bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const
 {
-    if (m_content.get() == o.m_content.get())
-        return true;
-        
-    if (m_content && o.m_content && *m_content == *o.m_content)
-        return true;
+    ContentData* a = m_content.get();
+    ContentData* b = o.m_content.get();
 
-    return false;
+    while (a && b && *a == *b) {
+        a = a->next();
+        b = b->next();
+    }
+
+    return !a && !b;
 }
 
 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInheritedData& o) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to