mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibWeb: Skip children based on media when updating the source set
If child has a media attribute and its value does not match the environment, continue to the next child.
This commit is contained in:
parent
87ac906ee6
commit
29d29134ba
Notes:
sideshowbarker
2024-07-17 09:37:30 +09:00
Author: https://github.com/axgallo
Commit: 29d29134ba
Pull-request: https://github.com/SerenityOS/serenity/pull/19101
5 changed files with 32 additions and 1 deletions
|
@ -741,7 +741,14 @@ static void update_the_source_set(DOM::Element& element)
|
|||
if (source_set.is_empty())
|
||||
continue;
|
||||
|
||||
// FIXME: 6. If child has a media attribute, and its value does not match the environment, continue to the next child.
|
||||
// 6. If child has a media attribute, and its value does not match the environment, continue to the next child.
|
||||
if (child->has_attribute(HTML::AttributeNames::media)) {
|
||||
auto media_query = parse_media_query(CSS::Parser::ParsingContext { element.document() },
|
||||
child->attribute(HTML::AttributeNames::media));
|
||||
if (!media_query || !media_query->evaluate(element.document().window())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 7. Parse child's sizes attribute, and let source set's source size be the returned value.
|
||||
source_set.m_source_size = parse_a_sizes_attribute(element.document(), child->attribute(HTML::AttributeNames::sizes));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue