haikuwebkit/LayoutTests/platform/ios/fast/multicol
Simon Fraser ab23c891c4 getBoundingClientRect() returns the incorrect rectangle on elements whose parent element is set -webkit-column-count
https://bugs.webkit.org/show_bug.cgi?id=99959
rdar://80106111

Reviewed by Alan Bujtas.
Source/WebCore:

getBoundingClientRect() and getClientRects() for elements inside multicol had a quick
and dirty implementation that just mapped the element center point into a column. This
resulted in odd, negative top/left in some cases.

Fix by correctly generating multiple rects for elements that span columns, following
the repaint code path that already knew how to do this correctly.

The entry point is RenderFragmentContainer::absoluteQuadsForBox() which now has a
real implementation. For each fragment that the box covers, it calls fragmentRectsForFlowContentRect()
which generates one or more rects; RenderMultiColumnSet overrides this to
compute rects for multicol.

We have to take care not to eliminate empty rects, since the API does return these.

Tested by existing tests.

* dom/Element.cpp:
(WebCore::Element::absoluteEventBounds):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::absoluteQuadsIgnoringContinuation const):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::absoluteQuads const):
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::fragmentedFlowContentRectangle):
(WebCore::RenderFragmentContainer::fragmentRectsForFlowContentRect):
* rendering/RenderFragmentContainer.h:
(WebCore::RenderFragmentContainer::absoluteQuadsForBoxInFragment): Deleted.
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::absoluteQuadsForBox const):
* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::firstAndLastColumnsFromOffsets const):
(WebCore::RenderMultiColumnSet::repaintFragmentedFlowContent):
(WebCore::RenderMultiColumnSet::fragmentRectsForFlowContentRect):
(WebCore::RenderMultiColumnSet::collectLayerFragments):
* rendering/RenderMultiColumnSet.h:

LayoutTests:

These tests have all progressed.

* fast/multicol/client-rects-spanners-complex.html:
* fast/multicol/client-rects-spanners.html:
* fast/multicol/client-rects.html:
* fast/multicol/newmulticol/client-rects.html:
* imported/blink/fast/multicol/client-rects-rtl-expected.html:
* imported/blink/fast/multicol/client-rects-rtl.html: This test appeared to be hand-coded to the incorrect old behavior.
* platform/ios/fast/multicol/client-rects-expected.txt:
* platform/ios/fast/multicol/client-rects-spanners-complex-expected.txt:
* platform/ios/fast/multicol/client-rects-spanners-expected.txt:
* platform/ios/fast/multicol/newmulticol/client-rects-expected.txt:
* platform/mac/fast/multicol/client-rects-expected.txt:
* platform/mac/fast/multicol/client-rects-spanners-complex-expected.txt:
* platform/mac/fast/multicol/client-rects-spanners-expected.txt:
* platform/mac/fast/multicol/newmulticol/client-rects-expected.txt:


Canonical link: https://commits.webkit.org/239759@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-17 05:42:32 +00:00
..
newmulticol
pagination
span
vertical-lr
vertical-rl
block-axis-horizontal-bt-expected.txt
block-axis-horizontal-tb-expected.txt
block-axis-vertical-lr-expected.txt
block-axis-vertical-rl-expected.txt
border-padding-pagination-expected.txt
client-rects-expected.txt
client-rects-spanners-complex-expected.txt
client-rects-spanners-expected.txt
column-break-with-balancing-expected.txt
column-count-with-rules-expected.txt
column-rules-expected.txt
column-rules-stacking-expected.txt
columns-shorthand-parsing-expected.txt
float-avoidance-expected.txt
float-multicol-expected.txt
float-paginate-complex-expected.txt
float-paginate-empty-lines-expected.txt
float-paginate-expected.txt
layers-in-multicol-expected.txt
layers-split-across-columns-expected.txt
margin-collapse-expected.txt
max-height-columns-block-expected.txt
nested-columns-expected.txt
overflow-across-columns-expected.txt
overflow-across-columns-percent-height-expected.txt
overflow-unsplittable-expected.txt
paginate-block-replaced-expected.txt
positioned-split-expected.txt
positive-leading-expected.txt
scrolling-column-rules-expected.txt
scrolling-overflow-expected.txt
shadow-breaking-expected.txt
table-margin-collapse-expected.txt
table-vertical-align-expected.txt
tall-image-behavior-expected.txt
tall-image-behavior-lr-expected.txt
tall-image-behavior-lr-mixed-expected.txt
tall-image-behavior-rl-expected.txt
unsplittable-inline-block-expected.txt