Changeset 238345 in webkit


Ignore:
Timestamp:
Nov 17, 2018 2:04:51 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Caret stops blinking after context menu shown
https://bugs.webkit.org/show_bug.cgi?id=191715

Patch by Jonathan Hammer <jonathan@e3software.com> on 2018-11-17
Reviewed by Ryosuke Niwa.

Source/WebCore:

Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
the caret continues to blink even after the context menu is dismissed. The normal
way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
not apply in the case of context menus because handleMouseReleaseEvent is not
called once the context menu is up.

Test: fast/events/contextmenu-dismiss-blink-caret.html

  • page/EventHandler.cpp:

(WebCore::EventHandler::sendContextMenuEvent):

  • testing/Internals.cpp:

(WebCore::Internals::isCaretBlinkingSuspended):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

  • fast/events/contextmenu-dismiss-blink-caret-expected.txt: Added.
  • fast/events/contextmenu-dismiss-blink-caret.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238344 r238345  
     12018-11-17  Jonathan Hammer  <jonathan@e3software.com>
     2
     3        Caret stops blinking after context menu shown
     4        https://bugs.webkit.org/show_bug.cgi?id=191715
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/events/contextmenu-dismiss-blink-caret-expected.txt: Added.
     9        * fast/events/contextmenu-dismiss-blink-caret.html: Added.
     10
    1112018-11-16  Antoine Quint  <graouts@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r238344 r238345  
     12018-11-17  Jonathan Hammer  <jonathan@e3software.com>
     2
     3        Caret stops blinking after context menu shown
     4        https://bugs.webkit.org/show_bug.cgi?id=191715
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
     9        the caret continues to blink even after the context menu is dismissed. The normal
     10        way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
     11        not apply in the case of context menus because handleMouseReleaseEvent is not
     12        called once the context menu is up.
     13
     14        Test: fast/events/contextmenu-dismiss-blink-caret.html
     15
     16        * page/EventHandler.cpp:
     17        (WebCore::EventHandler::sendContextMenuEvent):
     18        * testing/Internals.cpp:
     19        (WebCore::Internals::isCaretBlinkingSuspended):
     20        * testing/Internals.h:
     21        * testing/Internals.idl:
     22
    1232018-11-16  Antoine Quint  <graouts@apple.com>
    224
  • trunk/Source/WebCore/page/EventHandler.cpp

    r238078 r238345  
    28782878        return false;
    28792879
     2880    // Caret blinking is normally un-suspended in handleMouseReleaseEvent, but we
     2881    // won't receive that event once the context menu is up.
     2882    m_frame.selection().setCaretBlinkingSuspended(false);
    28802883    // Clear mouse press state to avoid initiating a drag while context menu is up.
    28812884    m_mousePressed = false;
  • trunk/Source/WebCore/testing/Internals.cpp

    r238212 r238345  
    14801480    return DOMRect::create(document->frame()->selection().absoluteCaretBounds());
    14811481}
     1482   
     1483ExceptionOr<bool> Internals::isCaretBlinkingSuspended()
     1484{
     1485    Document* document = contextDocument();
     1486    if (!document || !document->frame())
     1487        return Exception { InvalidAccessError };
     1488   
     1489    return document->frame()->selection().isCaretBlinkingSuspended();
     1490}
    14821491
    14831492Ref<DOMRect> Internals::boundingBox(Element& element)
  • trunk/Source/WebCore/testing/Internals.h

    r238212 r238345  
    221221
    222222    ExceptionOr<Ref<DOMRect>> absoluteCaretBounds();
     223    ExceptionOr<bool> isCaretBlinkingSuspended();
    223224
    224225    Ref<DOMRect> boundingBox(Element&);
  • trunk/Source/WebCore/testing/Internals.idl

    r238212 r238345  
    239239
    240240    [MayThrowException] DOMRect absoluteCaretBounds();
     241    [MayThrowException] boolean isCaretBlinkingSuspended();
    241242
    242243    DOMRect boundingBox(Element element);
Note: See TracChangeset for help on using the changeset viewer.