mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
style: Make media feature evaluation take a computed::Context
This has no behavior change right now, but will simplify sharing code with container queries. Container queries will have container information in the computed::Context (this is necessary anyways for container-based units), so this avoids having to have different code for media and container queries. Differential Revision: https://phabricator.services.mozilla.com/D144152
This commit is contained in:
parent
6279504ddb
commit
8d8b5942be
6 changed files with 119 additions and 125 deletions
|
@ -56,12 +56,12 @@ impl SourceSizeList {
|
|||
|
||||
/// Evaluate this <source-size-list> to get the final viewport length.
|
||||
pub fn evaluate(&self, device: &Device, quirks_mode: QuirksMode) -> Au {
|
||||
let matching_source_size = self
|
||||
.source_sizes
|
||||
.iter()
|
||||
.find(|source_size| source_size.condition.matches(device, quirks_mode));
|
||||
|
||||
computed::Context::for_media_query_evaluation(device, quirks_mode, |context| {
|
||||
let matching_source_size = self
|
||||
.source_sizes
|
||||
.iter()
|
||||
.find(|source_size| source_size.condition.matches(context));
|
||||
|
||||
match matching_source_size {
|
||||
Some(source_size) => source_size.value.to_computed_value(context),
|
||||
None => match self.value {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue