RESOLVED FIXED 197397
Add SPI to set a list of hosts to which to send custom header fields cross-origin
https://bugs.webkit.org/show_bug.cgi?id=197397
Summary Add SPI to set a list of hosts to which to send custom header fields cross-or...
Alex Christensen
Reported 2019-04-29 17:48:43 PDT
Add SPI to set a list of hosts to which to send custom header fields cross-origin
Attachments
Patch (18.12 KB, patch)
2019-04-29 17:57 PDT, Alex Christensen
no flags
Patch (18.09 KB, patch)
2019-04-29 21:25 PDT, Alex Christensen
no flags
Patch (62.21 KB, patch)
2019-05-01 13:32 PDT, Alex Christensen
no flags
Archive of layout-test-results from ews107 for mac-highsierra-wk2 (1023.99 KB, application/zip)
2019-05-01 14:24 PDT, EWS Watchlist
no flags
Patch (64.13 KB, patch)
2019-05-01 15:56 PDT, Alex Christensen
no flags
Patch (65.53 KB, patch)
2019-05-01 17:08 PDT, Alex Christensen
no flags
Patch (66.87 KB, patch)
2019-05-02 09:14 PDT, Alex Christensen
no flags
Patch (67.32 KB, patch)
2019-05-02 10:04 PDT, Alex Christensen
no flags
Archive of layout-test-results from ews215 for win-future (13.58 MB, application/zip)
2019-05-02 12:10 PDT, EWS Watchlist
no flags
Patch (67.51 KB, patch)
2019-05-06 15:28 PDT, Alex Christensen
no flags
Patch (69.18 KB, patch)
2019-05-06 15:36 PDT, Alex Christensen
no flags
Patch (64.97 KB, patch)
2019-05-06 15:48 PDT, Alex Christensen
no flags
Archive of layout-test-results from ews214 for win-future (13.63 MB, application/zip)
2019-05-06 22:54 PDT, EWS Watchlist
no flags
Patch (68.00 KB, patch)
2019-05-07 14:08 PDT, Alex Christensen
no flags
Patch (64.88 KB, patch)
2019-05-07 14:15 PDT, Alex Christensen
no flags
Patch (64.78 KB, patch)
2019-05-15 15:58 PDT, Alex Christensen
no flags
Patch (64.94 KB, patch)
2019-05-17 14:43 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2019-04-29 17:57:12 PDT
Alex Christensen
Comment 2 2019-04-29 21:25:50 PDT
Alex Christensen
Comment 3 2019-05-01 13:32:26 PDT
Geoffrey Garen
Comment 4 2019-05-01 14:19:40 PDT
Looks like mac-wk2 is crashing on every test.
EWS Watchlist
Comment 5 2019-05-01 14:24:10 PDT
Comment on attachment 368698 [details] Patch Attachment 368698 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/12053841 Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 6 2019-05-01 14:24:12 PDT
Created attachment 368711 [details] Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
Alex Christensen
Comment 7 2019-05-01 15:56:31 PDT
Alex Christensen
Comment 8 2019-05-01 17:08:59 PDT
Alex Christensen
Comment 9 2019-05-02 09:14:32 PDT
Alex Christensen
Comment 10 2019-05-02 10:04:50 PDT
EWS Watchlist
Comment 11 2019-05-02 12:10:04 PDT
Comment on attachment 368780 [details] Patch Attachment 368780 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/12063884 New failing tests: http/tests/css/filters-on-iframes.html
EWS Watchlist
Comment 12 2019-05-02 12:10:14 PDT
Created attachment 368801 [details] Archive of layout-test-results from ews215 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews215 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Darin Adler
Comment 13 2019-05-02 15:00:54 PDT
Comment on attachment 368780 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=368780&action=review Started reviewing, but sadly didn't finish. But have a couple comments already > Source/WebCore/loader/CustomHeaderFields.cpp:48 > + if (domainOrPattern.length() > 2 > + && domainOrPattern[0] == '*' > + && domainOrPattern[1] == '.' > + && domainOrPattern.length() > registrableDomainLength > + && url.host().endsWith(StringView(domainOrPattern).substring(1))) > + return true; I think the first three lines of this could be replaced with this: if (domainOrPattern.startsWith("*.") For greater clarity and almost the same efficiency. I don’t understand the registrableDomainLength check and why it’s needed; hope we have test cases that fail if it’s removed. > Source/WebCore/loader/CustomHeaderFields.h:34 > +struct WEBCORE_EXPORT CustomHeaderFields { WEBCORE_EXPORT should go before struct, not after it, as a matter of coding style. > Source/WebKit/Platform/spi/ios/UIKitSPI.h:208 > typedef enum { > - UIFontTraitPlain = 0, > - UIFontTraitItalic = 1 << 0, > - UIFontTraitBold = 1 << 1, > -} UIFontTrait; > - > -@interface UIFont () > -+ (UIFont *)fontWithFamilyName:(NSString *)familyName traits:(UIFontTrait)traits size:(CGFloat)fontSize; > -- (UIFontTrait)traits; > -@end > - > -typedef enum { > UIAllCorners = 0xFF, > } UIRectCorners; No mention of the changes to this file in the change log. I don’t understand the rationale. Please just roll this file back or comment about why it’s being changed. > Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp:92 > + customHeaderFields.reserveInitialCapacity(this->customHeaderFields().size() + 1); Could compute this correctly instead of making it one two big by checking legacyCustomHeaderFields() size in a boolean.
Alex Christensen
Comment 14 2019-05-02 22:36:59 PDT
(In reply to Darin Adler from comment #13) > Comment on attachment 368780 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=368780&action=review > > Started reviewing, but sadly didn't finish. But have a couple comments > already > > > Source/WebCore/loader/CustomHeaderFields.cpp:48 > > + if (domainOrPattern.length() > 2 > > + && domainOrPattern[0] == '*' > > + && domainOrPattern[1] == '.' > > + && domainOrPattern.length() > registrableDomainLength > > + && url.host().endsWith(StringView(domainOrPattern).substring(1))) > > + return true; > > I think the first three lines of this could be replaced with this: > > if (domainOrPattern.startsWith("*.") That's a great idea. > > For greater clarity and almost the same efficiency. I don’t understand the > registrableDomainLength check and why it’s needed; hope we have test cases > that fail if it’s removed. The registrableDomainLength check is to prevent someone from adding something like "*.com". I'll add such a test. > > Source/WebCore/loader/CustomHeaderFields.h:34 > > +struct WEBCORE_EXPORT CustomHeaderFields { > > WEBCORE_EXPORT should go before struct, not after it, as a matter of coding > style. I disagree. It is needed exactly where it is to make Windows link successfully. We have 3 existing instances of "struct WEBCORE_EXPORT" and 0 of "WEBCORE_EXPORT struct". Same with 90 "class WEBCORE_EXPORT" and 0 "WEBCORE_EXPORT class". > > Source/WebKit/Platform/spi/ios/UIKitSPI.h:208 > > typedef enum { > > - UIFontTraitPlain = 0, > > - UIFontTraitItalic = 1 << 0, > > - UIFontTraitBold = 1 << 1, > > -} UIFontTrait; > > - > > -@interface UIFont () > > -+ (UIFont *)fontWithFamilyName:(NSString *)familyName traits:(UIFontTrait)traits size:(CGFloat)fontSize; > > -- (UIFontTrait)traits; > > -@end > > - > > -typedef enum { > > UIAllCorners = 0xFF, > > } UIRectCorners; > > No mention of the changes to this file in the change log. I don’t understand > the rationale. Please just roll this file back or comment about why it’s > being changed. These changes are needed because our code hygiene has been lacking ever since we started compiling multiple cpp files together. Such strange unrelated-looking build fixes are needed almost every time we add a new file because someone has assumed a file will always be included before this one. That's what's held me back and caused me to look into https://bugs.webkit.org/show_bug.cgi?id=197534 so the iOS build doesn't have so many unrelated fixes.
Alex Christensen
Comment 15 2019-05-06 15:28:17 PDT
Alex Christensen
Comment 16 2019-05-06 15:36:51 PDT
Alex Christensen
Comment 17 2019-05-06 15:48:29 PDT
EWS Watchlist
Comment 18 2019-05-06 22:54:21 PDT
Comment on attachment 369187 [details] Patch Attachment 369187 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/12119745 New failing tests: svg/repaint/remove-border-property-on-root.html security/contentSecurityPolicy/video-with-file-url-allowed-by-media-src-star.html
EWS Watchlist
Comment 19 2019-05-06 22:54:23 PDT
Created attachment 369238 [details] Archive of layout-test-results from ews214 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews214 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Alex Christensen
Comment 20 2019-05-07 12:05:51 PDT
ping review
Geoffrey Garen
Comment 21 2019-05-07 13:54:21 PDT
> > > Source/WebCore/loader/CustomHeaderFields.h:34 > > > +struct WEBCORE_EXPORT CustomHeaderFields { > > > > WEBCORE_EXPORT should go before struct, not after it, as a matter of coding > > style. > I disagree. It is needed exactly where it is to make Windows link > successfully. We have 3 existing instances of "struct WEBCORE_EXPORT" and 0 > of "WEBCORE_EXPORT struct". Same with 90 "class WEBCORE_EXPORT" and 0 > "WEBCORE_EXPORT class". Seems accurate: scratch.cc:3:16: warning: attribute 'visibility' is ignored, place it after "struct" to apply attribute to type declaration [-Wignored-attributes] __attribute__((visibility("default"))) struct S {
Geoffrey Garen
Comment 22 2019-05-07 14:02:17 PDT
Comment on attachment 369187 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=369187&action=review r=me > Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm:52 > + NSMutableDictionary<NSString *, NSString *> *dictionary = [[[NSMutableDictionary alloc] initWithCapacity:vector.size()] autorelease]; You can use +dictionaryWithCapacity here. > Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm:72 > + NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:domains.size()] autorelease]; +arrayWithCapacity
Alex Christensen
Comment 23 2019-05-07 14:08:24 PDT
Alex Christensen
Comment 24 2019-05-07 14:15:10 PDT
WebKit Commit Bot
Comment 25 2019-05-07 14:51:50 PDT
Comment on attachment 369328 [details] Patch Clearing flags on attachment: 369328 Committed r245038: <https://trac.webkit.org/changeset/245038>
WebKit Commit Bot
Comment 26 2019-05-07 14:51:52 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 27 2019-05-07 14:54:48 PDT
Ryan Haddad
Comment 28 2019-05-07 16:44:58 PDT
Reverted r245038 for reason: Breaks internal builds. Committed r245044: <https://trac.webkit.org/changeset/245044>
Ryan Haddad
Comment 29 2019-05-07 16:45:22 PDT
(In reply to Ryan Haddad from comment #28) > Reverted r245038 for reason: > > Breaks internal builds. > > Committed r245044: <https://trac.webkit.org/changeset/245044> Details in radar.
Alex Christensen
Comment 30 2019-05-15 15:58:56 PDT
WebKit Commit Bot
Comment 31 2019-05-16 11:08:37 PDT
Comment on attachment 370005 [details] Patch Clearing flags on attachment: 370005 Committed r245401: <https://trac.webkit.org/changeset/245401>
WebKit Commit Bot
Comment 32 2019-05-16 11:08:39 PDT
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 33 2019-05-17 10:27:19 PDT
Re-opened since this is blocked by bug 197990
Shawn Roberts
Comment 34 2019-05-17 11:22:23 PDT
Rolled out in https://trac.webkit.org/changeset/245470/webkit Causing internal build failures
Alex Christensen
Comment 35 2019-05-17 13:53:03 PDT
(In reply to Shawn Roberts from comment #34) > Rolled out in https://trac.webkit.org/changeset/245470/webkit > > Causing internal build failures Could you please put a link to such failures in the radar? It worked for all internal builds I tested.
Ryan Haddad
Comment 36 2019-05-17 13:58:49 PDT
(In reply to Alex Christensen from comment #35) > (In reply to Shawn Roberts from comment #34) > Could you please put a link to such failures in the radar? It worked for > all internal builds I tested. He emailed links to you. I added them to the radar.
Alex Christensen
Comment 37 2019-05-17 14:43:48 PDT
Alex Christensen
Comment 38 2019-05-17 14:50:49 PDT
Note You need to log in before you can comment on or make changes to this bug.