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 firstname.lastname@example.org: 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 email@example.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
Upstream PR merged
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.
You need to log in before you can comment on or make changes to this bug.