Closed Bug 1755803 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 32864 - Fix crash with content-visibility forced detach

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 32864 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/32864
Details from upstream follow.

Rune Lillesveen <futhark@chromium.org> wrote:

Fix crash with content-visibility forced detach

The problem was that
HTMLSlotElement::DetachDisplayLockedAssignedNodesLayoutTreeIfNeeded()
was called as part of a slot assignment recalc done from
AdjustDirectionalityIfNeededAfterChildrenChanged() from
ChildrenChanged() in ContainerNode::RemoveChildren(). The detach scope
object also covered ChildrenChanged, while the DisplayLock forced detach
did not have a dom removal scope.

Moved the detach scope around the actual removal and not surround the
ChildrenChanged() hook. If detaches happens in those hooks, the root
LayoutObject may even be different from the ContainerNode parent of the
removal. Those should have their own scopes if necessary.

Also, use in_detach_scope_ instead of in_dom_removal_ to figure out if
we should store the parent_for_detached_subtree_.

We don't add a scope around DetachDisplayLockedAssignedNodes... because
we do not want or need any layout tree adjustments inside the locked
subtree done by MarkForLayoutTreeChangesAfterDetach().

Bug: 1284278
Change-Id: Ibf4d4e21ddd9ad25e6bb0b013ca375b3b5b71ee5
Reviewed-on: https://chromium-review.googlesource.com/3468539
WPT-Export-Revision: 628bec770de56ada24e1d2004e3576f2043f7bc8

Component: web-platform-tests → Layout
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests

Status Summary

Firefox

PASS : 1

Chrome

CRASH: 1

Safari

PASS : 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8abff4f99055 [wpt PR 32864] - Fix crash with content-visibility forced detach, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.