WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2008 18:40:52 +0000 (18:40 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2008 18:40:52 +0000 (18:40 +0000)
        Reviewed by Sam Weinig.

        - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple

        Test: fast/repaint/line-flow-with-floats-10.html

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
        If the float's top margin has changed and it has not been repositioned
        yet, we do not have its new y position.

LayoutTests:

        Reviewed by Sam Weinig.

        - test for assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple

        * fast/repaint/line-flow-with-floats-10.html: Added.
        * platform/mac/fast/repaint/line-flow-with-floats-10-expected.checksum: Added.
        * platform/mac/fast/repaint/line-flow-with-floats-10-expected.png: Added.
        * platform/mac/fast/repaint/line-flow-with-floats-10-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/line-flow-with-floats-10.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/bidi.cpp

index 6574103dc977461db48c7eabb0a7ca3b3430b817..846f1d3a719c6bde241442318c3661e393b2f084 100644 (file)
@@ -1,3 +1,14 @@
+2008-03-19  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - test for assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
+
+        * fast/repaint/line-flow-with-floats-10.html: Added.
+        * platform/mac/fast/repaint/line-flow-with-floats-10-expected.checksum: Added.
+        * platform/mac/fast/repaint/line-flow-with-floats-10-expected.png: Added.
+        * platform/mac/fast/repaint/line-flow-with-floats-10-expected.txt: Added.
+
 2008-03-19  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by John Sullivan.
diff --git a/LayoutTests/fast/repaint/line-flow-with-floats-10.html b/LayoutTests/fast/repaint/line-flow-with-floats-10.html
new file mode 100644 (file)
index 0000000..d1159ac
--- /dev/null
@@ -0,0 +1,10 @@
+<body style="margin: 0;" onload="loaded()">
+    <script src="resources/line-flow-with-floats.js"></script>
+    <script>
+        function test(doc)
+        {
+            doc.getElementById("blueFloat").style.marginTop = "14px";
+        }
+    </script>
+    <iframe onload="loaded()" id="iframe" src="resources/line-flow-with-floats.html" style="border: none; width: 500px; height: 600px;"></iframe>
+</body>
diff --git a/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.checksum b/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.checksum
new file mode 100644 (file)
index 0000000..c33fc33
--- /dev/null
@@ -0,0 +1 @@
+8f2cd89f7eaf0c428cb7cb454db843a5
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.png b/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.png
new file mode 100644 (file)
index 0000000..ef5cb38
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.txt b/LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-10-expected.txt
new file mode 100644 (file)
index 0000000..389299f
--- /dev/null
@@ -0,0 +1,82 @@
+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
+      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 70x150 [bgcolor=#FFC0CB]
+              RenderBlock {P} at (0,66) size 418x498 [border: (3px solid #800000)]
+                RenderText {#text} at (6,6) size 354x108
+                  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 158: "neck nicely straightened "
+                  text run at (164,78) width 196: "out, and was going to give the"
+                  text run at (6,96) width 239: "hedgehog a blow with its head, it "
+                RenderInline {I} at (0,0) size 39x18
+                  RenderText {#text} at (245,96) size 39x18
+                    text run at (245,96) width 39: "would"
+                RenderText {#text} at (284,96) size 406x72
+                  text run at (284,96) width 76: " twist itself"
+                  text run at (6,114) width 237: "round and look up in her face, with "
+                  text run at (243,114) width 169: "such a puzzled expression"
+                  text run at (6,132) width 227: "that she could not help bursting out "
+                  text run at (233,132) width 179: "laughing: and when she had"
+                  text run at (6,150) width 248: "got its head down, and was going to "
+                RenderText {#text} at (254,150) size 406x126
+                  text run at (254,150) width 158: "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,272) 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 304x36
+                  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 (57,330) width 170: "for the hedgehogs; and in "
+                  text run at (227,330) width 115: "a very short time "
+                RenderInline {SPAN} at (0,0) size 355x36
+                  RenderText {#text} at (342,330) size 355x36
+                    text run at (342,330) width 19: "the"
+                    text run at (6,348) width 42: "Queen"
+                RenderText {#text} at (48,348) size 355x54
+                  text run at (48,348) width 256: " was in a furious passion, and went "
+                  text run at (304,348) width 57: "stamping"
+                  text run at (6,366) width 355: "about, and shouting \x{2018}Off with his head!\x{2019} or \x{2018}Off with"
+                  text run at (6,384) width 219: "her head!\x{2019} 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}"
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
index 8170d00a0e6badf2f42661b7a5cab7d32b9ca5e6..e7914abd029670f1c276d0ecaa22e35f590e2035 100644 (file)
@@ -1,3 +1,16 @@
+2008-03-19  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
+
+        Test: fast/repaint/line-flow-with-floats-10.html
+
+        * rendering/bidi.cpp:
+        (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
+        If the float's top margin has changed and it has not been repositioned
+        yet, we do not have its new y position.
+
 2008-03-19  David Hyatt  <hyatt@apple.com>
 
         New implementation of full page zoom.  Because of how much doesn't transform when zooming, and because
index d42b597967fc7f51f24f8f551d484c6c9ddfe1a2..3cfc1efb588c9d58a796e11d27705e3694725aa2 100644 (file)
@@ -1056,8 +1056,7 @@ RootInlineBox* RenderBlock::determineStartPosition(bool& fullLayout, BidiState&
                         break;
                     }
                     if (floats[floatIndex].rect.size() != newSize) {
-                        int floatTop = f->yPos() - f->marginTop();
-                        ASSERT(floatTop == floats[floatIndex].rect.y());
+                        int floatTop = floats[floatIndex].rect.y();
                         curr->markDirty();
                         markLinesDirtyInVerticalRange(curr->blockHeight(), floatTop + max(floats[floatIndex].rect.height(), newSize.height()));
                         floats[floatIndex].rect.setSize(newSize);