Commit e092f9c1 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Revert "Workaround for nested remove for datalists."

This reverts commit f7623733.

Reason for revert: causes DCHECK failures in external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-mode-disabled.html

Original change's description:
> Workaround for nested remove for datalists.
> 
> Nested removes confuses the style traversal roots. Make this a general
> workaround for UA shadow removals.
> 
> Bug: 888236, 888448
> Change-Id: Ia0165e7478c96282900a8191eeac18ae34586a2c
> Reviewed-on: https://chromium-review.googlesource.com/1238728
> Reviewed-by: Anders Ruud <andruud@chromium.org>
> Commit-Queue: Rune Lillesveen <futhark@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#593510}

TBR=futhark@chromium.org,andruud@chromium.org

Change-Id: I843b4cc5d9be74fea13ff43305b0093fd64dcae3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 888236, 888448, 888618
Reviewed-on: https://chromium-review.googlesource.com/1240505Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593592}
parent a3d55f3d
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="root">
<div id="d"></div>
<datalist id="messages">
<option>
<input list="messages">
<style>
.parent > .child { color:pink }
</style>
</option>
</datalist>
</div>
<script>
test(() => {
document.body.offsetTop;
// Make sure we have a StyleInvalidationRoot.
d.classList.add("parent");
// Nested remove() in UA shadow for <input list=messages>
root.remove();
}, "Nested removal should not cause a DCHECK or crash.");
</script>
......@@ -1512,15 +1512,14 @@ void StyleEngine::NodeWillBeRemoved(Node& node) {
void StyleEngine::ChildrenRemoved(ContainerNode& parent) {
if (!parent.isConnected())
return;
if ((parent.IsShadowRoot() && ToShadowRoot(parent).IsUserAgent()) ||
parent.IsInUserAgentShadowRoot()) {
// This is a workaround for nested removals. There are elements which
// removes parts of its UA shadow DOM as part being removed which means we
// do a removal from within another removal where isConnected() is not
// completely up to date which would confuse this code. Instead we will
// clean traversal roots properly in the outer remove.
// TODO(crbug.com/882869): MediaControlLoadingPanelElement
// TODO(crbug.com/888448): TextFieldInputType::ListAttributeTargetChanged
if (parent.IsShadowRoot() && ToShadowRoot(parent).IsUserAgent() &&
ToShadowRoot(parent).host().IsMediaControlElement()) {
// TODO(crbug.com/882869):
// This is a workaround for MediaControlLoadingPanelElement which removes
// its shadow root children as part of RemovedFrom() which means we do a
// removal from within another removal where isConnected() is not completely
// up to date which would confuse the code. Instead we will clean traversal
// roots properly in the outer remove.
return;
}
style_invalidation_root_.ChildrenRemoved(parent);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment