summaryrefslogtreecommitdiffstats
path: root/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
diff options
context:
space:
mode:
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];