Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LayoutNG] Use offsets relative to the block flow when using legacy APIs. #26333

Merged
merged 1 commit into from Oct 31, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Oct 29, 2020

We still use the legacy layout engine APIs when calculating offsets
relative to some ancestor (needed by DOM APIs such as offsetLeft,
offsetTop and getClientRects()). This means that we cannot use offsets
relative to the containing box fragment. We need to make them relative
to the containing LayoutBlockFlow instead, or machineries such as
LayoutObject::MapLocalToAncestor() will fail when in block
fragmentation.

Also fixed an issue in the NG-to-legacy-writeback code. It was wrong for
RTL, since we used the inline-size of the column (rather than that oof
the column set) when converting between logical and physical offsets.
This alone doesn't fix any existing tests, but it is needed by the new
tests added in this CL, and also helps fix a couple of the existing
tests that now pass.

Also move one ContainingBlockFlowFragmentOf() call out of the way (we
get nullptr when block-fragmented). Moved it into paint fragment-specific
code, which was the only code that needed it.

Bug: 829028
Change-Id: Ib19b11ecfdd47cdd77aed41c6935be86004fe166
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2508590
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822860}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

…PIs.

We still use the legacy layout engine APIs when calculating offsets
relative to some ancestor (needed by DOM APIs such as offsetLeft,
offsetTop and getClientRects()). This means that we cannot use offsets
relative to the containing box fragment. We need to make them relative
to the containing LayoutBlockFlow instead, or machineries such as
LayoutObject::MapLocalToAncestor() will fail when in block
fragmentation.

Also fixed an issue in the NG-to-legacy-writeback code. It was wrong for
RTL, since we used the inline-size of the column (rather than that oof
the column set) when converting between logical and physical offsets.
This alone doesn't fix any existing tests, but it is needed by the new
tests added in this CL, and also helps fix a couple of the existing
tests that now pass.

Also move one ContainingBlockFlowFragmentOf() call out of the way (we
get nullptr when block-fragmented). Moved it into paint fragment-specific
code, which was the only code that needed it.

Bug: 829028
Change-Id: Ib19b11ecfdd47cdd77aed41c6935be86004fe166
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2508590
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822860}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants