| Summary: | [MQ4] Replace the last uses of legacy media query code | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||||||||||
| Component: | CSS | Assignee: | Antti Koivisto <koivisto> | ||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||
| Severity: | Normal | CC: | cdumez, changseok, darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, japhet, jer.noble, macpherson, menard, philipj, sergio, webkit-bug-importer, youssefdevelops, y_soliman | ||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| Bug Depends on: | |||||||||||||||
| Bug Blocks: | 180234, 248619 | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Antti Koivisto
2022-12-01 03:23:52 PST
Created attachment 463831 [details]
Patch
Created attachment 463832 [details]
Patch
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. Created attachment 463833 [details]
Patch for landing
Created attachment 463834 [details]
Patch
Created attachment 463836 [details]
Patch for landing
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]. |