Summary: | Do not try to preconnect on link click when link preconnect setting is disabled | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||
Component: | WebCore Misc. | Assignee: | Carlos Garcia Campos <cgarcia> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, bugs-noreply, cdumez, cgarcia, mcatanzaro, webkit-bug-importer, webkit | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=244026 | ||||||
Attachments: |
|
Description
Michael Catanzaro
2022-09-23 07:58:00 PDT
Created attachment 462600 [details]
Add ENABLE(SERVER_PRECONNECT) guards
Not sure if those are all instances that need to be guarded, but at least those two seem to make the browser appear usable again.
Comment on attachment 462600 [details] Add ENABLE(SERVER_PRECONNECT) guards View in context: https://bugs.webkit.org/attachment.cgi?id=462600&action=review > Source/WebCore/html/HTMLAnchorElement.cpp:542 > +#if !ENABLE(SERVER_PRECONNECT) > + return; > +#endif It would be better to add the guard around the block below. But I wonder if it would be better to check linkPreconnectEnabled in settings instead. Alex? Chris? > Source/WebCore/loader/LinkLoader.cpp:214 > +#if !ENABLE(SERVER_PRECONNECT) > + return; > +#endif Are you sure you need this one? If server preconnect is disabled then params.relAttribute.isLinkPreconnect should be false below, so it will return early in any case. (In reply to Carlos Garcia Campos from comment #2) > Are you sure you need this one? No. Consider my patch just a step in debugging rather than a fix proposal. I know nothing about WebKit's codebase and my setup takes a few hours to build a working WK package, so I simply went with testing a minimal change that seemed likely to avoid the crash, and reported my findings here :) Comment on attachment 462600 [details] Add ENABLE(SERVER_PRECONNECT) guards View in context: https://bugs.webkit.org/attachment.cgi?id=462600&action=review >> Source/WebCore/html/HTMLAnchorElement.cpp:542 >> +#endif > > It would be better to add the guard around the block below. But I wonder if it would be better to check linkPreconnectEnabled in settings instead. Alex? Chris? Yeah, this isn't great. It adds a bunch of unreachable code when SERVER_PRECONNECT is disabled. Pull request: https://github.com/WebKit/WebKit/pull/4790 Committed 255024@main (49f6854f09b5): <https://commits.webkit.org/255024@main> Reviewed commits have been landed. Closing PR #4790 and removing active labels. |