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

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed)

Created:
6 years, 3 months ago by kouhei (in TOK)
Modified:
6 years, 2 months ago
Reviewers:
pdr., esprehn, rune
CC:
aandrey+blink_chromium.org, darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, blink-reviews-rendering, caseq+blink_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, krit, dstockwell, eae+blinkwatch, ed+blinkwatch_opera.com, Eric Willigers, eustas+blink_chromium.org, f(malita), fs, gyuyoung.kim_webkit.org, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, loislo+blink_chromium.org, lushnikov+blink_chromium.org, malch+blink_chromium.org, Mike Lawther (Google), paulirish+reviews_chromium.org, pfeldman+blink_chromium.org, rjwright, rwlbuis, rune+blink, Stephen Chennney, sergeyv+blink_chromium.org, shans, sof, Steve Block, Timothy Loh, vsevik+blink_chromium.org, webcomponents-bugzilla_chromium.org, yurys+blink_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Track reasons for |Node::SetNeedsStyleRecalc| Based on Eric Williger's patch: https://crrev.com/89783003 This CL tracks reason for invalidating style on each |Node::SetNeedsStyleRecalc| call. This enables devtools/about:tracing to show the Blink internal reason why a style invalidation was triggered. This patch introduces a new |reason| argument to |Node::SetNeedsStyleRecalc| method. The argument type |StyleChangeReasonForTracing| is actually a typedef to |const char[]|. The string itself is instantiated on separate cpp file for minimal binary size. This pattern is borrowed from src/extensions/common/manifest_constants.h (Thanks jyasskin@!), and similar pattern can be found in Blink Source/core/inspector/InspectorInstrumentation.h, BUG=316388, 410701 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=182824

Patch Set 1 #

Total comments: 18

Patch Set 2 : minimize enum #

Patch Set 3 : use const char[] #

Total comments: 27

Patch Set 4 : reasons as tuple #

Total comments: 10

Patch Set 5 : swap args #

Patch Set 6 : fix compile #

Total comments: 2

