New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 671311 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Node::assignedSlot should call updateDistribution

Project Member Reported by esprehn@chromium.org, Dec 5 2016

Issue description

It's not correct to skip the updateDistribution call inside assignedSlot, that means code is reading the stale slots and getting the wrong answer. updateDistribution is a single branch if distribution is not dirty and should be fine to call here.

There's some vague discussion here:
https://bugs.chromium.org/p/chromium/issues/detail?id=584596

but it doesn't make sense that there's a penalty to calling updateDistribution(). If it's slow that means distribution was dirty and there was work that must be done to not get the wrong answer.
 
Owner: kochi@chromium.org
Status: Assigned (was: Untriaged)





I do not think assignedNode() should call updateDistribution because it might cause the *abuse* of updateDistribution().

Other callers of assignedNodes() does not rely on that. They are calling updateDistribution() at more early stages, I think.

I do not have much concern about the performance penalty of updateDistribution(). Rather, my concern is that we should have a clear distribution status management. If we allow calling updateDistribution() at arbitrary places, casually, it is difficult to have a good assumption where distribution is updated.

If we can updateDistribution at an earlier stage at a proper timing, we should do it.
The function should assert that distribution is clean then? It needs to either assert or call it.
Ah, you meant Node::assignedSlot(). I thought you meant HTMLSlotElement::assignedNodes(). Sorry. Please forget comment #2.

Regarding Node::assignedSlot (and Node::assignedSlotForBinding), it no longer requires updated *distribution*. I rewrote distribution logic when I introduced slotchange events. A slotname-to-slot map in each treescope is *dynamically* updated on DOM mutation timing.

Now we can remove assignedSlotForBling().






Owner: hayato@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 9 2016

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

commit 5277d3159e5a5ca75fb1306167d6356b99c97e32
Author: hayato <hayato@chromium.org>
Date: Fri Dec 09 09:45:02 2016

Do not call updateDistribution() in Node::assingedSlotForBinding()

updateDistribution() is no longer required here since slotname-to-slot hashmap is
dynamically updated at the timing of DOM mutations.

BUG= 671311 

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

[modify] https://crrev.com/5277d3159e5a5ca75fb1306167d6356b99c97e32/third_party/WebKit/Source/core/dom/Node.cpp

Status: Fixed (was: Assigned)
Fixed as "Do not call updateDistribution".

Sign in to add a comment