2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * Copyright (C) 2010 Joone Hur <joone@kldp.org>
4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * Copyright (C) 2011 Igalia S.L.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #include "DumpRenderTreeSupportGtk.h"
26 #include "AXObjectCache.h"
27 #include "AccessibilityObjectWrapperAtk.h"
28 #include "AnimationController.h"
29 #include "DOMWrapperWorld.h"
31 #include "EditorClientGtk.h"
33 #include "FocusController.h"
34 #include "FrameLoaderClientGtk.h"
35 #include "FrameTree.h"
36 #include "FrameView.h"
37 #include "GCController.h"
38 #include "GraphicsContext.h"
39 #include "HTMLInputElement.h"
40 #include "JSDOMWindow.h"
41 #include "JSDocument.h"
42 #include "JSElement.h"
44 #include "JSNodeList.h"
48 #include "PageGroup.h"
49 #include "PlatformString.h"
50 #include "PrintContext.h"
51 #include "RenderListItem.h"
52 #include "RenderTreeAsText.h"
53 #include "RenderView.h"
54 #include "SecurityOrigin.h"
56 #include "TextIterator.h"
57 #include "WebKitDOMRangePrivate.h"
58 #include "WorkerThread.h"
59 #include "webkitglobalsprivate.h"
60 #include "webkitwebframe.h"
61 #include "webkitwebframeprivate.h"
62 #include "webkitwebview.h"
63 #include "webkitwebviewprivate.h"
64 #include <JavaScriptCore/APICast.h>
67 #include "SVGDocumentExtensions.h"
68 #include "SVGSMILElement.h"
72 using namespace WebCore;
73 using namespace WebKit;
75 bool DumpRenderTreeSupportGtk::s_drtRun = false;
76 bool DumpRenderTreeSupportGtk::s_linksIncludedInTabChain = true;
77 bool DumpRenderTreeSupportGtk::s_selectTrailingWhitespaceEnabled = false;
79 DumpRenderTreeSupportGtk::DumpRenderTreeSupportGtk()
83 DumpRenderTreeSupportGtk::~DumpRenderTreeSupportGtk()
87 void DumpRenderTreeSupportGtk::setDumpRenderTreeModeEnabled(bool enabled)
92 bool DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()
96 void DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(bool enabled)
98 s_linksIncludedInTabChain = enabled;
101 bool DumpRenderTreeSupportGtk::linksIncludedInFocusChain()
103 return s_linksIncludedInTabChain;
106 void DumpRenderTreeSupportGtk::setSelectTrailingWhitespaceEnabled(bool enabled)
108 s_selectTrailingWhitespaceEnabled = enabled;
111 bool DumpRenderTreeSupportGtk::selectTrailingWhitespaceEnabled()
113 return s_selectTrailingWhitespaceEnabled;
116 JSValueRef DumpRenderTreeSupportGtk::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
118 JSLock lock(SilenceAssertionsOnly);
119 ExecState* exec = toJS(context);
121 return JSValueMakeUndefined(context);
122 JSValue jsValue = toJS(exec, value);
123 if (!jsValue.inherits(&JSDocument::s_info))
124 return JSValueMakeUndefined(context);
126 JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
127 Document* document = jsDocument->impl();
128 RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
129 return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
132 WebKitDOMRange* DumpRenderTreeSupportGtk::jsValueToDOMRange(JSContextRef context, JSValueRef value)
137 JSLock lock(SilenceAssertionsOnly);
138 ExecState* exec = toJS(context);
140 Range* range = toRange(toJS(exec, value));
148 * @frame: a #WebKitWebFrame
150 * Return value: child frames of @frame
152 GSList* DumpRenderTreeSupportGtk::getFrameChildren(WebKitWebFrame* frame)
154 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
156 Frame* coreFrame = core(frame);
160 GSList* children = 0;
161 for (Frame* child = coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
162 FrameLoader* loader = child->loader();
163 WebKit::FrameLoaderClient* client = static_cast<WebKit::FrameLoaderClient*>(loader->client());
165 children = g_slist_append(children, client->webFrame());
173 * @frame: a #WebKitWebFrame
175 * Return value: inner text of @frame
177 CString DumpRenderTreeSupportGtk::getInnerText(WebKitWebFrame* frame)
179 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString(""));
181 Frame* coreFrame = core(frame);
185 FrameView* view = coreFrame->view();
186 if (view && view->layoutPending())
189 Element* documentElement = coreFrame->document()->documentElement();
190 if (!documentElement)
192 return documentElement->innerText().utf8();
197 * @frame: a #WebKitWebFrame
199 * Return value: Non-recursive render tree dump of @frame
201 CString DumpRenderTreeSupportGtk::dumpRenderTree(WebKitWebFrame* frame)
203 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString(""));
205 Frame* coreFrame = core(frame);
209 FrameView* view = coreFrame->view();
211 if (view && view->layoutPending())
214 return externalRepresentation(coreFrame).utf8();
218 * counterValueForElementById:
219 * @frame: a #WebKitWebFrame
220 * @id: an element ID string
222 * Return value: The counter value of element @id in @frame
224 CString DumpRenderTreeSupportGtk::counterValueForElementById(WebKitWebFrame* frame, const char* id)
226 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
228 Frame* coreFrame = core(frame);
232 Element* coreElement = coreFrame->document()->getElementById(AtomicString(id));
236 return counterValueForElement(coreElement).utf8();
240 * numberForElementById
241 * @frame: a #WebKitWebFrame
242 * @id: an element ID string
243 * @pageWidth: width of a page
244 * @pageHeight: height of a page
246 * Return value: The number of page where the specified element will be put
248 int DumpRenderTreeSupportGtk::pageNumberForElementById(WebKitWebFrame* frame, const char* id, float pageWidth, float pageHeight)
250 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
252 Frame* coreFrame = core(frame);
256 Element* coreElement = coreFrame->document()->getElementById(AtomicString(id));
259 return PrintContext::pageNumberForElement(coreElement, FloatSize(pageWidth, pageHeight));
263 * numberOfPagesForFrame
264 * @frame: a #WebKitWebFrame
265 * @pageWidth: width of a page
266 * @pageHeight: height of a page
268 * Return value: The number of pages to be printed.
270 int DumpRenderTreeSupportGtk::numberOfPagesForFrame(WebKitWebFrame* frame, float pageWidth, float pageHeight)
272 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
274 Frame* coreFrame = core(frame);
278 return PrintContext::numberOfPages(coreFrame, FloatSize(pageWidth, pageHeight));
283 * @frame: a #WebKitWebFrame
284 * @propertyName: name of a property
285 * @pageNumber: number of a page
287 * Return value: The value of the given property name.
289 CString DumpRenderTreeSupportGtk::pageProperty(WebKitWebFrame* frame, const char* propertyName, int pageNumber)
291 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
293 Frame* coreFrame = core(frame);
297 return PrintContext::pageProperty(coreFrame, propertyName, pageNumber).utf8();
302 * @frame: a #WebKitWebFrame
303 * @pageNumber: number of a page
305 * Return value: TRUE if a page box is visible.
307 bool DumpRenderTreeSupportGtk::isPageBoxVisible(WebKitWebFrame* frame, int pageNumber)
309 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), false);
311 Frame* coreFrame = core(frame);
315 return coreFrame->document()->isPageBoxVisible(pageNumber);
319 * pageSizeAndMarginsInPixels
320 * @frame: a #WebKitWebFrame
321 * @pageNumber: number of a page
322 * @width: width of a page
323 * @height: height of a page
324 * @marginTop: top margin of a page
325 * @marginRight: right margin of a page
326 * @marginBottom: bottom margin of a page
327 * @marginLeft: left margin of a page
329 * Return value: The value of page size and margin.
331 CString DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(WebKitWebFrame* frame, int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
333 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), CString());
335 Frame* coreFrame = core(frame);
339 return PrintContext::pageSizeAndMarginsInPixels(coreFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).utf8();
344 * @frame: a #WebKitWebFrame
345 * @sourceCode: code of a user stylesheet
348 void DumpRenderTreeSupportGtk::addUserStyleSheet(WebKitWebFrame* frame, const char* sourceCode, bool allFrames)
350 g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
352 Frame* coreFrame = core(frame);
356 WebKitWebView* webView = getViewFromFrame(frame);
357 Page* page = core(webView);
358 page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, KURL(), nullptr, nullptr, allFrames ? InjectInAllFrames : InjectInTopFrameOnly);
362 * getPendingUnloadEventCount:
363 * @frame: a #WebKitWebFrame
365 * Return value: number of pending unload events
367 guint DumpRenderTreeSupportGtk::getPendingUnloadEventCount(WebKitWebFrame* frame)
369 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
371 return core(frame)->domWindow()->pendingUnloadEventListeners();
374 bool DumpRenderTreeSupportGtk::pauseAnimation(WebKitWebFrame* frame, const char* name, double time, const char* element)
377 Element* coreElement = core(frame)->document()->getElementById(AtomicString(element));
378 if (!coreElement || !coreElement->renderer())
380 return core(frame)->animation()->pauseAnimationAtTime(coreElement->renderer(), AtomicString(name), time);
383 bool DumpRenderTreeSupportGtk::pauseTransition(WebKitWebFrame* frame, const char* name, double time, const char* element)
386 Element* coreElement = core(frame)->document()->getElementById(AtomicString(element));
387 if (!coreElement || !coreElement->renderer())
389 return core(frame)->animation()->pauseTransitionAtTime(coreElement->renderer(), AtomicString(name), time);
392 bool DumpRenderTreeSupportGtk::pauseSVGAnimation(WebKitWebFrame* frame, const char* animationId, double time, const char* elementId)
396 Document* document = core(frame)->document();
397 if (!document || !document->svgExtensions())
399 Element* coreElement = document->getElementById(AtomicString(animationId));
400 if (!coreElement || !SVGSMILElement::isSMILElement(coreElement))
402 return document->accessSVGExtensions()->sampleAnimationAtTime(elementId, static_cast<SVGSMILElement*>(coreElement), time);
408 CString DumpRenderTreeSupportGtk::markerTextForListItem(WebKitWebFrame* frame, JSContextRef context, JSValueRef nodeObject)
410 JSC::ExecState* exec = toJS(context);
411 Element* element = toElement(toJS(exec, nodeObject));
415 return WebCore::markerTextForListItem(element).utf8();
418 unsigned int DumpRenderTreeSupportGtk::numberOfActiveAnimations(WebKitWebFrame* frame)
420 Frame* coreFrame = core(frame);
424 return coreFrame->animation()->numberOfActiveAnimations(coreFrame->document());
427 void DumpRenderTreeSupportGtk::suspendAnimations(WebKitWebFrame* frame)
429 Frame* coreFrame = core(frame);
433 return coreFrame->animation()->suspendAnimations();
436 void DumpRenderTreeSupportGtk::resumeAnimations(WebKitWebFrame* frame)
438 Frame* coreFrame = core(frame);
442 return coreFrame->animation()->resumeAnimations();
445 void DumpRenderTreeSupportGtk::clearMainFrameName(WebKitWebFrame* frame)
447 g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
449 core(frame)->tree()->clearName();
452 AtkObject* DumpRenderTreeSupportGtk::getRootAccessibleElement(WebKitWebFrame* frame)
454 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0);
456 #if HAVE(ACCESSIBILITY)
457 if (!AXObjectCache::accessibilityEnabled())
458 AXObjectCache::enableAccessibility();
460 WebKitWebFramePrivate* priv = frame->priv;
461 if (!priv->coreFrame || !priv->coreFrame->document())
464 AtkObject* wrapper = priv->coreFrame->document()->axObjectCache()->rootObject()->wrapper();
474 AtkObject* DumpRenderTreeSupportGtk::getFocusedAccessibleElement(WebKitWebFrame* frame)
476 #if HAVE(ACCESSIBILITY)
477 AtkObject* wrapper = getRootAccessibleElement(frame);
481 return webkit_accessible_get_focused_element(WEBKIT_ACCESSIBLE(wrapper));
487 void DumpRenderTreeSupportGtk::executeCoreCommandByName(WebKitWebView* webView, const gchar* name, const gchar* value)
489 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
490 g_return_if_fail(name);
491 g_return_if_fail(value);
493 core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value);
496 bool DumpRenderTreeSupportGtk::isCommandEnabled(WebKitWebView* webView, const gchar* name)
498 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
499 g_return_val_if_fail(name, FALSE);
501 return core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
504 void DumpRenderTreeSupportGtk::setComposition(WebKitWebView* webView, const char* text, int start, int length)
506 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
507 g_return_if_fail(text);
509 Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
513 Editor* editor = frame->editor();
514 if (!editor || (!editor->canEdit() && !editor->hasComposition()))
517 String compositionString = String::fromUTF8(text);
518 Vector<CompositionUnderline> underlines;
519 underlines.append(CompositionUnderline(0, compositionString.length(), Color(0, 0, 0), false));
520 editor->setComposition(compositionString, underlines, start, start + length);
523 bool DumpRenderTreeSupportGtk::hasComposition(WebKitWebView* webView)
525 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
526 Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
529 Editor* editor = frame->editor();
533 return editor->hasComposition();
536 bool DumpRenderTreeSupportGtk::compositionRange(WebKitWebView* webView, int* start, int* length)
538 g_return_val_if_fail(start && length, false);
539 *start = *length = 0;
541 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
542 Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
546 Editor* editor = frame->editor();
547 if (!editor || !editor->hasComposition())
550 *start = editor->compositionStart();
551 *length = editor->compositionEnd() - *start;
555 void DumpRenderTreeSupportGtk::confirmComposition(WebKitWebView* webView, const char* text)
557 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
559 Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
563 Editor* editor = frame->editor();
567 if (!editor->hasComposition()) {
568 editor->insertText(String::fromUTF8(text), 0);
572 editor->confirmComposition(String::fromUTF8(text));
575 editor->confirmComposition();
578 bool DumpRenderTreeSupportGtk::firstRectForCharacterRange(WebKitWebView* webView, int location, int length, cairo_rectangle_int_t* rect)
580 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
581 g_return_val_if_fail(rect, false);
583 if ((location + length < location) && (location + length))
586 Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
590 Editor* editor = frame->editor();
594 Element* selectionRoot = frame->selection()->rootEditableElement();
595 Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement();
596 RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, location, length);
600 *rect = editor->firstRectForRange(range.get());
604 bool DumpRenderTreeSupportGtk::selectedRange(WebKitWebView* webView, int* start, int* length)
606 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
607 g_return_val_if_fail(start && length, false);
609 Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
613 RefPtr<Range> range = frame->selection()->toNormalizedRange().get();
617 Element* selectionRoot = frame->selection()->rootEditableElement();
618 Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement();
620 RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset());
621 ASSERT(testRange->startContainer() == scope);
622 *start = TextIterator::rangeLength(testRange.get());
625 testRange->setEnd(range->endContainer(), range->endOffset(), ec);
626 ASSERT(testRange->startContainer() == scope);
627 *length = TextIterator::rangeLength(testRange.get());
632 void DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(WebKitWebView* webView, bool enabled)
634 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
635 g_return_if_fail(webView);
637 WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient());
638 client->setSmartInsertDeleteEnabled(enabled);
641 void DumpRenderTreeSupportGtk::whiteListAccessFromOrigin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains)
643 SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
646 void DumpRenderTreeSupportGtk::resetOriginAccessWhiteLists()
648 SecurityOrigin::resetOriginAccessWhitelists();
651 void DumpRenderTreeSupportGtk::gcCollectJavascriptObjects()
653 gcController().garbageCollectNow();
656 void DumpRenderTreeSupportGtk::gcCollectJavascriptObjectsOnAlternateThread(bool waitUntilDone)
658 gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone);
661 unsigned long DumpRenderTreeSupportGtk::gcCountJavascriptObjects()
663 JSC::JSLock lock(JSC::SilenceAssertionsOnly);
664 return JSDOMWindow::commonJSGlobalData()->heap.objectCount();
667 void DumpRenderTreeSupportGtk::layoutFrame(WebKitWebFrame* frame)
669 Frame* coreFrame = core(frame);
673 FrameView* view = coreFrame->view();
680 // For testing fast/viewport.
681 void DumpRenderTreeSupportGtk::dumpConfigurationForViewport(WebKitWebView* webView, gint deviceDPI, gint deviceWidth, gint deviceHeight, gint availableWidth, gint availableHeight)
683 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
685 ViewportArguments arguments = webView->priv->corePage->mainFrame()->document()->viewportArguments();
686 ViewportAttributes attrs = computeViewportAttributes(arguments, /* default layout width for non-mobile pages */ 980, deviceWidth, deviceHeight, deviceDPI, IntSize(availableWidth, availableHeight));
688 fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f] and userScalable %f\n", attrs.layoutSize.width(), attrs.layoutSize.height(), attrs.initialScale, attrs.minimumScale, attrs.maximumScale, attrs.userScalable);
691 void DumpRenderTreeSupportGtk::clearOpener(WebKitWebFrame* frame)
693 Frame* coreFrame = core(frame);
695 coreFrame->loader()->setOpener(0);
698 unsigned int DumpRenderTreeSupportGtk::workerThreadCount()
701 return WebCore::WorkerThread::workerThreadCount();
707 bool DumpRenderTreeSupportGtk::webkitWebFrameSelectionHasSpellingMarker(WebKitWebFrame *frame, gint from, gint length)
709 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), FALSE);
711 return core(frame)->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
714 bool DumpRenderTreeSupportGtk::findString(WebKitWebView* webView, const gchar* targetString, WebKitFindOptions findOptions)
716 return core(webView)->findString(String::fromUTF8(targetString), findOptions);
719 double DumpRenderTreeSupportGtk::defaultMinimumTimerInterval()
721 return Settings::defaultMinDOMTimerInterval();
724 void DumpRenderTreeSupportGtk::setMinimumTimerInterval(WebKitWebView* webView, double interval)
726 core(webView)->settings()->setMinDOMTimerInterval(interval);
729 static void modifyAccessibilityValue(AtkObject* axObject, bool increment)
731 if (!axObject || !WEBKIT_IS_ACCESSIBLE(axObject))
734 AccessibilityObject* coreObject = webkit_accessible_get_accessibility_object(WEBKIT_ACCESSIBLE(axObject));
739 coreObject->increment();
741 coreObject->decrement();
744 void DumpRenderTreeSupportGtk::incrementAccessibilityValue(AtkObject* axObject)
746 modifyAccessibilityValue(axObject, true);
749 void DumpRenderTreeSupportGtk::decrementAccessibilityValue(AtkObject* axObject)
751 modifyAccessibilityValue(axObject, false);
754 void DumpRenderTreeSupportGtk::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
756 JSC::ExecState* exec = toJS(context);
757 Element* element = toElement(toJS(exec, nodeObject));
760 HTMLInputElement* inputElement = element->toInputElement();
764 inputElement->setAutofilled(autofilled);
767 void DumpRenderTreeSupportGtk::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value)
769 JSC::ExecState* exec = toJS(context);
770 Element* element = toElement(toJS(exec, nodeObject));
773 HTMLInputElement* inputElement = element->toInputElement();
777 size_t bufferSize = JSStringGetMaximumUTF8CStringSize(value);
778 GOwnPtr<gchar> valueBuffer(static_cast<gchar*>(g_malloc(bufferSize)));
779 JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize);
780 inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
783 void DumpRenderTreeSupportGtk::rectangleForSelection(WebKitWebFrame* frame, cairo_rectangle_int_t* rectangle)
785 Frame* coreFrame = core(frame);
789 IntRect bounds = enclosingIntRect(coreFrame->selection()->bounds());
790 rectangle->x = bounds.x();
791 rectangle->y = bounds.y();
792 rectangle->width = bounds.width();
793 rectangle->height = bounds.height();
796 bool DumpRenderTreeSupportGtk::shouldClose(WebKitWebFrame* frame)
798 Frame* coreFrame = core(frame);
801 return coreFrame->loader()->shouldClose();
804 void DumpRenderTreeSupportGtk::scalePageBy(WebKitWebView* webView, float scaleFactor, float x, float y)
806 core(webView)->setPageScaleFactor(scaleFactor, IntPoint(x, y));