New issue
Advanced search Search tips

Issue 671976 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

A distinct slotchange event must be enqueued for changes made during a mutation observer delivery

Project Member Reported by hayato@chromium.org, Dec 7 2016

Issue description

Blink is failing on the following web-platform-tests:

testSlotchangeFiresAtEndOfMicroTask in https://github.com/w3c/web-platform-tests/blob/master/shadow-dom/slotchange-event.html

- The DOM Standard uses a *global* slotlist to fire slotchange events.
  See https://dom.spec.whatwg.org/#notify-mutation-observers  

- However, Blink uses per-slot microtask and flag so that it prevents enqueuing a microtask for the same slot more than once.

Blink should use a global slotlist, as it is defined *notifying mutation observers* in DOM Standard, so that the behavior should match the spec.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 16 2017

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

commit c806e7eaec2921239800ad1a907b3d347f4f4a30
Author: hayato <hayato@chromium.org>
Date: Mon Jan 16 10:02:33 2017

Dispatch slotchange events in "notify mutation observers" steps

The spec is: https://dom.spec.whatwg.org/#notify-mutation-observers

The current behavior does not match the DOM Standard. The difference is observable
if a user mutates DOM, which will trigger a slotchange, in a mutation observer's
callback function.

See  crbug.com/671976  for details.

This CL fixes a failing wpt test, wpt/shadow-dom/slotchnage-event.html.

BUG= 649159 , 671976 

Review-Url: https://codereview.chromium.org/2622193002
Cr-Commit-Position: refs/heads/master@{#443866}

[modify] https://crrev.com/c806e7eaec2921239800ad1a907b3d347f4f4a30/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/c806e7eaec2921239800ad1a907b3d347f4f4a30/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/c806e7eaec2921239800ad1a907b3d347f4f4a30/third_party/WebKit/Source/core/dom/MutationObserver.cpp
[modify] https://crrev.com/c806e7eaec2921239800ad1a907b3d347f4f4a30/third_party/WebKit/Source/core/dom/MutationObserver.h
[modify] https://crrev.com/c806e7eaec2921239800ad1a907b3d347f4f4a30/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
[modify] https://crrev.com/c806e7eaec2921239800ad1a907b3d347f4f4a30/third_party/WebKit/Source/core/html/HTMLSlotElement.h

Comment 2 by hayato@chromium.org, Jan 16 2017

Status: Fixed (was: Assigned)

Sign in to add a comment