New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 591654 link

Starred by 17 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Changing <link rel="stylesheet"> media type from non-matching to matching value *sometimes* triggers an additional request

Project Member Reported by jakearchibald@chromium.org, Mar 3 2016

Issue description

http://filamentgroup.github.io/loadCSS/test/110-reducedexample.html

I can't recreate this by refreshing the page, but this seems to recreate the issue reliably:

1. Open a new tab
2. Open devtools network tab so you can see the requests
3. Navigate to http://filamentgroup.github.io/loadCSS/test/110-reducedexample.html
4. Two requests in devtools

Video of issue https://www.youtube.com/watch?v=y4ltmB5-Yp8&feature=youtu.be

This was spotted by the developers of loadCSS https://github.com/filamentgroup/loadCSS/issues/134#issuecomment-191479025
 
Components: Blink>Loader
Status: Available (was: Untriaged)
Repros on ToT.

Comment 2 by r...@opera.com, Mar 10 2016

Owner: r...@opera.com
Status: Assigned (was: Available)
It happens when changing from matching to matching or non-matching to non-matching as well. We do a LinkStyle::process() whenever media changes on link which causes a stylesheet clear + load. That shouldn't be necessary.

Notes:

1. A link rel=stylesheet still loads for non-matching media queries, even unknown media types.
2. The media type makes the stylesheet non-blocking if it doesn't match when we start loading.

If the expected behavior is that we shouldn't change blocking/non-blocking behavior of the stylesheet when changing media while loading, the fix is just to just set the media query for the media attribute, and if there is an existing stylesheet which has finished loading, do necessary stylesheet ruleset + metadata + style recalc.

Comment 3 by r...@opera.com, Mar 12 2016

Status: Started (was: Assigned)

Comment 4 by r...@opera.com, Mar 13 2016

Comment 5 by y...@yoav.ws, Apr 7 2016

Components: -Blink>CSS -Blink>Network
Owner: y...@yoav.ws
As the issue requires some cleanup of HTMLLinkElement & LinkLoader, I'll take ownership.

Comment 6 by y...@yoav.ws, Sep 8 2016

Status: Assigned (was: Started)

Comment 7 by addyo@chromium.org, Mar 29 2017

Cc: addyo@chromium.org
Labels: -Performance Performance-Loading

Sign in to add a comment