The maximum subframe count check should not be skipped for empty URLs.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jul 2019 21:57:39 +0000 (21:57 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Jul 2019 21:57:39 +0000 (21:57 +0000)
commitc253dd0238a0e3ee8a870baaeb3686279596c399
tree0a025c55d00ed3dab62a0b23e3f839841ed1e0f7
parentea80e635b84917bba1f79f75197e8497b99f200d
The maximum subframe count check should not be skipped for empty URLs.
https://bugs.webkit.org/show_bug.cgi?id=200032

Patch by Sergei Glazunov <glazunov@google.com> on 2019-07-29
Reviewed by Ryosuke Niwa.

Source/WebCore:

Move the check closer to the actual frame creation code in `loadSubframe`.

Test: fast/dom/connected-subframe-counter-overflow.html

* dom/Document.cpp:
(WebCore::Document::prepareForDestruction): Assert that all child frames have been detached.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::canLoad const):
(WebCore::HTMLFrameElementBase::canLoadURL const):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::canAddSubframe const): Deleted.
* html/HTMLFrameOwnerElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::canLoadURL const):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):

LayoutTests:

* fast/dom/connected-subframe-counter-overflow-expected.txt: Added.
* fast/dom/connected-subframe-counter-overflow.html: Added.
* fast/frames/lots-of-iframes-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/connected-subframe-counter-overflow-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/connected-subframe-counter-overflow.html [new file with mode: 0644]
LayoutTests/fast/frames/lots-of-iframes-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/html/HTMLFrameElementBase.cpp
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.h
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/loader/SubframeLoader.cpp