Bug 1517632 [wpt PR 14706] - Make background-size: cover and contain really cover, a=testonly
authorStephen Chenney <schenney@chromium.org>
Thu, 31 Jan 2019 15:44:11 +0000
changeset 456841 008eb2c66b1c95e426a18fa1d9983689fc836c46
parent 456840 79754828b060e705daaf9e069ea81797ebd2efb5
child 456842 16c8854443ebe2c0f4a65e239440aafc95da7a37
push id111705
push userjames@hoppipolla.co.uk
push dateTue, 05 Feb 2019 18:07:20 +0000
treeherdermozilla-inbound@9592b19c9b09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1517632, 14706, 785171, 1394014, 619962
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1517632 [wpt PR 14706] - Make background-size: cover and contain really cover, a=testonly Automatic update from web-platform-tests Make background-size: cover and contain really cover With background-repeat: no-repeat and background-size: cover, the computations for dest rect for the no-repeat case use the tile size to set the dest rect. This prevents tiled drawing from painting more than one tile. But the background-size computations for cover and contain use an unsnapped position area to set the tile size, which produces an unsnapped tile size. This unsnapped tile size, when set as the dest rect for painting, results in a tile that doesn't fill the background as one would expect for cover or contain. This patch switches to always computing the cover and contain tile sizes using a snapped position area to give a snapped dest rect. R: fs@opera.com, fmalita@chromium.org Bug: 785171 Change-Id: I38343ac09d689e9d1360e7043b2ef49adeadb983 Reviewed-on: https://chromium-review.googlesource.com/c/1394014 Commit-Queue: Stephen Chenney <schenney@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Cr-Commit-Position: refs/heads/master@{#619962} -- wpt-commits: 615fe3bb8ffe7cc5c47efcf7e87910ebea1c208f wpt-pr: 14706
testing/web-platform/tests/css/css-backgrounds/background-image-cover-zoomed-1.html
testing/web-platform/tests/css/css-backgrounds/reference/background-image-cover-zoomed-1-ref.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-backgrounds/background-image-cover-zoomed-1.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>CSS Background Test: background-size:cover should cover at zoom</title>
+    <link rel="author" title="schenney" href="mailto:schenney@chromium.org">
+    <link rel="help" href="http://www.w3.org/TR/css3-background">
+    <link rel="match" href="reference/background-image-cover-zoomed-1-ref.html">
+    <style>
+      body {
+        zoom: 80%;
+      }
+      body > div {
+        background: #f00;
+        width: 504px;
+        height: 252px;
+      }
+
+      div > div {
+        width: 504px;
+        height: 252px;
+        background-image: url(support/40px-wide-20px-tall-green-rect.png);
+        background-size: cover;
+        background-repeat: no-repeat;
+      }
+  </style>
+</head>
+
+<body>
+  <div>
+    <div>
+    </div>
+  </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-backgrounds/reference/background-image-cover-zoomed-1-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>CSS Background Test Reference</title>
+    <link rel="author" title="schenney" href="mailto:schenney@chromium.org">
+    <style>
+      body {
+        zoom: 80%;
+      }
+      body > div {
+        width: 504px;
+        height: 252px;
+        background-image: url(../support/40px-wide-20px-tall-green-rect.png);
+        background-size: cover;
+        background-repeat: no-repeat;
+      }
+  </style>
+</head>
+
+<body>
+  <div>
+  </div>
+</body>
+</html>