[Webkit-unassigned] [Bug 259419] New: Better type handling in HTMLImageElement resource selection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 22 13:08:22 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=259419

            Bug ID: 259419
           Summary: Better type handling in HTMLImageElement resource
                    selection
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ahmad.saleem792 at gmail.com
                CC: annevk at annevk.nl, bfulgham at webkit.org, ntim at apple.com,
                    sabouhallawa at apple.com

Hi Team,

While going through Blink's commit, I came across following commit:

Blink Commit: https://src.chromium.org/viewvc/blink?view=revision&revision=183450

Blink Function (as of today): https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_image_element.cc;l=402?q=isSupportedImagePrefixedMIMEType&ss=chromium

bool HTMLImageElement::SupportedImageType(
    const String& type,
    const HashSet<String>* disabled_image_types) {
  String trimmed_type = ContentType(type).GetType();
  // An empty type attribute is implicitly supported.
  if (trimmed_type.empty())
    return true;
  if (disabled_image_types && disabled_image_types->Contains(trimmed_type)) {
    return false;
  }
  return MIMETypeRegistry::IsSupportedImagePrefixedMIMEType(trimmed_type);
}
_______________

WebKit Source: https://searchfox.org/wubkat/source/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp#126

^ If I am not wrong.

_______________

One thing, which is different and for reason, I raised this bug report is that, for 'empty type', Blink is returning 'true', while we are 'false'.

bool isSupportedImageType(const String& imageType)
{
    if (imageType.isEmpty())
        return false;
    return defaultSupportedImageTypes().contains(imageType) || additionalSupportedImageTypes().contains(imageType);
}

__________________

Just wanted to raise, so we can get this sorted and CCed 'Anne' (well-versed in Standards) to get input. Also 'Brent' and 'Tim' - if they have any information.

This was raised on GitHub as following issue: https://github.com/ResponsiveImagesCG/picture-element/issues/238 (Took from Chrome Monorail bug)

__________

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230722/003b558e/attachment.htm>


More information about the webkit-unassigned mailing list