gecko-dev/testing/web-platform/tests/client-hints/resources/dpr.py
Rune Lillesveen aec891f144 Bug 1499368 [wpt PR 13542] - Don't propagate root/body background to viewport for display:none., a=testonly
Automatic update from web-platform-testsDon't propagate root/body background to viewport for display:none.

According to the specification, we should not paint backgrounds for
html or body on the viewport if they are display:none [1].

[1] https://drafts.csswg.org/css-backgrounds/#special-backgrounds

Bug: 895757
Change-Id: Ia975022e3bfa849298667f72908a64c0d5331872
Reviewed-on: https://chromium-review.googlesource.com/c/1283134
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599990}

--

wpt-commits: 6aa79dbab74eee1e2112908cd150514942bdac36
wpt-pr: 13542


--HG--
rename : testing/web-platform/tests/tools/lint/tests/dummy/ref/about_blank-ref.html => testing/web-platform/tests/tools/lint/tests/dummy/about_blank.html
2018-11-07 14:40:16 +00:00

24 lines
832 B
Python

def main(request, response):
"""
Simple handler that sets a response header based on which client hint
request headers were received.
"""
response.headers.append("Access-Control-Allow-Origin", "*")
values = request.GET
name = values.first('name')
type = values.first('mimeType')
dpr = values.first('dpr')
double = None
if 'double' in values:
double = values.first('double')
image_path = request.doc_root + "/".join(request.url_parts[2].split("/")[:-1]) + "/" + name
f = open(image_path, "rb")
buff = f.read()
f.close()
response.headers.set("Content-Type", type)
response.headers.set("Content-DPR", dpr)
if double:
response.headers.append("Content-DPR", double)
response.headers.set("Content-Length", len(buff))
response.content = buff