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

Issue 1058763002: Introduce Node::needsDistributionRecalc and use it in ElementShadow to fix the wrong assertions. (Closed)

Created:
5 years, 8 months ago by hayato
Modified:
5 years, 8 months ago
Reviewers:
esprehn, kojii, sergeyv, kochi
CC:
blink-reviews, webcomponents-bugzilla_chromium.org, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, rwlbuis, sergeyv
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Introduce Node::needsDistributionRecalc and use it in ElementShadow to fix the wrong assertions. This prevents a possible ASSERTION hit in ElementShadow::finalDestinationInsertionPointFor() (and one more) if the given node is not in-a-document. If a node is not in-a-document, the recalc flag of node.document() is not cleared even when node.updateDistribution() is called. In other words, the following code is *wrong* if a node is not in-a-document. > node.updateDistribution(); > ASSERT(!node.document().childNeedsDistributionRecalc()). ElementShadow's finalInsertionPointsFor can be called for a node which is not in-a-document. BUG=473000 TEST=Existing Layout tests. No behavior change except for assertion. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193176

Patch Set 1 #

Patch Set 2 : git cl try #

Total comments: 2

Patch Set 3 : Fix Todo in the comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -2 lines) Patch
M Source/core/dom/Node.h View 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (4 generated)
hayato
PTAL
5 years, 8 months ago (2015-04-02 07:37:03 UTC) #2
hayato
+cc: sergeyv@, the original crash reporter.
5 years, 8 months ago (2015-04-02 07:45:07 UTC) #3
kochi
if ASSERT is not enabled, does ElementShadow.cpp compile?
5 years, 8 months ago (2015-04-02 08:52:16 UTC) #4
hayato
On 2015/04/02 08:52:16, Takayoshi Kochi wrote: > if ASSERT is not enabled, does ElementShadow.cpp compile? ...
5 years, 8 months ago (2015-04-02 09:14:20 UTC) #5
kochi
It would be nice to add a test that hits the wrong assertion. https://codereview.chromium.org/1058763002/diff/20001/Source/core/dom/Node.cpp File ...
5 years, 8 months ago (2015-04-02 10:27:10 UTC) #6
sergeyv
lgtm
5 years, 8 months ago (2015-04-06 08:14:33 UTC) #8
kochi
lgtm that this seems to meet sergeyv's expectation.
5 years, 8 months ago (2015-04-06 08:30:09 UTC) #9
hayato
Let me land this. Yeah, it would be better to have a test, however, let ...
5 years, 8 months ago (2015-04-06 08:32:00 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1058763002/40001
5 years, 8 months ago (2015-04-06 08:32:29 UTC) #13
esprehn
This patch isn't correct, you need to walk up the tree from the node to ...
5 years, 8 months ago (2015-04-06 09:30:18 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://src.chromium.org/viewvc/blink?view=rev&revision=193176
5 years, 8 months ago (2015-04-06 09:44:33 UTC) #15
hayato
On 2015/04/06 09:30:18, esprehn wrote: > This patch isn't correct, you need to walk up ...
5 years, 8 months ago (2015-04-06 09:53:10 UTC) #16
hayato
Let me make a concrete example which I am worrying about, where the distribution is ...
5 years, 8 months ago (2015-04-06 10:06:58 UTC) #17
esprehn
I'm not sure I understand, recalcDistribution() is only called for elements with ShadowRoot to update ...
5 years, 8 months ago (2015-04-07 04:45:13 UTC) #18
hayato
5 years, 8 months ago (2015-04-08 10:45:48 UTC) #19
Message was sent while issue was closed.
On 2015/04/07 04:45:13, esprehn wrote:
> I'm not sure I understand, recalcDistribution() is only called for elements
with
> ShadowRoot to update the distribution of insertion points in that scope. A
node
> having that bit set means something totally different from node.treeScope()
(the
> root in the tree of trees) having it set.

Thank you. I've just uploaded the follow-up patch in
https://codereview.chromium.org/1068193002/.

Powered by Google App Engine
This is Rietveld 408576698