mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
Move Element::matches_environment
to MediaList
(#39034)
It more logically matches `MediaList`, and it allows us to call this method with a document. This is required when parsing Link headers, as they don't have an associated element, but they do have a document. Part of #35035 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
aac6aa6c70
commit
fc6bee8b81
4 changed files with 32 additions and 34 deletions
|
@ -339,7 +339,7 @@ impl VirtualMethods for HTMLLinkElement {
|
|||
}
|
||||
|
||||
let matches_media_environment =
|
||||
self.upcast::<Element>().matches_environment(&attr.value());
|
||||
MediaList::matches_environment(&self.owner_document(), &attr.value());
|
||||
self.previous_media_environment_matched
|
||||
.set(matches_media_environment);
|
||||
},
|
||||
|
@ -573,7 +573,7 @@ impl HTMLLinkElement {
|
|||
None => "",
|
||||
};
|
||||
|
||||
if !element.matches_environment(mq_str) {
|
||||
if !MediaList::matches_environment(&document, mq_str) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue