Re: [ResourcePriorities] Blocking content resources on CSS properties

On Tue, Nov 5, 2013 at 10:38 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> 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.

Agreed. Browsers are *not* willing to give up their preload scanners,
which adopting the property as currently specified would require.
Content resources should be delayed with content attributes, which are
preload-friendly.

~TJ

Received on Tuesday, 5 November 2013 19:15:53 UTC