Skip to content

Commit e80db1b

Browse files
aleventhalchromium-wpt-export-bot
authored andcommitted
Improved de-duping of ChildrenChanged() for Removed()'d nodes
1. Only process ChildrenChanged() for the included root of a change. For example, if a <div id="root" style="display:none"> will be included because it is a potential relation target. If descendants change, the only ChildrenChanged() necessary to process is on #root. 2. Share common code for detaching a node and queuing up the appropriate children changes. This simplifies ProcessInvalidatedObjects() by removing one of the inner loops, and enables a follow-up CL to remove the outer loop as well. #1 results in a massive speedup for display none toggles. In combination with other recent changes in DetachAndRemoveFromChildrenOfAncestors(), is 7x faster for many-nodes-toggle-display-none in perf_tests . This change alone accounts for about half of the overall improvement. Follow-ups: - Restore lifecycle check by processing deferred children changes via nodes_with_pending_children_changed_ and not queuing via the traditional mechanism. While doing this, look for opportunities to consolidate more children changed events. - Remove outer loop from ProcessInvalidatedObjects(). Bug: None Change-Id: I80466fda792cd0ca6dd051065a42ba702e4cc8b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2946971 Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org> Cr-Commit-Position: refs/heads/master@{#891343}
1 parent 6a6a92e commit e80db1b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<html class="test-wait">
2+
<head>
3+
<script>
4+
window.onload = function() {
5+
requestAnimationFrame(() => {
6+
requestAnimationFrame(() => {
7+
document.querySelector('svg').style.display = 'contents';
8+
document.documentElement.className = '';
9+
});
10+
});
11+
};
12+
</script>
13+
</head>
14+
<body>
15+
<div role="group" class="group">
16+
<div class="ignored1">
17+
<div class="ignored2">
18+
<div class="ignored3">
19+
<svg role="none"> <!-- Ignored -->
20+
<g id="foo"></g> <!-- Ignored but included in tree -->
21+
<circle cx="10" cy="10" r="5" />
22+
</svg>
23+
</div>
24+
</div>
25+
</div>
26+
</div>
27+
</body>
28+
</html>

0 commit comments

Comments
 (0)