Title: [253139] trunk
Revision
253139
Author
[email protected]
Date
2019-12-04 20:29:03 -0800 (Wed, 04 Dec 2019)

Log Message

Nullptr crash in RenderLayoutState::pageLogicalHeight const via RenderGrid::computeIntrinsicLogicalWidths inside RenderMarquee::updateMarqueePosition
https://bugs.webkit.org/show_bug.cgi?id=204527

Patch by Jack Lee <[email protected]> on 2019-12-04
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/table/crash-empty-layoutStateStack.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
(WebCore::RenderTable::markForPaginationRelayoutIfNeeded):

LayoutTests:

* fast/table/crash-empty-layoutStateStack-expected.txt: Added.
* fast/table/crash-empty-layoutStateStack.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (253138 => 253139)


--- trunk/LayoutTests/ChangeLog	2019-12-05 04:13:18 UTC (rev 253138)
+++ trunk/LayoutTests/ChangeLog	2019-12-05 04:29:03 UTC (rev 253139)
@@ -1,3 +1,13 @@
+2019-12-04  Jack Lee  <[email protected]>
+
+        Nullptr crash in RenderLayoutState::pageLogicalHeight const via RenderGrid::computeIntrinsicLogicalWidths inside RenderMarquee::updateMarqueePosition
+        https://bugs.webkit.org/show_bug.cgi?id=204527
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/table/crash-empty-layoutStateStack-expected.txt: Added.
+        * fast/table/crash-empty-layoutStateStack.html: Added.
+
 2019-12-04  Alexey Shvayka  <[email protected]>
 
         Non-callable "handleEvent" property is silently ignored

Added: trunk/LayoutTests/fast/table/crash-empty-layoutStateStack-expected.txt (0 => 253139)


--- trunk/LayoutTests/fast/table/crash-empty-layoutStateStack-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/table/crash-empty-layoutStateStack-expected.txt	2019-12-05 04:29:03 UTC (rev 253139)
@@ -0,0 +1,3 @@
+Bug 204527: Crashes in RenderTable when layoutStateStack is empty
+This test passes if it does not CRASH.
+

Added: trunk/LayoutTests/fast/table/crash-empty-layoutStateStack.html (0 => 253139)


--- trunk/LayoutTests/fast/table/crash-empty-layoutStateStack.html	                        (rev 0)
+++ trunk/LayoutTests/fast/table/crash-empty-layoutStateStack.html	2019-12-05 04:29:03 UTC (rev 253139)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+    <head>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+    </script>
+    <style>
+        marquee {display: inline-grid;}
+        table {writing-mode: tb-rl;}
+    </style>
+    </head>
+
+    <body>
+        <marquee><table>
+        <div class="tableAfter"></div>
+        <div>Bug <a href="" Crashes in RenderTable when layoutStateStack is empty</div>
+        <div>This test passes if it does not CRASH.</div>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (253138 => 253139)


--- trunk/Source/WebCore/ChangeLog	2019-12-05 04:13:18 UTC (rev 253138)
+++ trunk/Source/WebCore/ChangeLog	2019-12-05 04:29:03 UTC (rev 253139)
@@ -1,3 +1,16 @@
+2019-12-04  Jack Lee  <[email protected]>
+
+        Nullptr crash in RenderLayoutState::pageLogicalHeight const via RenderGrid::computeIntrinsicLogicalWidths inside RenderMarquee::updateMarqueePosition
+        https://bugs.webkit.org/show_bug.cgi?id=204527
+
+        Reviewed by Ryosuke Niwa.
+
+        Test: fast/table/crash-empty-layoutStateStack.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::layout):
+        (WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
+
 2019-12-04  Chris Dumez  <[email protected]>
 
         PageConfiguration::progressTrackerClient should use a smart pointer

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (253138 => 253139)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2019-12-05 04:13:18 UTC (rev 253138)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2019-12-05 04:29:03 UTC (rev 253139)
@@ -559,7 +559,7 @@
     }
 
     auto* layoutState = view().frameView().layoutContext().layoutState();
-    if (layoutState->pageLogicalHeight())
+    if (layoutState && layoutState->pageLogicalHeight())
         setPageLogicalOffset(layoutState->pageLogicalOffset(this, logicalTop()));
 
     bool didFullRepaint = repainter.repaintAfterLayout();
@@ -1584,7 +1584,7 @@
 void RenderTable::markForPaginationRelayoutIfNeeded()
 {
     auto* layoutState = view().frameView().layoutContext().layoutState();
-    if (!layoutState->isPaginated() || (!layoutState->pageLogicalHeightChanged() && (!layoutState->pageLogicalHeight() || layoutState->pageLogicalOffset(this, logicalTop()) == pageLogicalOffset())))
+    if (!layoutState || !layoutState->isPaginated() || (!layoutState->pageLogicalHeightChanged() && (!layoutState->pageLogicalHeight() || layoutState->pageLogicalOffset(this, logicalTop()) == pageLogicalOffset())))
         return;
     
     // When a table moves, we have to dirty all of the sections too.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to