WebKit Bugzilla
Attachment 349762 Details for
Bug 187545
: REGRESSION(r196265): WKWebView fires mouseover, mouseenter, and mouseleave events even when it's in a background window
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187545-20180914082201.patch (text/plain), 4.86 KB, created by
Sihui Liu
on 2018-09-14 08:22:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2018-09-14 08:22:02 PDT
Size:
4.86 KB
patch
obsolete
>Subversion Revision: 235862 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c03842c1747f1c0b643161b689337847b8c72cd9..8ee0ede9069bbba9cde26c4a555f2274784dd201 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-09-14 Sihui Liu <sihui_liu@apple.com> >+ >+ REGRESSION (r196265): WKWebView fires mouseover, mouseenter, and mouseleave events even when it's in a background window >+ https://bugs.webkit.org/show_bug.cgi?id=187545 >+ <rdar://problem/42401575> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We should only update the scrollbar for for mouse event if the window is not active. >+ >+ Test: fast/events/inactive_window_no_mouse_event.html >+ >+ * page/EventHandler.cpp: >+ (WebCore::EventHandler::handleMouseMoveEvent): >+ > 2018-09-10 Simon Fraser <simon.fraser@apple.com> > > svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 36504769757ba13922ba6c8ef9f8f89e3f086adf..952439d805931d678071235054bcba40d73414d5 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -1964,7 +1964,9 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& platformMouseE > scrollbar->mouseMoved(platformMouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering. > #endif > if (onlyUpdateScrollbars) { >+#if PLATFORM(GTK) > updateMouseEventTargetNode(mouseEvent.targetNode(), platformMouseEvent, true); >+#endif > return true; > } > } >diff --git a/LayoutTests/fast/events/inactive_window_no_mouse_event-expected.txt b/LayoutTests/fast/events/inactive_window_no_mouse_event-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..eec0c37f0092a309740586df2f6071f6dfd66a3c >--- /dev/null >+++ b/LayoutTests/fast/events/inactive_window_no_mouse_event-expected.txt >@@ -0,0 +1,6 @@ >+This tests what happens when the window is inactive. To manually run the test, open the page in Safari. Open another app like TextEdit which makes Safari window inactive. Move mouse to the red square on the page, you should see no new statements about mouse event. >+ >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/events/inactive_window_no_mouse_event.html b/LayoutTests/fast/events/inactive_window_no_mouse_event.html >new file mode 100644 >index 0000000000000000000000000000000000000000..df585b5cccc6a7942a260b625eabc4b5cc0a3320 >--- /dev/null >+++ b/LayoutTests/fast/events/inactive_window_no_mouse_event.html >@@ -0,0 +1,49 @@ >+<!DOCTYPE html> >+<head> >+<script src="../../resources/js-test.js"></script> >+<script> >+function log(message) { >+ document.getElementById('console').innerHTML += (message + "\n"); >+} >+ >+var mouseenterCount = 0; >+var mouseleaveCount = 0; >+var mousemoveCount = 0; >+ >+document.addEventListener("DOMContentLoaded", function(event) { >+ >+ var target = document.getElementById("target"); >+ target.addEventListener('mouseenter',() => { >+ log("Mouse enters target."); >+ mouseenterCount ++; >+ }); >+ target.addEventListener('mouseleave',() => { >+ log("Mouse leaves target."); >+ mouseleaveCount ++; >+ }); >+ document.body.addEventListener('mousemove',() => { >+ log("Mouse moves."); >+ mousemouseCount ++; >+ }); >+ >+ window.internals.setPageIsFocusedAndActive(false); >+ >+ eventSender.mouseMoveTo(1, 1); >+ eventSender.mouseMoveTo(300, 300); >+ eventSender.mouseMoveTo(1, 1); >+ >+ setTimeout(() => { >+ shouldBe("mouseenterCount", "0"); >+ shouldBe("mouseleaveCount", "0"); >+ shouldBe("mousemoveCount", "0"); >+ }, 200); >+}); >+</script> >+</head> >+ >+<body id=body> >+<p>This tests what happens when the window is inactive. To manually run the test, open the page in Safari. Open another app like TextEdit which makes Safari window inactive. Move mouse to the red square on the page, you should see no new statements about mouse event.</p> >+<div id="target" style="width:200px; height:200px; top:200px; left:200px; background-color:red; position:absolute"> >+</div> >+<pre id="console"></pre> >+</body> >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index 4b5201496cca9cb737139004ae2649cd63e77a09..9b379755c37015ecd2e02f7522d193eb2eb27c17 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -1217,6 +1217,9 @@ editing/spelling/text-replacement-after-typing-to-word.html [ Skip ] > # Depends on mac-specific code in TestController. > webkit.org/b/187550 http/tests/plugins/plugin-allow-then-reload.html [ Failure ] > >+# Expects different behaviors on GTK >+webkit.org/b/187545 fast/events/inactive_window_no_mouse_event.html [ Skip ] >+ > #//////////////////////////////////////////////////////////////////////////////////////// > # End of Expected failures. > #
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 187545
:
349690
|
349743
|
349748
|
349750
|
349752
|
349753
|
349754
|
349762
|
349765
|
349768
|
349770
|
349774
|
349786
|
349788
|
349789
|
349790
|
349805
|
349824
|
349825
|
349836
|
349876
|
349878
|
349936
|
349993
|
350266