https://bugs.webkit.org/show_bug.cgi?id=80886
Reviewed by Ryosuke Niwa.
Patch by Antonio Gomes <agomes@rim.com>
Source/WebCore:
Add Internals::nodesFromRect implementation to unify
the codepath for testing Document::nodesFromRect in a
cross port way.
No new tests, since we are improving here the infra-structure
for testing a specific method.
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:
Source/WebKit/gtk:
Removed DRTSupportGtk::nodesFromRect support, since
it can work in the cross-port way through the
Internals interface.
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
(DumpRenderTreeSupportGtk):
Source/WebKit/mac:
Removed mac specific support for nodesFromRect for testing purposes only,
since it can work in a cross-port way through the Internals interface.
* WebKit.order:
* WebView/WebView.mm:
* WebView/WebViewPrivate.h:
Source/WebKit/qt:
Removed DRTSupportQt::nodesFromRect support, since
it can work in the cross-port way through the
Internals interface.
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
* WebCoreSupport/DumpRenderTreeSupportQt.h:
Tools:
This clean up allows to remove port specific bits of each
DRT implementation that supports testing Document::nodesFromRect,
in favor of making use of the 'Internals' interface to test it.
This makes its code conveniently more expansible and cleaner.
Also removed stubs from Win and EFL, Wn and BlackBerry DRTs.
* DumpRenderTree/LayoutTestController.cpp:
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
(LayoutTestController):
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
* DumpRenderTree/qt/LayoutTestControllerQt.h:
(LayoutTestController):
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
LayoutTests:
Adjust nodesFromRect tests to use Internals
instead of LayoutTestController interface.
* fast/dom/resources/nodesFromRect.js:
(check):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110594
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-12 Antonio Gomes <agomes@rim.com>
+
+ Convert nodesFromRect tests to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=80886
+
+ Reviewed by Ryosuke Niwa.
+
+ Adjust nodesFromRect tests to use Internals
+ instead of LayoutTestController interface.
+
+ * fast/dom/resources/nodesFromRect.js:
+ (check):
+
2012-03-13 Philip Rogers <pdr@google.com>
Fix the use of stale text fragments
function check(x, y, topPadding, rightPadding, bottomPadding, leftPadding, list, doc)
{
- if (!window.layoutTestController)
+ if (!window.internals)
return;
if (!doc)
doc = document;
- var nodes = layoutTestController.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */);
+ var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */);
if (!nodes)
return;
+2012-03-12 Antonio Gomes <agomes@rim.com>
+
+ Convert nodesFromRect tests to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=80886
+
+ Reviewed by Ryosuke Niwa.
+
+ Add Internals::nodesFromRect implementation to unify
+ the codepath for testing Document::nodesFromRect in a
+ cross port way.
+
+ No new tests, since we are improving here the infra-structure
+ for testing a specific method.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::nodesFromRect):
+ (WebCore):
+ * testing/Internals.h:
+ (Internals):
+ * testing/Internals.idl:
+
2012-03-13 Philip Rogers <pdr@google.com>
Fix the use of stale text fragments
return document->touchEventHandlerCount();
}
+PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding,
+ unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, ExceptionCode& ec) const
+{
+ if (!document || !document->frame() || !document->frame()->view()) {
+ ec = INVALID_ACCESS_ERR;
+ return 0;
+ }
+
+ return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping);
+}
+
}
#define Internals_h
#include "FrameDestructionObserver.h"
+#include "NodeList.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
unsigned wheelEventHandlerCount(Document*, ExceptionCode&);
unsigned touchEventHandlerCount(Document*, ExceptionCode&);
+ PassRefPtr<NodeList> nodesFromRect(Document*, int x, int y, unsigned topPadding, unsigned rightPadding,
+ unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, ExceptionCode&) const;
+
static const char* internalsId;
InternalSettings* settings() const { return m_settings.get(); }
unsigned long wheelEventHandlerCount(in Document document) raises (DOMException);
unsigned long touchEventHandlerCount(in Document document) raises (DOMException);
+ NodeList nodesFromRect(in Document document, in long x, in long y,
+ in unsigned long topPadding, in unsigned long rightPadding, in unsigned long bottomPadding, in unsigned long leftPadding,
+ in boolean ignoreClipping) raises (DOMException);
+
readonly attribute InternalSettings settings;
};
}
+2012-03-12 Antonio Gomes <agomes@rim.com>
+
+ Convert nodesFromRect tests to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=80886
+
+ Reviewed by Ryosuke Niwa.
+
+ Removed DRTSupportGtk::nodesFromRect support, since
+ it can work in the cross-port way through the
+ Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+ (DumpRenderTreeSupportGtk):
+
2012-03-07 Kangil Han <kangil.han@samsung.com>
[DRT] Remove PlainTextController implementations.
return s_selectTrailingWhitespaceEnabled;
}
-JSValueRef DumpRenderTreeSupportGtk::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- JSLock lock(SilenceAssertionsOnly);
- ExecState* exec = toJS(context);
- if (!value)
- return JSValueMakeUndefined(context);
- JSValue jsValue = toJS(exec, value);
- if (!jsValue.inherits(&JSDocument::s_info))
- return JSValueMakeUndefined(context);
-
- JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
- Document* document = jsDocument->impl();
- RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
- return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
-}
-
/**
* getFrameChildren:
* @frame: a #WebKitWebFrame
static void setSelectTrailingWhitespaceEnabled(bool);
static bool selectTrailingWhitespaceEnabled();
- static JSValueRef nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
static void dumpConfigurationForViewport(WebKitWebView* webView, gint deviceDPI, gint deviceWidth, gint deviceHeight, gint availableWidth, gint availableHeight);
static void clearOpener(WebKitWebFrame*);
+2012-03-12 Antonio Gomes <agomes@rim.com>
+
+ Convert nodesFromRect tests to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=80886
+
+ Reviewed by Ryosuke Niwa.
+
+ Removed mac specific support for nodesFromRect for testing purposes only,
+ since it can work in a cross-port way through the Internals interface.
+
+ * WebKit.order:
+ * WebView/WebView.mm:
+ * WebView/WebViewPrivate.h:
+
2012-03-13 Anders Carlsson <andersca@apple.com>
Remove a nonexistent WebUIDelegate method from WebUIDelegatePrivate.h
__ZN15WebChromeClient15closeWindowSoonEv
-[WebView(WebIBActions) stopLoading:]
-[WebView(WebPrivate) _closeWindow]
--[WebView(WebViewPrivateNodesFromRect) _nodesFromRect:forDocument:x:y:top:right:bottom:left:ignoreClipping:]
__ZN20WebFrameLoaderClient38dispatchDecidePolicyForNewWindowActionEMN7WebCore13PolicyCheckerEFvNS0_12PolicyActionEERKNS0_16NavigationActionERKNS0_15ResourceRequestEN3WTF10PassRefPtrINS0_9FormStateEEERKNSB_6StringE
-[WebDefaultPolicyDelegate webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:]
__ZN20WebFrameLoaderClient18dispatchCreatePageERKN7WebCore16NavigationActionE
@end
-@implementation WebView (WebViewPrivateNodesFromRect)
-
-- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping
-{
- JSLock lock(SilenceAssertionsOnly);
- ExecState* exec = toJS(context);
- if (!value)
- return JSValueMakeUndefined(context);
- JSValue jsValue = toJS(exec, value);
- if (!jsValue.inherits(&JSDocument::s_info))
- return JSValueMakeUndefined(context);
- JSDocument* jsDocument = static_cast<JSDocument*>(asObject(jsValue));
- Document* document = jsDocument->impl();
- RefPtr<NodeList> nodes = document->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
- return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get()));
-}
-
-@end
-
void WebInstallMemoryPressureHandler(void)
{
memoryPressureHandler().install();
- (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
@end
-@interface WebView (WebViewPrivateNodesFromRect)
-- (JSValueRef)_nodesFromRect:(JSContextRef)context forDocument:(JSValueRef)value x:(int)x y:(int)y top:(unsigned)top right:(unsigned)right bottom:(unsigned)bottom left:(unsigned)left ignoreClipping:(BOOL)ignoreClipping;
-@end
-
@interface NSObject (WebViewFrameLoadDelegatePrivate)
- (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;
+2012-03-12 Antonio Gomes <agomes@rim.com>
+
+ Convert nodesFromRect tests to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=80886
+
+ Reviewed by Ryosuke Niwa.
+
+ Removed DRTSupportQt::nodesFromRect support, since
+ it can work in the cross-port way through the
+ Internals interface.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
2012-03-09 Jon Lee <jonlee@apple.com>
Rename NotificationPresenter to NotificationClient
#endif
}
-QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- QVariantList res;
- WebCore::Element* webElement = document.m_element;
- if (!webElement)
- return res;
-
- Document* doc = webElement->document();
- if (!doc)
- return res;
- RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping);
- for (unsigned i = 0; i < nodes->length(); i++) {
- // QWebElement will be null if the Node is not an HTML Element
- if (nodes->item(i)->isHTMLElement())
- res << QVariant::fromValue(QWebElement(nodes->item(i)));
- else
- res << QVariant::fromValue(QDRTNode(nodes->item(i)));
- }
- return res;
-}
-
void DumpRenderTreeSupportQt::setDefersLoading(QWebPage* page, bool flag)
{
Page* corePage = QWebPagePrivate::core(page);
static void scalePageBy(QWebFrame*, float scale, const QPoint& origin);
- static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
static QString responseMimeType(QWebFrame*);
static void clearOpener(QWebFrame*);
static void addURLToRedirect(const QString& origin, const QString& destination);
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVClientRectList@1@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z
?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVRange@1@@Z
+ ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNodeList@1@@Z
?toRange@WebCore@@YAPAVRange@1@VJSValue@JSC@@@Z
?updateLayoutIgnorePendingStylesheets@Document@WebCore@@QAEXXZ
?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
?view@Document@WebCore@@QBEPAVFrameView@2@XZ
?willDetachPage@FrameDestructionObserver@WebCore@@UAEXXZ
+ ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N@Z
_ZN7WebCore22RuntimeEnabledFeatures31isMultipleShadowSubtreesEnabledE;
_ZN7WebCore22RuntimeEnabledFeatures32setMultipleShadowSubtreesEnabledEb;
_ZN7WebCore22RuntimeEnabledFeatures18isShadowDOMEnabledE;
+_ZNK7WebCore8Document13nodesFromRectEiijjjjb;
+_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE;
local:
_Z*;
cti*;
+2012-03-12 Antonio Gomes <agomes@rim.com>
+
+ Convert nodesFromRect tests to use Internals interface
+ https://bugs.webkit.org/show_bug.cgi?id=80886
+
+ Reviewed by Ryosuke Niwa.
+
+ This clean up allows to remove port specific bits of each
+ DRT implementation that supports testing Document::nodesFromRect,
+ in favor of making use of the 'Internals' interface to test it.
+
+ This makes its code conveniently more expansible and cleaner.
+
+ Also removed stubs from Win and EFL DRTs.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController):
+ * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+
2012-03-13 Ojan Vafai <ojan@chromium.org>
Rebaselining for a new port doesn't work right with multiple fallback ports
return controller->computedStyleIncludingVisitedInfo(context, arguments[0]);
}
-static JSValueRef nodesFromRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
- if (argumentCount != 8)
- return JSValueMakeUndefined(context);
-
- int x = JSValueToNumber(context, arguments[1], NULL);
- int y = JSValueToNumber(context, arguments[2], NULL);
- int top = static_cast<unsigned>(JSValueToNumber(context, arguments[3], NULL));
- int right = static_cast<unsigned>(JSValueToNumber(context, arguments[4], NULL));
- int bottom = static_cast<unsigned>(JSValueToNumber(context, arguments[5], NULL));
- int left = static_cast<unsigned>(JSValueToNumber(context, arguments[6], NULL));
- bool ignoreClipping = JSValueToBoolean(context, arguments[7]);
-
- // Has mac implementation.
- LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- return controller->nodesFromRect(context, arguments[0], x, y, top, right, bottom, left, ignoreClipping);
-}
-
static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
{ "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "nodesFromRect", nodesFromRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "disallowIncreaseForApplicationCacheQuota", disallowIncreaseForApplicationCacheQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
bool isCommandEnabled(JSStringRef name);
void keepWebHistory();
JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
- JSValueRef nodesFromRect(JSContextRef, JSValueRef, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
void notifyDone();
int numberOfPages(float pageWidthInPixels, float pageHeightInPixels);
int numberOfPendingGeolocationPermissionRequests();
return mainFrame->editor()->selectionStartHasMarkerFor(WebCore::DocumentMarker::Spelling, from, length);
}
-JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- notImplemented();
- return JSValueMakeUndefined(context);
-}
-
void LayoutTestController::setSerializeHTTPLoads(bool)
{
// FIXME: Implement if needed for https://bugs.webkit.org/show_bug.cgi?id=50758.
return JSValueMakeUndefined(context);
}
-JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef, int, int, unsigned, unsigned, unsigned, unsigned, bool)
-{
- notImplemented();
- return JSValueMakeUndefined(context);
-}
-
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
notImplemented();
return JSValueMakeUndefined(context);
}
-JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- return DumpRenderTreeSupportGtk::nodesFromRect(context, value, x, y, top, right, bottom, left, ignoreClipping);
-}
-
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
// FIXME: implement
return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value];
}
-JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- return [[mainFrame webView] _nodesFromRect:context forDocument:value x:x y:y top:top right:right bottom:bottom left:left ignoreClipping:ignoreClipping];
-}
-
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText]));
return false;
}
-QVariantList LayoutTestController::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- return DumpRenderTreeSupportQt::nodesFromRect(document, x, y, top, right, bottom, left, ignoreClipping);
-}
-
void LayoutTestController::addURLToRedirect(const QString& origin, const QString& destination)
{
DumpRenderTreeSupportQt::addURLToRedirect(origin, destination);
void abortModal() {}
bool hasSpellingMarker(int from, int length);
- QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
-
void addURLToRedirect(const QString& origin, const QString& destination);
/*
return JSValueMakeUndefined(context);
}
-JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- // FIXME: Implement this.
- return JSValueMakeUndefined(context);
-}
-
JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
{
COMPtr<IWebFramePrivate> framePrivate(Query, frame);
return 0;
}
-JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
-{
- // FIXME: Implement this.
- return 0;
-}
-
void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
{
}