[Webkit-unassigned] [Bug 256410] overflow:clip fails when a float is present

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 13 13:55:26 PDT 2023


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

--- Comment #2 from zalan <zalan at apple.com> ---
intrusive floats like this don't get clipped by their containing block (or ancestors all the way to where they end up being intrusive) because we paint them out of the normal paint order (see RenderBlockFlow::paintFloats), so by the time we get to paint them, clipping is gone.
Probably RenderBlockFlow::paintFloats should apply clipping by looking at the ancestor chain of these intrusive floats.

should read the spec first (always), but with overflow: clip, layout and paint could get very disconnected when intrusive floats are involved due to the fact that unlike overflow: hidden, clip does not establish a formatting context. such intrusive floats can impact the position of other, inline level and/or float avoider boxes and yet in the final rendering they look like as if some invisible force pushed them away.
e.g.

<style>
.clip {
  width: 50px;
  height: 50px;
}

.float {
  width: 500px;
  height: 100px;
  float: left;
}

</style>
<div class=clip>
  <div class=float></div>
</div>
<div>
  this line is constrained by the intrusive but yet clipped float
</div

will produce something like this:

   .clip
 ___________
|          |*******************************
|  .float  |                              *
|          |                              *
|__________|   clipped out part           *
 *                                        *this line is constrained by the intrusive but yet clipped float
 ******************************************

where the '*' part is hidden.

 ___________
|          |
|          |                              
|          |                              
|__________|           
                                           this line is constrained by the intrusive but yet clipped float

-- 
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/20230513/217051bf/attachment.htm>


More information about the webkit-unassigned mailing list