Title: [196052] trunk
Revision
196052
Author
commit-qu...@webkit.org
Date
2016-02-02 23:01:28 -0800 (Tue, 02 Feb 2016)

Log Message

ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
https://bugs.webkit.org/show_bug.cgi?id=153576

Patch by Fujii Hironori <hironori.fu...@jp.sony.com> on 2016-02-02
Reviewed by Darin Adler.

Source/WebCore:

Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html

The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
because of the uniqueness of LayoutUnit::round introduced by this bug
<https://bugs.webkit.org/show_bug.cgi?id=107208>.
Should convert a FloatPoint to a LayoutPoint before rounding.

* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::mapToContainer):

LayoutTests:

* fast/block/geometry-map-assertion-with-rounding-negative-half-expected.txt: Added.
* fast/block/geometry-map-assertion-with-rounding-negative-half.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196051 => 196052)


--- trunk/LayoutTests/ChangeLog	2016-02-03 06:34:06 UTC (rev 196051)
+++ trunk/LayoutTests/ChangeLog	2016-02-03 07:01:28 UTC (rev 196052)
@@ -1,3 +1,13 @@
+2016-02-02  Fujii Hironori  <hironori.fu...@jp.sony.com>
+
+        ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
+        https://bugs.webkit.org/show_bug.cgi?id=153576
+
+        Reviewed by Darin Adler.
+
+        * fast/block/geometry-map-assertion-with-rounding-negative-half-expected.txt: Added.
+        * fast/block/geometry-map-assertion-with-rounding-negative-half.html: Added.
+
 2016-02-02  Darin Adler  <da...@apple.com>
 
         Follow up for:

Added: trunk/LayoutTests/fast/block/geometry-map-assertion-with-rounding-negative-half-expected.txt (0 => 196052)


--- trunk/LayoutTests/fast/block/geometry-map-assertion-with-rounding-negative-half-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/geometry-map-assertion-with-rounding-negative-half-expected.txt	2016-02-03 07:01:28 UTC (rev 196052)
@@ -0,0 +1,2 @@
+PASS if no assert or crash in debug build.
+

Added: trunk/LayoutTests/fast/block/geometry-map-assertion-with-rounding-negative-half.html (0 => 196052)


--- trunk/LayoutTests/fast/block/geometry-map-assertion-with-rounding-negative-half.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/geometry-map-assertion-with-rounding-negative-half.html	2016-02-03 07:01:28 UTC (rev 196052)
@@ -0,0 +1,32 @@
+<div>PASS if no assert or crash in debug build.</div>
+<div id="a"><span id="x"></span><span id="b"></span></div>
+<style>
+#a {
+  background: pink;
+  display: inline-block;
+  position: absolute;
+  width: auto;
+  top: -300px;
+  left: -400px;
+}
+#b {
+  display: inline-block;
+  position: absolute;
+  height: 100%;
+  width: 100%;
+  overflow: scroll
+}
+#x {
+  display: inline-block;
+  height: 30px;
+  width: 100.5px;
+}
+</style>
+<script>
+  if (window.testRunner)
+    testRunner.dumpAsText();
+
+  document.addEventListener("DOMContentLoaded", function() {
+    document.getElementById('a').offsetWidth;
+  }, false);
+</script>

Modified: trunk/Source/WebCore/ChangeLog (196051 => 196052)


--- trunk/Source/WebCore/ChangeLog	2016-02-03 06:34:06 UTC (rev 196051)
+++ trunk/Source/WebCore/ChangeLog	2016-02-03 07:01:28 UTC (rev 196052)
@@ -1,3 +1,20 @@
+2016-02-02  Fujii Hironori  <hironori.fu...@jp.sony.com>
+
+        ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
+        https://bugs.webkit.org/show_bug.cgi?id=153576
+
+        Reviewed by Darin Adler.
+
+        Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html
+
+        The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
+        because of the uniqueness of LayoutUnit::round introduced by this bug
+        <https://bugs.webkit.org/show_bug.cgi?id=107208>.
+        Should convert a FloatPoint to a LayoutPoint before rounding.
+
+        * rendering/RenderGeometryMap.cpp:
+        (WebCore::RenderGeometryMap::mapToContainer):
+
 2016-02-02  Aakash Jain  <aakash_j...@apple.com>
 
         Remove references to CallFrameInlines.h

Modified: trunk/Source/WebCore/rendering/RenderGeometryMap.cpp (196051 => 196052)


--- trunk/Source/WebCore/rendering/RenderGeometryMap.cpp	2016-02-03 06:34:06 UTC (rev 196051)
+++ trunk/Source/WebCore/rendering/RenderGeometryMap.cpp	2016-02-03 07:01:28 UTC (rev 196052)
@@ -104,20 +104,21 @@
 FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, const RenderLayerModelObject* container) const
 {
     FloatPoint result;
+#if !ASSERT_DISABLED
+    FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAbsolute(p, m_mapCoordinatesFlags);
+#endif
     
-    if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() && (!container || (m_mapping.size() && container == m_mapping[0].m_renderer)))
+    if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() && (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) {
         result = p + roundedIntSize(m_accumulatedOffset);
-    else {
+        // Should convert to a LayoutPoint because of the uniqueness of LayoutUnit::round
+        ASSERT(roundedIntPoint(LayoutPoint(rendererMappedResult)) == result);
+    } else {
         TransformState transformState(TransformState::ApplyTransformDirection, p);
         mapToContainer(transformState, container);
         result = transformState.lastPlanarPoint();
+        ASSERT(rendererMappedResult == result);
     }
 
-#if !ASSERT_DISABLED
-    FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAbsolute(p, m_mapCoordinatesFlags);
-    ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result));
-#endif
-
     return result;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to