This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10575 - It appears that parser-inserted scripts should block if an ancestor browsing context has a style sheet blocking scripts
Summary: It appears that parser-inserted scripts should block if an ancestor browsing ...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P1 critical
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: https://bugzilla.mozilla.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 09:07 UTC by Henri Sivonen
Modified: 2010-11-01 23:30 UTC (History)
7 users (show)

See Also:


Attachments

Description Henri Sivonen 2010-09-08 09:07:12 UTC
When Gecko checks if there'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
Comment 1 Ian 'Hixie' Hickson 2010-09-26 16:38:59 UTC
EDITOR'S RESPONSE: This is an Editor'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?
Comment 2 Boris Zbarsky 2010-09-26 18:48:51 UTC
> 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!).
Comment 3 Boris Zbarsky 2010-09-26 18:49:52 UTC
Oh, I can't speak to what other browsers do (nor to how willing they are to accept FOUC).
Comment 4 Henri Sivonen 2010-09-28 12:05:36 UTC
(In reply to comment #1)
> Do other browsers do this?

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

I didn't test what Trident does in this case.
Comment 5 Boris Zbarsky 2010-09-28 12:38:36 UTC
Interesting.  Does Webkit just accept the FOUC issue and incorrect rendering that arise as a result?  They didn't use to, but perhaps their "performance over correctness" drive has moved them in this direction....
Comment 6 Henri Sivonen 2010-09-28 12:49:07 UTC
(In reply to comment #5)
> Interesting.  Does Webkit just accept the FOUC issue and incorrect rendering
> that arise as a result?

WebKit doesn't FOUC. I'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
Comment 7 Boris Zbarsky 2010-09-28 12:53:41 UTC
OK.  I don't think we'd consider either behavior acceptable for Gecko.... but maybe someone can convince me why the Webkit one is web-compatible?  It hasn't been in our testing.
Comment 8 Ian 'Hixie' Hickson 2010-09-28 19:46:41 UTC
This stuff was originally added based on feedback from WebKit so I'm surprised that they don't block.
Comment 9 Ian 'Hixie' Hickson 2010-10-06 17:45:59 UTC
<dhyatt> i believe currently webkit blocks a script if there are pending sheets but only if the script is external
<dhyatt> if the script is inline i think we don't block
<dhyatt> which i consdier a bug
<dhyatt> we do not consider ancestor documents though
<dhyatt> so if the ancestor of some subframe has pending sheets we won't block
<dhyatt> and yes we suppress painting when there are pending sheets
Comment 10 Ian 'Hixie' Hickson 2010-10-06 17:48:21 UTC
<dhyatt> i don't have a strong opinion ... i think blocking until ancestor sheets were ready would be fine
Comment 11 Ian 'Hixie' Hickson 2010-10-14 00:57:29 UTC
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?
Comment 12 Ian 'Hixie' Hickson 2010-10-18 22:13:44 UTC
Update: This is currently pending feedback from Henri -- he said he wanted to do some testing first. I'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.
Comment 13 Ian 'Hixie' Hickson 2010-11-01 23:30:16 UTC
EDITOR'S RESPONSE: This is an Editor'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's comments.

I made the change based on what I could determine Gecko does from looking at bz's patch in the Gecko bug mentioned in comment 0. Please file new P1/crit bugs if there are issues with this solution.
Comment 14 contributor 2010-11-01 23:30:27 UTC
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&to=5663