- Revision
- 182821
- Author
- bfulg...@apple.com
- Date
- 2015-04-14 16:48:00 -0700 (Tue, 14 Apr 2015)
Log Message
Correct layering violation in DumpRenderTree Build
https://bugs.webkit.org/show_bug.cgi?id=143732
Reviewed by Simon Fraser.
Source/WebCore:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
the internal WebCore objects needed to implement this function.
(WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
* testing/js/WebCoreTestSupport.h:
Tools:
Correct a layering violation in DumpRenderTree by calling functions on the
WebCoreTestSupport library, rather than attempting to work with WebCore
types directly.
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController monitorWheelEvents]): Call methods on WebCoreTestSupport, rather
than WebCore itself.,
(-[EventSendingController callAfterScrollingCompletes:]): Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (182820 => 182821)
--- trunk/Source/WebCore/ChangeLog 2015-04-14 23:47:01 UTC (rev 182820)
+++ trunk/Source/WebCore/ChangeLog 2015-04-14 23:48:00 UTC (rev 182821)
@@ -1,3 +1,16 @@
+2015-04-14 Brent Fulgham <bfulg...@apple.com>
+
+ Correct layering violation in DumpRenderTree Build
+ https://bugs.webkit.org/show_bug.cgi?id=143732
+
+ Reviewed by Simon Fraser.
+
+ * testing/js/WebCoreTestSupport.cpp:
+ (WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
+ the internal WebCore objects needed to implement this function.
+ (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
+ * testing/js/WebCoreTestSupport.h:
+
2015-04-14 Brady Eidson <beid...@apple.com>
Make sure media element loads hit content filter extensions.
Modified: trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp (182820 => 182821)
--- trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp 2015-04-14 23:47:01 UTC (rev 182820)
+++ trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp 2015-04-14 23:48:00 UTC (rev 182821)
@@ -31,7 +31,10 @@
#include "Internals.h"
#include "JSDocument.h"
#include "JSInternals.h"
+#include "MainFrame.h"
+#include "WheelEventTestTrigger.h"
#include <_javascript_Core/APICast.h>
+#include <_javascript_Core/JSValueRef.h>
#include <_javascript_Core/Profile.h>
#include <interpreter/CallFrame.h>
#include <runtime/IdentifierInlines.h>
@@ -62,4 +65,20 @@
InternalSettings::from(page)->resetToConsistentState();
}
+void monitorWheelEvents(WebCore::Frame& frame)
+{
+ frame.mainFrame().ensureTestTrigger();
}
+
+void setTestCallbackAndStartNotificationTimer(WebCore::Frame& frame, JSContextRef context, JSObjectRef jsCallbackFunction)
+{
+ WheelEventTestTrigger* trigger = frame.mainFrame().ensureTestTrigger();
+ JSValueProtect(context, jsCallbackFunction);
+
+ trigger->setTestCallbackAndStartNotificationTimer([=](void) {
+ JSObjectCallAsFunction(context, jsCallbackFunction, nullptr, 0, nullptr, nullptr);
+ JSValueUnprotect(context, jsCallbackFunction);
+ });
+}
+
+}
Modified: trunk/Source/WebCore/testing/js/WebCoreTestSupport.h (182820 => 182821)
--- trunk/Source/WebCore/testing/js/WebCoreTestSupport.h 2015-04-14 23:47:01 UTC (rev 182820)
+++ trunk/Source/WebCore/testing/js/WebCoreTestSupport.h 2015-04-14 23:48:00 UTC (rev 182821)
@@ -27,6 +27,7 @@
#define WebCoreTestSupport_h
typedef const struct OpaqueJSContext* JSContextRef;
+typedef struct OpaqueJSValue* JSObjectRef;
#if PLATFORM(COCOA)
#define TEST_SUPPORT_EXPORT WTF_EXPORT_PRIVATE
@@ -34,10 +35,16 @@
#define TEST_SUPPORT_EXPORT
#endif
+namespace WebCore {
+class Frame;
+}
+
namespace WebCoreTestSupport {
void injectInternalsObject(JSContextRef) TEST_SUPPORT_EXPORT;
void resetInternalsObject(JSContextRef) TEST_SUPPORT_EXPORT;
+void monitorWheelEvents(WebCore::Frame&) TEST_SUPPORT_EXPORT;
+void setTestCallbackAndStartNotificationTimer(WebCore::Frame&, JSContextRef, JSObjectRef) TEST_SUPPORT_EXPORT;
} // namespace WebCore
Modified: trunk/Tools/ChangeLog (182820 => 182821)
--- trunk/Tools/ChangeLog 2015-04-14 23:47:01 UTC (rev 182820)
+++ trunk/Tools/ChangeLog 2015-04-14 23:48:00 UTC (rev 182821)
@@ -1,3 +1,19 @@
+2015-04-14 Brent Fulgham <bfulg...@apple.com>
+
+ Correct layering violation in DumpRenderTree Build
+ https://bugs.webkit.org/show_bug.cgi?id=143732
+
+ Reviewed by Simon Fraser.
+
+ Correct a layering violation in DumpRenderTree by calling functions on the
+ WebCoreTestSupport library, rather than attempting to work with WebCore
+ types directly.
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController monitorWheelEvents]): Call methods on WebCoreTestSupport, rather
+ than WebCore itself.,
+ (-[EventSendingController callAfterScrollingCompletes:]): Ditto.
+
2015-04-14 Benjamin Poulain <benja...@webkit.org>
Add a conservative DFA minimizer for the content extension matcher
Modified: trunk/Tools/DumpRenderTree/mac/EventSendingController.mm (182820 => 182821)
--- trunk/Tools/DumpRenderTree/mac/EventSendingController.mm 2015-04-14 23:47:01 UTC (rev 182820)
+++ trunk/Tools/DumpRenderTree/mac/EventSendingController.mm 2015-04-14 23:48:00 UTC (rev 182821)
@@ -35,6 +35,7 @@
#import "DumpRenderTree.h"
#import "DumpRenderTreeDraggingInfo.h"
#import "DumpRenderTreeFileDraggingSource.h"
+#import "WebCoreTestSupport.h"
#import <WebKit/DOMPrivate.h>
#import <WebKit/WebKit.h>
#import <WebKit/WebViewPrivate.h>
@@ -42,10 +43,6 @@
#if !PLATFORM(IOS)
#import <Carbon/Carbon.h> // for GetCurrentEventTime()
-#import <_javascript_Core/JSRetainPtr.h>
-#import <WebCore/MainFrame.h>
-#import <WebCore/Page.h>
-#import <WebCore/WheelEventTestTrigger.h>
#endif
#if PLATFORM(IOS)
@@ -1267,8 +1264,8 @@
WebCore::Frame* frame = [[mainFrame webView] _mainCoreFrame];
if (!frame)
return;
-
- frame->mainFrame().ensureTestTrigger();
+
+ WebCoreTestSupport::monitorWheelEvents(*frame);
#endif
}
@@ -1283,14 +1280,8 @@
if (!frame)
return;
- WebCore::WheelEventTestTrigger* trigger = frame->mainFrame().ensureTestTrigger();
JSGlobalContextRef globalContext = [mainFrame globalContext];
- JSValueProtect(globalContext, jsCallbackFunction);
-
- trigger->setTestCallbackAndStartNotificationTimer([=](void) {
- JSObjectCallAsFunction(globalContext, jsCallbackFunction, nullptr, 0, nullptr, nullptr);
- JSValueUnprotect(globalContext, jsCallbackFunction);
- });
+ WebCoreTestSupport::setTestCallbackAndStartNotificationTimer(*frame, globalContext, jsCallbackFunction);
#endif
}