Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: webkit/glue/webkit_glue.cc

Issue 338056: Add layoutTestController.counterValueForElementById (Closed)
Patch Set: style fix Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webkit_glue.h ('k') | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkit_glue.cc
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index 63bc486ae7b192e7c32a8de74a9c6f5ed49ceb21..eee852ab1f48e08da0518f6a5f5c3b7beae71c7e 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -138,6 +138,20 @@ std::wstring DumpRenderer(WebFrame* web_frame) {
return StringToStdWString(frameText);
}
+bool CounterValueForElementById(WebFrame* web_frame, const std::string& id,
+ std::wstring* counter_value) {
+ WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(web_frame);
+ WebCore::Frame* frame = webFrameImpl->frame();
+
+ WebCore::Element* element =
+ frame->document()->getElementById(WebCore::AtomicString(id.c_str()));
+ if (!element)
+ return false;
+ WebCore::String counterValue = WebCore::counterValueForElement(element);
+ *counter_value = StringToStdWString(counterValue);
+ return true;
+}
+
std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) {
WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(web_frame);
WebCore::IntSize offset = webFrameImpl->frameview()->scrollOffset();
« no previous file with comments | « webkit/glue/webkit_glue.h ('k') | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698