Handle meta viewport in HTMLPreloadScanner
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 22:16:27 +0000 (22:16 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 22:16:27 +0000 (22:16 +0000)
commitf31ae3a92ddf15f1a9f6d6ec1d1439e5671952ec
treebb1f66ea92293ae9f226657c3ff83a9d729c4009
parent4a2ea90b7d9c00232d1b573d62066f929ed703ef
Handle meta viewport in HTMLPreloadScanner
https://bugs.webkit.org/show_bug.cgi?id=144640

Reviewed by Dean Jackson.

Source/WebCore:

Add support for the <meta> tag to the HTMLPreloadScanner
and when the meta tag's name is viewport, get the document
to process the tag's attribute value, and set its ViewportArgument.

Tests: fast/dom/HTMLMetaElement/meta-preloader.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::tagIdFor): Added meta.
(WebCore::TokenPreloadScanner::initiatorFor): Added meta.
(WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Call document.processViewport is meta viewport encountered.
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Keep track of meta viewport tags.
(WebCore::testPreloadScannerViewportSupport): Testing function that makes sure this functionality is working.
* html/parser/HTMLPreloadScanner.h:
* testing/Internals.cpp:
(WebCore::Internals::testPreloaderSettingViewport): Calls the testing function.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Added a layout test that is simply calling an internals method
that tests the HTMLPreloadScanner.

* fast/dom/HTMLMetaElement/meta-preloader-expected.txt: Added.
* fast/dom/HTMLMetaElement/meta-preloader.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLMetaElement/meta-preloader-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLMetaElement/meta-preloader.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLPreloadScanner.cpp
Source/WebCore/html/parser/HTMLPreloadScanner.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl