Bug 11360

Summary: editing/pasteboard/copy-paste-bidi intermittently fails due to disappearance of anonymous RenderBlock
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, aroben, hyatt, justin.garcia, mitz, timothy
Priority: P2 Keywords: LayoutTestFailure
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://build.webkit.org/results/post-commit-powerpc-mac-os-x/3925/editing/pasteboard/copy-paste-bidi-diffs.txt
Attachments:
Description Flags
Test case showing how empty anonymous blocks can be left behind none

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.