Skip to content

Commit

Permalink
Bug 1646999 [wpt PR 24256] - [AspectRatio] Add a test for <picture>, …
Browse files Browse the repository at this point in the history
…a=testonly

Automatic update from web-platform-tests
[AspectRatio] Add a test for <picture>

<picture> does not currently let you specify an aspect ratio per
source:
w3c/csswg-drafts#5212
whatwg/html#4968

So this just tests setting a single aspect-ratio on the <img> element
for now.

Bug: 1045668
Change-Id: I89f5132322f8131bf346ea663b889e3b1d740e7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254454
Auto-Submit: Christian Biesinger <[email protected]>
Commit-Queue: Ian Kilpatrick <[email protected]>
Reviewed-by: Ian Kilpatrick <[email protected]>
Cr-Commit-Position: refs/heads/master@{#780870}

--

wpt-commits: 0c5883bd05b5d962ae68998b450510582e6ef6ca
wpt-pr: 24256
  • Loading branch information
cbiesinger authored and moz-wptsync-bot committed Jun 24, 2020
1 parent 952bd58 commit 8bc964a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: picture</title>
<link rel="author" title="Google LLC" href="https://www.google.com/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />

<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>

<picture>
<source srcset="support/20x50-green.png">
<img style="width: 100px; aspect-ratio: 1/1;">
</picture>

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<title>Animating 'stop-color' from 'currentcolor'</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg>
<linearGradient id="lg" style="color: green">
<stop stop-color="red">
<animate attributeName="stop-color" from="currentcolor" to="green" dur="10s" fill="freeze"/>
</stop>
</linearGradient>
<rect width="100" height="100" fill="url(#lg)"/>
</svg>
<script>
async_test(t => {
let svg = document.querySelector("svg");
svg.pauseAnimations();
svg.setCurrentTime(5);
onload = t.step_func(() => {
requestAnimationFrame(t.step_func_done(() => {
let stop = document.querySelector("stop");
assert_equals(getComputedStyle(stop).getPropertyValue("stop-color"),
"rgb(0, 128, 0)");
}));
});
});
</script>

0 comments on commit 8bc964a

Please sign in to comment.