Re: [whatwg] style sheet blocking scripts

2009-12-10 Thread David Hyatt
This is false.  WebKit will block the parser when it encounters an external 
script if there are pending stylesheet loads.  However we have a speculative 
preloader that will continue to parse and load resources beyond that script 
(but the real parser will be blocked).

dave

On Dec 9, 2009, at 3:42 PM, tali garsiel wrote:

 Well, not completely.
 Regarding the first question- Webkit guys told me (on their IRC channel) that 
 the don't block the parser and only block scripts that request visual 
 information, so I'm still  confused.
 
  Date: Wed, 9 Dec 2009 17:01:30 +
  From: i...@hixie.ch
  To: t_gars...@hotmail.com; bzbar...@mit.edu
  CC: wha...@whatwg.org
  Subject: Re: [whatwg] style sheet blocking scripts
  
  On Wed, 28 Oct 2009, tali garsiel wrote:
   
   This is a quote from Section 4.2 of the spec:
   
   A style sheet in the context of the Document of an HTML parser or XML 
   parser is said to be a style sheet blocking scripts if the element was 
   created by that Document's parser, and the element is either a style 
   element or a link element that was an external resource link that 
   contributes to the styling processing model when the element was c reated 
   by the parser, and the element's style sheet was enabled when the 
   element was created by the parser, and the element's style sheet ready 
   flag is not yet set, and, the last time the event loop reached step 1, 
   the element was in that Document
   
   And the section about parsing - the script tag says that before 
   executing a script the parser must:
   
   3. Spin the event loop until there is no style sheet blocking scripts 
   and the script's ready to be parser-executed flag is set.
   
   I have two questions:
   
   1. As far as I know, Firefox and Webkit have a stall on demand 
   behavior, where a stylesheet blocks a script only if the script asks 
   from style information. According to the spec the style sheet always 
   blocks a script, am I right?
   
   2. Can you clarify the condition - the element's style sheet was 
   enabled when the element was created by the parser, and the element's 
   style sheet ready flag is not yet set, and, the last time the event loop 
   reached step 1, the element was in that Document
   
   Does it mean the style sheet blocks scripts only if it's currently being 
   parsed?
  
  On Wed, 28 Oct 2009, Boris Zbarsky wrote:
   On 10/28/09 2:59 AM, tali garsiel wrote:
1. As far as I know, Firefox and Webkit have a stall on demand 
behavior, where a stylesheet blocks a script only if the script asks 
from style information.
   
   You know wrong, sorry. Firefox has the behavior the spec describes; 
   webkit blocks the parser completely on stylesheets (the behavior Firefox 
   used to have). Last I chec ked, at least.
   
2. Can you clarify the condition - the element's style sheet was 
enabled when the element was created by the parser, and the element's 
style sheet ready flag is not yet set, and, the last time the event 
loop reached step 1, the element was in that Document
   
   The parts of that condition basically mean:
   
   1) When the element was created by the parser, it was in the then-enabled
   stylesheet set (i.e. not an alternate stylesheet).
   2) The stylesheet, or one of its @import descendants, is still loading.
   3) The stylesheet linking element is still in the document (so the 
   stylesheet
   still applies).
  
  Thanks Boris.
  
  Tali, does this answer your question to your satisfaction?
  
  -- 
  Ian Hickson U+1047E )\._.,--,'``. fL
  http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
  Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
 
 Windows Live Hotmail: Your friends can get your Facebook updates, right from 
 Hotmail®.



Re: [whatwg] style sheet blocking scripts

2009-12-10 Thread David Hyatt

On Dec 9, 2009, at 4:10 PM, James Robinson wrote:

 2009/12/9 tali garsiel t_gars...@hotmail.com
 Well, not completely.
 Regarding the first question- Webkit guys told me (on their IRC channel) that 
 the don't block the parser and only block scripts that request visual 
 information, so I'm still  confused.
 
 Here's my understanding of the implementation inside WebKit currently:
 During parsing, WebKit does not block the parser on stylesheet loads, but 
 does block external scripts from running until previously-encountered 
 stylesheets have loaded.  WebKit does not suspend script execution on 
 requests for visual information if stylesheets have not loaded (for example 
 for inline scripts or in the case of stylesheets added dynamically after 
 parsing has completed).  WebKit does suspend parsing of the document on 
 script loads, but has a speculative preloader to attempt to start fetches for 
 resources past the script tag.
 
 - James
 

This is accurate, although I'd add that we consider it a bug that we don't yet 
block the parser for inline scripts in addition to external scripts.

dave



Re: [whatwg] style sheet blocking scripts

2009-12-10 Thread David Hyatt
It is considered a bug.

On Dec 9, 2009, at 4:57 PM, Jonas Sicking wrote:

 On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com wrote:
 2009/12/9 tali garsiel t_gars...@hotmail.com
 
 Well, not completely.
 Regarding the first question- Webkit guys told me (on their IRC channel)
 that the don't block the parser and only block scripts that request visual
 information, so I'm still  confused.
 
 Here's my understanding of the implementation inside WebKit currently:
 During parsing, WebKit does not block the parser on stylesheet loads, but
 does block external scripts from running until previously-encountered
 stylesheets have loaded.  WebKit does not suspend script execution on
 requests for visual information if stylesheets have not loaded (for example
 for inline scripts or in the case of stylesheets added dynamically after
 parsing has completed).  WebKit does suspend parsing of the document on
 script loads, but has a speculative preloader to attempt to start fetches
 for resources past the script tag.
 
 Why does webkit treat external scripts different from inline scripts
 here? I.e. why is an inline script allowed to run even if there are
 pending stylesheet loads, but external scripts not? That seems
 inconsistent and confusing.
 
 Is this considered a bug or desired behavior?
 
 / Jonas



Re: [whatwg] style sheet blocking scripts

2009-12-10 Thread tali garsiel

I understand now. Thank you for your answers.

From: hy...@apple.com
Date: Thu, 10 Dec 2009 12:15:50 -0600
To: jam...@google.com
CC: wha...@whatwg.org; bzbar...@mit.edu; i...@hixie.ch; t_gars...@hotmail.com
Subject: Re: [whatwg] style sheet blocking scripts




On Dec 9, 2009, at 4:10 PM, James Robinson wrote:2009/12/9 tali garsiel 
t_gars...@hotmail.com






Well, not completely.Regarding the first question- Webkit guys told me (on 
their IRC channel) that the don't block the parser and only block scripts that 
request visual information, so I'm still  confused.


Here's my understanding of the implementation inside WebKit currently:During 
parsing, WebKit does not block the parser on stylesheet loads, but does block 
external scripts from running until previously-encountered stylesheets have 
loaded.  WebKit does not suspend script execution on requests for visual 
information if stylesheets have not loaded (for example for inline scripts or 
in the case of stylesheets added dynamically after parsing has completed).  
WebKit does suspend parsing of the document on script loads, but has a 
speculative preloader to attempt to start fetches for resources past the 
script tag.

- James

This is accurate, although I'd add that we consider it a bug that we don't yet 
block the parser for inline scripts in addition to external scripts.
dave
  
_
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009

Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread Ian Hickson
On Wed, 28 Oct 2009, tali garsiel wrote:
 
 This is a quote from Section 4.2 of the spec:
 
 A style sheet in the context of the Document of an HTML parser or XML 
 parser is said to be a style sheet blocking scripts if the element was 
 created by that Document's parser, and the element is either a style 
 element or a link element that was an external resource link that 
 contributes to the styling processing model when the element was created 
 by the parser, and the element's style sheet was enabled when the 
 element was created by the parser, and the element's style sheet ready 
 flag is not yet set, and, the last time the event loop reached step 1, 
 the element was in that Document
 
 And the section about parsing - the script tag says that before 
 executing a script the parser must:
 
 3. Spin the event loop until there is no style sheet blocking scripts 
 and the script's ready to be parser-executed flag is set.
 
 I have two questions:
 
 1. As far as I know, Firefox and Webkit have a stall on demand 
 behavior, where a stylesheet blocks a script only if the script asks 
 from style information. According to the spec the style sheet always 
 blocks a script, am I right?
 
 2. Can you clarify the condition - the element's style sheet was 
 enabled when the element was created by the parser, and the element's 
 style sheet ready flag is not yet set, and, the last time the event loop 
 reached step 1, the element was in that Document
 
 Does it mean the style sheet blocks scripts only if it's currently being 
 parsed?

On Wed, 28 Oct 2009, Boris Zbarsky wrote:
 On 10/28/09 2:59 AM, tali garsiel wrote:
  1. As far as I know, Firefox and Webkit have a stall on demand 
  behavior, where a stylesheet blocks a script only if the script asks 
  from style information.
 
 You know wrong, sorry.  Firefox has the behavior the spec describes; 
 webkit blocks the parser completely on stylesheets (the behavior Firefox 
 used to have).  Last I checked, at least.
 
  2. Can you clarify the condition - the element's style sheet was 
  enabled when the element was created by the parser, and the element's 
  style sheet ready flag is not yet set, and, the last time the event 
  loop reached step 1, the element was in that Document
 
 The parts of that condition basically mean:
 
 1)  When the element was created by the parser, it was in the then-enabled
 stylesheet set (i.e. not an alternate stylesheet).
 2)  The stylesheet, or one of its @import descendants, is still loading.
 3)  The stylesheet linking element is still in the document (so the stylesheet
 still applies).

Thanks Boris.

Tali, does this answer your question to your satisfaction?

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread James Robinson
2009/12/9 tali garsiel t_gars...@hotmail.com

  Well, not completely.
 Regarding the first question- Webkit guys told me (on their IRC channel)
 that the don't block the parser and only block scripts that request visual
 information, so I'm still  confused.


Here's my understanding of the implementation inside WebKit currently:
During parsing, WebKit does not block the parser on stylesheet loads, but
does block external scripts from running until previously-encountered
stylesheets have loaded.  WebKit does not suspend script execution on
requests for visual information if stylesheets have not loaded (for example
for inline scripts or in the case of stylesheets added dynamically after
parsing has completed).  WebKit does suspend parsing of the document on
script loads, but has a speculative preloader to attempt to start fetches
for resources past the script tag.

- James





  Date: Wed, 9 Dec 2009 17:01:30 +
  From: i...@hixie.ch
  To: t_gars...@hotmail.com; bzbar...@mit.edu
  CC: wha...@whatwg.org
  Subject: Re: [whatwg] style sheet blocking scripts

 
  On Wed, 28 Oct 2009, tali garsiel wrote:
  
   This is a quote from Section 4.2 of the spec:
  
   A style sheet in the context of the Document of an HTML parser or XML
   parser is said to be a style sheet blocking scripts if the element was
   created by that Document's parser, and the element is either a style
   element or a link element that was an external resource link that
   contributes to the styling processing model when the element was c
 reated
   by the parser, and the element's style sheet was enabled when the
   element was created by the parser, and the element's style sheet ready
   flag is not yet set, and, the last time the event loop reached step 1,
   the element was in that Document
  
   And the section about parsing - the script tag says that before
   executing a script the parser must:
  
   3. Spin the event loop until there is no style sheet blocking scripts
   and the script's ready to be parser-executed flag is set.
  
   I have two questions:
  
   1. As far as I know, Firefox and Webkit have a stall on demand
   behavior, where a stylesheet blocks a script only if the script asks
   from style information. According to the spec the style sheet always
   blocks a script, am I right?
  
   2. Can you clarify the condition - the element's style sheet was
   enabled when the element was created by the parser, and the element's
   style sheet ready flag is not yet set, and, the last time the event
 loop
   reached step 1, the element was in that Document
  
   Does it mean the style sheet blocks scripts only if it's currently
 being
   parsed?
 
  On Wed, 28 Oct 2009, Boris Zbarsky wrote:
   On 10/28/09 2:59 AM, tali garsiel wrote:
1. As far as I know, Firefox and Webkit have a stall on demand
behavior, where a stylesheet blocks a script only if the script asks
from style information.
  
   You know wrong, sorry. Firefox has the behavior the spec describes;
   webkit blocks the parser completely on stylesheets (the behavior
 Firefox
   used to have). Last I chec ked, at least.

  
2. Can you clarify the condition - the element's style sheet was
enabled when the element was created by the parser, and the element's

style sheet ready flag is not yet set, and, the last time the event
loop reached step 1, the element was in that Document
  
   The parts of that condition basically mean:
  
   1) When the element was created by the parser, it was in the
 then-enabled
   stylesheet set (i.e. not an alternate stylesheet).
   2) The stylesheet, or one of its @import descendants, is still loading.
   3) The stylesheet linking element is still in the document (so the
 stylesheet
   still applies).
 
  Thanks Boris.
 
  Tali, does this answer your question to your satisfaction?
 
  --
  Ian Hickson U+1047E )\._.,--,'``. fL
  http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
  Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'

 --
 Windows Live Hotmail: Your friends can get your Facebook updates, right
 from 
 Hotmail®.http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009



Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread Jonas Sicking
On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com wrote:
 2009/12/9 tali garsiel t_gars...@hotmail.com

 Well, not completely.
 Regarding the first question- Webkit guys told me (on their IRC channel)
 that the don't block the parser and only block scripts that request visual
 information, so I'm still  confused.

 Here's my understanding of the implementation inside WebKit currently:
 During parsing, WebKit does not block the parser on stylesheet loads, but
 does block external scripts from running until previously-encountered
 stylesheets have loaded.  WebKit does not suspend script execution on
 requests for visual information if stylesheets have not loaded (for example
 for inline scripts or in the case of stylesheets added dynamically after
 parsing has completed).  WebKit does suspend parsing of the document on
 script loads, but has a speculative preloader to attempt to start fetches
 for resources past the script tag.

Why does webkit treat external scripts different from inline scripts
here? I.e. why is an inline script allowed to run even if there are
pending stylesheet loads, but external scripts not? That seems
inconsistent and confusing.

Is this considered a bug or desired behavior?

/ Jonas


Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread James Robinson
On Wed, Dec 9, 2009 at 2:57 PM, Jonas Sicking jo...@sicking.cc wrote:

 On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com wrote:
  2009/12/9 tali garsiel t_gars...@hotmail.com
 
  Well, not completely.
  Regarding the first question- Webkit guys told me (on their IRC channel)
  that the don't block the parser and only block scripts that request
 visual
  information, so I'm still  confused.
 
  Here's my understanding of the implementation inside WebKit currently:
  During parsing, WebKit does not block the parser on stylesheet loads, but
  does block external scripts from running until previously-encountered
  stylesheets have loaded.  WebKit does not suspend script execution on
  requests for visual information if stylesheets have not loaded (for
 example
  for inline scripts or in the case of stylesheets added dynamically after
  parsing has completed).  WebKit does suspend parsing of the document on
  script loads, but has a speculative preloader to attempt to start fetches
  for resources past the script tag.

 Why does webkit treat external scripts different from inline scripts
 here? I.e. why is an inline script allowed to run even if there are
 pending stylesheet loads, but external scripts not? That seems
 inconsistent and confusing.

 Is this considered a bug or desired behavior?


The former:
http://trac.webkit.org/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L2017

http://trac.webkit.org/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L2017I'm
not sure how much this matters in practice.  In theory, this is unobservable
to the page unless it queries the loaded stylesheets directly or a property
derived from layout both of which should suspend script execution.

- James



 / Jonas



Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread Boris Zbarsky

On 12/9/09 3:06 PM, James Robinson wrote:

On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com
mailto:jam...@google.com wrote:

WebKit does not suspend script execution on requests for visual information if 
stylesheets have not loaded



In theory, this is unobservable to the page unless it queries the loaded 
stylesheets
directly or a property derived from layout both of which should suspend
script execution.


I'm having a hard time reconciling the above two claims.

-Boris


Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread Jonas Sicking
On Wed, Dec 9, 2009 at 3:06 PM, James Robinson jam...@google.com wrote:
 On Wed, Dec 9, 2009 at 2:57 PM, Jonas Sicking jo...@sicking.cc wrote:

 On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com wrote:
  2009/12/9 tali garsiel t_gars...@hotmail.com
 
  Well, not completely.
  Regarding the first question- Webkit guys told me (on their IRC
  channel)
  that the don't block the parser and only block scripts that request
  visual
  information, so I'm still  confused.
 
  Here's my understanding of the implementation inside WebKit currently:
  During parsing, WebKit does not block the parser on stylesheet loads,
  but
  does block external scripts from running until previously-encountered
  stylesheets have loaded.  WebKit does not suspend script execution on
  requests for visual information if stylesheets have not loaded (for
  example
  for inline scripts or in the case of stylesheets added dynamically after
  parsing has completed).  WebKit does suspend parsing of the document on
  script loads, but has a speculative preloader to attempt to start
  fetches
  for resources past the script tag.

 Why does webkit treat external scripts different from inline scripts
 here? I.e. why is an inline script allowed to run even if there are
 pending stylesheet loads, but external scripts not? That seems
 inconsistent and confusing.

 Is this considered a bug or desired behavior?

 The
 former: http://trac.webkit.org/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L2017
 I'm not sure how much this matters in practice.  In theory, this is
 unobservable to the page unless it queries the loaded stylesheets directly
 or a property derived from layout both of which should suspend script
 execution.

