Web Inspector: provide style invalidation reasons with Layout timeline records
https://bugs.webkit.org/show_bug.cgi?id=120084
Summary Web Inspector: provide style invalidation reasons with Layout timeline records
Simon Fraser (smfr)
Reported 2013-08-20 13:42:14 PDT
Allow the inspector to show the reason for style invalidation
Attachments
Patch (not for review but feedback welcome). (44.01 KB, patch)
2013-08-20 13:46 PDT, Simon Fraser (smfr)
no flags
Screenshot (256.98 KB, image/png)
2013-08-20 13:56 PDT, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2013-08-20 13:46:51 PDT
Created attachment 209226 [details] Patch (not for review but feedback welcome).
Simon Fraser (smfr)
Comment 2 2013-08-20 13:56:12 PDT
Created attachment 209227 [details] Screenshot
Darin Adler
Comment 3 2013-08-20 14:14:02 PDT
Comment on attachment 209226 [details] Patch (not for review but feedback welcome). View in context: https://bugs.webkit.org/attachment.cgi?id=209226&action=review > Source/WebCore/inspector/InspectorInstrumentation.h:177 > + enum RecalcStyleReason { Putting these inside the InspectorInstrumentation namespace makes use of them so wordy. Really wish they weren’t in the namespace. > Source/WebCore/inspector/InspectorInstrumentation.h:196 > + class RecalcStyleReasonSetter { Would be nice to make this explicitly non-copyable. > Source/WebCore/inspector/InspectorInstrumentation.h:551 > + static RecalcStyleReason s_recalcStyleReason; Is the cost for all this extra global variable access affordable?
Radar WebKit Bug Importer
Comment 4 2013-08-21 17:22:21 PDT
Antti Koivisto
Comment 5 2013-08-23 00:25:34 PDT
Comment on attachment 209226 [details] Patch (not for review but feedback welcome). View in context: https://bugs.webkit.org/attachment.cgi?id=209226&action=review > Source/WebCore/inspector/InspectorInstrumentation.h:191 > + enum RecalcStyleReason { > + NoReason, > + CSSAnimation, > + Fullscreen, > + ActiveState, > + HoverState, > + FocusState, > + AttributeChange, > + ClassAttributeChange, > + InlineStyleChange, > + SelectorSensitiveStateChange, > + DOMTreeChange, > + FormControlChange, > + DragStateChange, > + }; It might be useful to make the reason tracking part of the style resolve code rather than being in Inspector land. We might have internal uses for this information. Specifically we might want to decide what sort of resolve to do at resolve time instead at invalidation time like we do now. This is not really a show stopper for this patch (we can switch over later) but something to consider. >> Source/WebCore/inspector/InspectorInstrumentation.h:196 >> + class RecalcStyleReasonSetter { > > Would be nice to make this explicitly non-copyable. Global variable based hackery like this is pretty distasteful. It is probably ok for Inspector interface but at least we shouldn't propagate these elsewhere.
Simon Fraser (smfr)
Comment 6 2013-08-23 08:57:23 PDT
> It might be useful to make the reason tracking part of the style resolve code rather than being in Inspector land. We might have internal uses for this information. Specifically we might want to decide what sort of resolve to do at resolve time instead at invalidation time like we do now. > > This is not really a show stopper for this patch (we can switch over later) but something to consider. Interesting, though in some cases it would require plumbing a "reason" param through several levels of calls. > >> Source/WebCore/inspector/InspectorInstrumentation.h:196 > >> + class RecalcStyleReasonSetter { > > > > Would be nice to make this explicitly non-copyable. > > Global variable based hackery like this is pretty distasteful. It is probably ok for Inspector interface but at least we shouldn't propagate these elsewhere. InspectorInstrumentation consults a global to decide whether to take a fast return, so this isn't really any different, but I agree that global state is icky.
Timothy Hatcher
Comment 7 2014-01-18 00:43:53 PST
Sorry I didn't see this until now. I like where this is going. With the Timeline work I'm doing this would be great to get landed. Layout reasons would be good too.
Blaze Burg
Comment 8 2017-04-06 16:09:03 PDT
Blaze Burg
Comment 9 2017-04-06 16:49:50 PDT
*** Bug 107667 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.