Patch Set 7 : use AtomicString #

Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -90 lines) Patch
M Source/core/Init.cpp View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/PropertySetCSSStyleDeclaration.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/invalidation/StyleInvalidator.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/invalidation/StyleSheetInvalidationAnalysis.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 4 8 chunks +15 lines, -15 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 7 chunks +8 lines, -8 lines 0 comments Download
M Source/core/dom/DocumentStyleSheetCollection.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 chunks +6 lines, -6 lines 0 comments Download
M Source/core/dom/Fullscreen.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/ShadowTreeStyleSheetCollection.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A Source/core/dom/StyleChangeReason.h View 1 2 3 4 5 6 1 chunk +109 lines, -0 lines 0 comments Download
A Source/core/dom/StyleChangeReason.cpp View 1 2 3 4 5 6 1 chunk +70 lines, -0 lines 0 comments Download
M Source/core/dom/StyleEngine.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/TreeScope.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/VisitedLinkState.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/shadow/ElementShadow.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/shadow/InsertionPoint.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/LocalFrame.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLBodyElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLFormControlElement.cpp View 1 2 3 4 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/HTMLFrameSetElement.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 3 4 4 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/HTMLObjectElement.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLPlugInElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLSelectElement.cpp View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLTableElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTextAreaElement.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/FileInputType.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/InputType.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/TextFieldInputType.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/shadow/DateTimeEditElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/shadow/DateTimeFieldElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorCSSAgent.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/page/Page.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderTextControl.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGAElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGAnimateElement.cpp View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGCursorElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGForeignObjectElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGSVGElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 35 (5 generated)
kouhei (in TOK)
Finally done rebasing. Does the StyleChangeReasons look right to you? or should we track more ...
6 years, 3 months ago (2014-09-05 23:21:43 UTC) #2
pdr.
This looks great! Some general comments and questions below. https://codereview.chromium.org/547823002/diff/1/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/547823002/diff/1/Source/core/dom/ContainerNode.cpp#newcode1046 Source/core/dom/ContainerNode.cpp:1046: ...
6 years, 3 months ago (2014-09-06 22:36:28 UTC) #3
pdr.
What do you think about using a similar approach for setNeedsLayout()? It has many of ...
6 years, 3 months ago (2014-09-06 22:43:53 UTC) #4
kouhei (in TOK)
Thanks for your comments! Hotel internet connection too slow for goma so I'll address comments ...
6 years, 3 months ago (2014-09-06 23:10:34 UTC) #5
kouhei (in TOK)
On 2014/09/06 22:43:53, pdr wrote: > What do you think about using a similar approach ...
6 years, 3 months ago (2014-09-06 23:16:51 UTC) #6
pdr.
On 2014/09/06 23:10:34, kouhei wrote: > Thanks for your comments! Hotel internet connection too slow ...
6 years, 3 months ago (2014-09-06 23:22:07 UTC) #7
kouhei (in TOK)
> https://codereview.chromium.org/547823002/diff/1/Source/core/dom/StyleChangeReason.h#newcode13 > > Source/core/dom/StyleChangeReason.h:13: StyleRecalcDueToActivePseudoClass, > > On 2014/09/06 22:36:28, pdr wrote: > > ...
6 years, 3 months ago (2014-09-06 23:28:11 UTC) #8
rune
https://codereview.chromium.org/547823002/diff/1/Source/core/dom/StyleChangeReason.h File Source/core/dom/StyleChangeReason.h (right): https://codereview.chromium.org/547823002/diff/1/Source/core/dom/StyleChangeReason.h#newcode64 Source/core/dom/StyleChangeReason.h:64: StyleRecalcDueToZoom, These constants are very tied up to implementation ...
6 years, 3 months ago (2014-09-08 08:27:57 UTC) #9
rune
https://codereview.chromium.org/547823002/diff/1/Source/core/html/HTMLObjectElement.cpp File Source/core/html/HTMLObjectElement.cpp (right): https://codereview.chromium.org/547823002/diff/1/Source/core/html/HTMLObjectElement.cpp#newcode260 Source/core/html/HTMLObjectElement.cpp:260: setNeedsStyleRecalc(StyleRecalcDueToPlugin, SubtreeStyleChange); This SubtreeStyleChange is a hack to trigger ...
6 years, 3 months ago (2014-09-08 08:33:24 UTC) #11
kouhei (in TOK)
Thanks for your comments! Updated CL. https://codereview.chromium.org/547823002/diff/1/Source/core/dom/ContainerNode.cpp File Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/547823002/diff/1/Source/core/dom/ContainerNode.cpp#newcode1046 Source/core/dom/ContainerNode.cpp:1046: setNeedsStyleRecalc(StyleRecalcDueToActivePseudoClass, SubtreeStyleChange); On ...
6 years, 3 months ago (2014-09-08 23:29:13 UTC) #12
rune
On 2014/09/08 23:29:13, kouhei wrote: > > There already exists inspector functionality for finding the ...
6 years, 3 months ago (2014-09-09 08:11:27 UTC) #13
rune
On 2014/09/09 08:11:27, rune wrote: > If you make an html test-case like [1] and ...
6 years, 3 months ago (2014-09-09 08:16:25 UTC) #14
kouhei (in TOK)
Updated CL. I think now its ready for broader review. Would you take a look? ...
6 years, 3 months ago (2014-09-09 17:59:40 UTC) #16
pdr.
@rune, would you be up for commenting on our doc as well? We also have ...
6 years, 3 months ago (2014-09-09 23:11:24 UTC) #17
pdr.
I think this patch looks good but I'd like for rune's OK before committing. @esprehn, ...
6 years, 3 months ago (2014-09-09 23:19:06 UTC) #18
rune
On 2014/09/09 23:19:06, pdr wrote: > I think this patch looks good but I'd like ...
6 years, 3 months ago (2014-09-10 07:12:43 UTC) #19
kouhei (in TOK)
esprehn: Would you take a look? On 2014/09/10 07:12:43, rune wrote: > On 2014/09/09 23:19:06, ...
6 years, 3 months ago (2014-09-11 18:24:44 UTC) #20
pdr.
LGTM. @esprehn, could you take a look?
6 years, 3 months ago (2014-09-11 18:32:11 UTC) #21
esprehn
I'll review ASAP. To unsubscribe from this group and stop receiving emails from it, send ...
6 years, 3 months ago (2014-09-11 19:24:40 UTC) #22
kouhei (in TOK)
On 2014/09/11 19:24:40, esprehn wrote: > I'll review ASAP. > > To unsubscribe from this ...
6 years, 3 months ago (2014-09-17 23:34:15 UTC) #23
esprehn
I think we want this class to be a pair of strings, first is the ...
6 years, 3 months ago (2014-09-19 04:53:10 UTC) #24
kouhei (in TOK)
PTAL. Changed StyleChangeReasonForTracing to track extraData string which may be const char* or attribute name. ...
6 years, 3 months ago (2014-09-22 09:03:55 UTC) #25
pdr.
Esprehn, ping? The invalidation tracking project is now blocked on this review.
6 years, 3 months ago (2014-09-24 17:21:34 UTC) #26
esprehn
https://codereview.chromium.org/547823002/diff/60001/Source/core/dom/StyleChangeReason.cpp File Source/core/dom/StyleChangeReason.cpp (right): https://codereview.chromium.org/547823002/diff/60001/Source/core/dom/StyleChangeReason.cpp#newcode63 Source/core/dom/StyleChangeReason.cpp:63: return String(m_reason); These have hidden mallocs. Maybe that's okay. ...
6 years, 2 months ago (2014-09-26 03:53:02 UTC) #27
kouhei (in TOK)
Sorry for late reply. PTAL. https://codereview.chromium.org/547823002/diff/60001/Source/core/dom/StyleChangeReason.cpp File Source/core/dom/StyleChangeReason.cpp (right): https://codereview.chromium.org/547823002/diff/60001/Source/core/dom/StyleChangeReason.cpp#newcode63 Source/core/dom/StyleChangeReason.cpp:63: return String(m_reason); On 2014/09/26 ...
6 years, 2 months ago (2014-09-29 02:05:32 UTC) #29
esprehn
lgtm https://codereview.chromium.org/547823002/diff/120001/Source/core/dom/StyleChangeReason.cpp File Source/core/dom/StyleChangeReason.cpp (right): https://codereview.chromium.org/547823002/diff/120001/Source/core/dom/StyleChangeReason.cpp#newcode60 Source/core/dom/StyleChangeReason.cpp:60: new (NotNull, (void*)&Active) String(":active"); I think there's some ...
6 years, 2 months ago (2014-09-29 02:30:23 UTC) #30
kouhei (in TOK)
https://codereview.chromium.org/547823002/diff/120001/Source/core/dom/StyleChangeReason.cpp File Source/core/dom/StyleChangeReason.cpp (right): https://codereview.chromium.org/547823002/diff/120001/Source/core/dom/StyleChangeReason.cpp#newcode60 Source/core/dom/StyleChangeReason.cpp:60: new (NotNull, (void*)&Active) String(":active"); On 2014/09/29 02:30:23, esprehn wrote: ...
6 years, 2 months ago (2014-09-29 03:24:45 UTC) #31
kouhei (in TOK)
Thanks for review!
6 years, 2 months ago (2014-09-29 03:24:57 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/547823002/140001
6 years, 2 months ago (2014-09-29 03:26:19 UTC) #34
commit-bot: I haz the power
6 years, 2 months ago (2014-09-29 09:45:12 UTC) #35
Message was sent while issue was closed.
Committed patchset #7 (id:140001) as 182824

Powered by Google App Engine
This is Rietveld 408576698