Fix preloader issue with srcdoc documents.
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 22:41:21 +0000 (22:41 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 22:41:21 +0000 (22:41 +0000)
commite59a91f30a9c80579071f150819786e77fa43f94
tree7079b6eb29dfb3fe55c4e0ec6cbba20583237f49
parent214eaf791cbd347546c51acfd588aa79cb033038
Fix preloader issue with srcdoc documents.
https://bugs.webkit.org/show_bug.cgi?id=151744

Reviewed by Ryosuke Niwa.

Source/WebCore:

Make sure that PreloadRequest is resolving URLs based on the document's
baseURL() rather than using url() as the base URL, which is not how URLs
are resolved by the parser, and fails when document->url() diverges from
the document's base URL (e.g. in the case of srcdoc based documents).

Test: fast/preloader/iframe-srcdoc.html

* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::completeURL):

LayoutTests:

Added a test that makes sure that srcdoc based subresources are properly preloaded.

* fast/preloader/iframe-srcdoc-expected.txt: Added.
* fast/preloader/iframe-srcdoc.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/preloader/iframe-srcdoc-expected.txt [new file with mode: 0644]
LayoutTests/fast/preloader/iframe-srcdoc.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLResourcePreloader.cpp