srcset parsing for extremely large numbers |
|||
Issue descriptionChrome Version: ToT OS: All but iOS What steps will reproduce the problem? (1) Open http://w3c-test.org/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html (2) Observe What is the expected result? No failing tests What happens instead? A test fails. Please use labels and text to provide additional information. <img srcset="/images/green-256x256.png 9e99999999999999999999999x" data-expect="0"> This srcset attribute value is valid though density is extremely large. Our Decimal parser produces +Infinity for the string, and DescriptorToken::ToFloat() assumes it as invalid. Edge, Firefox, and Safari works correctly.
,
Oct 22
,
Oct 22
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/09b18a02d183f468777640bfbbee33352ee1795c commit 09b18a02d183f468777640bfbbee33352ee1795c Author: Fredrik Söderquist <fs@opera.com> Date: Mon Oct 22 18:02:04 2018 An <img> with no 'src', no 'alt' but 'srcset' represents nothing Based on [1], it would seem that we should treat the case where we have no image candidate as representing nothing - this apparently also matches what other UAs do. Simplify the NoImageSourceSpecified helper function a bit. (IsNull implies IsEmpty and !hasAttribute.) [1] https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:the-img-element-5 Bug: 897033 Change-Id: I37ecad8faea2b929e8cf35ce7c746313b2d3b915 Reviewed-on: https://chromium-review.googlesource.com/c/1293574 Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#601648} [delete] https://crrev.com/96c0be24a293ae3dd08592cfe6496729cd2636f9/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/current-pixel-density/basic-expected.txt [modify] https://crrev.com/09b18a02d183f468777640bfbbee33352ee1795c/third_party/blink/renderer/core/html/html_image_fallback_helper.cc
,
Oct 23
|
|||
►
Sign in to add a comment |
|||
Comment 1 by f...@opera.com
, Oct 22