W3C home > Mailing lists > Public > public-web-perf@w3.org > November 2013

[ResourcePriorities] Blocking content resources on CSS properties

From: Simon Sapin <simon.sapin@exyr.org>
Date: Tue, 05 Nov 2013 18:38:58 +0000
Message-ID: <52793B42.2070608@exyr.org>
To: public-web-perf@w3.org
CC: www-style <www-style@w3.org>
Hi,

(Please keep me in CC as Iím not subscribed to public-web-perf.)

https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourcePriorities/Overview.html#resource-priorities-property

In the current draft, the 'resource-priorities' CSS property applies to 
content resources such as images in the <img> element. It shouldnít.

Because the 'postpone' value of that properties is a "must", this means 
that the decision to fetch a resource is blocked on resolving the value 
of a CSS property, which itself may depend on fetching external stylesheets.

There are two issues with this:

* This introduces a circular dependency. You donít know when youíre 
supposed to fetch a stylesheet until after youíve applied it.

* Some browsers speculatively parse HTML to find images and other 
resources and start fetching them as soon as possible. CSS properties 
may not be resolved yet at that point. Waiting for them introduces 
unnecessary delays.


To resolve both of these issues, I suggest changing the 
resource-priorities property so that it does not apply to any "content 
resource" such as <img> but only to "CSS resources" such as 
background-image.

This change does not affect functionality since the property on content 
resources is redundant with the attributes that this spec adds to 
various HTML and SVG elements.

-- 
Simon Sapin
Received on Tuesday, 5 November 2013 18:39:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:04:37 UTC