summaryrefslogtreecommitdiffstats
path: root/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-05 14:27:46 +0000
committerSteve Block <steveblock@google.com>2010-02-15 10:49:50 +0000
commit5e2bc6953fe6923165b8a5d7679939693a1d58d6 (patch)
tree6ccb8c24bc2bf5e8f413e6cfae250b729b426631 /WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
parent4a00f4fccc3cb7e9996749a05631f5d7b9de756e (diff)
downloadexternal_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.zip
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.gz
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.bz2
Merge webkit.org at r54340 : Initial merge by git
Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44
Diffstat (limited to 'WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm')
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index 5f020fa..67c8c91 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -176,6 +176,18 @@ void LayoutTestController::keepWebHistory()
}
}
+int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels)
+{
+ RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id));
+ NSString *idNS = (NSString *)idCF.get();
+
+ DOMElement *element = [[mainFrame DOMDocument] getElementById:idNS];
+ if (!element)
+ return -1;
+
+ return [mainFrame pageNumberForElement:element:pageWidthInPixels:pageHeightInPixels];
+}
+
size_t LayoutTestController::webHistoryItemCount()
{
return [[[WebHistory optionalSharedHistory] allItems] count];