Skip to content


Browse files Browse the repository at this point in the history
srcdoc iframes fail to clear when srcdoc attribute removed

Reviewed by Darin Adler.

The bug was caused by the superfluous null string check in HTMLFrameElementBase::parseAttribute in the case of srcdoc being a null string.
When both src and srcdoc are both, we should navigate to about:blank instead.

* LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/srcdoc-attribute-reset-expected.txt:
* Source/WebCore/html/HTMLFrameElementBase.cpp:

Canonical link:
  • Loading branch information
rniwa committed Aug 1, 2022
1 parent 219983b commit e540252
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
@@ -1,6 +1,4 @@

Harness Error (TIMEOUT), message = null

TIMEOUT Verify that the frame reloads with empty body after we remove srcdoc. Test timed out
PASS Verify that the frame reloads with empty body after we remove srcdoc.

8 changes: 3 additions & 5 deletions Source/WebCore/html/HTMLFrameElementBase.cpp
Expand Up @@ -110,11 +110,9 @@ void HTMLFrameElementBase::openURL(LockHistory lockHistory, LockBackForwardList
void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const AtomString& value)
if (name == srcdocAttr) {
if (value.isNull()) {
const AtomString& srcValue = attributeWithoutSynchronization(srcAttr);
if (!srcValue.isNull())
} else
if (value.isNull())
} else if (name == srcAttr && !hasAttributeWithoutSynchronization(srcdocAttr))
Expand Down

0 comments on commit e540252

Please sign in to comment.