RESOLVED FIXED 248594
[MQ4] Replace the last uses of legacy media query code
https://bugs.webkit.org/show_bug.cgi?id=248594
Summary [MQ4] Replace the last uses of legacy media query code
Antti Koivisto
Reported 2022-12-01 03:23:52 PST
In preloader etc.
Attachments
Patch (13.23 KB, patch)
2022-12-01 08:28 PST, Antti Koivisto
ews-feeder: commit-queue-
Patch (13.30 KB, patch)
2022-12-01 08:48 PST, Antti Koivisto
no flags
Patch for landing (13.33 KB, patch)
2022-12-01 09:20 PST, Antti Koivisto
koivisto: commit-queue+
Patch (132.42 KB, patch)
2022-12-01 09:30 PST, Antti Koivisto
no flags
Patch for landing (13.18 KB, patch)
2022-12-01 09:49 PST, Antti Koivisto
no flags
Radar WebKit Bug Importer
Comment 1 2022-12-01 03:25:06 PST
Antti Koivisto
Comment 2 2022-12-01 08:28:00 PST
Antti Koivisto
Comment 3 2022-12-01 08:48:37 PST
Darin Adler
Comment 4 2022-12-01 08:54:39 PST
Comment on attachment 463832 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463832&action=review What a great moment! > Source/WebCore/style/StyleScope.cpp:702 > > + Extra blank line here. > Source/WebKitLegacy/mac/DOM/DOM.mm:710 > HTMLLinkElement& link = *static_cast<HTMLLinkElement*>(core(self)); > - > - auto& media = link.attributeWithoutSynchronization(HTMLNames::mediaAttr); > - if (media.isEmpty()) > - return true; > - > - Document& document = link.document(); > - auto mediaQuerySet = MediaQuerySet::create(media, MediaQueryParserContext(document)); > - return LegacyMediaQueryEvaluator { "screen"_s, document, document.renderView() ? &document.renderView()->style() : nullptr }.evaluate(mediaQuerySet.get()); > + return link.mediaAttributeMatches(); I think we should just one-line this: return static_cast<HTMLLinkElement*>(core(self))->mediaAttributeMatches(); Also wondering why we need static_cast here, maybe it should be downcast, or maybe we need to overload core so we don’t need a typecast. But since this is legacy WebKit, I guess we can just leave it as-is.
Antti Koivisto
Comment 5 2022-12-01 09:20:54 PST
Created attachment 463833 [details] Patch for landing
Antti Koivisto
Comment 6 2022-12-01 09:30:20 PST
Antti Koivisto
Comment 7 2022-12-01 09:49:46 PST
Created attachment 463836 [details] Patch for landing
EWS
Comment 8 2022-12-01 12:54:23 PST
Committed 257252@main (be64fdb44bd3): <https://commits.webkit.org/257252@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 463836 [details].
Note You need to log in before you can comment on or make changes to this bug.