Closed
Bug 1067345
Opened 10 years ago
Closed 9 years ago
Speculative parser doesn't handle <picture>/srcset based resources
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: yoav, Assigned: johns)
References
Details
Attachments
(7 files, 6 obsolete files)
2.20 KB,
patch
|
Details | Diff | Splinter Review | |
7.43 KB,
patch
|
Details | Diff | Splinter Review | |
16.20 KB,
patch
|
Details | Diff | Splinter Review | |
7.47 KB,
patch
|
Details | Diff | Splinter Review | |
10.84 KB,
patch
|
Details | Diff | Splinter Review | |
34.53 KB,
patch
|
Details | Diff | Splinter Review | |
13.94 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36 Steps to reproduce: Looking at the code that handles speculative loads at http://mxr.mozilla.org/mozilla-central/source/parser/html/nsHtml5TreeBuilderCppSupplement.h#103 picture based resources don't seem to be handled. Furthermore, it seems that <img> based resources will just preload the 'src' attribute regardless of the presence of the srcset attribute or a <picture> parent. So, it seems like the problem is two-fold: src resources should not be preloaded for such resources, and srcset/<picture> based resources should be.
Comment 1•10 years ago
|
||
At the very least we should not pref <picture> on by default as long as we preload <img src> as a child of <picture> or with an srcset attribute without actually checking if the <img src> will end up being used. But indeed, it would be even better to gather the relevant <picture>/srcset bits in full in the preloader and ship them to the main thread for evaluation so that the right URL can be preloaded.
Updated•10 years ago
|
Blocks: srcset-prefon
Assignee | ||
Comment 2•10 years ago
|
||
So the quirk fix is to not take action on <img src> with a <picture> parent or <srcset> attr, one of which is necessary to trigger non-simple-src rules. To extend early image opening off thread to the full <picture> implementation, the ResponsiveImageSelector class is already designed to be runnable off thread, but there are some scenarios where e.g. viewport width isn't available yet that would need to return a indeterminate response -- we would resume loading in that case at element creation on the dom thread.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jschoenick
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•10 years ago
|
||
Assignee | ||
Comment 4•10 years ago
|
||
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Assignee | ||
Comment 7•10 years ago
|
||
Assignee | ||
Comment 8•10 years ago
|
||
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8514662 -
Attachment is obsolete: true
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8514663 -
Attachment is obsolete: true
Assignee | ||
Comment 11•10 years ago
|
||
Attachment #8514664 -
Attachment is obsolete: true
Assignee | ||
Comment 12•10 years ago
|
||
Attachment #8514665 -
Attachment is obsolete: true
Assignee | ||
Comment 13•10 years ago
|
||
Attachment #8514666 -
Attachment is obsolete: true
Assignee | ||
Comment 14•10 years ago
|
||
Attachment #8514667 -
Attachment is obsolete: true
Assignee | ||
Comment 15•10 years ago
|
||
Comment 16•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/afeff812b5dd https://hg.mozilla.org/integration/mozilla-inbound/rev/4cc6d580cda6 https://hg.mozilla.org/integration/mozilla-inbound/rev/7884f103f1e7 https://hg.mozilla.org/integration/mozilla-inbound/rev/406045c02f89 https://hg.mozilla.org/integration/mozilla-inbound/rev/c1b3abf6bb98 https://hg.mozilla.org/integration/mozilla-inbound/rev/b64c085b06e1 https://hg.mozilla.org/integration/mozilla-inbound/rev/9c39680606e8
Comment 17•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/afeff812b5dd https://hg.mozilla.org/mozilla-central/rev/4cc6d580cda6 https://hg.mozilla.org/mozilla-central/rev/7884f103f1e7 https://hg.mozilla.org/mozilla-central/rev/406045c02f89 https://hg.mozilla.org/mozilla-central/rev/c1b3abf6bb98 https://hg.mozilla.org/mozilla-central/rev/b64c085b06e1 https://hg.mozilla.org/mozilla-central/rev/9c39680606e8
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox38:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Depends on: 1140769
Comment 18•7 years ago
|
||
Who reviewed these patches? I don't see reviews from anyone who's a peer for the HTML parser here, or reviews from anyone at all. These added a ton of bloat to the nsHtml5SpeculativeLoad struct...
Flags: needinfo?(josh)
Comment 19•7 years ago
|
||
Apparently nobody. I thought I had checked that, but I guess it got lost in the shuffle when I inherited the responsive image work.
Flags: needinfo?(josh)
Comment 20•7 years ago
|
||
Alright, thanks. I'll see what Henri ends up saying in bug 1382020 about how this code should actually work...
You need to log in
before you can comment on or make changes to this bug.
Description
•