[webkit-reviews] review requested: [Bug 210893] Web Inspector: front-end shouldn't change the order of User Style Sheet rules : [Attachment 399217] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 12 18:28:39 PDT 2020


Nikita Vasilyev <nvasilyev at apple.com> has asked  for review:
Bug 210893: Web Inspector: front-end shouldn't change the order of User Style
Sheet rules
https://bugs.webkit.org/show_bug.cgi?id=210893

Attachment 399217: Patch

https://bugs.webkit.org/attachment.cgi?id=399217&action=review




--- Comment #8 from Nikita Vasilyev <nvasilyev at apple.com> ---
Created attachment 399217

  --> https://bugs.webkit.org/attachment.cgi?id=399217&action=review

Patch

(In reply to Nikita Vasilyev from comment #5)
> It looks like this
> 
> ```
>     if (pageStyleSheet && pageStyleSheet->ownerNode() &&
> pageStyleSheet->ownerNode()->nodeName() == "#document")
>	  return Inspector::Protocol::CSS::StyleSheetOrigin::User;
> ```
> 
> is rather arbitrary and should be replaced with something that looks into
> the stylesheet's level.
> 
> WebCore/page/UserStyleSheet.h defines `level` method. It looks like this is
> what should be used to determine whether inspector receives
> `Inspector::Protocol::CSS::StyleSheetOrigin::User` or something else.
> 
> I don't understand the relationship between page/UserStyleSheet and
> css/CSSStyleSheet. I don't know if I can access the `level` method here.

I couldn't figure out how to do this but checking for "user-style-sheet://"
protocol worked pretty well!

cq- for now as I'm still trying to figure out how to write a Web Inspector
test.


More information about the webkit-reviews mailing list