Why is this more in theory for inline scripts than for external scripts?

/ Jonas


Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread Jonas Sicking
On Wed, Dec 9, 2009 at 3:18 PM, Jonas Sicking jo...@sicking.cc wrote:
 On Wed, Dec 9, 2009 at 3:06 PM, James Robinson jam...@google.com wrote:
 On Wed, Dec 9, 2009 at 2:57 PM, Jonas Sicking jo...@sicking.cc wrote:

 On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com wrote:
  2009/12/9 tali garsiel t_gars...@hotmail.com
 
  Well, not completely.
  Regarding the first question- Webkit guys told me (on their IRC
  channel)
  that the don't block the parser and only block scripts that request
  visual
  information, so I'm still  confused.
 
  Here's my understanding of the implementation inside WebKit currently:
  During parsing, WebKit does not block the parser on stylesheet loads,
  but
  does block external scripts from running until previously-encountered
  stylesheets have loaded.  WebKit does not suspend script execution on
  requests for visual information if stylesheets have not loaded (for
  example
  for inline scripts or in the case of stylesheets added dynamically after
  parsing has completed).  WebKit does suspend parsing of the document on
  script loads, but has a speculative preloader to attempt to start
  fetches
  for resources past the script tag.

 Why does webkit treat external scripts different from inline scripts
 here? I.e. why is an inline script allowed to run even if there are
 pending stylesheet loads, but external scripts not? That seems
 inconsistent and confusing.

 Is this considered a bug or desired behavior?

 The
 former: http://trac.webkit.org/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L2017
 I'm not sure how much this matters in practice.  In theory, this is
 unobservable to the page unless it queries the loaded stylesheets directly
 or a property derived from layout both of which should suspend script
 execution.

 Why is this more in theory for inline scripts than for external scripts?

Or rather, why is this more unobservable for inline scripts than for
external scripts?

/ Jonas


Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread James Robinson
On Wed, Dec 9, 2009 at 3:18 PM, Boris Zbarsky bzbar...@mit.edu wrote:

 On 12/9/09 3:06 PM, James Robinson wrote:

On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com
mailto:jam...@google.com wrote:

 WebKit does not suspend script execution on requests for visual
 information if stylesheets have not loaded


  In theory, this is unobservable to the page unless it queries the loaded
 stylesheets
 directly or a property derived from layout both of which should suspend
 script execution.


 I'm having a hard time reconciling the above two claims.


Hence the in theory.  If WebKit did suspend script execution on requests
for information that pending stylesheets might influence, then theory would
match practice.  It currently does not (which I believe is contrary to what
the spec says).  I'm curious if this actually negatively impacts anyone in
the wild, as suspending script execution in the middle of a block to wait
for a network load is generally not ideal.

