<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>225363</bug_id>
          
          <creation_ts>2021-05-04 13:02:09 -0700</creation_ts>
          <short_desc>document.styleSheets doesn&apos;t include all of the stylesheets, when `title` attribute is present</short_desc>
          <delta_ts>2022-07-24 21:24:54 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>56932</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=89297</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Holbert">dholbert</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>heycam</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1756639</commentid>
    <comment_count>0</comment_count>
      <attachid>427692</attachid>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2021-05-04 13:02:09 -0700</bug_when>
    <thetext>Created attachment 427692
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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1756643</commentid>
    <comment_count>1</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2021-05-04 13:07:23 -0700</bug_when>
    <thetext>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&apos;t render in any browser; i.e. it&apos;s why the document renders as cyan instead of red or pink).  Chrome doesn&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1756739</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2021-05-04 17:42:29 -0700</bug_when>
    <thetext>Is this the same as bug 89297?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1756773</commentid>
    <comment_count>3</comment_count>
    <who name="Daniel Holbert">dholbert</who>
    <bug_when>2021-05-04 18:57:19 -0700</bug_when>
    <thetext>(In reply to Alexey Proskuryakov from comment #2)
&gt; Is this the same as bug 89297?

Hmm - I&apos;m not 100% sure, but it looks like it very well could be.

(Feel free to mark as a duplicate if appropriate.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1759042</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-05-11 13:03:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/77858309&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886359</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-24 09:30:18 -0700</bug_when>
    <thetext>I am able to reproduce this issue in Safari 15.6 on macOS 12.5 and it shows &quot;FAIL - xxx expected 2, got 4.&quot; while all other browsers (Chrome Canary 106 and Firefox Nightly 104) do show &quot;PASS&quot; in the test case. Just wanted to share updated testing result. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886465</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-24 21:24:54 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 56932 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>427692</attachid>
            <date>2021-05-04 13:02:09 -0700</date>
            <delta_ts>2021-05-04 13:02:09 -0700</delta_ts>
            <desc>testcase 1</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>815</size>
            <attacher name="Daniel Holbert">dholbert</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjwhLS0gTm90aWNlIHdlIGhhdmUgNCBzdHlsZXNoZWV0cyBoZXJlOiAt
LT4KPHN0eWxlIHRpdGxlPSJmb28iPjpyb290IHsgYmFja2dyb3VuZDogb3JhbmdlIH08L3N0eWxl
Pgo8c3R5bGU+OnJvb3QgeyBiYWNrZ3JvdW5kOiBjeWFuIH08L3N0eWxlPgo8c3R5bGUgdGl0bGU9
ImJhciI+OnJvb3QgeyBiYWNrZ3JvdW5kOiBwaW5rIH08L3N0eWxlPgo8c3R5bGUgdGl0bGU9ImJs
YWgiPjpyb290IHsgYmFja2dyb3VuZDogcmVkIH08L3N0eWxlPgoKPHNjcmlwdD4KICAvLyBXZSBl
eHBlY3QgdGhlICdkaXNhYmxlZCcgZmxhZyB0byBiZSAndHJ1ZScgZm9yIHRoZSBzZWNvbmQgKHJl
ZCkgc3R5bGVzaGVldC4KICAvLyAoWW91IGNhbiB2aXN1YWxseSBzZWUg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