Closed Bug 1507842 Opened 5 years ago Closed 5 years ago

Removing src attribute from iframe should load about:blank in it

Categories

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

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

See https://html.spec.whatwg.org/multipage/iframe-embed-object.html#otherwise-steps-for-iframe-or-frame-elements step 1.

It looks like we don't even run https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes on src attr removal.  Testcase:

  <iframe src="data:text/html,A  test"></iframe>
  <div onclick="document.querySelector('iframe').removeAttribute('src');">
    Click me
  </div>

Chrome and Safari both load about:blank in this case.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #9025836 - Flags: review?(amarchesini) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/60639eb34a6d
Removing an src attribute from an iframe should load about:blank in it.  r=baku
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/deefae2125c4
Fix tab/space lint failure on a CLOSED TREE
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/14141 for changes under testing/web-platform/tests
https://hg.mozilla.org/mozilla-central/rev/60639eb34a6d
https://hg.mozilla.org/mozilla-central/rev/deefae2125c4
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Note to MDN writers' team:

I've added a note about this to the Fx65 rel notes:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/65#HTML

I don't think there is a lot of docs work to do here, but you might want to add a note about this somewhere on the <iframe> reference page.

I've added a note about this to the src information at
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#Attributes
https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement#Properties

I'm not sure if this needs a specific entry in the browser compatibility data?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: