Closed Bug 1718781 Opened 4 years ago Closed 2 months ago

When href is missing from a preload link it ignores imagesrcset

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 90
defect

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: derekmj74, Assigned: firefox)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:90.0) Gecko/20100101 Firefox/90.0

Steps to reproduce:

I've shortened the image names but apart from that I used this HTML:

<link rel="preload" imagesrcset="small.jpg 100w, medium.jpg 500w, large.jpg 1000w" imagesizes="100vw" as="image">

Actual results:

The image did not preload.

Expected results:

I think this line "One or both of the href or imagesrcset attributes must be present." from https://html.spec.whatwg.org/multipage/semantics.html#the-link-element means the href can be absent and the preloading will still work. I tested in Chrome and Edge and it works there.

In Firefox I have to use an empty href i.e. href="", which the spec disallows if I'm reading it right.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Blocks: rel=preload
Severity: -- → S3
Flags: needinfo?(bugs)
Priority: -- → P3

This might be a rather simple bug to fix.

Severity: S3 → --
Flags: needinfo?(smaug)
Priority: P3 → --

Yeah..perhaps Document::ResolvePreloadImage needs to be tweaked? Still an S3 I believe

Severity: -- → S3
Duplicate of this bug: 2020155
Assignee: nobody → firefox
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

I noticed D285549 is still a WIP. I've been working on this too, and my patch also covers the speculative parser path (nsHtml5TreeBuilderCppSupplement.h), which handles preloads during initial HTML parsing. Happy to collaborate, or have both reviewed together.

https://phabricator.services.mozilla.com/D285588

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/58482 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Upstream PR merged by moz-wptsync-bot
Attachment #9549129 - Attachment is obsolete: true
QA Whiteboard: [qa-triage-done-c151/b150]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: