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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10575</bug_id>
          
          <creation_ts>2010-09-08 09:07:12 +0000</creation_ts>
          <short_desc>It appears that parser-inserted scripts should block if an ancestor browsing context has a style sheet blocking scripts</short_desc>
          <delta_ts>2010-11-01 23:30:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>https://bugzilla.mozilla.org/show_bug.cgi?id=383331</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henri Sivonen">hsivonen</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>mjs</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>w3c</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38647</commentid>
    <comment_count>0</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-09-08 09:07:12 +0000</bug_when>
    <thetext>When Gecko checks if there&apos;s a style sheet blocking scripts, it also checks if documents in ancestor browser context has a style sheet blocking scripts. Please add this to the spec.

This was added for https://bugzilla.mozilla.org/show_bug.cgi?id=383331</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39481</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-09-26 16:38:59 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale: Why does Gecko do this? Are there pages that depend on the styles of ancestor documents? Do other browsers do this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39502</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-26 18:48:51 +0000</bug_when>
    <thetext>&gt; Are there pages that depend on the styles of ancestor documents?

There ARE scripts that request layout information at subframes and can thus cause undesirable flashes of unstyled content in the ancestor.  Of course iframe size also depends on the ancestor style information. 

All this is very clear had you actually read the link in comment 0 (or even just its summary!).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39503</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-26 18:49:52 +0000</bug_when>
    <thetext>Oh, I can&apos;t speak to what other browsers do (nor to how willing they are to accept FOUC).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39724</commentid>
    <comment_count>4</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-09-28 12:05:36 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Do other browsers do this?

AFAICT, only Gecko and Trident allow sheets to block scripts. WebKit and Presto don&apos;t appear to block scripts on pending sheets ever.

I didn&apos;t test what Trident does in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39727</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-28 12:38:36 +0000</bug_when>
    <thetext>Interesting.  Does Webkit just accept the FOUC issue and incorrect rendering that arise as a result?  They didn&apos;t use to, but perhaps their &quot;performance over correctness&quot; drive has moved them in this direction....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39729</commentid>
    <comment_count>6</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2010-09-28 12:49:07 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; Interesting.  Does Webkit just accept the FOUC issue and incorrect rendering
&gt; that arise as a result?

WebKit doesn&apos;t FOUC. I&apos;m guessing WebKit suppresses painting if there are pending sheets.

Presto accepts the FOUC.

http://hsivonen.iki.fi/test/moz/sheet-blocking-script-baseline.php</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39730</commentid>
    <comment_count>7</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2010-09-28 12:53:41 +0000</bug_when>
    <thetext>OK.  I don&apos;t think we&apos;d consider either behavior acceptable for Gecko.... but maybe someone can convince me why the Webkit one is web-compatible?  It hasn&apos;t been in our testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39798</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-09-28 19:46:41 +0000</bug_when>
    <thetext>This stuff was originally added based on feedback from WebKit so I&apos;m surprised that they don&apos;t block.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40727</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-06 17:45:59 +0000</bug_when>
    <thetext>&lt;dhyatt&gt; i believe currently webkit blocks a script if there are pending sheets but only if the script is external
&lt;dhyatt&gt; if the script is inline i think we don&apos;t block
&lt;dhyatt&gt; which i consdier a bug
&lt;dhyatt&gt; we do not consider ancestor documents though
&lt;dhyatt&gt; so if the ancestor of some subframe has pending sheets we won&apos;t block
&lt;dhyatt&gt; and yes we suppress painting when there are pending sheets</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40728</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-06 17:48:21 +0000</bug_when>
    <thetext>&lt;dhyatt&gt; i don&apos;t have a strong opinion ... i think blocking until ancestor sheets were ready would be fine</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41275</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-14 00:57:29 +0000</bug_when>
    <thetext>Should this still be limited to just style sheets that have been added by a parser? Should it be only parsers that are parsing for the document or its browsing context ancestors, or any parser?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41507</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-10-18 22:13:44 +0000</bug_when>
    <thetext>Update: This is currently pending feedback from Henri -- he said he wanted to do some testing first. I&apos;m happy to make this block on ancestors as soon as an implementor clarifies whether they want this to still be bound to parsers, and if so, exactly which parsers in a multi-frame case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41935</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-01 23:30:16 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter&apos;s comments.

I made the change based on what I could determine Gecko does from looking at bz&apos;s patch in the Gecko bug mentioned in comment 0. Please file new P1/crit bugs if there are issues with this solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41936</commentid>
    <comment_count>14</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-11-01 23:30:27 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5663.
Check-in comment: Make style sheets block scripts even in descendant documents
http://html5.org/tools/web-apps-tracker?from=5662&amp;to=5663</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>