| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4acc273 commit a7f743f
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ Last update: | |||
| 13 | 13 | - console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console | |
| 14 | 14 | - encoding: https://github.com/web-platform-tests/wpt/tree/3c9820d1cc/encoding | |
| 15 | 15 | - url: https://github.com/web-platform-tests/wpt/tree/1783c9bccf/url | |
| 16 | - - resources: https://github.com/web-platform-tests/wpt/tree/001e50de41/resources | ||
| 16 | + - resources: https://github.com/web-platform-tests/wpt/tree/351a99782b/resources | ||
| 17 | 17 | - interfaces: https://github.com/web-platform-tests/wpt/tree/8719553b2d/interfaces | |
| 18 | 18 | - html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/2c5c3c4c27/html/webappapis/microtask-queuing | |
| 19 | 19 | - html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/264f12bc7b/html/webappapis/timers | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -281,9 +281,12 @@ | |||
| 281 | 281 | * pointer source | |
| 282 | 282 | * @returns {Actions} | |
| 283 | 283 | */ | |
| 284 | - pointerDown: function({button=this.ButtonType.LEFT, sourceName=null}={}) { | ||
| 284 | + pointerDown: function({button=this.ButtonType.LEFT, sourceName=null, | ||
| 285 | + width, height, pressure, tangentialPressure, | ||
| 286 | + tiltX, tiltY, twist, altitudeAngle, azimuthAngle}={}) { | ||
| 285 | 287 | let source = this.getSource("pointer", sourceName); | |
| 286 | - source.pointerDown(this, button); | ||
| 288 | + source.pointerDown(this, button, width, height, pressure, tangentialPressure, | ||
| 289 | + tiltX, tiltY, twist, altitudeAngle, azimuthAngle); | ||
| 287 | 290 | return this; | |
| 288 | 291 | }, | |
| 289 | 292 | ||
@@ -314,9 +317,13 @@ | |||
| 314 | 317 | * @returns {Actions} | |
| 315 | 318 | */ | |
| 316 | 319 | pointerMove: function(x, y, | |
| 317 | - {origin="viewport", duration, sourceName=null}={}) { | ||
| 320 | + {origin="viewport", duration, sourceName=null, | ||
| 321 | + width, height, pressure, tangentialPressure, | ||
| 322 | + tiltX, tiltY, twist, altitudeAngle, azimuthAngle}={}) { | ||
| 318 | 323 | let source = this.getSource("pointer", sourceName); | |
| 319 | - source.pointerMove(this, x, y, duration, origin); | ||
| 324 | + source.pointerMove(this, x, y, duration, origin, width, height, pressure, | ||
| 325 | + tangentialPressure, tiltX, tiltY, twist, altitudeAngle, | ||
| 326 | + azimuthAngle); | ||
| 320 | 327 | return this; | |
| 321 | 328 | }, | |
| 322 | 329 | ||
@@ -424,6 +431,38 @@ | |||
| 424 | 431 | this.actions = new Map(); | |
| 425 | 432 | } | |
| 426 | 433 | ||
| 434 | + function setPointerProperties(action, width, height, pressure, tangentialPressure, | ||
| 435 | + tiltX, tiltY, twist, altitudeAngle, azimuthAngle) { | ||
| 436 | + if (width) { | ||
| 437 | + action.width = width; | ||
| 438 | + } | ||
| 439 | + if (height) { | ||
| 440 | + action.height = height; | ||
| 441 | + } | ||
| 442 | + if (pressure) { | ||
| 443 | + action.pressure = pressure; | ||
| 444 | + } | ||
| 445 | + if (tangentialPressure) { | ||
| 446 | + action.tangentialPressure = tangentialPressure; | ||
| 447 | + } | ||
| 448 | + if (tiltX) { | ||
| 449 | + action.tiltX = tiltX; | ||
| 450 | + } | ||
| 451 | + if (tiltY) { | ||
| 452 | + action.tiltY = tiltY; | ||
| 453 | + } | ||
| 454 | + if (twist) { | ||
| 455 | + action.twist = twist; | ||
| 456 | + } | ||
| 457 | + if (altitudeAngle) { | ||
| 458 | + action.altitudeAngle = altitudeAngle; | ||
| 459 | + } | ||
| 460 | + if (azimuthAngle) { | ||
| 461 | + action.azimuthAngle = azimuthAngle; | ||
| 462 | + } | ||
| 463 | + return action; | ||
| 464 | + } | ||
| 465 | + | ||
| 427 | 466 | PointerSource.prototype = { | |
| 428 | 467 | serialize: function(tickCount) { | |
| 429 | 468 | if (!this.actions.size) { | |
@@ -441,12 +480,16 @@ | |||
| 441 | 480 | return data; | |
| 442 | 481 | }, | |
| 443 | 482 | ||
| 444 | - pointerDown: function(actions, button) { | ||
| 483 | + pointerDown: function(actions, button, width, height, pressure, tangentialPressure, | ||
| 484 | + tiltX, tiltY, twist, altitudeAngle, azimuthAngle) { | ||
| 445 | 485 | let tick = actions.tickIdx; | |
| 446 | 486 | if (this.actions.has(tick)) { | |
| 447 | 487 | tick = actions.addTick().tickIdx; | |
| 448 | 488 | } | |
| 449 | - this.actions.set(tick, {type: "pointerDown", button}); | ||
| 489 | + let actionProperties = setPointerProperties({type: "pointerDown", button}, width, height, | ||
| 490 | + pressure, tangentialPressure, tiltX, tiltY, | ||
| 491 | + twist, altitudeAngle, azimuthAngle); | ||
| 492 | + this.actions.set(tick, actionProperties); | ||
| 450 | 493 | }, | |
| 451 | 494 | ||
| 452 | 495 | pointerUp: function(actions, button) { | |
@@ -457,15 +500,20 @@ | |||
| 457 | 500 | this.actions.set(tick, {type: "pointerUp", button}); | |
| 458 | 501 | }, | |
| 459 | 502 | ||
| 460 | - pointerMove: function(actions, x, y, duration, origin) { | ||
| 503 | + pointerMove: function(actions, x, y, duration, origin, width, height, pressure, | ||
| 504 | + tangentialPressure, tiltX, tiltY, twist, altitudeAngle, azimuthAngle) { | ||
| 461 | 505 | let tick = actions.tickIdx; | |
| 462 | 506 | if (this.actions.has(tick)) { | |
| 463 | 507 | tick = actions.addTick().tickIdx; | |
| 464 | 508 | } | |
| 465 | - this.actions.set(tick, {type: "pointerMove", x, y, origin}); | ||
| 509 | + let moveAction = {type: "pointerMove", x, y, origin}; | ||
| 466 | 510 | if (duration) { | |
| 467 | - this.actions.get(tick).duration = duration; | ||
| 511 | + moveAction.duration = duration; | ||
| 468 | 512 | } | |
| 513 | + let actionProperties = setPointerProperties(moveAction, width, height, pressure, | ||
| 514 | + tangentialPressure, tiltX, tiltY, twist, | ||
| 515 | + altitudeAngle, azimuthAngle); | ||
| 516 | + this.actions.set(tick, actionProperties); | ||
| 469 | 517 | }, | |
| 470 | 518 | ||
| 471 | 519 | addPause: function(actions, duration) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -146,6 +146,24 @@ | |||
| 146 | 146 | y: centerPoint[1]}); | |
| 147 | 147 | }, | |
| 148 | 148 | ||
| 149 | + /** | ||
| 150 | + * Deletes all cookies. | ||
| 151 | + * | ||
| 152 | + * This matches the behaviour of the {@link | ||
| 153 | + * https://w3c.github.io/webdriver/#delete-all-cookies|WebDriver | ||
| 154 | + * Delete All Cookies command}. | ||
| 155 | + * | ||
| 156 | + * @param {WindowProxy} context - Browsing context in which | ||
| 157 | + * to run the call, or null for the current | ||
| 158 | + * browsing context. | ||
| 159 | + * | ||
| 160 | + * @returns {Promise} fulfilled after cookies are deleted, or rejected in | ||
| 161 | + * the cases the WebDriver command errors | ||
| 162 | + */ | ||
| 163 | + delete_all_cookies: function(context=null) { | ||
| 164 | + return window.test_driver_internal.delete_all_cookies(context); | ||
| 165 | + }, | ||
| 166 | + | ||
| 149 | 167 | /** | |
| 150 | 168 | * Send keys to an element | |
| 151 | 169 | * | |
@@ -458,6 +476,10 @@ | |||
| 458 | 476 | }); | |
| 459 | 477 | }, | |
| 460 | 478 | ||
| 479 | + delete_all_cookies: function(context=null) { | ||
| 480 | + return Promise.reject(new Error("unimplemented")); | ||
| 481 | + }, | ||
| 482 | + | ||
| 461 | 483 | send_keys: function(element, keys) { | |
| 462 | 484 | if (this.in_automation) { | |
| 463 | 485 | return Promise.reject(new Error('Not implemented')); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2956,22 +2956,16 @@ policies and contribution forms [3]. | |||
| 2956 | 2956 | } | |
| 2957 | 2957 | ||
| 2958 | 2958 | function sanitize_unpaired_surrogates(str) { | |
| 2959 | - return str.replace(/([\ud800-\udbff])(?![\udc00-\udfff])/g, | ||
| 2960 | - function(_, unpaired) | ||
| 2961 | - { | ||
| 2962 | - return code_unit_str(unpaired); | ||
| 2963 | - }) | ||
| 2964 | - // This replacement is intentionally implemented without an | ||
| 2965 | - // ES2018 negative lookbehind assertion to support runtimes | ||
| 2966 | - // which do not yet implement that language feature. | ||
| 2967 | - .replace(/(^|[^\ud800-\udbff])([\udc00-\udfff])/g, | ||
| 2968 | - function(_, previous, unpaired) { | ||
| 2969 | - if (/[\udc00-\udfff]/.test(previous)) { | ||
| 2970 | - previous = code_unit_str(previous); | ||
| 2971 | - } | ||
| 2972 | - | ||
| 2973 | - return previous + code_unit_str(unpaired); | ||
| 2974 | - }); | ||
| 2959 | + return str.replace( | ||
| 2960 | + /([\ud800-\udbff]+)(?![\udc00-\udfff])|(^|[^\ud800-\udbff])([\udc00-\udfff]+)/g, | ||
| 2961 | + function(_, low, prefix, high) { | ||
| 2962 | + var output = prefix || ""; // prefix may be undefined | ||
| 2963 | + var string = low || high; // only one of these alternates can match | ||
| 2964 | + for (var i = 0; i < string.length; i++) { | ||
| 2965 | + output += code_unit_str(string[i]); | ||
| 2966 | + } | ||
| 2967 | + return output; | ||
| 2968 | + }); | ||
| 2975 | 2969 | } | |
| 2976 | 2970 | ||
| 2977 | 2971 | function sanitize_all_unpaired_surrogates(tests) { | |
@@ -3612,6 +3606,9 @@ policies and contribution forms [3]. | |||
| 3612 | 3606 | ||
| 3613 | 3607 | function AssertionError(message) | |
| 3614 | 3608 | { | |
| 3609 | + if (typeof message == "string") { | ||
| 3610 | + message = sanitize_unpaired_surrogates(message); | ||
| 3611 | + } | ||
| 3615 | 3612 | this.message = message; | |
| 3616 | 3613 | this.stack = this.get_stack(); | |
| 3617 | 3614 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ | |||
| 12 | 12 | "path": "url" | |
| 13 | 13 | }, | |
| 14 | 14 | "resources": { | |
| 15 | - "commit": "001e50de41dc35820774b27e31f77a165f4c0b9b", | ||
| 15 | + "commit": "351a99782b9677706b5dc0dd78e85978fa4ab130", | ||
| 16 | 16 | "path": "resources" | |
| 17 | 17 | }, | |
| 18 | 18 | "interfaces": { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments