This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
<textarea> with float:left disappears when editing text
https://bugs.webkit.org/show_bug.cgi?id=132188 <rdar://problem/110093535> Reviewed by Simon Fraser. Consider the following example: <div id=top> <div id=middle> <div id=float_box style="width: 100px; height: 100px;"></div> </div> </div> 1. A float box can intrude into multiple containers ("top" and "middle"). 2. Containers construct FloatingObjects for intruding floats (multiple FloatingObjects can point to the same float when it crosses containers). 3. Float boxes (usually) are painted by the top most container where they intrude ("top"). 4. However self-painting float boxes always paint themselves (this is not specific to floats, all renderers behave like this). 5. FloatingObject's m_paintsFloat controls which container is responsible for painting the (non-self-painting) float box. When a float box goes from self-painting to non-self painting, we need to ensure that one of its containers takes care of painting it by adjusting the associated FloatingObject's paint flag. It is usually done as part of the layout process at RenderBlockFlow::addIntrudingFloats when containers finish running layout on their child renderers (including float boxes) (i.e. the containing block chain takes care of updating this bit). However when the float box is the root of the layout (i.e. subtree layout) none of its containers get the chance to update this paint flag since layout flow never reaches said ancestors. (note when the layout's entry point is the float box, it's guaranteed that none of the intruding/overhanging properties change at the containing block level (i.e. no need to extend the layout to the ancestor chain). At this point this is really only about ensuring that one of the ancestors (through the already constructed FloatingObjects) starts painting this float box. * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::updateFloatBoxAfterSelfPaintingLayerChange): * Source/WebCore/rendering/RenderBox.h: * Source/WebCore/rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): Canonical link: https://commits.webkit.org/264943@main
- Loading branch information
Showing 3 changed files with 51 additions and 0 deletions.