Incorrect pagination in flipped-blocks writing modes with border/padding before
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2011 22:42:12 +0000 (22:42 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2011 22:42:12 +0000 (22:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70444

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/multicol/flipped-blocks-border-after.html

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState): Account for flipped blocks when adjusting the page offset.

LayoutTests:

* fast/multicol/flipped-blocks-border-after-expected.png: Added.
* fast/multicol/flipped-blocks-border-after-expected.txt: Added.
* fast/multicol/flipped-blocks-border-after.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97888 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/multicol/flipped-blocks-border-after-expected.png [new file with mode: 0644]
LayoutTests/fast/multicol/flipped-blocks-border-after-expected.txt [new file with mode: 0644]
LayoutTests/fast/multicol/flipped-blocks-border-after.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/LayoutState.cpp

index 793cd2a175babbedb1eaffa2b37bf9795d0246db..fc8bc9d85dfbb5ea439682e73ad5c9298b4e1a56 100644 (file)
@@ -1,3 +1,14 @@
+2011-10-19  Dan Bernstein  <mitz@apple.com>
+
+        Incorrect pagination in flipped-blocks writing modes with border/padding before
+        https://bugs.webkit.org/show_bug.cgi?id=70444
+
+        Reviewed by Darin Adler.
+
+        * fast/multicol/flipped-blocks-border-after-expected.png: Added.
+        * fast/multicol/flipped-blocks-border-after-expected.txt: Added.
+        * fast/multicol/flipped-blocks-border-after.html: Added.
+
 2011-10-19  Beth Dakin  <bdakin@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=70396
diff --git a/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.png b/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.png
new file mode 100644 (file)
index 0000000..d438eb3
Binary files /dev/null and b/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.png differ
diff --git a/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.txt b/LayoutTests/fast/multicol/flipped-blocks-border-after-expected.txt
new file mode 100644 (file)
index 0000000..1ce64ac
--- /dev/null
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+layer at (8,8) size 100x150
+  RenderBlock {DIV} at (0,0) size 100x150 [bgcolor=#FF0000] [border: (50px solid #008000) none]
+    RenderBlock {DIV} at (0,0) size 50x100 [bgcolor=#008000]
+    RenderBlock {DIV} at (0,100) size 50x100 [bgcolor=#008000]
+layer at (8,158) size 100x150
+  RenderBlock {DIV} at (0,150) size 100x150 [bgcolor=#FF0000] [border: none (50px solid #008000) none]
+    RenderBlock {DIV} at (0,0) size 50x100 [bgcolor=#008000]
+    RenderBlock {DIV} at (0,100) size 50x100 [bgcolor=#008000]
+layer at (8,308) size 150x100
+  RenderBlock {DIV} at (0,300) size 150x100 [bgcolor=#FF0000] [border: none (50px solid #008000)]
+    RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#008000]
+    RenderBlock {DIV} at (100,0) size 100x50 [bgcolor=#008000]
+layer at (8,408) size 150x100
+  RenderBlock {DIV} at (0,400) size 150x100 [bgcolor=#FF0000] [border: none (50px solid #008000) none]
+    RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#008000]
+    RenderBlock {DIV} at (100,0) size 100x50 [bgcolor=#008000]
diff --git a/LayoutTests/fast/multicol/flipped-blocks-border-after.html b/LayoutTests/fast/multicol/flipped-blocks-border-after.html
new file mode 100644 (file)
index 0000000..91f79e5
--- /dev/null
@@ -0,0 +1,24 @@
+<style>
+    div.outer { border-width: 0; border-color: green; border-style: solid; background-color: red; width: 100px; height: 100px; -webkit-column-gap: 0; -webkit-columns: 2; }
+    div.outer div { background-color: green; }
+</style>
+
+<div class="outer" style="-webkit-writing-mode: horizontal-bt; border-top-width: 50px;">
+    <div style="height: 100px;"></div>
+    <div style="height: 100px; -webkit-column-break-before: always;"></div>
+</div>
+
+<div class="outer" style="-webkit-writing-mode: horizontal-tb; border-bottom-width: 50px;">
+    <div style="height: 100px;"></div>
+    <div style="height: 100px; -webkit-column-break-before: always;"></div>
+</div>
+
+<div class="outer" style="-webkit-writing-mode: vertical-rl; border-left-width: 50px;">
+    <div style="width: 100px;"></div>
+    <div style="width: 100px; -webkit-column-break-before: always;"></div>
+</div>
+
+<div class="outer" style="-webkit-writing-mode: vertical-lr; border-right-width: 50px;">
+    <div style="width: 100px;"></div>
+    <div style="width: 100px; -webkit-column-break-before: always;"></div>
+</div>
index 7c48c295d4e99a5d9e66db3c2b770706968db7ac..2d1911cbe51c1e9cb25beb6e62d436462c4fb031 100644 (file)
@@ -1,3 +1,15 @@
+2011-10-19  Dan Bernstein  <mitz@apple.com>
+
+        Incorrect pagination in flipped-blocks writing modes with border/padding before
+        https://bugs.webkit.org/show_bug.cgi?id=70444
+
+        Reviewed by Darin Adler.
+
+        Test: fast/multicol/flipped-blocks-border-after.html
+
+        * rendering/LayoutState.cpp:
+        (WebCore::LayoutState::LayoutState): Account for flipped blocks when adjusting the page offset.
+
 2011-10-19  Beth Dakin  <bdakin@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=70396
index afa2f7d750bc97b540f010987087d0d0cef00330..f3fcad83e0a9734958387a2929a80963c8f19699 100644 (file)
@@ -85,8 +85,9 @@ LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSiz
     // We can compare this later on to figure out what part of the page we're actually on,
     if (pageLogicalHeight || m_columnInfo) {
         m_pageLogicalHeight = pageLogicalHeight;
-        m_pageOffset = LayoutSize(m_layoutOffset.width() + renderer->borderLeft() + renderer->paddingLeft(),
-                               m_layoutOffset.height() + renderer->borderTop() + renderer->paddingTop());
+        bool isFlipped = renderer->style()->isFlippedBlocksWritingMode();
+        m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? renderer->borderLeft() + renderer->paddingLeft() : renderer->borderRight() + renderer->paddingRight()),
+                               m_layoutOffset.height() + (!isFlipped ? renderer->borderTop() + renderer->paddingTop() : renderer->borderBottom() + renderer->paddingBottom()));
         m_pageLogicalHeightChanged = pageLogicalHeightChanged;
     } else {
         // If we don't establish a new page height, then propagate the old page height and offset down.