[webkit-changes] [WebKit/WebKit] 974596: Coalesce selectionchange events

Ryosuke Niwa noreply at github.com
Tue Mar 19 22:44:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9745969e4c27dee4ad32759fa5bfde231f7f25e4
      https://github.com/WebKit/WebKit/commit/9745969e4c27dee4ad32759fa5bfde231f7f25e4
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2024-03-19 (Tue, 19 Mar 2024)

  Changed paths:
    M LayoutTests/fast/events/selectionchange-iframe-expected.txt
    M LayoutTests/fast/events/selectionchange-user-initiated-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-distinct-text-controls-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-distinct-text-controls.html
    A LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-document-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-document.html
    M LayoutTests/imported/w3c/web-platform-tests/selection/textcontrols/selectionchange.html
    M Source/WebCore/editing/FrameSelection.cpp
    M Source/WebCore/editing/FrameSelection.h
    M Source/WebCore/html/HTMLTextFormControlElement.cpp
    M Source/WebCore/html/HTMLTextFormControlElement.h

  Log Message:
  -----------
  Coalesce selectionchange events
https://bugs.webkit.org/show_bug.cgi?id=271117

Reviewed by Chris Dumez.

Implement the spec change to avoid queuing a task to fire a selectionchange event when there is already a task scheduled
to do that for the target: https://github.com/w3c/selection-api/pull/172

Also update the relevant web platform tests: https://github.com/web-platform-tests/wpt/pull/45145

* LayoutTests/fast/events/selectionchange-iframe-expected.txt:
* LayoutTests/fast/events/selectionchange-user-initiated-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-distinct-text-controls-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-distinct-text-controls.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-document-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/selection/onselectionchange-on-document.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/selection/textcontrols/selectionchange.html:
* Source/WebCore/editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
* Source/WebCore/editing/FrameSelection.h:
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
(WebCore::HTMLTextFormControlElement::scheduleSelectionChangeEvent):
(WebCore::HTMLTextFormControlElement::scheduleSelectEvent):
* Source/WebCore/html/HTMLTextFormControlElement.h:
(WebCore::HTMLTextFormControlElement::hasScheduledSelectionChangeEvent const):
(WebCore::HTMLTextFormControlElement::setHasScheduledSelectionChangeEvent):

Canonical link: https://commits.webkit.org/276388@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list