Bug 180557 - Clean up the Image UTI utilities source files
Summary: Clean up the Image UTI utilities source files
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-07 17:01 PST by Said Abou-Hallawa
Modified: 2020-05-30 19:55 PDT (History)
5 users (show)

See Also:


Attachments
Patch (46.74 KB, patch)
2017-12-07 17:06 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (46.82 KB, patch)
2017-12-08 09:05 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (2.66 MB, application/zip)
2017-12-08 12:52 PST, EWS Watchlist
no flags Details
Patch (46.82 KB, patch)
2017-12-08 13:23 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (49.31 KB, patch)
2017-12-08 17:17 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (49.32 KB, patch)
2017-12-08 17:35 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews113 for mac-elcapitan (460.00 KB, application/zip)
2017-12-08 18:22 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (2.75 MB, application/zip)
2017-12-08 18:30 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews101 for mac-elcapitan (2.17 MB, application/zip)
2017-12-08 18:33 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews125 for ios-simulator-wk2 (2.25 MB, application/zip)
2017-12-08 18:59 PST, EWS Watchlist
no flags Details
Patch (42.10 KB, patch)
2017-12-08 20:44 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (42.47 KB, patch)
2018-01-02 14:59 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (42.51 KB, patch)
2018-01-02 18:22 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (42.65 KB, patch)
2018-01-03 14:18 PST, Said Abou-Hallawa
mjs: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-12-07 17:01:30 PST
1. Move platform/network/mac/UTIUtilities.mm to platform/graphics/cg/UTIUtilities.cpp [ reason it is not related to network ]
2. Move platform/network/mac/UTIUtilities.h to platform/graphics/cg/UTIUtilities.h [ reason it is related to image UTI for CG platform only ]
3. Move platform/graphics/cg/ImageSourceCGWin.cpp to platform/graphics/cg/UTIUtilitiesWin.cpp [ reason it not related to ImageSource ]
4. Delete platform/graphics/cg/ImageSourceCG.cpp and platform/graphics/cg/ImageSourceCG.h [ reason the functions of these files are now in platform/network/mac/UTIUtilities.h and platform/network/mac/UTIUtilities.cpp ]
Comment 1 Said Abou-Hallawa 2017-12-07 17:06:44 PST
Created attachment 328759 [details]
Patch
Comment 2 Said Abou-Hallawa 2017-12-08 09:05:04 PST
Created attachment 328823 [details]
Patch
Comment 3 EWS Watchlist 2017-12-08 12:52:55 PST
Comment on attachment 328823 [details]
Patch

Attachment 328823 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5549083

New failing tests:
fast/text/vertical-quotation-marks.html
Comment 4 EWS Watchlist 2017-12-08 12:52:56 PST
Created attachment 328856 [details]
Archive of layout-test-results from ews107 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 5 Said Abou-Hallawa 2017-12-08 13:23:20 PST
Created attachment 328860 [details]
Patch
Comment 6 Tim Horton 2017-12-08 14:49:40 PST
UTIUtilities isn’t about graphics either, so this doesn’t seem like an improvement.

Honestly, network doesn’t seem like the worst place for it -- it’s all about types of resources.
Comment 7 Said Abou-Hallawa 2017-12-08 17:17:37 PST
Created attachment 328891 [details]
Patch
Comment 8 EWS Watchlist 2017-12-08 17:20:03 PST
Attachment 328891 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/UTIUtilities.cpp:38:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Said Abou-Hallawa 2017-12-08 17:35:02 PST
Created attachment 328892 [details]
Patch
Comment 10 EWS Watchlist 2017-12-08 18:22:41 PST
Comment on attachment 328892 [details]
Patch

Attachment 328892 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/5553991

Number of test failures exceeded the failure limit.
Comment 11 EWS Watchlist 2017-12-08 18:22:42 PST
Created attachment 328894 [details]
Archive of layout-test-results from ews113 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 12 EWS Watchlist 2017-12-08 18:30:28 PST
Comment on attachment 328892 [details]
Patch

Attachment 328892 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5553997

New failing tests:
fast/canvas/webgl/premultiplyalpha-test.html
fast/canvas/canvas-toDataURL-case-insensitive-mimetype.html
fast/canvas/toDataURL-supportedTypes.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
Comment 13 EWS Watchlist 2017-12-08 18:30:29 PST
Created attachment 328895 [details]
Archive of layout-test-results from ews107 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 14 EWS Watchlist 2017-12-08 18:33:32 PST
Comment on attachment 328892 [details]
Patch

Attachment 328892 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5554127

New failing tests:
fast/canvas/webgl/premultiplyalpha-test.html
fast/canvas/canvas-toDataURL-case-insensitive-mimetype.html
fast/canvas/toDataURL-supportedTypes.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
Comment 15 EWS Watchlist 2017-12-08 18:33:33 PST
Created attachment 328896 [details]
Archive of layout-test-results from ews101 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 16 EWS Watchlist 2017-12-08 18:59:58 PST
Comment on attachment 328892 [details]
Patch

Attachment 328892 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/5554149

New failing tests:
fast/canvas/webgl/premultiplyalpha-test.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
fast/canvas/toDataURL-supportedTypes.html
fast/canvas/canvas-toDataURL-case-insensitive-mimetype.html
Comment 17 EWS Watchlist 2017-12-08 18:59:59 PST
Created attachment 328898 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 18 Said Abou-Hallawa 2017-12-08 20:44:24 PST
Created attachment 328899 [details]
Patch
Comment 19 Said Abou-Hallawa 2018-01-02 14:59:45 PST
Created attachment 330341 [details]
Patch
Comment 20 Tim Horton 2018-01-02 15:39:38 PST
Comment on attachment 330341 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330341&action=review

> Source/WebCore/platform/UTIUtilities.h:2
> + * Copyright (C) 2017 Apple Inc. All rights reserved.

Is this here because it’s also used for the -Win one? But then this defines lots of functions that that one doesn’t implement? Something is weird. Maybe you just need some #ifdefs around these definitions?
Comment 21 Said Abou-Hallawa 2018-01-02 18:22:56 PST
Created attachment 330362 [details]
Patch
Comment 22 Simon Fraser (smfr) 2018-01-03 09:39:41 PST
Comment on attachment 330362 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330362&action=review

> Source/WebCore/platform/UTIUtilities.h:37
> +String MIMETypeFromUTITree(const String&);

Maybe a comment should explain what a "UTI tree" is?

> Source/WebCore/platform/cocoa/UTIUtilities.cpp:63
> +    if (typeID == CFStringGetTypeID())
> +        return MIMETypeFromUTITree((CFStringRef)value);

I hope we never get into an infinite loop here. Are we guaranteed that the kUTTypeConformsToKey is always different from the UTI?

> Source/WebCore/platform/cocoa/UTIUtilities.cpp:88
> +public:

No need for public: in a struct.
Comment 23 Said Abou-Hallawa 2018-01-03 14:18:42 PST
Created attachment 330414 [details]
Patch
Comment 24 Said Abou-Hallawa 2018-01-03 14:28:40 PST
Comment on attachment 330362 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330362&action=review

>> Source/WebCore/platform/UTIUtilities.h:37
>> +String MIMETypeFromUTITree(const String&);
> 
> Maybe a comment should explain what a "UTI tree" is?

A comment was added.

>> Source/WebCore/platform/cocoa/UTIUtilities.cpp:63
>> +        return MIMETypeFromUTITree((CFStringRef)value);
> 
> I hope we never get into an infinite loop here. Are we guaranteed that the kUTTypeConformsToKey is always different from the UTI?

kUTTypeConformsToKey should return the parent(s) in the conformance tree of the given UTI. The conformance hierarchy can't have cycles but can have multiple parents because it supports multiple inheritance. See https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html#//apple_ref/doc/uid/TP40001319-CH202-SW4

>> Source/WebCore/platform/cocoa/UTIUtilities.cpp:88
>> +public:
> 
> No need for public: in a struct.

Fixed.
Comment 25 Maciej Stachowiak 2020-05-30 19:55:59 PDT
Comment on attachment 330414 [details]
Patch

Unfortunately, this old patch no longer applies.