Skip to content
  • tkent@chromium.org's avatar
    A Spin button should release mouse event capturing when a modal dialog opens · 05417697
    tkent@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=98007
    
    Reviewed by Hajime Morita.
    
    Description of bug:
    If the mouse left button is pressed on a spin button in
    input[type=number] and a 'change' event handler opens a modal dialog
    such as alert(), a repeating timer doesn't stop and mouse event
    capturing isn't released even though the mouse pointer isn't on the spin
    button.
    A user will see repeating alert dialogs for a document like <input
    type=number value=1 onchange="if (this.value==1) {alert(...);
    this.value=1;}"> by clicking the up button.
    
    How to solve:
    We should notify modal dialog or popup open to a spin button.
    This patch introduce PopupOpeningObserver. Chrome notifies it when
    any dialogs / popups is opening. SpinButtonElement implements
    PopupOpeningObserver and registers/unregisters itself to/from
    Chrome.
    
    No new tests. This is a behavior change, but it's very hard to make an
    automated test for timer-related behavior.
    
    * page/PopupOp...
    05417697