[webkit-changes] [WebKit/WebKit] c03d0a: REGRESSION(262277 at main): wpt/css/CSS2/floats/float...

Alan Baradlay noreply at github.com
Tue Jun 20 20:52:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c03d0ac6e6db178f90923a0a63080b5ca210d25f
      https://github.com/WebKit/WebKit/commit/c03d0ac6e6db178f90923a0a63080b5ca210d25f
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-06-20 (Tue, 20 Jun 2023)

  Changed paths:
    A LayoutTests/fast/block/float/float-overflows-containing-block-expected.html
    A LayoutTests/fast/block/float/float-overflows-containing-block.html
    M Source/WebCore/layout/floats/FloatingContext.cpp

  Log Message:
  -----------
  REGRESSION(262277 at main): wpt/css/CSS2/floats/floats-rule3-outside-left-001.xht
https://bugs.webkit.org/show_bug.cgi?id=258216
rdar://110903782

Reviewed by Antti Koivisto.

This patch ensures floats can (horizontally) overflow their containing blocks, however they should not overflow when their static position is constrained by other floats (i.e. not enough horizontal space left)
e.g.

 It's perfectly fine for a float (F) to overflow its containing block (C).
 <div id=C style="width: 100px;">
   <div id=F style="width: 200px; float: left">
  _________________________
 |C _______________________|____
 | |F                      |    |
 | |                       |    |
 | |                       |    |
 | |_______________________|____|
 |_________________________|

However when the float is constrained by other, intruding floats (I) on the same vertical position, overflow should not happen
 <div id=I style="width: 20px; float: left"></div>
 <div id=A style="width: 100px;">
   <div id=F style="width: 200px; float: left">

  _____
 |I    |
 |_____|_____________________
 |A    | ____________________|_________
 |     ||F                   |         |
 |     ||                    |         |
 |     ||                    |         |
 |     ||____________________|_________|
 |_____|_____________________|
 |     |
 |_____|

^^ incorrect layout

  _____
 |I    |
 |_____|_____________________
 |A    |                     |
 |     |                     |
 |     |                     |
 |     |                     |
 |     |                     |
 |_____|_____________________|
 |     |
 |_____|
  ______________________________
 |F                             |
 |                              |
 |                              |
 |______________________________|

^^ correct layout

Note that overflowing, when the intruding float (I) does not constrain the float candidate (F) position is also perfectly fine.
                                            _____
  ___________________________              |I    |
 |A _________________________|____         |     |
 | |F                        |    |        |     |
 | |                         |    |        |     |
 | |                         |    |        |     |
 | |_________________________|____|        |     |
 |___________________________|             |     |
                                           |     |
                                           |_____|

* LayoutTests/fast/block/float/float-overflows-containing-block-expected.html: Added.
* LayoutTests/fast/block/float/float-overflows-containing-block.html: Added.
* Source/WebCore/layout/floats/FloatingContext.cpp:
(WebCore::Layout::findAvailablePosition):

Canonical link: https://commits.webkit.org/265345@main




More information about the webkit-changes mailing list