srcset value displayed wrong in Element Inspector
Reported by
bluemoe...@gmx.de,
Dec 6 2016
|
||||
Issue descriptionUserAgent: 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
,
Dec 7 2016
@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.
,
Dec 9 2016
,
Dec 14 2016
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.
,
May 8 2017
,
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
,
May 11 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by manoranj...@chromium.org
, Dec 6 2016