Fix <script srcset> being loaded by the preloader.
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 08:09:03 +0000 (08:09 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 08:09:03 +0000 (08:09 +0000)
commit5cdb27f8f74066a8ee705cde8c373f148a01a976
tree3d7720b314793cc151f4eb24dff562a3190026f0
parent31411b565bec8badf10b574b620e96c0ae39f7bf
Fix <script srcset> being loaded by the preloader.
https://bugs.webkit.org/show_bug.cgi?id=144675

Reviewed by Darin Adler.

Source/WebCore:

Fix HTMLPreloadScanner to make sure that srcset is only loaded
when it is present on an <img>.

Tests: http/tests/loading/preload-script-src.html
       http/tests/loading/preload-script-srcset-ignored.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):

LayoutTests:

Add preloader tests to make sure that <script src> is preloaded,
and <script srcset> is not.

* http/tests/loading/preload-script-src-expected.txt: Added.
* http/tests/loading/preload-script-src.html: Added.
* http/tests/loading/preload-script-srcset-ignored-expected.txt: Added.
* http/tests/loading/preload-script-srcset-ignored.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/loading/preload-script-src-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/preload-script-src.html [new file with mode: 0644]
LayoutTests/http/tests/loading/preload-script-srcset-ignored-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/preload-script-srcset-ignored.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLPreloadScanner.cpp