Bug 219203 - CSSStyleSheet.cssRules and rules should throw in case of opaque stylesheets
Summary: CSSStyleSheet.cssRules and rules should throw in case of opaque stylesheets
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-20 07:28 PST by youenn fablet
Modified: 2020-12-01 06:58 PST (History)
11 users (show)

See Also:


Attachments
Patch (7.13 KB, patch)
2020-11-20 08:15 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (8.18 KB, patch)
2020-11-20 08:47 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (11.12 KB, patch)
2020-11-20 14:16 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (11.42 KB, patch)
2020-11-20 14:48 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (11.10 KB, patch)
2020-11-30 09:40 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (11.09 KB, patch)
2020-12-01 00:53 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (11.17 KB, patch)
2020-12-01 06:17 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-11-20 07:28:12 PST
CSSStyleSheet.cssRules and rules should throw in case of opaque stylesheets
Apparently, that is what Chrome and Firefox are doing.
Comment 1 youenn fablet 2020-11-20 08:15:30 PST
Created attachment 414675 [details]
Patch
Comment 2 youenn fablet 2020-11-20 08:47:35 PST
Created attachment 414686 [details]
Patch
Comment 3 youenn fablet 2020-11-20 14:16:11 PST
Created attachment 414723 [details]
Patch
Comment 4 youenn fablet 2020-11-20 14:48:20 PST
Created attachment 414730 [details]
Patch
Comment 5 Radar WebKit Bug Importer 2020-11-27 07:29:14 PST
<rdar://problem/71764897>
Comment 6 youenn fablet 2020-11-30 09:09:47 PST
Ping review
Comment 7 Alex Christensen 2020-11-30 09:18:06 PST
Comment on attachment 414730 [details]
Patch

This removes the canAccessRules check from other callers of rules and cssRules.
I think FromJS should be ForJS.
Comment 8 youenn fablet 2020-11-30 09:40:50 PST
Created attachment 415029 [details]
Patch
Comment 9 Alex Christensen 2020-11-30 10:04:33 PST
Comment on attachment 415029 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415029&action=review

> Source/WebCore/css/CSSStyleSheet.cpp:257
> +ExceptionOr<RefPtr<CSSRuleList>> CSSStyleSheet::rulesForJS()

This could be ExceptionOr<Ref>
Comment 10 Ryosuke Niwa 2020-11-30 14:26:56 PST
Comment on attachment 415029 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415029&action=review

> Source/WebCore/css/CSSStyleSheet.h:66
> +    ExceptionOr<RefPtr<CSSRuleList>> cssRulesForJS();
> +    ExceptionOr<RefPtr<CSSRuleList>> rulesForJS();

ForBindings is the canonical naming convention we use.
Comment 11 youenn fablet 2020-12-01 00:53:28 PST
Created attachment 415108 [details]
Patch for landing
Comment 12 youenn fablet 2020-12-01 06:17:43 PST
Created attachment 415132 [details]
Patch for landing
Comment 13 EWS 2020-12-01 06:58:34 PST
Committed r270296: <https://trac.webkit.org/changeset/270296>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415132 [details].