https://bugs.webkit.org/show_bug.cgi?id=48663
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Nov 2010 19:07:12 +0000 (19:07 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Nov 2010 19:07:12 +0000 (19:07 +0000)
Reviewed by Dan Bernstein.

Make repaint invalidation work with vertical lines.  Rewrite linesBoundingBox for RenderText and
RenderInline to give the correct rectangle back for vertical lines.  Also patch linesVisibleOverflowBoundingBox
to give back the correct rectangle for vertical lines.

Fix bugs in the overflow accessors of InlineFlowBox when m_overflow was 0.

Patch hit testing to also account for "rt" and "bt" blocks.

WebCore:

* rendering/InlineBox.cpp:
(WebCore::InlineBox::adjustForFlippedBlocksWritingMode):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::nodeAtPoint):
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::logicalLeftVisibleOverflow):
(WebCore::InlineFlowBox::logicalRightVisibleOverflow):
(WebCore::InlineFlowBox::bottomLayoutOverflow):
(WebCore::InlineFlowBox::rightLayoutOverflow):
(WebCore::InlineFlowBox::bottomVisualOverflow):
(WebCore::InlineFlowBox::rightVisualOverflow):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::nodeAtPoint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::hitTestFloats):
(WebCore::RenderBlock::hitTestContents):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
(WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
* rendering/RenderBox.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::linesBoundingBox):
(WebCore::RenderInline::linesVisibleOverflowBoundingBox):
(WebCore::RenderInline::clippedOverflowRectForRepaint):
* rendering/RenderText.cpp:
(WebCore::RenderText::linesBoundingBox):

LayoutTests:

* fast/repaint/inline-horizontal-bt-overflow.html: Added.
* fast/repaint/inline-vertical-lr-overflow.html: Added.
* fast/repaint/inline-vertical-rl-overflow.html: Copied from fast/repaint/inline-vertical-rl-overflow.html.
* platform/mac/fast/blockflow/background-vertical-lr-expected.txt:
* platform/mac/fast/blockflow/background-vertical-rl-expected.txt:
* platform/mac/fast/blockflow/basic-vertical-line-expected.txt:
* platform/mac/fast/blockflow/border-image-vertical-lr-expected.txt:
* platform/mac/fast/blockflow/border-image-vertical-rl-expected.txt:
* platform/mac/fast/blockflow/border-radius-clipping-vertical-lr-expected.txt:
* platform/mac/fast/blockflow/border-vertical-lr-expected.checksum:
* platform/mac/fast/blockflow/border-vertical-lr-expected.png:
* platform/mac/fast/blockflow/border-vertical-lr-expected.txt:
* platform/mac/fast/blockflow/box-shadow-vertical-lr-expected.txt:
* platform/mac/fast/blockflow/box-shadow-vertical-rl-expected.txt:
* platform/mac/fast/blockflow/english-lr-text-expected.txt:
* platform/mac/fast/blockflow/english-rl-text-expected.txt:
* platform/mac/fast/blockflow/japanese-lr-text-expected.txt:
* platform/mac/fast/blockflow/japanese-rl-text-expected.txt:
* platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.checksum: Added.
* platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.png: Added.
* platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.txt: Added.
* platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.checksum: Added.
* platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.png: Added.
* platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.txt: Added.
* platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum: Copied from platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum.
* platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png: Copied from platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png.

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

37 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/repaint/inline-horizontal-bt-overflow.html [new file with mode: 0644]
LayoutTests/fast/repaint/inline-vertical-lr-overflow.html [new file with mode: 0644]
LayoutTests/fast/repaint/inline-vertical-rl-overflow.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/blockflow/background-vertical-lr-expected.txt
LayoutTests/platform/mac/fast/blockflow/background-vertical-rl-expected.txt
LayoutTests/platform/mac/fast/blockflow/basic-vertical-line-expected.txt
LayoutTests/platform/mac/fast/blockflow/border-image-vertical-lr-expected.txt
LayoutTests/platform/mac/fast/blockflow/border-image-vertical-rl-expected.txt
LayoutTests/platform/mac/fast/blockflow/border-radius-clipping-vertical-lr-expected.txt
LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.checksum
LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.png
LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.txt
LayoutTests/platform/mac/fast/blockflow/box-shadow-vertical-lr-expected.txt
LayoutTests/platform/mac/fast/blockflow/box-shadow-vertical-rl-expected.txt
LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.txt
LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.txt
LayoutTests/platform/mac/fast/blockflow/japanese-lr-text-expected.txt
LayoutTests/platform/mac/fast/blockflow/japanese-rl-text-expected.txt
LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/InlineBox.cpp
WebCore/rendering/InlineFlowBox.cpp
WebCore/rendering/InlineFlowBox.h
WebCore/rendering/InlineTextBox.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBox.cpp
WebCore/rendering/RenderBox.h
WebCore/rendering/RenderInline.cpp
WebCore/rendering/RenderText.cpp

