WebKit Bugzilla
Attachment 359997 Details for
Bug 193664
: [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193664-20190124180356.patch (text/plain), 8.10 KB, created by
Fujii Hironori
on 2019-01-24 01:03:57 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-01-24 01:03:57 PST
Size:
8.10 KB
patch
obsolete
>Subversion Revision: 240313 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a1ee260b2bca024f86cd5676277f9b112f4f2ace..37eabe67d7e02e0b96c5263a3259aee958110e70 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-22 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext >+ https://bugs.webkit.org/show_bug.cgi?id=193664 >+ >+ Reviewed by Brent Fulgham. >+ >+ WinCairo WebKitTestRunner always crash on openning test cases of >+ HTMLMeterElement. >+ >+ If GraphicsContext::getWindowsContext retruned null HDC, >+ LocalWindowsContext shouldn't release the null HDC. >+ >+ Covered by existing tests. >+ >+ * platform/graphics/win/LocalWindowsContext.h: >+ (WebCore::LocalWindowsContext::~LocalWindowsContext): >+ Release m_hdc only if it isn't null. >+ > 2019-01-22 Devin Rousso <drousso@apple.com> > > Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node >diff --git a/Source/WebCore/platform/graphics/win/LocalWindowsContext.h b/Source/WebCore/platform/graphics/win/LocalWindowsContext.h >index 93450ef815aeddb6ef91ae73186ae329ea424686..e2bf1d1d2df62343ffc455ba7a8d7ce2fb7330bc 100644 >--- a/Source/WebCore/platform/graphics/win/LocalWindowsContext.h >+++ b/Source/WebCore/platform/graphics/win/LocalWindowsContext.h >@@ -43,7 +43,8 @@ public: > > ~LocalWindowsContext() > { >- m_graphicsContext.releaseWindowsContext(m_hdc, m_rect, m_supportAlphaBlend); >+ if (m_hdc) >+ m_graphicsContext.releaseWindowsContext(m_hdc, m_rect, m_supportAlphaBlend); > } > > HDC hdc() const { return m_hdc; } >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 0dcfede603ffccc7135c9ffe420c76ce208493dd..f2dc92f136d2c929ab1d365e3d05e3008287b5b7 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-24 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [Win][WebKitTestRunner] Implement EventSenderProxy >+ https://bugs.webkit.org/show_bug.cgi?id=193755 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKitTestRunner/EventSenderProxy.h: Removed unused members m_buttonState and m_mouseButtonsCurrentlyDown. >+ * WebKitTestRunner/win/EventSenderProxyWin.cpp: >+ (WTR::EventSenderProxy::dispatchMessage): >+ (WTR::EventSenderProxy::EventSenderProxy): >+ (WTR::EventSenderProxy::mouseDown): >+ (WTR::EventSenderProxy::mouseUp): >+ (WTR::EventSenderProxy::mouseMoveTo): >+ (WTR::EventSenderProxy::mouseScrollBy): >+ (WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases): >+ > 2019-01-22 Aakash Jain <aakash_jain@apple.com> > > [build.webkit.org] Unit-test failure after r237113 >diff --git a/Tools/WebKitTestRunner/EventSenderProxy.h b/Tools/WebKitTestRunner/EventSenderProxy.h >index bfdad965b56832dda9bb2fc1a62a11f1ff1373af..5321f173a3a5e1c012e26126cd03bdda7573a4d5 100644 >--- a/Tools/WebKitTestRunner/EventSenderProxy.h >+++ b/Tools/WebKitTestRunner/EventSenderProxy.h >@@ -123,6 +123,11 @@ private: > void prepareAndDispatchTouchEvent(enum wpe_input_touch_event_type); > #endif > >+#if PLATFORM(WIN) >+ LRESULT dispatchMessage(UINT message, WPARAM, LPARAM); >+ POINT positionInPoint() const { return { static_cast<LONG>(m_position.x), static_cast<LONG>(m_position.y) }; } >+#endif >+ > double m_time; > WKPoint m_position; > bool m_leftMouseButtonDown; >@@ -143,9 +148,6 @@ private: > uint32_t m_mouseButtonsCurrentlyDown { 0 }; > Vector<struct wpe_input_touch_event_raw> m_touchEvents; > HashSet<unsigned, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> m_updatedTouchEvents; >-#elif PLATFORM(WIN) >- uint32_t m_buttonState; >- uint32_t m_mouseButtonsCurrentlyDown { 0 }; > #endif > }; > >diff --git a/Tools/WebKitTestRunner/win/EventSenderProxyWin.cpp b/Tools/WebKitTestRunner/win/EventSenderProxyWin.cpp >index 0270929084551ac41f3df6d7bd8b6d361200b522..02e6c256ab6ae27e1eed4564a6e4264efcd55079 100644 >--- a/Tools/WebKitTestRunner/win/EventSenderProxyWin.cpp >+++ b/Tools/WebKitTestRunner/win/EventSenderProxyWin.cpp >@@ -33,23 +33,19 @@ > > namespace WTR { > >-// Key event location code defined in DOM Level 3. >-enum KeyLocationCode { >- DOMKeyLocationStandard = 0x00, >- DOMKeyLocationLeft = 0x01, >- DOMKeyLocationRight = 0x02, >- DOMKeyLocationNumpad = 0x03 >-}; >- >-enum ButtonState { >- ButtonReleased = 0, >- ButtonPressed = 1 >-}; >- >-enum PointerAxis { >- VerticalScroll = 0, >- HorizontalScroll = 1 >-}; >+LRESULT EventSenderProxy::dispatchMessage(UINT message, WPARAM wParam, LPARAM lParam) >+{ >+ MSG msg { }; >+ msg.hwnd = WKViewGetWindow(m_testController->mainWebView()->platformView()); >+ msg.message = message; >+ msg.wParam = wParam; >+ msg.lParam = lParam; >+ msg.time = GetTickCount() + static_cast<DWORD>(m_time); >+ msg.pt = positionInPoint(); >+ >+ TranslateMessage(&msg); >+ return DispatchMessage(&msg); >+} > > EventSenderProxy::EventSenderProxy(TestController* testController) > : m_testController(testController) >@@ -58,7 +54,6 @@ EventSenderProxy::EventSenderProxy(TestController* testController) > , m_clickCount(0) > , m_clickTime(0) > , m_clickButton(kWKEventMouseButtonNoButton) >- , m_buttonState(ButtonReleased) > { > } > >@@ -68,25 +63,82 @@ EventSenderProxy::~EventSenderProxy() > > void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers) > { >- notImplemented(); >+ int messageType; >+ switch (button) { >+ case 0: >+ messageType = WM_LBUTTONDOWN; >+ break; >+ case 1: >+ messageType = WM_MBUTTONDOWN; >+ break; >+ case 2: >+ messageType = WM_RBUTTONDOWN; >+ break; >+ case 3: >+ // fast/events/mouse-click-events expects the 4th button has event.button = 1, so send an WM_MBUTTONDOWN >+ messageType = WM_MBUTTONDOWN; >+ break; >+ default: >+ messageType = WM_LBUTTONDOWN; >+ break; >+ } >+ WPARAM wparam = 0; >+ dispatchMessage(messageType, wparam, MAKELPARAM(positionInPoint().x, positionInPoint().y)); > } > > void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers) > { >- notImplemented(); >+ int messageType; >+ switch (button) { >+ case 0: >+ messageType = WM_LBUTTONUP; >+ break; >+ case 1: >+ messageType = WM_MBUTTONUP; >+ break; >+ case 2: >+ messageType = WM_RBUTTONUP; >+ break; >+ case 3: >+ // fast/events/mouse-click-events expects the 4th button has event.button = 1, so send an WM_MBUTTONUP >+ messageType = WM_MBUTTONUP; >+ break; >+ default: >+ messageType = WM_LBUTTONUP; >+ break; >+ } >+ WPARAM wparam = 0; >+ dispatchMessage(messageType, wparam, MAKELPARAM(positionInPoint().x, positionInPoint().y)); > } > > void EventSenderProxy::mouseMoveTo(double x, double y) > { >- notImplemented(); >+ m_position.x = x; >+ m_position.y = y; >+ dispatchMessage(WM_MOUSEMOVE, 0, MAKELPARAM(positionInPoint().x, positionInPoint().y)); > } > >-void EventSenderProxy::mouseScrollBy(int horizontal, int vertical) >+void EventSenderProxy::mouseScrollBy(int x, int y) > { >- notImplemented(); >+ RECT rect; >+ GetWindowRect(WKViewGetWindow(m_testController->mainWebView()->platformView()), &rect); >+ >+ if (x) { >+ UINT scrollChars = 1; >+ SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scrollChars, 0); >+ x *= WHEEL_DELTA / scrollChars; >+ dispatchMessage(WM_MOUSEHWHEEL, MAKEWPARAM(0, x), MAKELPARAM(rect.left + positionInPoint().x, rect.top + positionInPoint().y)); >+ } >+ >+ if (y) { >+ UINT scrollLines = 3; >+ SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, 0); >+ y *= WHEEL_DELTA / scrollLines; >+ dispatchMessage(WM_MOUSEWHEEL, MAKEWPARAM(0, y), MAKELPARAM(rect.left + positionInPoint().x, rect.top + positionInPoint().y)); >+ } > } > >-void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int horizontal, int vertical, int, int) >+void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int, int, int, int) > { > notImplemented(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193664
:
359726
|
359997