RESOLVED DUPLICATE of bug 56932 Bug 225363
document.styleSheets doesn't include all of the stylesheets, when `title` attribute is present
https://bugs.webkit.org/show_bug.cgi?id=225363
Summary document.styleSheets doesn't include all of the stylesheets, when `title` att...
Daniel Holbert
Reported 2021-05-04 13:02:09 PDT
Created attachment 427692 [details] testcase 1 STR: 1. Load attached testcase, and look at the alert() that appears. EXPECTED RESULTS: alert should say PASS (i.e. `document.styleSheets.length` should be 4) ACTUAL RESULTS: alert says FAIL, and reports that document.styleSheets.length is in fact 2. Firefox and Chromium both give expected results. Safari 14 gives actual results.
Attachments
testcase 1 (815 bytes, text/html)
2021-05-04 13:02 PDT, Daniel Holbert
no flags
Daniel Holbert
Comment 1 2021-05-04 13:07:23 PDT
The relevant spec text here is: https://drafts.csswg.org/cssom/#add-a-css-style-sheet Note that the last two stylesheets here should be be flagged as *disabled* (which is why they don't render in any browser; i.e. it's why the document renders as cyan instead of red or pink). Chrome doesn't set the disabled flag properly, which is a bug[1], but it does treat them as disabled from a rendering perspective and it does correctly add it to the list of stylesheets. This WebKit bug here is about these sheets being missing from the document.styleSheets list. [1] https://bugs.chromium.org/p/chromium/issues/detail?id=1205488
Alexey Proskuryakov
Comment 2 2021-05-04 17:42:29 PDT
Is this the same as bug 89297?
Daniel Holbert
Comment 3 2021-05-04 18:57:19 PDT
(In reply to Alexey Proskuryakov from comment #2) > Is this the same as bug 89297? Hmm - I'm not 100% sure, but it looks like it very well could be. (Feel free to mark as a duplicate if appropriate.)
Radar WebKit Bug Importer
Comment 4 2021-05-11 13:03:19 PDT
Ahmad Saleem
Comment 5 2022-07-24 09:30:18 PDT
I am able to reproduce this issue in Safari 15.6 on macOS 12.5 and it shows "FAIL - xxx expected 2, got 4." while all other browsers (Chrome Canary 106 and Firefox Nightly 104) do show "PASS" in the test case. Just wanted to share updated testing result. Thanks!
Ryosuke Niwa
Comment 6 2022-07-24 21:24:54 PDT
*** This bug has been marked as a duplicate of bug 56932 ***
Note You need to log in before you can comment on or make changes to this bug.