Diff
Modified: branches/subpixellayout/Source/WebKit/qt/Api/qwebelement.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/Api/qwebelement.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/Api/qwebelement.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -547,11 +547,11 @@
\sa tagName()
*/
-QRectF QWebElement::geometry() const
+QRect QWebElement::geometry() const
{
if (!m_element)
return QRect();
- return FloatRect(m_element->getRect());
+ return pixelSnappedIntRect(m_element->getRect());
}
/*!
@@ -1498,7 +1498,7 @@
view->updateLayoutAndStyleIfNeededRecursive();
- IntRect rect = enclosingIntRect(e->getRect());
+ IntRect rect = pixelSnappedIntRect(e->getRect());
if (rect.size().isEmpty())
return;
Modified: branches/subpixellayout/Source/WebKit/qt/Api/qwebelement.h (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/Api/qwebelement.h 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/Api/qwebelement.h 2012-02-09 22:17:41 UTC (rev 107290)
@@ -84,7 +84,7 @@
bool hasFocus() const;
void setFocus();
- QRectF geometry() const;
+ QRect geometry() const;
QString tagName() const;
QString prefix() const;
Modified: branches/subpixellayout/Source/WebKit/qt/Api/qwebframe.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/Api/qwebframe.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/Api/qwebframe.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -133,7 +133,7 @@
if (!frame || !frame->document() || !frame->view() || !frame->eventHandler())
return false;
- QPoint contentsPos = frame->view()->windowToContents(IntPoint(pos));
+ QPoint contentsPos = frame->view()->windowToContents(pos);
Node* node = frame->document()->elementFromPoint(contentsPos.x(), contentsPos.y());
if (!node)
return false;
Modified: branches/subpixellayout/Source/WebKit/qt/Api/qwebpage.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/Api/qwebpage.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/Api/qwebpage.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -1420,7 +1420,7 @@
// We can't access absoluteCaretBounds() while the view needs to layout.
return QVariant();
}
- return QVariant(view->contentsToWindow(enclosingIntRect(frame->selection()->absoluteCaretBounds())));
+ return QVariant(view->contentsToWindow(pixelSnappedIntRect(frame->selection()->absoluteCaretBounds())));
}
case Qt::ImFont: {
if (renderTextControl) {
@@ -2448,7 +2448,7 @@
QSize QWebPage::viewportSize() const
{
if (d->mainFrame && d->mainFrame.data()->d->frame->view())
- return expandedIntSize(d->mainFrame.data()->d->frame->view()->frameRect().size());
+ return pixelSnappedIntRect(d->mainFrame.data()->d->frame->view()->frameRect()).size();
return d->viewportSize;
}
@@ -2472,7 +2472,7 @@
QWebFrame *frame = mainFrame();
if (frame->d->frame && frame->d->frame->view()) {
WebCore::FrameView* view = frame->d->frame->view();
- view->resize(QSize(size));
+ view->resize(size);
view->adjustViewSize();
}
}
@@ -2580,10 +2580,8 @@
QWebFrame* frame = d->mainFrame.data();
if (frame) {
WebCore::FrameView* view = frame->d->frame->view();
- if (view && view->useFixedLayout()) {
- const FloatSize& size = d->mainFrame.data()->d->frame->view()->fixedLayoutSize();
- return QSize(size.width(), size.height());
- }
+ if (view && view->useFixedLayout())
+ return d->mainFrame.data()->d->frame->view()->fixedLayoutSize();
}
return d->fixedLayoutSize;
@@ -2622,7 +2620,7 @@
if (size.isValid()) {
view->setUseFixedLayout(true);
- view->setFixedLayoutSize(d->fixedLayoutSize);
+ view->setFixedLayoutSize(size);
} else if (view->useFixedLayout())
view->setUseFixedLayout(false);
Modified: branches/subpixellayout/Source/WebKit/qt/declarative/qdeclarativewebview.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/declarative/qdeclarativewebview.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/declarative/qdeclarativewebview.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -1019,7 +1019,7 @@
if (maxHeight <= 0)
maxHeight = INT_MAX;
while (!element.parent().isNull() && element.geometry().width() <= maxWidth && element.geometry().height() <= maxHeight) {
- hitRect = element.geometry().toRect();
+ hitRect = element.geometry();
element = element.parent();
}
return hitRect;
Modified: branches/subpixellayout/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -2702,7 +2702,7 @@
// open the popup by clicking. check if focus is on the popup
const QWebElement webCombo = view.page()->mainFrame()->documentElement().findFirst(QLatin1String("select[name=select]"));
- QTest::mouseClick(&view, Qt::LeftButton, 0, webCombo.geometry().center().toPoint());
+ QTest::mouseClick(&view, Qt::LeftButton, 0, webCombo.geometry().center());
QComboBox* combo = view.findChild<QComboBox*>();
QVERIFY(combo != 0);
@@ -2732,7 +2732,7 @@
bool autoSipEnabled = qApp->autoSipEnabled();
qApp->setAutoSipEnabled(false);
const QWebElement inputElement = view.page()->mainFrame()->documentElement().findFirst(QLatin1String("input[type=text]"));
- QTest::mouseClick(&view, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&view, Qt::LeftButton, 0, inputElement.geometry().center());
m_inputFieldsTestView = &view;
view.installEventFilter( this );
QTest::qWait(delay);
@@ -2750,7 +2750,7 @@
frame->setHtml(html);
page.setViewportSize(QSize(200, 0)); //no height so link is not visible
const QWebElement linkElement = frame->documentElement().findFirst(QLatin1String("a#link"));
- QWebHitTestResult result = frame->hitTestContent(linkElement.geometry().center().toPoint());
+ QWebHitTestResult result = frame->hitTestContent(linkElement.geometry().center());
QCOMPARE(result.linkText(), QString("link text"));
QWebElement link = result.linkElement();
QCOMPARE(link.attribute("target"), QString("_foo"));
@@ -3126,11 +3126,11 @@
QWebElement fooAnchor = frame->findFirstElement("a[id=foo]");
frame->scrollToAnchor("foo");
- QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().toRect().top());
+ QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().top());
frame->scrollToAnchor("bar");
frame->scrollToAnchor("foo");
- QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().toRect().top());
+ QCOMPARE(frame->scrollPosition().y(), fooAnchor.geometry().top());
frame->scrollToAnchor("top");
QCOMPARE(frame->scrollPosition().y(), 0);
Modified: branches/subpixellayout/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -1646,7 +1646,7 @@
EventSpy viewEventSpy(container);
QWebElementCollection inputs = page->mainFrame()->documentElement().findAll("input");
- QPoint textInputCenter = inputs.at(0).geometry().center().toPoint();
+ QPoint textInputCenter = inputs.at(0).geometry().center();
clickOnPage(page, textInputCenter);
@@ -1869,7 +1869,7 @@
//END - Tests for Selection when the Editor is not in Composition mode
//ImhHiddenText
- QPoint passwordInputCenter = inputs.at(1).geometry().center().toPoint();
+ QPoint passwordInputCenter = inputs.at(1).geometry().center();
clickOnPage(page, passwordInputCenter);
QVERIFY(inputMethodEnabled(view));
@@ -1882,7 +1882,7 @@
viewEventSpy.clear();
QWebElement para = page->mainFrame()->findFirstElement("p");
- clickOnPage(page, para.geometry().center().toPoint());
+ clickOnPage(page, para.geometry().center());
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
@@ -2214,7 +2214,7 @@
"<div id='btnDiv' _onclick_='i=document.getElementById("input5"); i.focus();'>abc</div>"\
"</body></html>");
QWebElement inputElement = page->mainFrame()->findFirstElement("div");
- clickOnPage(page, inputElement.geometry().center().toPoint());
+ clickOnPage(page, inputElement.geometry().center());
QVERIFY(!viewEventSpy.contains(QEvent::RequestSoftwareInputPanel));
@@ -3102,7 +3102,7 @@
QVERIFY(!view.page()->selectedText().isEmpty());
QWebElement link = view.page()->mainFrame()->findFirstElement("a");
- QPoint pos(link.geometry().center().toPoint());
+ QPoint pos(link.geometry().center());
QContextMenuEvent event(QContextMenuEvent::Mouse, pos);
view.page()->swallowContextMenuEvent(&event);
view.page()->updatePositionDependentActions(pos);
@@ -3125,7 +3125,7 @@
view.setHtml("<input type=\"text\">");
QWebElement link = view.page()->mainFrame()->findFirstElement("input");
- QPoint pos(link.geometry().center().toPoint());
+ QPoint pos(link.geometry().center());
QContextMenuEvent event(QContextMenuEvent::Mouse, pos);
view.page()->swallowContextMenuEvent(&event);
view.page()->updatePositionDependentActions(pos);
Modified: branches/subpixellayout/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp (107289 => 107290)
--- branches/subpixellayout/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp 2012-02-09 21:59:07 UTC (rev 107289)
+++ branches/subpixellayout/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp 2012-02-09 22:17:41 UTC (rev 107290)
@@ -245,61 +245,61 @@
// 'text' type
QWebElement inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=text]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
QVERIFY(webView.inputMethodHints() == Qt::ImhNone);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'password' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhHiddenText);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'tel' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=tel]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhDialableCharactersOnly);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'number' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=number]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhDigitsOnly);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'email' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=email]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhEmailCharactersOnly);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'url' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=url]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhUrlCharactersOnly);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'password' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhHiddenText);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'text' type
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=text]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
QVERIFY(webView.inputMethodHints() == Qt::ImhNone);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'password' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhHiddenText);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
// 'text area' field
inputElement = mainFrame->documentElement().findFirst(QLatin1String("textarea"));
- QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center().toPoint());
+ QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center());
QVERIFY(webView.inputMethodHints() == Qt::ImhNone);
QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled));
}