Closed Bug 1801664 Opened 2 years ago Closed 2 years ago

Ship make <embed> and <object> behave more like <iframe>

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: farre, Assigned: farre)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

No description provided.

This is about flipping:

  • browser.opaqueResponseBlocking.syntheticBrowsingContext
  • browser.opaqueResponseBlocking.syntheticBrowsingContext.filter

to true, enabling it for beta and release. Besides bug 1785227 we have no reported regressions. We have bug 1778503 tracking the worsened a11y story, but nothing for DevTools.

To be sure I thought I'd just make sure to gather feedback from a11y and DevTools before shipping, so that we're all ok with this.

Attached a file that shows how DevTools now sees that a cross-origin image embedded in either <object> or <embed> is loaded in a synthetic document.

Assignee: nobody → afarre
Status: NEW → ASSIGNED
Flags: needinfo?(jteh)
Flags: needinfo?(jdescottes)

If I understand correctly, using embed/object to embed an image is likely to be on very old sites. Is there any good reason to prefer embed/object over img? If they cared about a11y in the first place, does it seem reasonable to think they would have used img alt in the first place?

If all of the above seems reasonable, I think we're good here for a11y. We should maybe fix the a11y bug one day, but it seems very low priority.

Flags: needinfo?(jteh)

Thanks for the heads up!

On DevTools side, we should make sure to hide the markup generated for the object/embed when devtools.inspector.showAllAnonymousContent is set to false. Web developers probably don't expect to see the underlying elements.

I will file a bug for DevTools, but I don't think it has to block your work, it's a nice to have.

Flags: needinfo?(jdescottes)

Attached a file that shows how DevTools now sees that a cross-origin image embedded in either <object> or <embed> is loaded in a synthetic document.

FWIW, I think the screenshot actually shows how DevTools see a same origin image. It seems that fail to inspect cross origin objects and embeds, regardless of their content (image, document, etc...). Filed Bug 1801814

(In reply to James Teh [:Jamie] from comment #2)

If I understand correctly, using embed/object to embed an image is likely to be on very old sites. Is there any good reason to prefer embed/object over img? If they cared about a11y in the first place, does it seem reasonable to think they would have used img alt in the first place?

If all of the above seems reasonable, I think we're good here for a11y. We should maybe fix the a11y bug one day, but it seems very low priority.

The lore of using images in <object> and <embed> says that they were once used to try out new image formats. Or at least the lore for <object>, since <object> could then embed an image, and if the user agent didn't implement the image format, then it could use the fallback content of <object>. This is not how image formats are developed today, and I have no source for this piece of lore, but my point is that there is really no reason to do this. And in the end, the way forward is to recommend <iframe>/<img> instead of <object>/<embed>.

And yes, if you care about a11y, then you use img alt.(In reply to Julian Descottes [:jdescottes] from comment #4)

FWIW, I think the screenshot actually shows how DevTools see a same origin image. It seems that fail to inspect cross origin objects and embeds, regardless of their content (image, document, etc...). Filed Bug 1801814

Yes, exactly so.

Thank you both for the quick feedback!

Severity: -- → S3

This flips the prefs:

  • browser.opaqueResponseBlocking.syntheticBrowsingContext
  • browser.opaqueResponseBlocking.syntheticBrowsingContext.filter

that makes <object> and <embed> behave more like <iframe> when it
comes to image loading. This landed on Nightly through bug 1595491,
but with this we let it ride to Beta and then Release.

Pushed by afarre@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fe1f1bd756f3
Make <object> and <embed> behave like <iframe>. r=peterv
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Blocks: 1875466
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: