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

Re: [ResourcePriorities] Blocking content resources on CSS properties

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 6 Nov 2013 10:41:50 -0800
Message-ID: <CAAWBYDAjuB2-NPY5A+zUkR+cfzBhc_mn_P0Kg6xuZS4i7V=FQQ@mail.gmail.com>
To: Jatinder Mann <jmann@microsoft.com>
Cc: Simon Sapin <simon.sapin@exyr.org>, "public-web-perf@w3.org" <public-web-perf@w3.org>, Ivan Kotenkov <kotenkov@yandex-team.ru>, "Boris Zbarsky (bzbarsky@mit.edu)" <bzbarsky@mit.edu>, www-style <www-style@w3.org>
On Wed, Nov 6, 2013 at 10:39 AM, Jatinder Mann <jmann@microsoft.com> wrote:
> On Tue, Nov 5, 2013 at 10:32 AM, Simon Sapin wrote:
>> 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.
>
> Yes, you are right that the CSS property will most likely not be resolved until a later time. As the spec is currently written, there doesn't seem to be any way to implement resource-priories:'postpone' short of not preloading any resource until CSS properties have been resolved. Not preloading any resource, including those without postpone/lazyload, is a bad design and will slow down page loads.
>
> Seems like it makes most sense to scope the CSS property to only apply to resources downloaded by a CSS rule: 'background-image', 'border-image-source', 'content', 'cursor', 'list-style-image', and '@font-face src'.

Nah, I'm fine with applying it to content resources, with the caveat
outlined above that UAs may ignore it and preload anyway during the
initial load (perhaps defined as the period up to the document's load
event being fired).

~TJ
Received on Wednesday, 6 November 2013 18:42:37 UTC

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