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 457727 6966be74e5b1651a606bc41e86d13c8488257f06
parent 457726 467e3fe9844956e6999227c685da400b64c32d45
child 457728 5fa73072f194855d09b6c4750c695a321d235e48
push id111763
push userjames@hoppipolla.co.uk
push dateThu, 07 Feb 2019 22:12:57 +0000
treeherdermozilla-inbound@c983e907bbfd [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>