- James


 -Boris



Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread James Robinson
On Wed, Dec 9, 2009 at 3:19 PM, Jonas Sicking jo...@sicking.cc wrote:

 On Wed, Dec 9, 2009 at 3:18 PM, Jonas Sicking jo...@sicking.cc wrote:
  On Wed, Dec 9, 2009 at 3:06 PM, James Robinson jam...@google.com
 wrote:
  On Wed, Dec 9, 2009 at 2:57 PM, Jonas Sicking jo...@sicking.cc wrote:
 
  On Wed, Dec 9, 2009 at 2:10 PM, James Robinson jam...@google.com
 wrote:
   2009/12/9 tali garsiel t_gars...@hotmail.com
  
   Well, not completely.
   Regarding the first question- Webkit guys told me (on their IRC
   channel)
   that the don't block the parser and only block scripts that request
   visual
   information, so I'm still  confused.
  
   Here's my understanding of the implementation inside WebKit
 currently:
   During parsing, WebKit does not block the parser on stylesheet loads,
   but
   does block external scripts from running until previously-encountered
   stylesheets have loaded.  WebKit does not suspend script execution on
   requests for visual information if stylesheets have not loaded (for
   example
   for inline scripts or in the case of stylesheets added dynamically
 after
   parsing has completed).  WebKit does suspend parsing of the document
 on
   script loads, but has a speculative preloader to attempt to start
   fetches
   for resources past the script tag.
 
  Why does webkit treat external scripts different from inline scripts
  here? I.e. why is an inline script allowed to run even if there are
  pending stylesheet loads, but external scripts not? That seems
  inconsistent and confusing.
 
  Is this considered a bug or desired behavior?
 
  The
  former:
 http://trac.webkit.org/browser/trunk/WebCore/html/HTMLTokenizer.cpp#L2017
  I'm not sure how much this matters in practice.  In theory, this is
  unobservable to the page unless it queries the loaded stylesheets
 directly
  or a property derived from layout both of which should suspend script
  execution.
 
  Why is this more in theory for inline scripts than for external
 scripts?

 Or rather, why is this more unobservable for inline scripts than for
 external scripts?


You're right, there's no real difference in the observability of this
behavior for inline vs external scripts.

- James



 / Jonas



Re: [whatwg] style sheet blocking scripts

2009-12-09 Thread Boris Zbarsky

On 12/9/09 3:53 PM, James Robinson wrote:

Hence the in theory.  If WebKit did suspend script execution on
requests for information that pending stylesheets might influence, then
theory would match practice.  It currently does not (which I believe is
contrary to what the spec says).  I'm curious if this actually
negatively impacts anyone in the wild, as suspending script execution in
the middle of a block to wait for a network load is generally not ideal.


Sure.  The Gecko behavior is to not run the inline script until the 
stylesheets have loaded, just like webkit (and Gecko) does for 
non-inline scripts.


Any inline script that asks for layout information is affected, right? 
Good question on how much this is a problem in practice.  I don't have 
data on that


-Boris


[whatwg] style sheet blocking scripts

2009-10-28 Thread tali garsiel

Hi,

This is a quote from Section 4.2 of the spec:

A style sheet in the context of the Document of an HTML parser or XML parser 
is said to be a style sheet blocking scripts if the element was created by that 
Document's parser, and the element is either a style element or a link element 
that was an external resource link that contributes to the styling processing 
model when the element was created by the parser, and the element's style sheet 
was enabled when the element was created by the parser, and the element's style 
sheet ready flag is not yet set, and, the last time the event loop reached step 
1, the element was in that Document


And the section about parsing - the script tag says that before executing a 
script the parser must:

3. Spin the event loop until there is no style sheet blocking scripts and the 
script's ready to be parser-executed flag is set.


I have two questions:

1. As far as I know, Firefox and Webkit have a stall on demand behavior, 
where a stylesheet blocks a script only if the script asks from style 
information. According to the spec the style sheet always blocks a script, am I 
right?

2. Can you clarify the condition - the element's style sheet was enabled when 
the element was created by
the parser, and the element's style sheet ready flag is not yet set,
and, the last time the event loop reached step 1, the element was in
that Document

Does it mean the style sheet blocks scripts only if it's currently being parsed?


Tali
  
_
Windows Live: Make it easier for your friends to see what you’re up to on 
Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009


Re: [whatwg] style sheet blocking scripts

2009-10-28 Thread Boris Zbarsky

On 10/28/09 2:59 AM, tali garsiel wrote:

1. As far as I know, Firefox and Webkit have a stall on demand behavior, 
where a stylesheet blocks a script only if the script asks from style information.


You know wrong, sorry.  Firefox has the behavior the spec describes; 
webkit blocks the parser completely on stylesheets (the behavior Firefox 
used to have).  Last I checked, at least.



2. Can you clarify the condition - the element's style sheet was enabled when 
the element was created by
the parser, and the element's style sheet ready flag is not yet set,
and, the last time the event loop reached step 1, the element was in
that Document


The parts of that condition basically mean:

1)  When the element was created by the parser, it was in the 
then-enabled stylesheet set (i.e. not an alternate stylesheet).

2)  The stylesheet, or one of its @import descendants, is still loading.
3)  The stylesheet linking element is still in the document (so the 
stylesheet still applies).


-Boris