Add viewport meta tag support to QtWebKit API layer
authorjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jun 2010 20:02:22 +0000 (20:02 +0000)
committerjesus@webkit.org <jesus@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jun 2010 20:02:22 +0000 (20:02 +0000)
commit640b6b2f98151904921f752da6e81289779dcd64
tree3586aac1c6847038926e17c02d8dbe01a4cdc0b1
parent97cbe00f7d3ec7f6a2f05eb9080a1fc3a0ea26b6
Add viewport meta tag support to QtWebKit API layer

[Qt] QtWebKit does not support viewport meta tag
https://bugs.webkit.org/show_bug.cgi?id=39902

Patch by Jesus Sanchez-Palencia  <jesus@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org> on 2010-06-01
Reviewed by Simon Hausmann.

WebCore:

Add windowRect() to page client.

* platform/qt/QWebPageClient.h:

WebKit/qt:

This implements didReceiveViewportArguments in our ChromeClientQt
which is hooked up with QWebPage::viewportChangeRequested().
This signal does not affect the current default behavior.
The documentation of the signal explains how to make use of this new feature.

* Api/qwebframe_p.h:
(QWebFramePrivate::QWebFramePrivate):
Store information about whether the page has been laid out or not.
* Api/qwebpage.cpp:
(QWebPage::viewportChangeRequested):
* Api/qwebpage_p.h:
Added class QtViewportHintsPrivate.
* Api/qwebpage.h:
(QWebPage::setPreferredContentsSize):
Improved documentation and now only layout if the page had already
passed layout phase.
Added class QWebPage::ViewportHints.
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::windowRect):
Modified to work as intended by the DOM, for both QWebView
and QGraphicsWebView.
(WebCore::ChromeClientQt::didReceiveViewportArguments):
Emits the signal QWebPage::viewportChangeRequested.
* WebCoreSupport/ChromeClientQt.h:
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
(WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
Update information about whether the page has been laid out or not.
If the page has been laid out we ignore any further viewport meta data.
* WebCoreSupport/PageClientQt.cpp:
(WebCore::PageClientQWidget::windowRect):
(WebCore::PageClientQGraphicsWidget::windowRect):
(WebCore::PageClientQGraphicsWidget::graphicsItemVisibleRect):
* WebCoreSupport/PageClientQt.h:
The PageClient is now responsible for providing the right window rect.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
WebCore/ChangeLog
WebCore/platform/qt/QWebPageClient.h
WebKit/qt/Api/qwebframe_p.h
WebKit/qt/Api/qwebpage.cpp
WebKit/qt/Api/qwebpage.h
WebKit/qt/Api/qwebpage_p.h
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
WebKit/qt/WebCoreSupport/ChromeClientQt.h
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKit/qt/WebCoreSupport/PageClientQt.cpp
WebKit/qt/WebCoreSupport/PageClientQt.h