Title: [199551] trunk
Revision
199551
Author
[email protected]
Date
2016-04-14 13:49:12 -0700 (Thu, 14 Apr 2016)

Log Message

[css-grid] Implement CSSGridTemplateAreasValue::equals
https://bugs.webkit.org/show_bug.cgi?id=156578

Reviewed by Darin Adler.

Source/WebCore:

This was causing an infinite loop setting grid-template-areas
from _javascript_.

The reason was that CSSGridTemplateAreasValue needs
an specific implementation of equals() method.

Test: fast/css-grid-layout/grid-template-areas-infinite-loop.html

* css/CSSGridTemplateAreasValue.cpp:
(WebCore::CSSGridTemplateAreasValue::equals):
* css/CSSGridTemplateAreasValue.h:

LayoutTests:

* fast/css-grid-layout/grid-template-areas-infinite-loop-expected.txt: Added.
* fast/css-grid-layout/grid-template-areas-infinite-loop.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199550 => 199551)


--- trunk/LayoutTests/ChangeLog	2016-04-14 20:22:02 UTC (rev 199550)
+++ trunk/LayoutTests/ChangeLog	2016-04-14 20:49:12 UTC (rev 199551)
@@ -1,3 +1,13 @@
+2016-04-14  Manuel Rego Casasnovas  <[email protected]>
+
+        [css-grid] Implement CSSGridTemplateAreasValue::equals
+        https://bugs.webkit.org/show_bug.cgi?id=156578
+
+        Reviewed by Darin Adler.
+
+        * fast/css-grid-layout/grid-template-areas-infinite-loop-expected.txt: Added.
+        * fast/css-grid-layout/grid-template-areas-infinite-loop.html: Added.
+
 2016-04-14  Mark Lam  <[email protected]>
 
         Update treatment of invoking RegExp.prototype methods on RegExp.prototype.

Added: trunk/LayoutTests/fast/css-grid-layout/grid-template-areas-infinite-loop-expected.txt (0 => 199551)


--- trunk/LayoutTests/fast/css-grid-layout/grid-template-areas-infinite-loop-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-template-areas-infinite-loop-expected.txt	2016-04-14 20:49:12 UTC (rev 199551)
@@ -0,0 +1,3 @@
+This test checks that setting grid-template-areas from _javascript_ doesn't cause an infinite loop.
+
+

Added: trunk/LayoutTests/fast/css-grid-layout/grid-template-areas-infinite-loop.html (0 => 199551)


--- trunk/LayoutTests/fast/css-grid-layout/grid-template-areas-infinite-loop.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-template-areas-infinite-loop.html	2016-04-14 20:49:12 UTC (rev 199551)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<link href="" rel="stylesheet">
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</style>
+<p>This test checks that setting grid-template-areas from _javascript_ doesn't cause an infinite loop.</p>
+<div id="grid">
+</div>
+<script>
+    var grid = document.getElementById("grid");
+    grid.style.webkitGridTemplateAreas = '"a"';
+    grid.style.webkitGridTemplateAreas = '"b"';
+</script>

Modified: trunk/Source/WebCore/ChangeLog (199550 => 199551)


--- trunk/Source/WebCore/ChangeLog	2016-04-14 20:22:02 UTC (rev 199550)
+++ trunk/Source/WebCore/ChangeLog	2016-04-14 20:49:12 UTC (rev 199551)
@@ -1,3 +1,22 @@
+2016-04-14  Manuel Rego Casasnovas  <[email protected]>
+
+        [css-grid] Implement CSSGridTemplateAreasValue::equals
+        https://bugs.webkit.org/show_bug.cgi?id=156578
+
+        Reviewed by Darin Adler.
+
+        This was causing an infinite loop setting grid-template-areas
+        from _javascript_.
+
+        The reason was that CSSGridTemplateAreasValue needs
+        an specific implementation of equals() method.
+
+        Test: fast/css-grid-layout/grid-template-areas-infinite-loop.html
+
+        * css/CSSGridTemplateAreasValue.cpp:
+        (WebCore::CSSGridTemplateAreasValue::equals):
+        * css/CSSGridTemplateAreasValue.h:
+
 2016-04-14  Brent Fulgham  <[email protected]>
 
         [CMake] Clean up CMake files

Modified: trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp (199550 => 199551)


--- trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp	2016-04-14 20:22:02 UTC (rev 199550)
+++ trunk/Source/WebCore/css/CSSGridTemplateAreasValue.cpp	2016-04-14 20:49:12 UTC (rev 199551)
@@ -85,6 +85,11 @@
     return builder.toString();
 }
 
+bool CSSGridTemplateAreasValue::equals(const CSSGridTemplateAreasValue& other) const
+{
+    return m_gridAreaMap == other.m_gridAreaMap && m_rowCount == other.m_rowCount && m_columnCount == other.m_columnCount;
+}
+
 } // namespace WebCore
 
 #endif /* ENABLE(CSS_GRID_LAYOUT) */

Modified: trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h (199550 => 199551)


--- trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h	2016-04-14 20:22:02 UTC (rev 199550)
+++ trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h	2016-04-14 20:49:12 UTC (rev 199551)
@@ -54,6 +54,8 @@
     size_t rowCount() const { return m_rowCount; }
     size_t columnCount() const { return m_columnCount; }
 
+    bool equals(const CSSGridTemplateAreasValue&) const;
+
 private:
     CSSGridTemplateAreasValue(const NamedGridAreaMap&, size_t rowCount, size_t columnCount);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to