Bug 115820 - When a child becomes floated or out-of-flow it should find an anonymous wrapper if necessary
Summary: When a child becomes floated or out-of-flow it should find an anonymous wrapp...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 115687
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-08 12:29 PDT by Robert Hogan
Modified: 2023-03-18 09:10 PDT (History)
4 users (show)

See Also:


Attachments
Reduction (742 bytes, text/html)
2013-05-08 12:29 PDT, Robert Hogan
no flags Details
STP165 matches Chrome Canary 113 but differs Firefox Nightly 113 (355.40 KB, image/png)
2023-03-18 06:29 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hogan 2013-05-08 12:29:05 PDT
Created attachment 201096 [details]
Reduction

When a child becomes floated or out-of-flow it should check if its previous sibling is an anonymous block - if so, it should move in under the anonymous block.
Comment 1 Robert Hogan 2013-05-18 03:24:00 PDT
I definitely need advice on how to go about doing this - anonymous blocks are too complicated for trial and error.

If the render tree is like this:

      RenderBlock (anonymous) at (0,73) size 320x19
        RenderInline {SPAN} at (0,0) size 40x19
          RenderInline {SPAN} at (0,0) size 40x19 [bgcolor=#FF0000]
      RenderBlock (anonymous) at (0,92) size 320x40
        RenderBlock {DIV} at (0,0) size 160x40 [bgcolor=#008000]
          RenderText {#text} at (0,10) size 4x19
            text run at (0,10) width 4: " "
      RenderBlock (anonymous) at (0,132) size 320x0
        RenderInline {SPAN} at (0,0) size 0x0
      RenderBlock (anonymous) at (0,132) size 320x0
        RenderBlock {DIV} at (0,0) size 320x0
      RenderBlock (anonymous) at (0,132) size 320x0
        RenderInline {SPAN} at (0,0) size 0x0
          RenderInline {SPAN} at (0,0) size 0x0
            RenderText {#text} at (0,0) size 0x0
            RenderText {#text} at (0,0) size 0x0

and the first div becomes a float, I need to change it to this:

      RenderBlock (anonymous) at (0,73) size 320x19
        RenderInline {SPAN} at (0,0) size 40x19
          RenderInline {SPAN} at (0,0) size 40x19 [bgcolor=#FF0000]
          RenderBlock {DIV} (floating) at (0,0) size 160x40 [bgcolor=#008000]
            RenderText {#text} at (0,10) size 4x19
              text run at (0,10) width 4: " "
      RenderBlock (anonymous) at (0,132) size 320x0
        RenderBlock {DIV} at (0,0) size 320x0
      RenderBlock (anonymous) at (0,132) size 320x0
        RenderInline {SPAN} at (0,0) size 0x0
          RenderInline {SPAN} at (0,0) size 0x0
            RenderText {#text} at (0,0) size 0x0
            RenderText {#text} at (0,0) size 0x0

Can I just use moveChildTo() to move the float into the preceding anonymous block and destroy its old anonymous block parent? Or will I then need to rewrite the continuation map to link the RenderInline parent to the anonymous block containing the remaining block-flow DIV?
Comment 2 Ahmad Saleem 2023-03-18 06:29:43 PDT
Created attachment 465490 [details]
STP165 matches Chrome Canary 113 but differs Firefox Nightly 113

Just wanted to share updated test results. As mentioned, Safari is matching Chrome but differs from Firefox slightly in showing "red".
Comment 3 zalan 2023-03-18 09:10:54 PDT
This looks to be working now.