Title: [93144] trunk
Revision
93144
Author
hy...@apple.com
Date
2011-08-16 12:43:21 -0700 (Tue, 16 Aug 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=66254

Source/WebCore: 

Make region invalidation and repainting work properly. We do this by making RenderFlowThreads into
repaint containers and then issuing new repaints in the regions that contain the invalidated flow thread
content.

Reviewed by Simon Fraser.

Added new tests in fast/repaint.

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::repaintRectangleInRegions):
* rendering/RenderFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::enclosingRenderFlowThread):
(WebCore::RenderObject::containerForRepaint):
(WebCore::RenderObject::repaintUsingContainer):
* rendering/RenderObject.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
(WebCore::RenderView::renderFlowThreadWithName):
* rendering/RenderView.h:
(WebCore::RenderView::hasRenderFlowThreads):

LayoutTests: 

Make regions repaint properly. Added new repaint tests.

Reviewed by Simon Fraser.

* fast/repaint/japanese-rl-selection-repaint-in-regions.html: Added.
* fast/repaint/line-flow-with-floats-in-regions.html: Added.
* fast/repaint/overflow-flipped-writing-mode-block-in-regions.html: Added.
* platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Added.
* platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Added.
* platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.png: Added.
* platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.txt: Added.
* platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png: Added.
* platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93143 => 93144)


--- trunk/LayoutTests/ChangeLog	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/LayoutTests/ChangeLog	2011-08-16 19:43:21 UTC (rev 93144)
@@ -1,3 +1,21 @@
+2011-08-16  David Hyatt  <hy...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=66254
+
+        Make regions repaint properly. Added new repaint tests.
+
+        Reviewed by Simon Fraser.
+
+        * fast/repaint/japanese-rl-selection-repaint-in-regions.html: Added.
+        * fast/repaint/line-flow-with-floats-in-regions.html: Added.
+        * fast/repaint/overflow-flipped-writing-mode-block-in-regions.html: Added.
+        * platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png: Added.
+        * platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt: Added.
+        * platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.png: Added.
+        * platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.txt: Added.
+        * platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png: Added.
+        * platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt: Added.
+
 2011-08-16  Adam Roben  <aro...@apple.com>
 
         Add Windows expected results for some <canvas> tests

Added: trunk/LayoutTests/fast/repaint/japanese-rl-selection-repaint-in-regions.html (0 => 93144)


--- trunk/LayoutTests/fast/repaint/japanese-rl-selection-repaint-in-regions.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/japanese-rl-selection-repaint-in-regions.html	2011-08-16 19:43:21 UTC (rev 93144)
@@ -0,0 +1,31 @@
+<!doctype html>
+<html style="border:10px solid maroon; -webkit-writing-mode:vertical-rl">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<script src=""
+<script>
+function repaintTest()
+{
+    if (eventSender) {
+        eventSender.mouseMoveTo(660, 300);
+        eventSender.mouseDown();
+        eventSender.mouseMoveTo(660, 300);
+        eventSender.mouseMoveTo(300, 300);
+        eventSender.mouseUp();
+    }
+}
+</script>
+
+<style>
+body {
+    font-family: "HiraMinPro-W3";
+    font-size: 16pt;
+}
+</style>
+</head>
+<body style="border:5px solid black;" _onload_="runRepaintTest()">
+<div style="-webkit-flow:'thread'">
+せっかく見つけたすばらしい記事がどこにあったか忘れてしまった経験はありますかならタイトルとアドレスだけでなく、訪問したウェブページのコンテンツからも検索することができます。せっかく見つけたすばらしい記事がどこにあったか忘れてしまった経験はありますか ならタイトルとアドレスだけでなく、訪問したウェブページのコンテンツからも検索することができます。訪問したウェブページのコンテンツからも検索することができます。せっかく見つけたすばらしい記事がどこにあったか忘れてしまった経験はありますか ならタイトルとアドレスだけでなく、訪問
+</div>
+<div style="content:-webkit-from-flow('thread'); position:absolute;right:100px; top:100px; border:2px solid black; width:400px; height:400px"></div>
+</body>

Added: trunk/LayoutTests/fast/repaint/line-flow-with-floats-in-regions.html (0 => 93144)