index c57a031..c7b072b 100644 (file)
@@ -1,3 +1,44 @@
+2010-11-01  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=48663
+
+        Make repaint invalidation work with vertical lines.  Rewrite linesBoundingBox for RenderText and
+        RenderInline to give the correct rectangle back for vertical lines.  Also patch linesVisibleOverflowBoundingBox
+        to give back the correct rectangle for vertical lines.
+
+        Fix bugs in the overflow accessors of InlineFlowBox when m_overflow was 0.
+        
+        Patch hit testing to also account for "rt" and "bt" blocks.
+
+        * fast/repaint/inline-horizontal-bt-overflow.html: Added.
+        * fast/repaint/inline-vertical-lr-overflow.html: Added.
+        * fast/repaint/inline-vertical-rl-overflow.html: Copied from fast/repaint/inline-vertical-rl-overflow.html.
+        * platform/mac/fast/blockflow/background-vertical-lr-expected.txt:
+        * platform/mac/fast/blockflow/background-vertical-rl-expected.txt:
+        * platform/mac/fast/blockflow/basic-vertical-line-expected.txt:
+        * platform/mac/fast/blockflow/border-image-vertical-lr-expected.txt:
+        * platform/mac/fast/blockflow/border-image-vertical-rl-expected.txt:
+        * platform/mac/fast/blockflow/border-radius-clipping-vertical-lr-expected.txt:
+        * platform/mac/fast/blockflow/border-vertical-lr-expected.checksum:
+        * platform/mac/fast/blockflow/border-vertical-lr-expected.png:
+        * platform/mac/fast/blockflow/border-vertical-lr-expected.txt:
+        * platform/mac/fast/blockflow/box-shadow-vertical-lr-expected.txt:
+        * platform/mac/fast/blockflow/box-shadow-vertical-rl-expected.txt:
+        * platform/mac/fast/blockflow/english-lr-text-expected.txt:
+        * platform/mac/fast/blockflow/english-rl-text-expected.txt:
+        * platform/mac/fast/blockflow/japanese-lr-text-expected.txt:
+        * platform/mac/fast/blockflow/japanese-rl-text-expected.txt:
+        * platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.checksum: Added.
+        * platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.png: Added.
+        * platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.txt: Added.
+        * platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.checksum: Added.
+        * platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.png: Added.
+        * platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.txt: Added.
+        * platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum: Copied from platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum.
+        * platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png: Copied from platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png.
+
 2010-11-01  Eric Carlson  <eric.carlson@apple.com>
 
         Reviewed by Adam Roben.
diff --git a/LayoutTests/fast/repaint/inline-horizontal-bt-overflow.html b/LayoutTests/fast/repaint/inline-horizontal-bt-overflow.html
new file mode 100644 (file)
index 0000000..94ae696
--- /dev/null
@@ -0,0 +1,10 @@
+<script src="resources/repaint.js"></script>
+<script>
+    function repaintTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<body onload="runRepaintTest()" style="padding: 50px; -webkit-writing-mode:horizontal-bt">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/LayoutTests/fast/repaint/inline-vertical-lr-overflow.html b/LayoutTests/fast/repaint/inline-vertical-lr-overflow.html
new file mode 100644 (file)
index 0000000..0ccdf31
--- /dev/null
@@ -0,0 +1,10 @@
+<script src="resources/repaint.js"></script>
+<script>
+    function repaintTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<body onload="runRepaintTest()" style="padding: 50px; -webkit-writing-mode:vertical-lr">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span></div>
+</body>
diff --git a/LayoutTests/fast/repaint/inline-vertical-rl-overflow.html b/LayoutTests/fast/repaint/inline-vertical-rl-overflow.html
new file mode 100644 (file)
index 0000000..572941c
--- /dev/null
@@ -0,0 +1,10 @@
+<script src="resources/repaint.js"></script>
+<script>
+    function repaintTest()
+    {
+        document.getElementById("target").style.webkitTextStrokeColor = "green";
+    }
+</script>
+<body onload="runRepaintTest()" style="padding: 50px; -webkit-writing-mode:vertical-rl">
+    <div><span id="target" style="font-family: Ahem; font-size: 50px; -webkit-text-stroke: 50px red;">A&nbsp;&nbsp;B</span></div>
+</body>
index c4ac399..89c81a8 100644 (file)
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600
 layer at (0,0) size 456x600
   RenderBlock {HTML} at (0,0) size 456x600
     RenderBody {BODY} at (8,8) size 440x584
-      RenderInline {SPAN} at (0,0) size 220x98
+      RenderInline {SPAN} at (0,0) size 268x50
         RenderBlock {DIV} at (71,50) size 0x50
-        RenderBR {BR} at (50,100) size 0x98
+        RenderBR {BR} at (50,100) size 98x0
         RenderBlock {DIV} at (241,50) size 0x50
       RenderText {#text} at (0,0) size 0x0
index 581a404..e6d9ac5 100644 (file)
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600
 layer at (344,0) size 456x600
   RenderBlock {HTML} at (0,0) size 456x600
     RenderBody {BODY} at (8,8) size 440x584
-      RenderInline {SPAN} at (0,0) size 220x98
+      RenderInline {SPAN} at (0,0) size 268x50
         RenderBlock {DIV} at (163,50) size 0x50
-        RenderBR {BR} at (86,100) size 0x98
+        RenderBR {BR} at (86,100) size 98x0
         RenderBlock {DIV} at (333,50) size 0x50
       RenderText {#text} at (0,0) size 0x0
index 48d996a..5a0e486 100644 (file)
@@ -4,16 +4,16 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 316x304 [border: (2px solid #800000)]
-        RenderInline {SPAN} at (0,0) size 220x18 [border: (5px solid #000000) none (5px solid #000000) none]
+        RenderInline {SPAN} at (0,0) size 18x220 [border: (5px solid #000000) none (5px solid #000000) none]
           RenderImage {IMG} at (6,12) size 100x200 [bgcolor=#008000]
-        RenderText {#text} at (2,222) size 4x18
+        RenderText {#text} at (2,222) size 18x4
           text run at (2,222) width 4: " "
         RenderBR {BR} at (6,226) size 0x0
-        RenderInline {SPAN} at (0,0) size 220x18 [border: (5px solid #000000) none (5px solid #000000) none]
+        RenderInline {SPAN} at (0,0) size 18x220 [border: (5px solid #000000) none (5px solid #000000) none]
           RenderImage {IMG} at (110,12) size 100x200 [bgcolor=#008000]
-        RenderText {#text} at (106,222) size 4x18
+        RenderText {#text} at (106,222) size 18x4
           text run at (106,222) width 4: " "
         RenderBR {BR} at (110,226) size 0x0
-        RenderInline {SPAN} at (0,0) size 220x18 [border: (5px solid #000000) none (5px solid #000000) none]
+        RenderInline {SPAN} at (0,0) size 18x220 [border: (5px solid #000000) none (5px solid #000000) none]
           RenderImage {IMG} at (214,12) size 100x200 [bgcolor=#008000]
         RenderText {#text} at (0,0) size 0x0
index 8e06d69..0d829c5 100644 (file)
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600
 layer at (0,0) size 460x600
   RenderBlock {HTML} at (0,0) size 460x600
     RenderBody {BODY} at (8,8) size 444x584
-      RenderInline {SPAN} at (0,0) size 252x121 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderInline {SPAN} at (0,0) size 323x80 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
         RenderBlock {DIV} at (93,101) size 0x25
-        RenderBR {BR} at (71,126) size 0x100
+        RenderBR {BR} at (71,126) size 100x0
         RenderBlock {DIV} at (265,50) size 0x50
       RenderText {#text} at (0,0) size 0x0
index 638a379..28519c2 100644 (file)
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600
 layer at (340,0) size 460x600
   RenderBlock {HTML} at (0,0) size 460x600
     RenderBody {BODY} at (8,8) size 444x584
-      RenderInline {SPAN} at (0,0) size 252x121 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderInline {SPAN} at (0,0) size 323x80 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
         RenderBlock {DIV} at (164,101) size 0x25
-        RenderBR {BR} at (86,126) size 0x100
+        RenderBR {BR} at (86,126) size 100x0
         RenderBlock {DIV} at (336,50) size 0x50
       RenderText {#text} at (0,0) size 0x0
index 88c346d..5a3715c 100644 (file)
@@ -4,10 +4,10 @@ layer at (0,0) size 785x621
   RenderBlock {HTML} at (0,0) size 785x600
     RenderBody {BODY} at (8,8) size 727x584
       RenderBlock {DIV} at (0,0) size 144x600
-        RenderInline {SPAN} at (0,0) size 613x65 [bgcolor=#0000FF]
+        RenderInline {SPAN} at (0,0) size 137x613 [bgcolor=#0000FF]
           RenderText {#text} at (0,0) size 0x0
-          RenderInline {SPAN} at (0,0) size 598x50 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
-            RenderText {#text} at (5,35) size 578x20
+          RenderInline {SPAN} at (0,0) size 137x613 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
+            RenderText {#text} at (5,35) size 127x613
               text run at (5,35) width 578: "This sentence is too long to fit"
               text run at (77,0) width 302: "on a single line."
         RenderText {#text} at (0,0) size 0x0
index 4276b39..482aef0 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.png and b/LayoutTests/platform/mac/fast/blockflow/border-vertical-lr-expected.png differ
index 360aec9..d074c62 100644 (file)
@@ -1,25 +1,25 @@
-layer at (0,0) size 1181x585
-  RenderView at (0,0) size 800x585
-layer at (0,0) size 1181x585
-  RenderBlock {HTML} at (0,0) size 772x585
-    RenderBody {BODY} at (8,8) size 756x569
-      RenderInline {SPAN} at (0,0) size 676x29 [border: (2px solid #000000)]
-        RenderText {#text} at (4,4) size 676x17
-          text run at (4,4) width 529: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}"
-          text run at (67,0) width 529: "\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}\x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}"
-          text run at (130,0) width 550: "\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}"
-          text run at (193,0) width 212: "\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}"
-      RenderText {#text} at (193,216) size 7x21
-        text run at (193,216) width 7: " "
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 772x600
+  RenderBlock {HTML} at (0,0) size 772x600
+    RenderBody {BODY} at (8,8) size 756x584
+      RenderInline {SPAN} at (0,0) size 218x554 [border: (2px solid #000000)]
+        RenderText {#text} at (4,4) size 210x554
+          text run at (4,4) width 550: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}"
+          text run at (67,0) width 550: "\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}\x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}"
+          text run at (130,0) width 550: "\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}"
+          text run at (193,0) width 170: "\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}"
+      RenderText {#text} at (193,174) size 21x7
+        text run at (193,174) width 7: " "
       RenderBR {BR} at (0,0) size 0x0
-      RenderBR {BR} at (252,0) size 0x21
-      RenderInline {SPAN} at (0,0) size 858x35 [border: (5px solid #000000)]
-        RenderText {#text} at (322,7) size 851x14
-          text run at (322,7) width 529: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}"
-          text run at (385,0) width 536: "\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B} \x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}"
-          text run at (448,0) width 550: "\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}"
-          text run at (511,0) width 550: "\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}"
-          text run at (574,0) width 529: "\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}"
-          text run at (637,0) width 529: "\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}"
-          text run at (700,0) width 473: "\x{307E}\x{3059}\x{304B} \x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}"
+      RenderBR {BR} at (252,0) size 21x0
+      RenderInline {SPAN} at (0,0) size 413x558 [border: (5px solid #000000)]
+        RenderText {#text} at (322,7) size 399x558
+          text run at (322,7) width 550: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}"
+          text run at (385,0) width 558: "\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B} \x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}"
+          text run at (448,0) width 550: "\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}"
+          text run at (511,0) width 550: "\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}"
+          text run at (574,0) width 550: "\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}"
+          text run at (637,0) width 558: "\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B} \x{306A}"
+          text run at (700,0) width 381: "\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}"
       RenderText {#text} at (0,0) size 0x0
index aaf2bc6..f47392c 100644 (file)
@@ -4,14 +4,14 @@ layer at (0,0) size 785x608
   RenderBlock {HTML} at (0,0) size 785x600
     RenderBody {BODY} at (8,8) size 769x584
       RenderBlock {DIV} at (0,0) size 144x600
-        RenderInline {SPAN} at (0,0) size 598x203 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
-          RenderText {#text} at (5,21) size 578x173
+        RenderInline {SPAN} at (0,0) size 137x598 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
+          RenderText {#text} at (5,21) size 127x578
             text run at (5,21) width 578: "This sentence is too long to fit"
             text run at (77,139) width 302: "on a single line."
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {DIV} at (194,0) size 144x600
-        RenderInline {SPAN} at (0,0) size 598x203 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
-          RenderText {#text} at (5,21) size 578x173
+        RenderInline {SPAN} at (0,0) size 137x598 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
+          RenderText {#text} at (5,21) size 127x578
             text run at (5,21) width 578: "This sentence is too long to fit"
             text run at (77,139) width 302: "on a single line."
         RenderText {#text} at (0,0) size 0x0
index a44c1cf..9637dce 100644 (file)
@@ -4,14 +4,14 @@ layer at (0,0) size 785x608
   RenderBlock {HTML} at (0,0) size 785x600
     RenderBody {BODY} at (8,8) size 769x584
       RenderBlock {DIV} at (0,0) size 144x600
-        RenderInline {SPAN} at (0,0) size 598x203 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
-          RenderText {#text} at (8,21) size 578x173
+        RenderInline {SPAN} at (0,0) size 137x598 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
+          RenderText {#text} at (8,21) size 127x578
             text run at (8,21) width 578: "This sentence is too long to fit"
             text run at (80,139) width 302: "on a single line."
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {DIV} at (194,0) size 144x600
-        RenderInline {SPAN} at (0,0) size 598x203 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
-          RenderText {#text} at (8,21) size 578x173
+        RenderInline {SPAN} at (0,0) size 137x598 [bgcolor=#FFFFE0] [border: (5px solid #008000)]
+          RenderText {#text} at (8,21) size 127x578
             text run at (8,21) width 578: "This sentence is too long to fit"
             text run at (80,139) width 302: "on a single line."
         RenderText {#text} at (0,0) size 0x0
index 5b12a55..7604a6b 100644 (file)
@@ -4,31 +4,31 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 132x500
-        RenderInline {SPAN} at (0,0) size 395x22
-          RenderText {#text} at (0,0) size 395x22
+        RenderInline {SPAN} at (0,0) size 22x395
+          RenderText {#text} at (0,0) size 22x395
             text run at (0,0) width 395: "This text should be rotated 90 degrees and underlined."
-        RenderText {#text} at (0,395) size 5x22
+        RenderText {#text} at (0,395) size 22x5
           text run at (0,395) width 5: " "
         RenderBR {BR} at (5,400) size 0x0
-        RenderInline {SPAN} at (0,0) size 386x22
-          RenderText {#text} at (22,0) size 386x22
+        RenderInline {SPAN} at (0,0) size 22x386
+          RenderText {#text} at (22,0) size 22x386
             text run at (22,0) width 386: "This text should be rotated 90 degrees and overlined."
-        RenderText {#text} at (22,386) size 5x22
+        RenderText {#text} at (22,386) size 22x5
           text run at (22,386) width 5: " "
         RenderBR {BR} at (27,391) size 0x0
-        RenderInline {SPAN} at (0,0) size 423x22
-          RenderText {#text} at (44,0) size 423x22
+        RenderInline {SPAN} at (0,0) size 22x423
+          RenderText {#text} at (44,0) size 22x423
             text run at (44,0) width 423: "This text should be rotated 90 degrees and struck through."
-        RenderText {#text} at (44,423) size 5x22
+        RenderText {#text} at (44,423) size 22x5
           text run at (44,423) width 5: " "
         RenderBR {BR} at (49,428) size 0x0
-        RenderInline {SPAN} at (0,0) size 449x22
-          RenderText {#text} at (66,0) size 449x22
+        RenderInline {SPAN} at (0,0) size 22x449
+          RenderText {#text} at (66,0) size 22x449
             text run at (66,0) width 449: "This text should have a red shadow that is offset horizontally."
-        RenderText {#text} at (66,449) size 5x22
+        RenderText {#text} at (66,449) size 22x5
           text run at (66,449) width 5: " "
         RenderBR {BR} at (71,454) size 0x0
-        RenderBR {BR} at (88,0) size 0x22
-        RenderInline {SPAN} at (0,0) size 460x22
-          RenderText {#text} at (110,0) size 460x22
+        RenderBR {BR} at (88,0) size 22x0
+        RenderInline {SPAN} at (0,0) size 22x460
+          RenderText {#text} at (110,0) size 22x460
             text run at (110,0) width 460: "This text should have an overline plus horizontal green shadow"
index 66c514c..51069ca 100644 (file)
@@ -5,10 +5,10 @@ layer at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 504x584 [border: (2px solid #000000)]
       RenderBlock {DIV} at (18,2) size 204x580 [border: (2px solid #800000)]
         RenderBlock (floating) {DIV} at (2,478) size 100x100 [bgcolor=#00FF00]
-        RenderText {#text} at (2,2) size 280x18
+        RenderText {#text} at (2,2) size 36x472
           text run at (2,2) width 280: "Here is some text in a vertical-rl block flow. "
           text run at (2,282) width 192: "The block direction is right-to-"
           text run at (20,2) width 24: "left."
         RenderBR {BR} at (34,26) size 0x0
-        RenderText {#text} at (38,2) size 203x18
+        RenderText {#text} at (38,2) size 18x203
           text run at (38,2) width 203: "This line should also be vertical."
index ee39777..c60ae6d 100644 (file)
@@ -3,7 +3,7 @@ layer at (0,0) size 800x600
 layer at (0,0) size 398x600
   RenderBlock {HTML} at (0,0) size 398x600 [border: (10px solid #800000)]
     RenderBody {BODY} at (18,18) size 362x564 [border: (5px solid #000000)]
-      RenderText {#text} at (5,5) size 803x21
+      RenderText {#text} at (5,5) size 341x529
         text run at (5,5) width 529: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}"
         text run at (37,5) width 529: "\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}\x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}"
         text run at (69,5) width 529: "\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}"
index 652c284..7df9b27 100644 (file)
@@ -3,7 +3,7 @@ layer at (0,0) size 800x600
 layer at (402,0) size 398x600
   RenderBlock {HTML} at (0,0) size 398x600 [border: (10px solid #800000)]
     RenderBody {BODY} at (18,18) size 362x564 [border: (5px solid #000000)]
-      RenderText {#text} at (10,5) size 803x21
+      RenderText {#text} at (10,5) size 341x529
         text run at (10,5) width 529: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}"
         text run at (42,5) width 529: "\x{3066}\x{3057}\x{307E}\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}\x{306A}\x{3089}\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}"
         text run at (74,5) width 529: "\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}"
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.checksum b/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.checksum
new file mode 100644 (file)
index 0000000..fdd8637
--- /dev/null
@@ -0,0 +1 @@
+f75d16159fe00224641143a95945d7cd
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.png b/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.png
new file mode 100644 (file)
index 0000000..7e303eb
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.txt b/LayoutTests/platform/mac/fast/repaint/inline-horizontal-bt-overflow-expected.txt
new file mode 100644 (file)
index 0000000..d48bed7
--- /dev/null
@@ -0,0 +1,9 @@
+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
+      RenderBlock {DIV} at (50,50) size 684x50
+        RenderInline {SPAN} at (0,0) size 200x50 [textStrokeColor=#008000] [textStrokeWidth=50.00]
+          RenderText {#text} at (0,0) size 200x50
+            text run at (0,0) width 200: "A  B"
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.checksum b/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.checksum
new file mode 100644 (file)
index 0000000..dc753c9
--- /dev/null
@@ -0,0 +1 @@
+001a25517f0a9d241227ced7a38aaf09
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.png b/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.png
new file mode 100644 (file)
index 0000000..9a981d7
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.txt b/LayoutTests/platform/mac/fast/repaint/inline-vertical-lr-overflow-expected.txt
new file mode 100644 (file)
index 0000000..9f8abc2
--- /dev/null
@@ -0,0 +1,9 @@
+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
+      RenderBlock {DIV} at (50,50) size 50x484
+        RenderInline {SPAN} at (0,0) size 50x200 [textStrokeColor=#008000] [textStrokeWidth=50.00]
+          RenderText {#text} at (0,0) size 50x200
+            text run at (0,0) width 200: "A  B"
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum b/LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.checksum
new file mode 100644 (file)
index 0000000..cdfba35
--- /dev/null
@@ -0,0 +1 @@
+fda140f9717c5c03d6669ce19af124c8
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png b/LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png
new file mode 100644 (file)
index 0000000..c1635a1
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/inline-vertical-rl-overflow-expected.png differ
index eb8c777..9204088 100644 (file)
@@ -1,3 +1,44 @@
+2010-11-01  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=48663
+
+        Make repaint invalidation work with vertical lines.  Rewrite linesBoundingBox for RenderText and
+        RenderInline to give the correct rectangle back for vertical lines.  Also patch linesVisibleOverflowBoundingBox
+        to give back the correct rectangle for vertical lines.
+
+        Fix bugs in the overflow accessors of InlineFlowBox when m_overflow was 0.
+        
+        Patch hit testing to also account for "rt" and "bt" blocks.
+
+        * rendering/InlineBox.cpp:
+        (WebCore::InlineBox::adjustForFlippedBlocksWritingMode):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::nodeAtPoint):
+        * rendering/InlineFlowBox.h:
+        (WebCore::InlineFlowBox::logicalLeftVisibleOverflow):
+        (WebCore::InlineFlowBox::logicalRightVisibleOverflow):
+        (WebCore::InlineFlowBox::bottomLayoutOverflow):
+        (WebCore::InlineFlowBox::rightLayoutOverflow):
+        (WebCore::InlineFlowBox::bottomVisualOverflow):
+        (WebCore::InlineFlowBox::rightVisualOverflow):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::nodeAtPoint):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::hitTestFloats):
+        (WebCore::RenderBlock::hitTestContents):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeRectForRepaint):
+        (WebCore::RenderBox::adjustForFlippedBlocksWritingMode):
+        * rendering/RenderBox.h:
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::linesBoundingBox):
+        (WebCore::RenderInline::linesVisibleOverflowBoundingBox):
+        (WebCore::RenderInline::clippedOverflowRectForRepaint):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::linesBoundingBox):
+
 2010-11-01  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders Carlsson.
index 1ce68f9..6191253 100644 (file)
@@ -295,12 +295,7 @@ void InlineBox::adjustForFlippedBlocksWritingMode(IntRect& rect)
 {
     if (!renderer()->style()->isFlippedBlocksWritingMode())
         return;
-    
-    RenderBlock* block = root()->block();
-    if (block->style()->isHorizontalWritingMode())
-        rect.setY(block->height() - rect.bottom());
-    else
-        rect.setX(block->width() - rect.right());
+    return root()->block()->adjustForFlippedBlocksWritingMode(rect);
 }
 
 } // namespace WebCore
index d165231..8287ceb 100644 (file)
@@ -654,6 +654,7 @@ void InlineFlowBox::computeBlockDirectionOverflow(int lineTop, int lineBottom, b
 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
 {
     IntRect overflowRect(visibleOverflowRect());
+    adjustForFlippedBlocksWritingMode(overflowRect);
     overflowRect.move(tx, ty);
     if (!overflowRect.intersects(result.rectForPoint(x, y)))
         return false;
@@ -667,7 +668,10 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
     }
 
     // Now check ourselves.
-    IntRect rect(tx + m_x, ty + m_y, width(), height());
+    IntPoint boxOrigin(m_x, m_y);
+    adjustForFlippedBlocksWritingMode(boxOrigin);
+    boxOrigin.move(tx, ty);
+    IntRect rect(boxOrigin, IntSize(width(), height()));
     if (visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
         renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty)); // Don't add in m_x or m_y here, we want coords in the containing block's space.
         if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
index a168f98..ee11162 100644 (file)
@@ -182,15 +182,17 @@ public:
     int bottomVisibleOverflow() const { return std::max(bottomLayoutOverflow(), bottomVisualOverflow()); }
     int leftVisibleOverflow() const { return std::min(leftLayoutOverflow(), leftVisualOverflow()); }
     int rightVisibleOverflow() const { return std::max(rightLayoutOverflow(), rightVisualOverflow()); }
+    int logicalLeftVisibleOverflow() const { return std::min(logicalLeftLayoutOverflow(), logicalLeftVisualOverflow()); }
+    int logicalRightVisibleOverflow() const { return std::max(logicalRightLayoutOverflow(), logicalRightVisualOverflow()); }
     int logicalTopVisibleOverflow() const { return std::min(logicalTopLayoutOverflow(), logicalTopVisualOverflow()); }
     int logicalBottomVisibleOverflow() const { return std::max(logicalBottomLayoutOverflow(), logicalBottomVisualOverflow()); }
 
     IntRect visibleOverflowRect() const { return m_overflow ? m_overflow->visibleOverflowRect() : IntRect(m_x, m_y, width(), height());  }
 
     int topLayoutOverflow() const { return m_overflow ? m_overflow->topLayoutOverflow() : m_y; }
-    int bottomLayoutOverflow() const { return m_overflow ? m_overflow->bottomLayoutOverflow() : m_y + logicalHeight(); }
+    int bottomLayoutOverflow() const { return m_overflow ? m_overflow->bottomLayoutOverflow() : m_y + height(); }
     int leftLayoutOverflow() const { return m_overflow ? m_overflow->leftLayoutOverflow() : m_x; }
-    int rightLayoutOverflow() const { return m_overflow ? m_overflow->rightLayoutOverflow() : m_x + m_logicalWidth; }
+    int rightLayoutOverflow() const { return m_overflow ? m_overflow->rightLayoutOverflow() : m_x + width(); }
     IntRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : IntRect(m_x, m_y, width(), height()); }
     int logicalLeftLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? leftLayoutOverflow() : topLayoutOverflow(); }
     int logicalRightLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? rightLayoutOverflow() : bottomLayoutOverflow(); }
@@ -198,9 +200,9 @@ public:
     int logicalBottomLayoutOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? bottomLayoutOverflow() : rightLayoutOverflow(); }
 
     int topVisualOverflow() const { return m_overflow ? m_overflow->topVisualOverflow() : m_y; }
-    int bottomVisualOverflow() const { return m_overflow ? m_overflow->bottomVisualOverflow() : m_y + logicalHeight(); }
+    int bottomVisualOverflow() const { return m_overflow ? m_overflow->bottomVisualOverflow() : m_y + height(); }
     int leftVisualOverflow() const { return m_overflow ? m_overflow->leftVisualOverflow() : m_x; }
-    int rightVisualOverflow() const { return m_overflow ? m_overflow->rightVisualOverflow() : m_x + m_logicalWidth; }
+    int rightVisualOverflow() const { return m_overflow ? m_overflow->rightVisualOverflow() : m_x + width(); }
     IntRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : IntRect(m_x, m_y, width(), height()); }
     int logicalLeftVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? leftVisualOverflow() : topVisualOverflow(); }
     int logicalRightVisualOverflow() const { return renderer()->style()->isHorizontalWritingMode() ? rightVisualOverflow() : bottomVisualOverflow(); }
index 43b025a..e545d37 100644 (file)
@@ -309,7 +309,10 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, in
     if (isLineBreak())
         return false;
 
-    IntRect rect(tx + m_x, ty + m_y, width(), height());
+    IntPoint boxOrigin(m_x, m_y);
+    adjustForFlippedBlocksWritingMode(boxOrigin);
+    boxOrigin.move(tx, ty);
+    IntRect rect(boxOrigin, IntSize(width(), height()));
     if (m_truncation != cFullTruncation && visibleToHitTesting() && rect.intersects(result.rectForPoint(x, y))) {
         renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
         if (!result.addNodeToRectBasedTestResult(renderer()->node(), x, y, rect))
index 47ec220..0644586 100644 (file)
@@ -4150,10 +4150,12 @@ bool RenderBlock::hitTestFloats(const HitTestRequest& request, HitTestResult& re
     DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
     for (it.toLast(); (floatingObject = it.current()); --it) {
         if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) {
-            int xOffset = tx + floatingObject->left() + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();
-            int yOffset =  ty + floatingObject->top() + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();
-            if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), xOffset, yOffset)) {
-                updateHitTestResult(result, IntPoint(x - xOffset, y - yOffset));
+            int xOffset = floatingObject->left() + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();
+            int yOffset =  floatingObject->top() + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();
+            IntPoint childPoint(tx + xOffset, ty + yOffset);
+            adjustForFlippedBlocksWritingMode(floatingObject->m_renderer, childPoint, ParentToChildFlippingAdjustment);
+            if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), childPoint.x(), childPoint.y())) {
+                updateHitTestResult(result, IntPoint(x - childPoint.x(), y - childPoint.y()));
                 return true;
             }
         }
@@ -4208,7 +4210,9 @@ bool RenderBlock::hitTestContents(const HitTestRequest& request, HitTestResult&
         if (hitTestAction == HitTestChildBlockBackgrounds)
             childHitTest = HitTestChildBlockBackground;
         for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) {
-            if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, x, y, tx, ty, childHitTest))
+            IntPoint childPoint(tx, ty);
+            adjustForFlippedBlocksWritingMode(child, childPoint, ParentToChildFlippingAdjustment);
+            if (!child->hasSelfPaintingLayer() && !child->isFloating() && child->nodeAtPoint(request, result, x, y, childPoint.x(), childPoint.y(), childHitTest))
                 return true;
         }
     }
index 35e597f..8c4b644 100644 (file)
@@ -1427,6 +1427,9 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In
         return;
     }
     
+    if (o->isBox())
+        toRenderBox(o)->adjustForFlippedBlocksWritingMode(rect);
+    
     o->computeRectForRepaint(repaintContainer, rect, fixed);
 }
 
@@ -3211,6 +3214,17 @@ void RenderBox::adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint& po
         point.move(width() - child->width() - child->x() - (adjustment == ParentToChildFlippingAdjustment ? child->x() : 0), 0);
 }
 
+void RenderBox::adjustForFlippedBlocksWritingMode(IntRect& rect)
+{
+    if (!style()->isFlippedBlocksWritingMode())
+        return;
+    
+    if (style()->isHorizontalWritingMode())
+        rect.setY(height() - rect.bottom());
+    else
+        rect.setX(width() - rect.right());
+}
+
 int RenderBox::convertFromFlippedWritingMode(int logicalPosition)
 {
     if (!style()->isFlippedBlocksWritingMode())
index 7854116..348b2f7 100644 (file)
@@ -379,6 +379,7 @@ public:
 
     enum FlippingAdjustment { ChildToParentFlippingAdjustment, ParentToChildFlippingAdjustment };
     void adjustForFlippedBlocksWritingMode(RenderBox* child, IntPoint&, FlippingAdjustment);
+    void adjustForFlippedBlocksWritingMode(IntRect&); // Unflips a rect in our coordinate space.
     int convertFromFlippedWritingMode(int position);
     IntSize locationOffsetIncludingFlipping();
 
index 4b28268..54957fc 100644 (file)
@@ -559,18 +559,22 @@ IntRect RenderInline::linesBoundingBox() const
     ASSERT(!firstLineBox() == !lastLineBox());  // Either both are null or both exist.
     if (firstLineBox() && lastLineBox()) {
         // Return the width of the minimal left side and the maximal right side.
-        int leftSide = 0;
-        int rightSide = 0;
+        int logicalLeftSide = 0;
+        int logicalRightSide = 0;
         for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
-            if (curr == firstLineBox() || curr->x() < leftSide)
-                leftSide = curr->x();
-            if (curr == firstLineBox() || curr->x() + curr->logicalWidth() > rightSide)
-                rightSide = curr->x() + curr->logicalWidth();
+            if (curr == firstLineBox() || curr->logicalLeft() < logicalLeftSide)
+                logicalLeftSide = curr->logicalLeft();
+            if (curr == firstLineBox() || curr->logicalRight() > logicalRightSide)
+                logicalRightSide = curr->logicalRight();
         }
-        result.setWidth(rightSide - leftSide);
-        result.setX(leftSide);
-        result.setHeight(lastLineBox()->y() + lastLineBox()->logicalHeight() - firstLineBox()->y());
-        result.setY(firstLineBox()->y());
+        
+        bool isHorizontal = style()->isHorizontalWritingMode();
+        
+        int x = isHorizontal ? logicalLeftSide : firstLineBox()->x();
+        int y = isHorizontal ? firstLineBox()->y() : logicalLeftSide;
+        int width = isHorizontal ? logicalRightSide - logicalLeftSide : lastLineBox()->logicalBottom() - x;
+        int height = isHorizontal ? lastLineBox()->logicalBottom() - y : logicalRightSide - logicalLeftSide;
+        result = IntRect(x, y, width, height);
     }
 
     return result;
@@ -582,15 +586,20 @@ IntRect RenderInline::linesVisibleOverflowBoundingBox() const
         return IntRect();
 
     // Return the width of the minimal left side and the maximal right side.
-    int leftSide = numeric_limits<int>::max();
-    int rightSide = numeric_limits<int>::min();
+    int logicalLeftSide = numeric_limits<int>::max();
+    int logicalRightSide = numeric_limits<int>::min();
     for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
-        leftSide = min(leftSide, curr->leftVisibleOverflow());
-        rightSide = max(rightSide, curr->rightVisibleOverflow());
+        logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisibleOverflow());
+        logicalRightSide = max(logicalRightSide, curr->logicalRightVisibleOverflow());
     }
 
-    return IntRect(leftSide, firstLineBox()->topVisibleOverflow(), rightSide - leftSide,
-        lastLineBox()->bottomVisibleOverflow() - firstLineBox()->topVisibleOverflow());
+    bool isHorizontal = style()->isHorizontalWritingMode();
+        
+    int x = isHorizontal ? logicalLeftSide : firstLineBox()->leftVisibleOverflow();
+    int y = isHorizontal ? firstLineBox()->topVisibleOverflow() : logicalLeftSide;
+    int width = isHorizontal ? logicalRightSide - logicalLeftSide : lastLineBox()->rightVisibleOverflow() - firstLineBox()->leftVisibleOverflow();
+    int height = isHorizontal ? lastLineBox()->bottomVisibleOverflow() - firstLineBox()->topVisibleOverflow() : logicalRightSide - logicalLeftSide;
+    return IntRect(x, y, width, height);
 }
 
 IntRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
@@ -619,6 +628,8 @@ IntRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* repain
     }
 
     IntRect r(-ow + left, -ow + top, boundingBox.width() + ow * 2, boundingBox.height() + ow * 2);
+    cb->adjustForFlippedBlocksWritingMode(r);
+
     if (cb->hasColumns())
         cb->adjustRectForColumns(r);
 
index 510d830..f08e8fb 100644 (file)
@@ -1237,18 +1237,22 @@ IntRect RenderText::linesBoundingBox() const
     ASSERT(!firstTextBox() == !lastTextBox());  // Either both are null or both exist.
     if (firstTextBox() && lastTextBox()) {
         // Return the width of the minimal left side and the maximal right side.
-        int leftSide = 0;
-        int rightSide = 0;
+        int logicalLeftSide = 0;
+        int logicalRightSide = 0;
         for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) {
-            if (curr == firstTextBox() || curr->x() < leftSide)
-                leftSide = curr->x();
-            if (curr == firstTextBox() || curr->x() + curr->logicalWidth() > rightSide)
-                rightSide = curr->x() + curr->logicalWidth();
+            if (curr == firstTextBox() || curr->logicalLeft() < logicalLeftSide)
+                logicalLeftSide = curr->logicalLeft();
+            if (curr == firstTextBox() || curr->logicalRight() > logicalRightSide)
+                logicalRightSide = curr->logicalRight();
         }
-        result.setWidth(rightSide - leftSide);
-        result.setX(leftSide);
-        result.setHeight(lastTextBox()->y() + lastTextBox()->logicalHeight() - firstTextBox()->y());
-        result.setY(firstTextBox()->y());
+        
+        bool isHorizontal = style()->isHorizontalWritingMode();
+        
+        int x = isHorizontal ? logicalLeftSide : firstTextBox()->x();
+        int y = isHorizontal ? firstTextBox()->y() : logicalLeftSide;
+        int width = isHorizontal ? logicalRightSide - logicalLeftSide : lastTextBox()->logicalBottom() - x;
+        int height = isHorizontal ? lastTextBox()->logicalBottom() - y : logicalRightSide - logicalLeftSide;
+        result = IntRect(x, y, width, height);
     }
 
     return result;