New issue
Advanced search Search tips

Issue 859391 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-09-18
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Investigate if we can move DOM mutation events to CEReactions

Project Member Reported by tkent@chromium.org, Jul 2

Issue description

There is an idea to dispatch legacy DOM mutation events on CEReaction timing.

As for DOMNodeInsertedIntoDocument, DOMNodeInserted, and DOMSubtreeModified, it would make almost no behavior differences.
As for DOMNdoeRemovedFromDocument and DOMNodeRemoved, it would make a behavior differenece because they are dispatched *before* nodes are actually removed.

We should try to count:
 * Node::parentNode() usage inside DOMNodeRemoved* event handlers

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/591eb3d45844fbd86f9067d0b90964793835719f

commit 591eb3d45844fbd86f9067d0b90964793835719f
Author: Kent Tamura <tkent@chromium.org>
Date: Mon Jul 02 07:07:55 2018

DOM: Stop inlining Node::parentNode().

This is a preparation to add a UseCounter in Node::parentNode().

Bug: 859391
Change-Id: I056f60207e000b6f9b1acd6e412444f96a8daee2
Reviewed-on: https://chromium-review.googlesource.com/1121944
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571831}
[modify] https://crrev.com/591eb3d45844fbd86f9067d0b90964793835719f/third_party/blink/renderer/core/dom/node.cc
[modify] https://crrev.com/591eb3d45844fbd86f9067d0b90964793835719f/third_party/blink/renderer/core/dom/node.h

Summary: Investigate if we can move DOM mutation events to CEReactions (was: Investigate if we can move DOM mutation events to CEReaction)
Owner: tkent@chromium.org
Status: Started (was: Available)
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2e4de5326a3cef994734ee2636a7fc2932ea99f8

commit 2e4de5326a3cef994734ee2636a7fc2932ea99f8
Author: Kent Tamura <tkent@chromium.org>
Date: Fri Jul 13 10:20:54 2018

DOM: Add some UseCounters to investigate possibility to change legacy DOM mutation event timing

We'd like to make DOMNodeRemoved and DOMNodeRemovedFromDocument events
asynchronous. This CL adds some UseCounters to investigate its impact.

* kDOMNodeRemoved*EventDelayed:
  We already dispatch the events asynchronously in some cases.
  This counts them.

* kDOMNodeRemoved*EventHandlerAccessDetachingNode:
  Count cases where
 - Accessing parentNode of to-be-removed Node
 - getElementById() for to-be-removed Node or its descendants
 - NodeList/HTMLCollection/querySelector*() for to-be-removed Node
  or its descendants in DONNodeRemoved* event handler.
  If we change the timing, we'll have incompatibility in such cases.

  This doesn't have a perfect coverage. For example, sibling access
  from a sibling of to-be-removed node is not counted.

* kDOMNodeRemoved*EventListenedAtNonTarget:
  Count if the events are listened at non-target nodes.
  If we change the timing, bubbling/capturing won't work well.

This CL has no behavior changes except UseCounters.
If benchmarks regress a little, we won't revert this CL soon, and
will revert after a branch point. If benchmarks regress very much,
we'll revert this CL.

Test infrastructure:
* Add internals.clearUseCounter() so that we can test a UseCounter
  multiple times in a single test.

Bug: 859391
Change-Id: Iefaa324217a3e914c7f095165aba513b847b328f
Reviewed-on: https://chromium-review.googlesource.com/1134640
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574877}
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/WebKit/LayoutTests/dom/README.md
[add] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/WebKit/LayoutTests/dom/legacy_mutation_event/domnoderemoved-usecounter.html
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/public/platform/web_feature.mojom
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/child_node_list.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/child_node_list.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/container_node.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/document.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/document.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/events/event_target.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/live_node_list.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/node.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/node.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/node.idl
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/node_child_removal_tracker.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/static_node_list.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/dom/tree_scope.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/frame/use_counter.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/frame/use_counter.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/html/html_collection.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/testing/internals.cc
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/testing/internals.h
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/third_party/blink/renderer/core/testing/internals.idl
[modify] https://crrev.com/2e4de5326a3cef994734ee2636a7fc2932ea99f8/tools/metrics/histograms/enums.xml

NextAction: 2018-09-18
Status: Assigned (was: Started)
Let's evaluate UseCounter values after M69 stable release.

The NextAction date has arrived: 2018-09-18

Sign in to add a comment