Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Issue 14660019: Run Mutation Observer and Custom Element callbacks consistently at microtask checkpoint (Closed)

Created:
7 years, 7 months ago by dominicc (has gone to gerrit)
Modified:
7 years, 6 months ago
Reviewers:
rafaelw1, dglazkov, rafaelw
CC:
blink-reviews, haraken, Nate Chapin, eae+blinkwatch, jsbell+bindings_chromium.org, abarth-chromium, rafaelw, adamk, dglazkov
Visibility:
Public.

Description

This introduces one place, Microtask::performCheckpoint, to add checkpoint steps and teleports all calls to MutationObservers::deliverAllMutations to their new home. It pulls the callback dispatching behavior that was left in CustomElementRegistry into its own class, CustomElementCallbackDispatcher. Custom Elements have evolved and how involve four callbacks with three timing semantics. CustomElementCallbackDispatcher will be the traffic cop when the latter three kinds of callbacks are implemented. This is fixes two bad behaviors (1. run Custom Element lifecycle callbacks and Mutation Observers in an inconsistent order depending on callsite; 2. allow pending lifecycle callbacks, or mutation events begot by lifecycle callbacks, to persist until the next microtask.) BUG=234509 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152982

Patch Set 1 #

Total comments: 1

Patch Set 2 : Mix Mutation Observer and Custom Element callbacks until a gooey consistency. #

Patch Set 3 : Header minimization. #

Total comments: 2

Patch Set 4 : Patch for landing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -220 lines) Patch
M Source/WebKit/chromium/src/WebKit.cpp View 1 2 chunks +2 lines, -4 lines 0 comments Download
M Source/bindings/scripts/CodeGeneratorV8.pm View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/CustomElementConstructorBuilder.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/V8RecursionScope.cpp View 1 2 chunks +3 lines, -6 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
A + Source/core/dom/CustomElementCallbackDispatcher.h View 1 2 3 2 chunks +40 lines, -38 lines 0 comments Download
A + Source/core/dom/CustomElementCallbackDispatcher.cpp View 1 2 3 2 chunks +33 lines, -28 lines 0 comments Download
M Source/core/dom/CustomElementRegistry.h View 1 4 chunks +1 line, -50 lines 0 comments Download
M Source/core/dom/CustomElementRegistry.cpp View 1 2 3 6 chunks +4 lines, -65 lines 0 comments Download
A + Source/core/dom/Microtask.h View 1 2 3 2 chunks +15 lines, -3 lines 0 comments Download
A + Source/core/dom/Microtask.cpp View 1 2 3 2 chunks +20 lines, -12 lines 0 comments Download
M Source/core/html/parser/HTMLScriptRunner.cpp View 1 3 chunks +5 lines, -10 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
dominicc (has gone to gerrit)
This assertion is trivially easy to trigger by doing something that queues a lifecycle callback ...
7 years, 7 months ago (2013-05-08 06:07:59 UTC) #1
dglazkov
Do we need a test for this? https://codereview.chromium.org/14660019/diff/1/Source/core/dom/CustomElementRegistry.h File Source/core/dom/CustomElementRegistry.h (right): https://codereview.chromium.org/14660019/diff/1/Source/core/dom/CustomElementRegistry.h#newcode101 Source/core/dom/CustomElementRegistry.h:101: void abandonQueuedLifecycleCallbacks(); ...
7 years, 7 months ago (2013-05-08 16:42:00 UTC) #2
rafaelw
I'd be in favor of just going ahead and abstracting the mutation observers delivery mechanism ...
7 years, 7 months ago (2013-05-08 18:33:42 UTC) #3
dominicc (has gone to gerrit)
This was based on abarth's feedback to stabilize the patient before planned surgery, but just ...
7 years, 7 months ago (2013-05-09 02:10:31 UTC) #4
dominicc (has gone to gerrit)
Getting back to this... Dimitri, PTAL rafaelw: I tried sharing suspending and making an "end ...
7 years, 6 months ago (2013-06-24 13:54:56 UTC) #5
dglazkov
LGTM. https://codereview.chromium.org/14660019/diff/11001/Source/core/dom/CustomElementCallbackDispatcher.h File Source/core/dom/CustomElementCallbackDispatcher.h (right): https://codereview.chromium.org/14660019/diff/11001/Source/core/dom/CustomElementCallbackDispatcher.h#newcode45 Source/core/dom/CustomElementCallbackDispatcher.h:45: static CustomElementCallbackDispatcher& dispatcher(); instance()?
7 years, 6 months ago (2013-06-24 19:20:11 UTC) #6
rafaelw
lgtm. Adam and I talked with Mark Miller last week and have a good starting ...
7 years, 6 months ago (2013-06-24 23:15:49 UTC) #7
dominicc (has gone to gerrit)
Thanks dglazkov and rafaelw for review. On 2013/06/24 23:15:49, rafaelw wrote: > Adam and I ...
7 years, 6 months ago (2013-06-25 00:45:00 UTC) #8
dominicc (has gone to gerrit)
(cont'd) Also I think Mutation Observers sorts its callbacks by observer creation age? Guess I'll ...
7 years, 6 months ago (2013-06-25 00:51:53 UTC) #9
rafaelw1
I wasn't remembering that readyCallbacks want to control their order as well ;-(. We were ...
7 years, 6 months ago (2013-06-25 01:00:28 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dominicc@chromium.org/14660019/18001
7 years, 6 months ago (2013-06-25 01:49:51 UTC) #11
commit-bot: I haz the power
7 years, 6 months ago (2013-06-25 03:56:46 UTC) #12
Message was sent while issue was closed.
Change committed as 152982

Powered by Google App Engine
This is Rietveld 408576698