[Qt] Rename content* to contents* in QQuickWebPage.

https://bugs.webkit.org/show_bug.cgi?id=77629

Reviewed by Kenneth Rohde Christiansen.

* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::QQuickWebPagePrivate):
(QQuickWebPagePrivate::paintToCurrentGLContext):
(QQuickWebPage::setContentsSize):
(QQuickWebPage::contentsSize):
(QQuickWebPage::setContentsScale):
(QQuickWebPage::contentsScale):
(QQuickWebPage::transformToItem):
(QQuickWebPagePrivate::updateSize):
* UIProcess/API/qt/qquickwebpage_p.h:
* UIProcess/API/qt/qquickwebpage_p_p.h:
(QQuickWebPagePrivate):
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::didChangeContentsSize):
(QQuickWebViewPrivate::updateVisibleContentRectAndScale):
(QQuickWebViewPrivate::PostTransitionState::apply):
* UIProcess/API/qt/qwebviewportinfo.cpp:
(QWebViewportInfo::contentsSize):
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView::scrollRequest):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::setItemRectVisible):
(WebKit::QtViewportInteractionEngine::event):
(WebKit::QtViewportInteractionEngine::wheelEvent):
(WebKit::QtViewportInteractionEngine::pagePositionRequest):
(WebKit::QtViewportInteractionEngine::computePosRangeForItemAtScale):
(WebKit::QtViewportInteractionEngine::applyConstraints):
(WebKit::QtViewportInteractionEngine::currentCSSScale):
(WebKit::QtViewportInteractionEngine::pinchGestureStarted):
(WebKit::QtViewportInteractionEngine::scaleContent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 50587b13
2012-02-02 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
[Qt] Rename content* to contents* in QQuickWebPage.
https://bugs.webkit.org/show_bug.cgi?id=77629
Reviewed by Kenneth Rohde Christiansen.
* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::QQuickWebPagePrivate):
(QQuickWebPagePrivate::paintToCurrentGLContext):
(QQuickWebPage::setContentsSize):
(QQuickWebPage::contentsSize):
(QQuickWebPage::setContentsScale):
(QQuickWebPage::contentsScale):
(QQuickWebPage::transformToItem):
(QQuickWebPagePrivate::updateSize):
* UIProcess/API/qt/qquickwebpage_p.h:
* UIProcess/API/qt/qquickwebpage_p_p.h:
(QQuickWebPagePrivate):
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::didChangeContentsSize):
(QQuickWebViewPrivate::updateVisibleContentRectAndScale):
(QQuickWebViewPrivate::PostTransitionState::apply):
* UIProcess/API/qt/qwebviewportinfo.cpp:
(QWebViewportInfo::contentsSize):
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView::scrollRequest):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::setItemRectVisible):
(WebKit::QtViewportInteractionEngine::event):
(WebKit::QtViewportInteractionEngine::wheelEvent):
(WebKit::QtViewportInteractionEngine::pagePositionRequest):
(WebKit::QtViewportInteractionEngine::computePosRangeForItemAtScale):
(WebKit::QtViewportInteractionEngine::applyConstraints):
(WebKit::QtViewportInteractionEngine::currentCSSScale):
(WebKit::QtViewportInteractionEngine::pinchGestureStarted):
(WebKit::QtViewportInteractionEngine::scaleContent):
2012-02-03 Simon Hausmann <simon.hausmann@nokia.com>
[Qt] Fix build when cross-compiling
......@@ -69,7 +69,7 @@ QQuickWebPagePrivate::QQuickWebPagePrivate(QQuickWebPage* q, QQuickWebView* view
, sgUpdateQueue(q)
, paintingIsInitialized(false)
, m_paintNode(0)
, contentScale(1)
, contentsScale(1)
, useTraditionalDesktopBehaviour(false)
{
}
......@@ -112,7 +112,7 @@ void QQuickWebPagePrivate::paintToCurrentGLContext()
return;
QTransform transform = q->itemTransform(0, 0);
transform.scale(contentScale, contentScale);
transform.scale(contentsScale, contentsScale);
float opacity = computeEffectiveOpacity(q);
QRectF clipRect = q->parentItem()->mapRectToScene(q->parentItem()->boundingRect());
......@@ -235,32 +235,32 @@ QtWebPageEventHandler* QQuickWebPage::eventHandler() const
return d->eventHandler.data();
}
void QQuickWebPage::setContentSize(const QSizeF& size)
void QQuickWebPage::setContentsSize(const QSizeF& size)
{
if (size.isEmpty() || d->contentSize == size)
if (size.isEmpty() || d->contentsSize == size)
return;
d->contentSize = size;
d->contentsSize = size;
d->updateSize();
d->setDrawingAreaSize(d->contentSize.toSize());
d->setDrawingAreaSize(d->contentsSize.toSize());
}
const QSizeF& QQuickWebPage::contentSize() const
const QSizeF& QQuickWebPage::contentsSize() const
{
return d->contentSize;
return d->contentsSize;
}
void QQuickWebPage::setContentScale(qreal scale)
void QQuickWebPage::setContentsScale(qreal scale)
{
ASSERT(scale > 0);
d->contentScale = scale;
d->contentsScale = scale;
d->updateSize();
}
qreal QQuickWebPage::contentScale() const
qreal QQuickWebPage::contentsScale() const
{
ASSERT(d->contentScale > 0);
return d->contentScale;
ASSERT(d->contentsScale > 0);
return d->contentsScale;
}
QTransform QQuickWebPage::transformFromItem() const
......@@ -270,12 +270,12 @@ QTransform QQuickWebPage::transformFromItem() const
QTransform QQuickWebPage::transformToItem() const
{
return QTransform(d->contentScale, 0, 0, 0, d->contentScale, 0, x(), y(), 1);
return QTransform(d->contentsScale, 0, 0, 0, d->contentsScale, 0, x(), y(), 1);
}
void QQuickWebPagePrivate::updateSize()
{
QSizeF scaledSize = contentSize * contentScale;
QSizeF scaledSize = contentsSize * contentsScale;
q->setSize(scaledSize);
}
......
......@@ -41,10 +41,10 @@ public:
QQuickWebPage(QQuickWebView* view = 0);
virtual ~QQuickWebPage();
void setContentSize(const QSizeF& size);
const QSizeF& contentSize() const;
void setContentScale(qreal);
qreal contentScale() const;
void setContentsSize(const QSizeF& size);
const QSizeF& contentsSize() const;
void setContentsScale(qreal);
qreal contentsScale() const;
QTransform transformFromItem() const;
QTransform transformToItem() const;
......
......@@ -54,8 +54,8 @@ public:
bool paintingIsInitialized;
QSGNode* m_paintNode;
QSizeF contentSize;
qreal contentScale;
QSizeF contentsSize;
qreal contentsScale;
bool useTraditionalDesktopBehaviour;
};
......
......@@ -231,7 +231,7 @@ void QQuickWebViewPrivate::didChangeContentsSize(const QSize& newSize)
return;
}
pageView->setContentSize(newSize);
pageView->setContentsSize(newSize);
q->m_experimental->viewportInfo()->didUpdateContentsSize();
}
......@@ -308,7 +308,7 @@ void QQuickWebViewPrivate::_q_updateVisibleContentRectAndScale()
Q_Q(QQuickWebView);
const QRectF visibleRectInCSSCoordinates = q->mapRectToWebContent(q->boundingRect()).intersected(pageView->boundingRect());
float scale = pageView->contentScale();
float scale = pageView->contentsScale();
QRect alignedVisibleContentRect = visibleRectInCSSCoordinates.toAlignedRect();
drawingArea->setVisibleContentsRectAndScale(alignedVisibleContentRect, scale);
......@@ -377,7 +377,7 @@ void QQuickWebViewPrivate::PostTransitionState::apply()
p->interactionEngine->pagePositionRequest(position);
if (contentsSize.isValid()) {
p->pageView->setContentSize(contentsSize);
p->pageView->setContentsSize(contentsSize);
p->q_ptr->experimental()->viewportInfo()->didUpdateContentsSize();
}
......
......@@ -38,7 +38,7 @@ QWebViewportInfo::~QWebViewportInfo()
QSize QWebViewportInfo::contentsSize() const
{
return QSize(m_webViewPrivate->pageView->contentSize().toSize());
return QSize(m_webViewPrivate->pageView->contentsSize().toSize());
}
QVariant QWebViewportInfo::currentScale() const
......
......@@ -328,7 +328,7 @@ void tst_QQuickWebView::scrollRequest()
// COMPARE with the position requested in the html
// Use qRound as that is also used when calculating the position
// in WebKit.
int y = -qRound(50 * webView()->page()->contentScale());
int y = -qRound(50 * webView()->page()->contentsScale());
QVERIFY(webView()->page()->pos().y() == y);
}
......
......@@ -180,7 +180,7 @@ void QtViewportInteractionEngine::setItemRectVisible(const QRectF& itemRect)
qreal itemScale = m_viewport->width() / itemRect.width();
m_content->setContentScale(itemScale);
m_content->setContentsScale(itemScale);
// We need to animate the content but the position represents the viewport hence we need to invert the position here.
// To animate the position together with the scale we multiply the position with the current scale;
......@@ -244,7 +244,7 @@ bool QtViewportInteractionEngine::event(QEvent* event)
QScrollPrepareEvent* prepareEvent = static_cast<QScrollPrepareEvent*>(event);
const QRectF viewportRect = m_viewport->boundingRect();
const QRectF contentRect = m_viewport->mapRectFromItem(m_content, m_content->boundingRect());
const QRectF posRange = computePosRangeForItemAtScale(m_content->contentScale());
const QRectF posRange = computePosRangeForItemAtScale(m_content->contentsScale());
prepareEvent->setContentPosRange(posRange);
prepareEvent->setViewportSize(viewportRect.size());
......@@ -303,7 +303,7 @@ void QtViewportInteractionEngine::wheelEvent(QWheelEvent* ev)
else
newPos.ry() += delta;
QRectF endPosRange = computePosRangeForItemAtScale(m_content->contentScale());
QRectF endPosRange = computePosRangeForItemAtScale(m_content->contentsScale());
m_content->setPos(-boundPosition(endPosRange.topLeft(), newPos, endPosRange.bottomRight()));
emit visibleContentRectAndScaleChanged();
......@@ -315,7 +315,7 @@ void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition
if (m_suspendCount)
return;
qreal endItemScale = m_content->contentScale(); // Stay at same scale.
qreal endItemScale = m_content->contentsScale(); // Stay at same scale.
QRectF endPosRange = computePosRangeForItemAtScale(endItemScale);
QPointF endPosition = boundPosition(endPosRange.topLeft(), pagePosition * endItemScale, endPosRange.bottomRight());
......@@ -327,7 +327,7 @@ void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition
QRectF QtViewportInteractionEngine::computePosRangeForItemAtScale(qreal itemScale) const
{
const QSizeF contentItemSize = m_content->contentSize() * itemScale;
const QSizeF contentItemSize = m_content->contentsSize() * itemScale;
const QSizeF viewportItemSize = m_viewport->boundingRect().size();
const qreal horizontalRange = contentItemSize.width() - viewportItemSize.width();
......@@ -449,7 +449,7 @@ void QtViewportInteractionEngine::applyConstraints(const Constraints& constraint
if (!m_hadUserInteraction) {
qreal initialScale = innerBoundedCSSScale(m_constraints.initialScale);
m_content->setContentScale(itemScaleFromCSS(initialScale));
m_content->setContentsScale(itemScaleFromCSS(initialScale));
}
// If the web app changes successively changes the viewport on purpose
......@@ -459,7 +459,7 @@ void QtViewportInteractionEngine::applyConstraints(const Constraints& constraint
qreal QtViewportInteractionEngine::currentCSSScale()
{
return cssScaleFromItem(m_content->contentScale());
return cssScaleFromItem(m_content->contentsScale());
}
bool QtViewportInteractionEngine::scrollAnimationActive() const
......@@ -532,7 +532,7 @@ void QtViewportInteractionEngine::pinchGestureStarted(const QPointF& pinchCenter
m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
m_lastPinchCenterInViewportCoordinates = pinchCenterInViewportCoordinates;
m_pinchStartScale = m_content->contentScale();
m_pinchStartScale = m_content->contentsScale();
// Reset the tiling look-ahead vector so that tiles all around the viewport will be requested on pinch-end.
emit viewportTrajectoryVectorChanged(QPointF());
......@@ -586,7 +586,7 @@ void QtViewportInteractionEngine::itemSizeChanged()
void QtViewportInteractionEngine::scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale)
{
QPointF oldPinchCenterOnViewport = m_viewport->mapFromWebContent(centerInCSSCoordinates);
m_content->setContentScale(itemScaleFromCSS(cssScale));
m_content->setContentsScale(itemScaleFromCSS(cssScale));
QPointF newPinchCenterOnViewport = m_viewport->mapFromWebContent(centerInCSSCoordinates);
m_content->setPos(m_content->pos() - (newPinchCenterOnViewport - oldPinchCenterOnViewport));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment