[Webkit-unassigned] [Bug 226765] Dynamically inserted inline-level element causes the adjacent float to shift down

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 16 06:32:27 PST 2022


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

--- Comment #3 from zalan <zalan at apple.com> ---
It looks like this breaks when the content is dynamically inserted. The same content works fine when no DOM mutation happens.

<style>
  #container {
  width: 500px;
  border: 1px solid black;
}

#container::after {
  content: 'after content';
  display: block;
}

#floating {
  float: right;
  background-color: blue;
}
</style>
<div id="container"><div id="floating">Float</div></div>
<script>
document.body.offsetHeight;
container.prepend(document.createTextNode("PASS if same line as float"));
</script>

produces the following render tree:

B---YGLS- --* RenderView at (0,0) size 1111x663
B-----LS- --    HTML RenderBlock at (0,0) size 1111x663
B-------- --      BODY RenderBody at (8,8) size 1095x647
B-------- --        DIV RenderBlock at (0,0) size 502x38
B---YG--- --          RenderBlock at (1,1) size 500x18
I-------- --            #text RenderText "PASS if same line as float"
B-F------ --          DIV RenderBlock at (468.11,19) size 32.89x18
I-------- --            #text RenderText "Float"
B----G--- --          <pseudo> RenderBlock at (1,19) size 500x18)
I---YG--- --            RenderText "after content"

while 
<div id="container">PASS if same line as float<div id="floating">Float</div></div>

B---YGLS- --* RenderView at (0,0) size 1111x663)
B-----LS- --    HTML RenderBlock at (0,0) size 1111x663
B-------- --      BODY RenderBody at (8,8) size 1095x647
B-------- --        DIV RenderBlock at (0,0) size 502x38
B---YG--- --          RenderBlock at (1,1) size 500x18
I-------- --            #text RenderText "PASS if same line as float"
B-F------ --            DIV RenderBlock at (467.11,0) size 32.89x18
I-------- --              #text RenderText "Float"
B----G--- --          <pseudo> RenderBlock at (1,19) size 500x18
I---YG--- --            RenderText "after content"

Note that in the first case, the "PASS if same line as float" is wrapped in an anon block container.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221216/e25fc44e/attachment.htm>


More information about the webkit-unassigned mailing list