⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286847 in webkit


Ignore:
Timestamp:
Dec 10, 2021, 6:07:23 AM (5 years ago)
Author:
Manuel Rego Casasnovas
Message:

[WPT] Import resources/accesskey.js
https://bugs.webkit.org/show_bug.cgi?id=234137

Reviewed by Rob Buis.

This just imports the changes from this WPT PR:
https://github.com/web-platform-tests/wpt/pull/32000

Which will allow to write other WPT tests using pressAccessKey() method.

  • web-platform-tests/resources/accesskey.js: Added.

(pressAccessKey):

  • web-platform-tests/resources/w3c-import.log:
  • web-platform-tests/shadow-dom/accesskey.tentative.html:
Location:
trunk/LayoutTests/imported/w3c
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r286821 r286847  
     12021-12-10  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [WPT] Import resources/accesskey.js
     4        https://bugs.webkit.org/show_bug.cgi?id=234137
     5
     6        Reviewed by Rob Buis.
     7
     8        This just imports the changes from this WPT PR:
     9        https://github.com/web-platform-tests/wpt/pull/32000
     10
     11        Which will allow to write other WPT tests using pressAccessKey() method.
     12
     13        * web-platform-tests/resources/accesskey.js: Added.
     14        (pressAccessKey):
     15        * web-platform-tests/resources/w3c-import.log:
     16        * web-platform-tests/shadow-dom/accesskey.tentative.html:
     17
    1182021-12-09  Chris Dumez  <cdumez@apple.com>
    219
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resources/w3c-import.log

    r269186 r286847  
    1818/LayoutTests/imported/w3c/web-platform-tests/resources/META.yml
    1919/LayoutTests/imported/w3c/web-platform-tests/resources/SVGAnimationTestCase-testharness.js
     20/LayoutTests/imported/w3c/web-platform-tests/resources/accesskey.js
    2021/LayoutTests/imported/w3c/web-platform-tests/resources/check-layout-th.js
    2122/LayoutTests/imported/w3c/web-platform-tests/resources/idlharness.js
  • trunk/LayoutTests/imported/w3c/web-platform-tests/shadow-dom/accesskey.tentative.html

    r276584 r286847  
    99<script src="/resources/testdriver-actions.js"></script>
    1010<script src="/resources/testdriver-vendor.js"></script>
     11<script src="/resources/accesskey.js"></script>
    1112</head>
    1213<body>
     
    1617
    1718const container = document.getElementById('container');
    18 
    19 function pressAccessKey(accessKey){
    20   let controlKey = '\uE009'; // left Control key
    21   let altKey = '\uE00A'; // left Alt key
    22   let optionKey = altKey;  // left Option key
    23   let shiftKey = '\uE008'; // left Shift key
    24   // There are differences in using accesskey across browsers and OS's.
    25   // See: // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
    26   let isMacOSX = navigator.userAgent.indexOf("Mac") != -1;
    27   let osAccessKey = isMacOSX ? [controlKey, optionKey] : [shiftKey, altKey];
    28   let actions = new test_driver.Actions();
    29   // Press keys.
    30   for (let key of osAccessKey) {
    31     actions = actions.keyDown(key);
    32   }
    33   actions = actions
    34             .keyDown(accessKey)
    35             .addTick()
    36             .keyUp(accessKey);
    37   osAccessKey.reverse();
    38   for (let key of osAccessKey) {
    39     actions = actions.keyUp(key);
    40   }
    41   return actions.send();
    42 }
    4319
    4420function testAccesskeyInShadowTree(mode) {
Note: See TracChangeset for help on using the changeset viewer.