Title: [231379] trunk
Revision
231379
Author
za...@apple.com
Date
2018-05-04 14:15:09 -0700 (Fri, 04 May 2018)

Log Message

Use the containing block to compute the pagination gap when the container is inline.
https://bugs.webkit.org/show_bug.cgi?id=184724
<rdar://problem/39521800>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/overflow/page-overflow-with-inline-body-crash.html

* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):

LayoutTests:

* fast/overflow/page-overflow-with-inline-body-crash-expected.txt: Added.
* fast/overflow/page-overflow-with-inline-body-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231378 => 231379)


--- trunk/LayoutTests/ChangeLog	2018-05-04 20:54:46 UTC (rev 231378)
+++ trunk/LayoutTests/ChangeLog	2018-05-04 21:15:09 UTC (rev 231379)
@@ -1,3 +1,14 @@
+2018-05-04  Zalan Bujtas  <za...@apple.com>
+
+        Use the containing block to compute the pagination gap when the container is inline.
+        https://bugs.webkit.org/show_bug.cgi?id=184724
+        <rdar://problem/39521800>
+
+        Reviewed by Simon Fraser.
+
+        * fast/overflow/page-overflow-with-inline-body-crash-expected.txt: Added.
+        * fast/overflow/page-overflow-with-inline-body-crash.html: Added.
+
 2018-05-04  Devin Rousso  <web...@devinrousso.com>
 
         Web Inspector: Canvas tab: Determine isFunction by looking at the prototype

Added: trunk/LayoutTests/fast/overflow/page-overflow-with-inline-body-crash-expected.txt (0 => 231379)


--- trunk/LayoutTests/fast/overflow/page-overflow-with-inline-body-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/overflow/page-overflow-with-inline-body-crash-expected.txt	2018-05-04 21:15:09 UTC (rev 231379)
@@ -0,0 +1 @@
+Pass if no crash

Added: trunk/LayoutTests/fast/overflow/page-overflow-with-inline-body-crash.html (0 => 231379)


--- trunk/LayoutTests/fast/overflow/page-overflow-with-inline-body-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/overflow/page-overflow-with-inline-body-crash.html	2018-05-04 21:15:09 UTC (rev 231379)
@@ -0,0 +1,13 @@
+<style>
+body { 
+	display: inline;
+}
+</style>
+<body>Pass if no crash</body>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+document.body.offsetHeight;
+document.body.style.columnGap = "0px";
+document.body.style.overflowY = "-webkit-paged-y";
+</script>

Modified: trunk/Source/WebCore/ChangeLog (231378 => 231379)


--- trunk/Source/WebCore/ChangeLog	2018-05-04 20:54:46 UTC (rev 231378)
+++ trunk/Source/WebCore/ChangeLog	2018-05-04 21:15:09 UTC (rev 231379)
@@ -1,3 +1,16 @@
+2018-05-04  Zalan Bujtas  <za...@apple.com>
+
+        Use the containing block to compute the pagination gap when the container is inline.
+        https://bugs.webkit.org/show_bug.cgi?id=184724
+        <rdar://problem/39521800>
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/overflow/page-overflow-with-inline-body-crash.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::applyPaginationToViewport):
+
 2018-05-04  Tim Horton  <timothy_hor...@apple.com>
 
         Don't use GSFont* in minimal simulator mode

Modified: trunk/Source/WebCore/page/FrameView.cpp (231378 => 231379)


--- trunk/Source/WebCore/page/FrameView.cpp	2018-05-04 20:54:46 UTC (rev 231378)
+++ trunk/Source/WebCore/page/FrameView.cpp	2018-05-04 21:15:09 UTC (rev 231379)
@@ -722,7 +722,11 @@
     if (overflowY == OPAGEDX || overflowY == OPAGEDY) {
         pagination.mode = WebCore::paginationModeForRenderStyle(documentOrBodyRenderer->style());
         GapLength columnGapLength = documentOrBodyRenderer->style().columnGap();
-        pagination.gap = columnGapLength.isNormal() ? 0 : valueForLength(columnGapLength.length(), downcast<RenderBox>(documentOrBodyRenderer)->availableLogicalWidth()).toUnsigned();
+        pagination.gap = 0;
+        if (!columnGapLength.isNormal()) {
+            if (auto* containerForPaginationGap = is<RenderBox>(documentOrBodyRenderer) ? downcast<RenderBox>(documentOrBodyRenderer) : documentOrBodyRenderer->containingBlock())
+                pagination.gap = valueForLength(columnGapLength.length(), containerForPaginationGap->availableLogicalWidth()).toUnsigned();
+        }
     }
     setPagination(pagination);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to