Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Qt] FloatSize Qt Support
https://bugs.webkit.org/show_bug.cgi?id=87237

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-05-23
Reviewed by Andreas Kling.

Source/WebCore:

No new functionality. No new tests.

* Target.pri:
* platform/graphics/FloatSize.h:
(FloatSize):
* platform/graphics/qt/FloatSizeQt.cpp: Added.
(WebCore::FloatSize::FloatSize):
(WebCore::FloatSize::operator QSizeF):

Source/WebKit2:

Basic cleanup possible to new Qt support in FloatSize.

* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::updateSize):
* UIProcess/API/qt/qwebkittest.cpp:
(QWebKitTest::layoutSize):

Canonical link: https://commits.webkit.org/104970@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Allan Sandfeld Jensen authored and webkit-commit-queue committed May 23, 2012
1 parent 0256c1d commit 7fd9ee2
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2012-05-23 Allan Sandfeld Jensen <allan.jensen@nokia.com>

[Qt] FloatSize Qt Support
https://bugs.webkit.org/show_bug.cgi?id=87237

Reviewed by Andreas Kling.

No new functionality. No new tests.

* Target.pri:
* platform/graphics/FloatSize.h:
(FloatSize):
* platform/graphics/qt/FloatSizeQt.cpp: Added.
(WebCore::FloatSize::FloatSize):
(WebCore::FloatSize::operator QSizeF):

2012-05-23 Alexei Filippov <alexeif@chromium.org>

Web Inspector: Enable HeapSnapshotRealWorker in production mode.
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/Target.pri
Expand Up @@ -2862,6 +2862,7 @@ SOURCES += \
platform/graphics/qt/FontPlatformDataQt.cpp \
platform/graphics/qt/FloatPointQt.cpp \
platform/graphics/qt/FloatRectQt.cpp \
platform/graphics/qt/FloatSizeQt.cpp \
platform/graphics/qt/FractionalLayoutPointQt.cpp \
platform/graphics/qt/FractionalLayoutRectQt.cpp \
platform/graphics/qt/FractionalLayoutSizeQt.cpp \
Expand Down
11 changes: 11 additions & 0 deletions Source/WebCore/platform/graphics/FloatSize.h
Expand Up @@ -31,6 +31,12 @@
#include "IntPoint.h"
#include <wtf/MathExtras.h>

#if PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QSizeF;
QT_END_NAMESPACE
#endif

#if PLATFORM(BLACKBERRY)
namespace BlackBerry {
namespace Platform {
Expand Down Expand Up @@ -114,6 +120,11 @@ class FloatSize {
return FloatSize(m_height, m_width);
}

#if PLATFORM(QT)
FloatSize(const QSizeF&);
operator QSizeF() const;
#endif

#if PLATFORM(BLACKBERRY)
FloatSize(const BlackBerry::Platform::FloatSize&);
operator BlackBerry::Platform::FloatSize() const;
Expand Down
39 changes: 39 additions & 0 deletions Source/WebCore/platform/graphics/qt/FloatSizeQt.cpp
@@ -0,0 +1,39 @@
/*
Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/

#include "config.h"

#include "FloatSize.h"

#include <QSizeF>

namespace WebCore {

FloatSize::FloatSize(const QSizeF& size)
: m_width(size.width())
, m_height(size.height())
{
}

FloatSize::operator QSizeF() const
{
return QSizeF(width(), height());
}

} // namespace
14 changes: 14 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,17 @@
2012-05-23 Allan Sandfeld Jensen <allan.jensen@nokia.com>

[Qt] FloatSize Qt Support
https://bugs.webkit.org/show_bug.cgi?id=87237

Reviewed by Andreas Kling.

Basic cleanup possible to new Qt support in FloatSize.

* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::updateSize):
* UIProcess/API/qt/qwebkittest.cpp:
(QWebKitTest::layoutSize):

2012-04-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>

[Qt] Make the web view's url property follow the active url
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
Expand Up @@ -160,7 +160,7 @@ void QQuickWebPagePrivate::updateSize()

DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
if (drawingArea && drawingArea->layerTreeHostProxy())
drawingArea->layerTreeHostProxy()->setContentsSize(WebCore::FloatSize(contentsSize.width(), contentsSize.height()));
drawingArea->layerTreeHostProxy()->setContentsSize(contentsSize);

q->setSize(scaledSize);

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/API/qt/qwebkittest.cpp
Expand Up @@ -128,5 +128,5 @@ QVariant QWebKitTest::isScalable() const

QVariant QWebKitTest::layoutSize() const
{
return QSizeF(m_webViewPrivate->attributes.layoutSize.width(), m_webViewPrivate->attributes.layoutSize.height());
return QSizeF(m_webViewPrivate->attributes.layoutSize);
}

0 comments on commit 7fd9ee2

Please sign in to comment.