Update web-platform-tests to revision be959408023fe02cf79abe70f6018598a7004a88

This commit is contained in:
WPT Sync Bot 2018-06-11 21:57:51 -04:00
parent a76777b115
commit 761c8bc2a9
171 changed files with 2434 additions and 907 deletions

View file

@ -32,6 +32,7 @@
2d.text.draw.space.collapse.space: "text-styles"
2d.text.draw.space.collapse.start: "text-styles"
2d.state: "the-canvas-state"
2d.scrollPathIntoView: "scroll"
2d.canvas: "../html/semantics/embedded-content/the-canvas-element"
2d.getcontext: "../html/semantics/embedded-content/the-canvas-element"
2d.scaled: "../html/semantics/embedded-content/the-canvas-element"

View file

@ -687,6 +687,9 @@ assertions:
- id: 2d.colorspace.img.noinfo
text: "Furthermore, the rendering of images that have no color correction information (such as those returned by the toDataURL() method) *must* be rendered with no color correction<^>."
- id: 2d.scrollPathIntoView.basic
text: "The scrollPathIntoView() method, when invoked, *must* run these steps<^>:"
- id: security.start
text: "All canvas elements *must* start with their origin-clean set to true<^>."
- id: security.drawImage.image

View file

@ -10153,3 +10153,79 @@
ctx.fill();
@assert pixel 50,25 ==~ 0,255,0,255;
expected: green
- name: 2d.scrollPathIntoView.basic
desc: scrollPathIntoView() works
testing:
- 2d.scrollPathIntoView.basic
code: |
var div = document.createElement('div');
div.style.cssText = 'width: 200vw; height: 200vh';
document.body.appendChild(div);
canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;';
window.scrollTo(0, 0);
ctx.beginPath();
ctx.rect(4, 8, 16, 32);
ctx.scrollPathIntoView();
var rect = canvas.getBoundingClientRect();
@assert Math.round(rect.top) === -8;
@assert Math.round(rect.left) === 200;
- name: 2d.scrollPathIntoView.verticalLR
desc: scrollPathIntoView() works in vertical-lr writing mode
testing:
- 2d.scrollPathIntoView.basic
code: |
document.documentElement.style.cssText = 'writing-mode: vertical-lr';
var div = document.createElement('div');
div.style.cssText = 'width: 200vw; height: 200vh';
document.body.appendChild(div);
canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;';
window.scrollTo(0, 0);
ctx.beginPath();
ctx.rect(4, 8, 16, 32);
ctx.scrollPathIntoView();
var rect = canvas.getBoundingClientRect();
@assert Math.round(rect.top) === 100;
@assert Math.round(rect.left) === -4;
- name: 2d.scrollPathIntoView.verticalRL
desc: scrollPathIntoView() works in vertical-rl writing mode
testing:
- 2d.scrollPathIntoView.basic
code: |
document.documentElement.style.cssText = 'writing-mode: vertical-rl';
var div = document.createElement('div');
div.style.cssText = 'width: 200vw; height: 200vh';
document.body.appendChild(div);
canvas.style.cssText = 'position: absolute; top: 100px; right: 200px; border: none;';
window.scrollTo(0, 0);
ctx.beginPath();
ctx.rect(4, 8, 16, 32);
ctx.scrollPathIntoView();
var rect = canvas.getBoundingClientRect();
var viewportWidth = document.scrollingElement.clientWidth;
var canvasWidth = canvas.width;
@assert Math.round(rect.top) === 100;
@assert Math.round(rect.right) === viewportWidth + (canvasWidth - 4 - 16);
- name: 2d.scrollPathIntoView.path
desc: scrollPathIntoView() with path argument works
testing:
- 2d.scrollPathIntoView.basic
code: |
var div = document.createElement('div');
div.style.cssText = 'width: 200vw; height: 200vh';
document.body.appendChild(div);
canvas.style.cssText = 'position: absolute; top: 100px; left: 200px; border: none;';
window.scrollTo(0, 0);
var path = new Path2D();
path.rect(4, 8, 16, 32);
ctx.scrollPathIntoView(path);
var rect = canvas.getBoundingClientRect();
@assert Math.round(rect.top) === -8;
@assert Math.round(rect.left) === 200;