Bug 11360 - editing/pasteboard/copy-paste-bidi intermittently fails due to disappearance of anonymous RenderBlock
Summary: editing/pasteboard/copy-paste-bidi intermittently fails due to disappearance ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL: http://build.webkit.org/results/post-...
Keywords: LayoutTestFailure
Depends on:
Reported: 2006-10-19 11:44 PDT by Adam Roben (:aroben)
Modified: 2006-10-26 14:24 PDT (History)
6 users (show)

See Also:

Test case showing how empty anonymous blocks can be left behind (310 bytes, text/html)
2006-10-22 14:09 PDT, mitz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2006-10-19 11:44:41 PDT
editing/pasteboard/copy-paste-bidi is sometimes failing with this diff:

@@ -49,7 +49,6 @@
               text run at (0,0) width 32: "1234"
               text run at (32,0) width 36 RTL: "\x{5E9}\x{5D3}\x{5D2}\x{5DB}"
               text run at (68,0) width 4: ":"
-          RenderBlock (anonymous) at (0,18) size 784x0
           RenderBlock {DIV} at (0,18) size 784x18
             RenderText {#text} at (712,0) size 72x18
               text run at (712,0) width 40 RTL: "\x{5E9}\x{5D3}\x{5D2}\x{5DB}:"
Comment 1 mitz 2006-10-22 12:43:24 PDT
I discovered that the undeterminism enters in ReplaceSelectionCommand::removeRedundantStyles(). The iteration order over the NodeStyleMap (in the for loop) isn't the same in every run (despite the order of traversal in the while loop that fills up the map being deterministic, of course).

You can probably simply replace the map with two vectors and iterate them simultaneously, to ensure deterministic order. However, you can also consider the current results as indicating two bugs in the rendering code: (a) leftover empty anonymous block(s) and (b) the final render tree depends on the order of operations.
Comment 2 Adam Roben (:aroben) 2006-10-22 13:17:41 PDT
Nice detective work, Mitz. I'm CCing hyatt to get his input on this.
Comment 3 mitz 2006-10-22 14:09:57 PDT
Created attachment 11185 [details]
Test case showing how empty anonymous blocks can be left behind

This test shows how the render tree can end up with empty anonymous blocks (in the failing layout test, the span is a temporary "Apple style span").
Comment 4 Darin Adler 2006-10-26 14:24:46 PDT
Fixed in r17311.