diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebCore/testing/Internals.cpp | |
parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebCore/testing/Internals.cpp')
-rw-r--r-- | Source/WebCore/testing/Internals.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp index c014adc74..04cfecd0d 100644 --- a/Source/WebCore/testing/Internals.cpp +++ b/Source/WebCore/testing/Internals.cpp @@ -966,14 +966,21 @@ unsigned Internals::touchEventHandlerCount(Document* document, ExceptionCode& ec } PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding, - unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode& ec) const + unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode& ec) const { if (!document || !document->frame() || !document->frame()->view()) { ec = INVALID_ACCESS_ERR; return 0; } + HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active; + if (ignoreClipping) + hitType |= HitTestRequest::IgnoreClipping; + if (allowShadowContent) + hitType |= HitTestRequest::AllowShadowContent; + if (allowChildFrameContent) + hitType |= HitTestRequest::AllowChildFrameContent; - return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent); + return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, hitType); } void Internals::emitInspectorDidBeginFrame() @@ -1170,6 +1177,34 @@ PassRefPtr<DOMStringList> Internals::iconURLs(Document* document) const return stringList.release(); } +int Internals::numberOfPages(float pageWidth, float pageHeight) +{ + if (!frame()) + return -1; + + return PrintContext::numberOfPages(frame(), FloatSize(pageWidth, pageHeight)); +} + +String Internals::pageProperty(String propertyName, int pageNumber, ExceptionCode& ec) const +{ + if (!frame()) { + ec = INVALID_ACCESS_ERR; + return String(); + } + + return PrintContext::pageProperty(frame(), propertyName.utf8().data(), pageNumber); +} + +String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionCode& ec) const +{ + if (!frame()) { + ec = INVALID_ACCESS_ERR; + return String(); + } + + return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); +} + #if ENABLE(FULLSCREEN_API) void Internals::webkitWillEnterFullScreenForElement(Document* document, Element* element) { |