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

Custom layout needs to force NG layout for the subtree. #25575

Merged
merged 1 commit into from Sep 18, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 16, 2020

Just like for MathML, custom layout (display:layout()) has no legacy
layout engine implementation, so we need to force NG layout, even when
contained by something that requires legacy fallback.

Rewrote the mechanism somewhat; calling ComputedStyle() on an element
isn't the right thing to do within Element::ShouldForceLegacyLayout()
(it called ShouldForceNGLayout(), which did that), since
ShouldForceLegacyLayout() is involved when style is about to change, or
when it has just been changed. ShouldForceLegacyLayout() will now
return true even if the display type requires LayoutNG. Cope with this
by just not setting ForceLegacyLayout on any NG LayoutObjects at all.
And remove a couple of DCHECKs in NG LayoutObject classes that expected
legacy fallback not to be in use on the Element side.
This is rather convoluted. :(

Also update HTMLSlotElement::AttachLayoutTree(), which recently got
modified to support legacy fallback properly.

This fixes one of three DCHECK failures that occur in the fuzzer test
in bug 1127112.

Bug: 1127112
Change-Id: I16b5f5297cb04192056f6c5137c2cefa1bc33298
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414289
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Frédéric Wang <fwang@igalia.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808311}

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.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2414289 branch 3 times, most recently from 62a3f1f to 31c1b63 Compare September 17, 2020 19:11
Just like for MathML, custom layout (display:layout()) has no legacy
layout engine implementation, so we need to force NG layout, even when
contained by something that requires legacy fallback.

Rewrote the mechanism somewhat; calling ComputedStyle() on an element
isn't the right thing to do within Element::ShouldForceLegacyLayout()
(it called ShouldForceNGLayout(), which did that), since
ShouldForceLegacyLayout() is involved when style is about to change, or
when it has just been changed. ShouldForceLegacyLayout() will now
return true even if the display type requires LayoutNG. Cope with this
by just not setting ForceLegacyLayout on any NG LayoutObjects at all.
And remove a couple of DCHECKs in NG LayoutObject classes that expected
legacy fallback not to be in use on the Element side.
This is rather convoluted. :(

Also update HTMLSlotElement::AttachLayoutTree(), which recently got
modified to support legacy fallback properly.

This fixes one of three DCHECK failures that occur in the fuzzer test
in bug 1127112.

Bug: 1127112
Change-Id: I16b5f5297cb04192056f6c5137c2cefa1bc33298
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414289
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Frédéric Wang <fwang@igalia.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808311}
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

3 participants