--- trunk/LayoutTests/fast/repaint/line-flow-with-floats-in-regions.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/line-flow-with-floats-in-regions.html	2011-08-16 19:43:21 UTC (rev 93144)
@@ -0,0 +1,11 @@
+<body style="margin: 0;" _onload_="loaded()">
+    <script src=""
+    <script>
+        function test(doc)
+        {
+            doc.getElementById("pinkFloat").style.height = "120px";
+        }
+    </script>
+    <iframe _onload_="loaded()" id="iframe" src="" style="border: none; width: 500px; height: 600px; -webkit-flow:'thread'"></iframe>
+    <div style="position:absolute;left:100px;top:0;width:500px;height:600px;content:-webkit-from-flow('thread')"></div>
+</body>

Added: trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-in-regions.html (0 => 93144)


--- trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-in-regions.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-block-in-regions.html	2011-08-16 19:43:21 UTC (rev 93144)
@@ -0,0 +1,16 @@
+<script src=""
+<script>
+    _onload_ = runRepaintTest;
+
+    function repaintTest()
+    {
+        document.getElementById("target").style.visibility = "hidden";
+    }
+</script>
+<div style="-webkit-flow: 'thread'; height: 100px; width: 100px; background-color: red; -webkit-writing-mode: horizontal-bt;">
+    <div style="height: 25px;">
+        <div style="height: 100px; background-color: green;"></div>
+    </div>
+</div>
+<div id="target" style="-webkit-flow: 'thread'; height: 50px; width: 100px; background-color: red; margin-top: -100px;"></div>
+<div style="content:-webkit-from-flow('thread'); width:100px;height:400px; border:2px solid black; position:absolute; left:100px; top:100px"></div>

Added: trunk/LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt (0 => 93144)


--- trunk/LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt	2011-08-16 19:43:21 UTC (rev 93144)
@@ -0,0 +1,32 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (754,0) size 46x600
+  RenderBlock {HTML} at (0,0) size 46x600 [border: (10px solid #800000)]
+    RenderBody {BODY} at (18,18) size 10x564 [border: (5px solid #000000)]
+layer at (296,100) size 404x404
+  RenderRegion {DIV} at (100,100) size 404x404 [border: (2px solid #000000)]
+Flow Threads
+  Thread with flow-name 'thread'
+    layer at (400,0) size 400x400 scrollX 80 scrollWidth 480
+      RenderFlowThread at (0,0) size 400x400
+        RenderBlock {DIV} at (0,0) size 480x400
+          RenderText {#text} at (5,0) size 469x388
+            text run at (5,0) width 381: "\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}"
+            text run at (37,0) width 381: "\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}"
+            text run at (69,0) width 360: "\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}"
+            text run at (101,0) width 381: "\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}"
+            text run at (133,0) width 381: "\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}"
+            text run at (165,0) width 381: "\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}"
+            text run at (197,0) width 388: "\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 (229,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}"
+            text run at (261,0) width 381: "\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}"
+            text run at (293,0) width 381: "\x{7D22}\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}"
+            text run at (325,0) width 381: "\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}\x{3053}\x{3068}"
+            text run at (357,0) width 381: "\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}"
+            text run at (389,0) width 381: "\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}"
+            text run at (421,0) width 388: "\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}"
+            text run at (453,0) width 191: "\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}\x{8A2A}\x{554F}"
+  Regions for flow 'thread'
+    RenderRegion {DIV} with index 0
+selection start: position 28 of child 0 {#text} of child 1 {DIV} of body
+selection end:   position 226 of child 0 {#text} of child 1 {DIV} of body

Added: trunk/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.txt (0 => 93144)


--- trunk/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.txt	2011-08-16 19:43:21 UTC (rev 93144)
@@ -0,0 +1,88 @@
+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 (0,0) size 800x600
+layer at (100,0) size 500x600
+  RenderRegion {DIV} at (100,0) size 500x600
+Flow Threads
+  Thread with flow-name 'thread'
+    layer at (0,0) size 500x600
+      RenderFlowThread at (0,0) size 500x600
+        RenderPartObject {IFRAME} at (0,0) size 500x600
+          layer at (0,0) size 500x600
+            RenderView at (0,0) size 500x600
+          layer at (0,0) size 500x600
+            RenderBlock {HTML} at (0,0) size 500x600
+              RenderBody {BODY} at (8,8) size 484x576
+                RenderBlock {DIV} at (0,0) size 450x50
+                  RenderBlock (floating) {DIV} at (370,10) size 70x120 [bgcolor=#FFC0CB]
+                RenderBlock {P} at (0,66) size 418x498 [border: (3px solid #800000)]
+                  RenderText {#text} at (6,6) size 406x108
+                    text run at (6,6) width 354: "The chief difficulty Alice found at first was in managing"
+                    text run at (6,24) width 25: "her "
+                    text run at (31,24) width 329: "flamingo: she succeeded in getting its body tucked"
+                    text run at (6,42) width 42: "away, "
+                    text run at (48,42) width 312: "comfortably enough, under her arm, with its legs"
+                    text run at (6,60) width 106: "hanging down, "
+                    text run at (112,60) width 248: "but generally, just as she had got its"
+                    text run at (6,78) width 176: "neck nicely straightened "
+                    text run at (182,78) width 230: "out, and was going to give the"
+                    text run at (6,96) width 224: "hedgehog a blow with its head, it "
+                  RenderInline {I} at (0,0) size 39x18
+                    RenderText {#text} at (230,96) size 39x18
+                      text run at (230,96) width 39: "would"
+                  RenderText {#text} at (269,96) size 406x72
+                    text run at (269,96) width 143: " twist itself round and"
+                    text run at (6,114) width 175: "look up in her face, with "
+                    text run at (181,114) width 231: "such a puzzled _expression_ that she"
+                    text run at (6,132) width 179: "could not help bursting out "
+                    text run at (185,132) width 227: "laughing: and when she had got its"
+                    text run at (6,150) width 229: "head down, and was going to "
+                  RenderText {#text} at (235,150) size 406x126
+                    text run at (235,150) width 177: "begin again, it was very"
+                    text run at (6,168) width 259: "provoking to find that the hedgehog had "
+                    text run at (265,168) width 147: "unrolled itself, and was"
+                    text run at (6,186) width 252: "in the act of crawling away: besides all "
+                    text run at (258,186) width 154: "this, there was generally"
+                    text run at (6,204) width 256: "a ridge or furrow in the way wherever "
+                    text run at (262,204) width 150: "she wanted to send the"
+                    text run at (6,222) width 264: "hedgehog to, and, as the doubled-up "
+                    text run at (270,222) width 142: "soldiers were always"
+                    text run at (6,240) width 292: "getting up and walking off to other parts of "
+                    text run at (298,240) width 114: "the ground, Alice"
+                    text run at (57,258) width 306: "soon came to the conclusion that it was a very "
+                  RenderBlock (floating) {SPAN} at (6,261) size 48x64 [bgcolor=#ADD8E6]
+                  RenderText {#text} at (363,258) size 355x36
+                    text run at (363,258) width 49: "difficult"
+                    text run at (57,276) width 88: "game indeed. "
+                  RenderBR {BR} at (0,0) size 0x0
+                  RenderText {#text} at (57,294) size 304x18
+                    text run at (57,294) width 304: "The players all played at once without waiting"
+                  RenderBlock (floating) {SPAN} at (364,297) size 48x80 [bgcolor=#90EE90]
+                  RenderText {#text} at (57,312) size 355x36
+                    text run at (57,312) width 63: "for turns, "
+                    text run at (120,312) width 241: "quarrelling all the while, and fighting"
+                    text run at (6,330) width 172: "for the hedgehogs; and in "
+                    text run at (178,330) width 116: "a very short time "
+                  RenderInline {SPAN} at (0,0) size 67x18
+                    RenderText {#text} at (294,330) size 67x18
+                      text run at (294,330) width 67: "the Queen"
+                  RenderText {#text} at (6,348) size 355x54
+                    text run at (6,348) width 226: "was in a furious passion, and went "
+                    text run at (232,348) width 129: "stamping about, and"
+                    text run at (6,366) width 288: "shouting \x{2018}Off with his head!\x{2019} or \x{2018}Off with "
+                    text run at (294,366) width 67: "her head!\x{2019}"
+                    text run at (6,384) width 151: "about once in a minute. "
+                  RenderBR {BR} at (0,0) size 0x0
+                  RenderText {#text} at (6,402) size 406x90
+                    text run at (6,402) width 387: "Alice began to feel very uneasy: to be sure, she had not as "
+                    text run at (393,402) width 19: "yet"
+                    text run at (6,420) width 406: "had any dispute with the Queen, but she knew that it might"
+                    text run at (6,438) width 406: "happen any minute, \x{2018}and then,\x{2019} thought she, \x{2018}what would"
+                    text run at (6,456) width 75: "become of "
+                    text run at (81,456) width 331: "me? They\x{2019}re dreadfully fond of beheading people"
+                    text run at (6,474) width 93: "here; the great "
+                    text run at (99,474) width 261: "wonder is, that there\x{2018}s any one left alive!\x{2019}"
+  Regions for flow 'thread'
+    RenderRegion {DIV} with index 0

Added: trunk/LayoutTests/platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt (0 => 93144)


--- trunk/LayoutTests/platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.txt	2011-08-16 19:43:21 UTC (rev 93144)
@@ -0,0 +1,17 @@
+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 (100,100) size 104x404
+  RenderRegion {DIV} at (100,100) size 104x404 [border: (2px solid #000000)]
+Flow Threads
+  Thread with flow-name 'thread'
+    layer at (0,0) size 100x400
+      RenderFlowThread at (0,0) size 100x400
+        RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+          RenderBlock {DIV} at (0,0) size 100x25
+            RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+        RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#FF0000]
+  Regions for flow 'thread'
+    RenderRegion {DIV} with index 0

Modified: trunk/Source/WebCore/ChangeLog (93143 => 93144)


--- trunk/Source/WebCore/ChangeLog	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/ChangeLog	2011-08-16 19:43:21 UTC (rev 93144)
@@ -1,3 +1,29 @@
+2011-08-16  David Hyatt  <hy...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=66254
+
+        Make region invalidation and repainting work properly. We do this by making RenderFlowThreads into
+        repaint containers and then issuing new repaints in the regions that contain the invalidated flow thread
+        content.
+
+        Reviewed by Simon Fraser.
+
+        Added new tests in fast/repaint.
+
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::repaintRectangleInRegions):
+        * rendering/RenderFlowThread.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::enclosingRenderFlowThread):
+        (WebCore::RenderObject::containerForRepaint):
+        (WebCore::RenderObject::repaintUsingContainer):
+        * rendering/RenderObject.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::RenderView):
+        (WebCore::RenderView::renderFlowThreadWithName):
+        * rendering/RenderView.h:
+        (WebCore::RenderView::hasRenderFlowThreads):
+
 2011-08-16  Joseph Pecoraro  <joep...@webkit.org>
 
         Abandoned Memory: Temporary CSS Fonts May Never Be Purged

Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (93143 => 93144)


--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp	2011-08-16 19:43:21 UTC (rev 93144)
@@ -295,4 +295,27 @@
     return isPointInsideFlowThread;
 }
 
+void RenderFlowThread::repaintRectangleInRegions(const LayoutRect& repaintRect, bool immediate)
+{
+    for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) {
+        RenderRegion* region = *iter;
+
+        // We only have to issue a repaint in this region if the region rect intersects the repaint rect.
+        LayoutRect flippedRegionRect(region->regionRect());
+        flipForWritingMode(flippedRegionRect); // Put the region rect into physical coordinates.
+        
+        IntRect clippedRect(flippedRegionRect);
+        clippedRect.intersect(repaintRect);
+        if (clippedRect.isEmpty())
+            continue;
+        
+        // Put the region rect into the region's physical coordinate space.
+        clippedRect.setLocation(region->contentBoxRect().location() + (repaintRect.location() - flippedRegionRect.location()));
+        
+        // Now switch to the region's writing mode coordinate space and let it repaint itself.
+        region->flipForWritingMode(clippedRect);
+        region->repaintRectangle(clippedRect, immediate);
+    }
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderFlowThread.h (93143 => 93144)


--- trunk/Source/WebCore/rendering/RenderFlowThread.h	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.h	2011-08-16 19:43:21 UTC (rev 93144)
@@ -88,6 +88,8 @@
 
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+    void repaintRectangleInRegions(const LayoutRect&, bool immediate);
+
 private:
     virtual const char* renderName() const { return "RenderFlowThread"; }
 

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (93143 => 93144)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-08-16 19:43:21 UTC (rev 93144)
@@ -45,6 +45,7 @@
 #include "RenderCounter.h"
 #include "RenderDeprecatedFlexibleBox.h"
 #include "RenderFlexibleBox.h"
+#include "RenderFlowThread.h"
 #include "RenderImage.h"
 #include "RenderImageResourceStyleImage.h"
 #include "RenderInline.h"
@@ -568,6 +569,17 @@
     return 0;
 }
 
+RenderFlowThread* RenderObject::enclosingRenderFlowThread() const
+{
+    RenderObject* curr = const_cast<RenderObject*>(this);
+    while (curr) {
+        if (curr->isRenderFlowThread())
+            return toRenderFlowThread(curr);
+        curr = curr->parent();
+    }
+    return 0;
+}
+
 RenderBlock* RenderObject::firstLineBlock() const
 {
     return 0;
@@ -1145,16 +1157,28 @@
 
 RenderBoxModelObject* RenderObject::containerForRepaint() const
 {
+    RenderView* v = view();
+    if (!v)
+        return 0;
+    
+    RenderBoxModelObject* repaintContainer = 0;
+
 #if USE(ACCELERATED_COMPOSITING)
-    if (RenderView* v = view()) {
-        if (v->usesCompositing()) {
-            RenderLayer* compLayer = enclosingLayer()->enclosingCompositingLayer();
-            return compLayer ? compLayer->renderer() : 0;
-        }
+    if (v->usesCompositing()) {
+        RenderLayer* compLayer = enclosingLayer()->enclosingCompositingLayer();
+        if (compLayer)
+            repaintContainer = compLayer->renderer();
     }
 #endif
-    // Do root-relative repaint.
-    return 0;
+
+    // If we have a flow thread, then we need to do individual repaints within the RenderRegions instead.
+    // Return the flow thread as a repaint container in order to create a chokepoint that allows us to change
+    // repainting to do individual region repaints.
+    // FIXME: Composited layers inside a flow thread will bypass this mechanism and will malfunction. It's not
+    // clear how to address this problem for composited descendants of a RenderFlowThread.
+    if (!repaintContainer && v->hasRenderFlowThreads())
+        repaintContainer = enclosingRenderFlowThread();
+    return repaintContainer;
 }
 
 void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const LayoutRect& r, bool immediate)
@@ -1164,6 +1188,9 @@
         return;
     }
 
+    if (repaintContainer->isRenderFlowThread())
+        return toRenderFlowThread(repaintContainer)->repaintRectangleInRegions(r, immediate);
+
 #if USE(ACCELERATED_COMPOSITING)
     RenderView* v = view();
     if (repaintContainer->isRenderView()) {

Modified: trunk/Source/WebCore/rendering/RenderObject.h (93143 => 93144)


--- trunk/Source/WebCore/rendering/RenderObject.h	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2011-08-16 19:43:21 UTC (rev 93144)
@@ -55,7 +55,7 @@
 class RenderBoxModelObject;
 class RenderInline;
 class RenderBlock;
-class RenderFlow;
+class RenderFlowThread;
 class RenderLayer;
 class RenderTheme;
 class TransformState;
@@ -185,6 +185,9 @@
     RenderBox* enclosingBox() const;
     RenderBoxModelObject* enclosingBoxModelObject() const;
 
+    // Function to return our enclosing flow thread if we are contained inside one.
+    RenderFlowThread* enclosingRenderFlowThread() const;
+
     virtual bool isEmpty() const { return firstChild() == 0; }
 
 #ifndef NDEBUG

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (93143 => 93144)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2011-08-16 19:43:21 UTC (rev 93144)
@@ -52,6 +52,7 @@
     , m_maximalOutlineSize(0)
     , m_pageLogicalHeight(0)
     , m_pageLogicalHeightChanged(false)
+    , m_hasRenderFlowThreads(false)
     , m_layoutState(0)
     , m_layoutStateDisableCount(0)
 {
@@ -818,7 +819,7 @@
     RenderFlowThread* flowRenderer = new (renderArena()) RenderFlowThread(document(), flowThread);
     flowRenderer->setStyle(RenderFlowThread::createFlowThreadStyle(style()));
     addChild(flowRenderer);
-    
+    m_hasRenderFlowThreads = true;
     return flowRenderer;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderView.h (93143 => 93144)


--- trunk/Source/WebCore/rendering/RenderView.h	2011-08-16 19:42:07 UTC (rev 93143)
+++ trunk/Source/WebCore/rendering/RenderView.h	2011-08-16 19:43:21 UTC (rev 93144)
@@ -167,6 +167,7 @@
     IntRect documentRect() const;
 
     RenderFlowThread* renderFlowThreadWithName(const AtomicString& flowThread);
+    bool hasRenderFlowThreads() const { return m_hasRenderFlowThreads; }
 
     void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     
@@ -245,6 +246,7 @@
 private:
     unsigned m_pageLogicalHeight;
     bool m_pageLogicalHeightChanged;
+    bool m_hasRenderFlowThreads;
     LayoutState* m_layoutState;
     unsigned m_layoutStateDisableCount;
 #if USE(ACCELERATED_COMPOSITING)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to