[webkit-changes] [WebKit/WebKit] 701a3c: testdriver-vendor.js uses an incorrect position fo...

Richard Robinson noreply at github.com
Wed Aug 14 14:26:18 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 701a3c6a95ff6704100315bc68530ea9afdb4987
      https://github.com/WebKit/WebKit/commit/701a3c6a95ff6704100315bc68530ea9afdb4987
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2024-08-14 (Wed, 14 Aug 2024)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/editing/run/caret-navigation-around-line-break-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-pointer-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/inert/inert-iframe-hittest-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_interleaved.tentative_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_interleaved.tentative_pen-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_pen-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_from_slot_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_interleaved.tentative_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_interleaved.tentative_pen-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_pen-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_mouse-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_mouse-nonstandard-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_mouse-right-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_mouse-right-nonstandard-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_pen-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_pen-nonstandard-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_pen-right-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerevent_attributes_pen-right-nonstandard-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js
    M LayoutTests/imported/w3c/web-platform-tests/selection/contenteditable/modifying-selection-with-primary-mouse-button.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/selection/select-end-of-line-image.tentative-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/uievents/click/click_event_target_child_parent-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/uievents/order-of-events/mouse-events/mouseevents-mousemove-expected.txt
    A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt
    A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/editing/run/caret-navigation-around-line-break-expected.txt
    M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_movementxy_with_pointerlock-expected.txt
    A LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt
    A LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-pointer-expected.txt
    A LayoutTests/platform/ios/imported/w3c/web-platform-tests/selection/select-end-of-line-image.tentative-expected.txt
    A LayoutTests/platform/ios/imported/w3c/web-platform-tests/uievents/order-of-events/mouse-events/mouseevents-mousemove-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_interleaved.tentative_mouse-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_interleaved.tentative_pen-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_mouse-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_appended_pen-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_from_slot_mouse-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_interleaved.tentative_mouse-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_after_target_removed_interleaved.tentative_pen-expected.txt
    A LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-expected.txt
    A LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt
    A LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-pseudo/text-selection-expected.txt
    A LayoutTests/platform/wpe/imported/w3c/web-platform-tests/editing/run/caret-navigation-around-line-break-expected.txt
    A LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-pointer-expected.txt
    M LayoutTests/platform/wpe/imported/w3c/web-platform-tests/selection/contenteditable/modifying-selection-with-primary-mouse-button.tentative-expected.txt
    A LayoutTests/platform/wpe/imported/w3c/web-platform-tests/selection/select-end-of-line-image.tentative-expected.txt
    A LayoutTests/platform/wpe/imported/w3c/web-platform-tests/uievents/click/click_event_target_child_parent-expected.txt

  Log Message:
  -----------
  testdriver-vendor.js uses an incorrect position for an action with an specified element origin
https://bugs.webkit.org/show_bug.cgi?id=262220
rdar://116145770

Reviewed by Tim Nguyen.

There are two main issues when trying to acquire a position for an action with a specified element origin:

1. Currently, the top-left position is used, whereas the spec (https://www.w3.org/TR/webdriver2/#processing-actions) says to use the center.

2. The check `x instanceof Y` is not correct for all cases; specifically, if `x` exists in a different
"realm" than Y, the check will fail (per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms).
This happens in `testdriver-vendor.js` when an element is checked if it is an `instanceof` `Element`,
which will fail when the element belongs to a sub-frame.

Fix (1) by just computing the center instead, and fix (2) by using the `Element` from the element's realm instead of the default one.

* LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js:
(async dispatchMouseActions):

Canonical link: https://commits.webkit.org/282257@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