Bug 243540

Summary: Stylesheets from other stylesheet sets should be disabled
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, bfulgham, karlcow, koivisto, rniwa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 15   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
See Also: https://bugs.webkit.org/show_bug.cgi?id=212515
https://bugs.webkit.org/show_bug.cgi?id=118708
Attachments:
Description Flags
WIP
none
Test none

Description Ahmad Saleem 2022-08-04 06:28:24 PDT
Hi Team,

Another test case from Chrome bugs, where Safari 15.6 is failing test case similar to Chrome and I think we should fix and align it with web-spec.

Test Case - https://bug1708045.bmoattachments.org/attachment.cgi?id=9220199

Chrome Bug - https://bugs.chromium.org/p/chromium/issues/detail?id=1205488

Web-Spec Reference (from Chrome Bug Report) - The sheet should be disabled, per https://drafts.csswg.org/cssom/#add-a-css-style-sheet

*** STEPS TO REPRODUCE ***

1) Run the test case and review dialog box

<> EXPECTED RESULT:

PASS (The red stylesheet's 'disabled' flag is true)

<> ACTUAL RESULT:

FAIL (The red stylesheet's 'disabled' flag is false)

____

NOTE - Safari 15.6 and Chrome Canary 106 both fail this test case.

If this has been fixed upstream, please mark this as DUPLICATE.

Thanks!
Comment 1 Ryosuke Niwa 2022-08-04 11:48:12 PDT
Created attachment 461403 [details]
WIP
Comment 2 Ryosuke Niwa 2022-08-04 11:48:22 PDT
Created attachment 461404 [details]
Test
Comment 3 Ryosuke Niwa 2022-08-07 18:47:00 PDT
Comment on attachment 461403 [details]
WIP

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

> Source/WebCore/style/StyleScope.cpp:408
> +                sheet->setDisabled(title != m_preferredStylesheetSetName);

This isn't quite right. Firefox allows unpreferred / disabled script to be enabled again by script.
Comment 4 Radar WebKit Bug Importer 2022-08-11 06:29:15 PDT
<rdar://problem/98504974>
Comment 5 Ahmad Saleem 2023-05-25 07:48:33 PDT
Web-Spec: Setting the disabled flag in step 5 of https://drafts.csswg.org/cssom/#add-a-css-style-sheet

Source - Mozilla bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1708045)