New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 895245 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

Multiple Content-DPR values fail to parse

Project Member Reported by y...@yoav.ws, Oct 15

Issue description

Chrome Version: M70
OS: All

Bug report from a GH issue [1]: "Currently Chrome treats multiple content-dpr responses headers as an error and ignores both."

What steps will reproduce the problem?
(1) Sending an image with a response header with multiple "Content-DPR" headers means that the intrinsic width of the image is not impacted.

What is the expected result?
Content-DPR should impact the image's intrinsic dimensions, even when multiple headers are included. The last value should "win".

What happens instead?

The values reach the renderer as a comma separated value list, get parsed as a float and fail, leaving the intrinsic dimensions unaffected.

[1] https://github.com/httpwg/http-extensions/issues/700#issuecomment-427132507



 

Comment 1 by y...@yoav.ws, Oct 15

Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b69e43a03d1c8ab4925b8d098de3151cec7bbb99

commit b69e43a03d1c8ab4925b8d098de3151cec7bbb99
Author: Yoav Weiss <yoav@yoav.ws>
Date: Mon Oct 15 17:53:30 2018

Fix processing of double Content-DPR values and add Content-DPR WPT tests

When processing multiple Content-DPR headers, the current logic parses
all of them as a single float, and understandably, fails in that task.
That means that if a server is adding multiple headers (due to
configuration error), none of them will be effective, contrary to the RFC.

This PR fixes that, copies over relevant tests from internal layout tests
to WPT, and adds a test for that issue specifically.

BUG= 895245 

Change-Id: I72b570ad4b1e4db9a2bb03be9d8fb1e3799b902b
Reviewed-on: https://chromium-review.googlesource.com/c/1280266
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Yoav Weiss <yoav@yoav.ws>
Cr-Commit-Position: refs/heads/master@{#599678}
[add] https://crrev.com/b69e43a03d1c8ab4925b8d098de3151cec7bbb99/third_party/WebKit/LayoutTests/external/wpt/client-hints/image-with-dpr-header.html
[add] https://crrev.com/b69e43a03d1c8ab4925b8d098de3151cec7bbb99/third_party/WebKit/LayoutTests/external/wpt/client-hints/resources/dpr.py
[add] https://crrev.com/b69e43a03d1c8ab4925b8d098de3151cec7bbb99/third_party/WebKit/LayoutTests/external/wpt/client-hints/resources/square.png
[modify] https://crrev.com/b69e43a03d1c8ab4925b8d098de3151cec7bbb99/third_party/blink/renderer/core/loader/resource/image_resource_content.cc

Comment 3 by y...@yoav.ws, Oct 15

Status: Fixed (was: Started)

Sign in to add a comment