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

Issue 15680005: Element::recalcStyle() overly reattach()-es InsertionPoints. (Closed)

Created:
7 years, 7 months ago by Hajime Morrita
Modified:
7 years, 6 months ago
Reviewers:
esprehn, dglazkov
CC:
blink-reviews, webcomponents-bugzilla_chromium.org, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org, tasak (please_use_google.com)
Visibility:
Public.

Description

Element::recalcStyle() overly reattach()-es InsertionPoints. Before this change, recalcStyle() reattach()-ed InsertinoPoints even if only inheriting styles were changed. This misbehavior was caused by the fact that InsertionPoint never have renderers. This change fixes it by telling recalcStyle() such a special case. The fix reveals some hidden flaws, which are also fixed: - ContentDistributor::invalidate() It didn't reattach() its children. These children, as well as ones of the host, need to be refreshed on invalidation. - ShadowRoot::attach() It should attach() itself if it isn't. - Element::setNeedsRecalcStyle() It should know about node distribution. TEST=input-color-in-content.html BUG=234801

Patch Set 1 #

Patch Set 2 : Remove garbage debug print from the test #

Patch Set 3 : Now it works! #

Patch Set 4 : Extend Element::setNeedsStyleRecalc() to make it shadow-DOM aware. #

Patch Set 5 : Fixed test failures #

Patch Set 6 : Updated test and test expectations #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -9 lines) Patch
A LayoutTests/fast/dom/shadow/input-color-in-content.html View 1 4 1 chunk +32 lines, -0 lines 1 comment Download
A + LayoutTests/fast/dom/shadow/input-color-in-content-expected.txt View 1 4 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/dom/shadow/summary-without-details.html View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/shadow/summary-without-details-expected.html View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M LayoutTests/platform/chromium-mac/fast/html/details-add-details-child-2-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/platform/chromium-mac/fast/html/details-no-summary4-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/platform/chromium-mac/fast/html/details-open4-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/html/details-add-details-child-2-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 1 comment Download
M LayoutTests/platform/chromium-win/fast/html/details-no-summary4-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M LayoutTests/platform/chromium-win/fast/html/details-open4-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 3 chunks +21 lines, -2 lines 2 comments Download
M Source/core/dom/NodeRenderingTraversal.cpp View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/dom/shadow/ContentDistributor.h View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M Source/core/dom/shadow/ContentDistributor.cpp View 1 2 3 4 4 chunks +20 lines, -4 lines 0 comments Download
M Source/core/dom/shadow/InsertionPoint.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/shadow/ShadowRoot.cpp View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Hajime Morrita
Hi Dimitri could you take a look? I understand ContentDistributor::invalidate() needs to be less messy. ...
7 years, 7 months ago (2013-05-27 10:12:01 UTC) #1
Hajime Morrita
Adding a glory reviewer
7 years, 7 months ago (2013-05-27 10:18:45 UTC) #2
Hajime Morrita
seems broken :-( looking...
7 years, 6 months ago (2013-05-28 10:01:32 UTC) #3
dglazkov
Attack of the overly attached recalcStyle! Looking forward to the next patch :)
7 years, 6 months ago (2013-05-28 19:25:04 UTC) #4
dglazkov
+esprehn, who loves overly attached things.
7 years, 6 months ago (2013-05-28 19:25:36 UTC) #5
Hajime Morrita
Fixed broken parts. This should pass LayoutTests. Actually, the problem is on the intersection of ...
7 years, 6 months ago (2013-05-29 07:21:53 UTC) #6
esprehn
I'd prefer you didn't add these bool vars, checking if you have custom callbacks is ...
7 years, 6 months ago (2013-05-29 08:31:53 UTC) #7
esprehn
Actually not lgtm. That setAttached is on purpose, it's not fishy. Attached means everHadStyleRecalc and ...
7 years, 6 months ago (2013-05-29 08:38:01 UTC) #8
Hajime Morrita
OK, let me search other approach.
7 years, 6 months ago (2013-05-29 08:44:37 UTC) #9
esprehn
On 2013/05/29 08:44:37, morrita1 wrote: > OK, let me search other approach. Btw the reason ...
7 years, 6 months ago (2013-05-29 16:32:32 UTC) #10
Hajime Morrita
Thanks for explanation, Elliott! I'm getting the point. I hope we could eventually kill the ...
7 years, 6 months ago (2013-05-29 23:24:09 UTC) #11
Hajime Morrita
7 years, 6 months ago (2013-05-31 05:41:51 UTC) #12
Hajime Morrita
ping?
7 years, 6 months ago (2013-06-13 00:26:20 UTC) #13
esprehn
I'm not sure what more you wanted me to do here?
7 years, 6 months ago (2013-06-13 00:50:42 UTC) #14
Hajime Morrita
What do you think this new approach?
7 years, 6 months ago (2013-06-13 01:06:44 UTC) #15
esprehn
This is too big a hammer, it's going to make changing styles in ShadowRoot's crazy ...
7 years, 6 months ago (2013-06-13 02:25:37 UTC) #16
esprehn
https://codereview.chromium.org/15680005/diff/28001/LayoutTests/fast/dom/shadow/input-color-in-content.html File LayoutTests/fast/dom/shadow/input-color-in-content.html (right): https://codereview.chromium.org/15680005/diff/28001/LayoutTests/fast/dom/shadow/input-color-in-content.html#newcode26 LayoutTests/fast/dom/shadow/input-color-in-content.html:26: }, 0); Btw, these nested setTimeout calls will be ...
7 years, 6 months ago (2013-06-13 02:45:40 UTC) #17
Hajime Morrita
> What's the purpose of this test? The bug referenced is about the value of ...
7 years, 6 months ago (2013-06-13 03:03:36 UTC) #18
Hajime Morrita
7 years, 6 months ago (2013-06-14 08:19:02 UTC) #19
Let me have another shot at https://codereview.chromium.org/17054002/

Powered by Google App Engine
This is Rietveld 408576698