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

Issue 671723 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

srcset value displayed wrong in Element Inspector

Reported by bluemoe...@gmx.de, Dec 6 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
1.
add some PICTURE > SOURCE or IMG tag to your code

2.
add a SRCSET attribute with multiple URLs containing commas
e.g. "http://foobar.com/img,200x200.png, http://foobar.com/img,400x400.png 2x"

3. 
open Element Inspector and debug this element

What is the expected behavior?
There should be two linked/clickable image sources. But there are four!

What went wrong?
The comma within the URLs are interpreted as URL delimiter. The correct delimiter should be ", "; in regexp: ",\s+"; in words: comma + space/s

Did this work before? N/A 

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
Labels: M-57
Cc: msrchandra@chromium.org
Labels: Needs-Feedback
@bluemoehre -- Could you please elaborate the issue and if possible provide any specific HTML file or so which would help us to triage the issue further.
Thanks in Advance.

Comment 3 by bluemoe...@gmx.de, Dec 9 2016

srcset-test.html
323 bytes View Download
debugger-bug.png
14.6 KB View Download
Components: -Platform>DevTools Platform>DevTools>Authoring
Owner: l...@chromium.org
Status: Assigned (was: Unconfirmed)
This report is correct.

The spec agrees: http://w3c.github.io/html/semantics-embedded-content.html#element-attrdef-img-srcset

We can't split on commas before we linkify.

Comment 5 by l...@chromium.org, May 8 2017

Labels: -Needs-Feedback
For reference, related bug:  https://crbug.com/407036 
Project Member

Comment 6 by bugdroid1@chromium.org, May 10 2017

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

commit c12dbdc00cf31c15ab5ac591c419aa27ad7b9033
Author: luoe <luoe@chromium.org>
Date: Wed May 10 17:13:27 2017

DevTools: correctly parse srcset attribute before linkifying urls

The "srcset" attribute can take multiple image candidate strings, consisting of
a url and an optional width/density descriptor (e.g. 1x, 2w). DevTools used to
split the value on commas, which broke when valid srcsets had urls containing
commas.

This CL updates the linkifier to more closely resemble the rules for parsing
the attribute:
https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-srcset-attribute

BUG= 671723 

Review-Url: https://codereview.chromium.org/2871593003
Cr-Commit-Position: refs/heads/master@{#470624}

[modify] https://crrev.com/c12dbdc00cf31c15ab5ac591c419aa27ad7b9033/third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes-expected.txt
[modify] https://crrev.com/c12dbdc00cf31c15ab5ac591c419aa27ad7b9033/third_party/WebKit/LayoutTests/http/tests/inspector/elements/elements-linkify-attributes.html
[modify] https://crrev.com/c12dbdc00cf31c15ab5ac591c419aa27ad7b9033/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js

Comment 7 by l...@chromium.org, May 11 2017

Status: Fixed (was: Assigned)

Sign in to add a comment