Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-08-14 23:35:27 +02:00 committed by Martin Robinson
parent bbf10a43b8
commit 9605ed7c74
5 changed files with 15 additions and 8 deletions

View file

@ -452,6 +452,10 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
fn namespace(&self) -> &Namespace {
self.element.namespace()
}
fn primary_box_size(&self) -> euclid::default::Size2D<app_units::Au> {
todo!();
}
}
impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element

View file

@ -440,9 +440,10 @@ ${helpers.predefined_type(
"container-type",
"ContainerType",
"computed::ContainerType::NONE",
engines="gecko",
engines="gecko servo",
animation_value_type="none",
gecko_pref="layout.css.container-queries.enabled",
servo_pref="layout.container-queries.enabled",
spec="https://drafts.csswg.org/css-contain-3/#container-type",
)}
@ -450,9 +451,10 @@ ${helpers.predefined_type(
"container-name",
"ContainerName",
"computed::ContainerName::none()",
engines="gecko",
engines="gecko servo",
animation_value_type="none",
gecko_pref="layout.css.container-queries.enabled",
servo_pref="layout.container-queries.enabled",
spec="https://drafts.csswg.org/css-contain-3/#container-name",
)}

View file

@ -7,7 +7,7 @@
use crate::context::QuirksMode;
use crate::custom_properties::CssEnvironment;
use crate::font_metrics::FontMetrics;
use crate::queries::feature::{AllowsRanges, Evaluator, ParsingRequirements, QueryFeatureDescription};
use crate::queries::feature::{AllowsRanges, Evaluator, FeatureFlags, QueryFeatureDescription};
use crate::media_queries::MediaType;
use crate::properties::ComputedValues;
use crate::values::computed::CSSPixelLength;
@ -259,13 +259,13 @@ lazy_static! {
atom!("width"),
AllowsRanges::Yes,
Evaluator::Length(eval_width),
ParsingRequirements::empty(),
FeatureFlags::empty(),
),
feature!(
atom!("scan"),
AllowsRanges::No,
keyword_evaluator!(eval_scan, Scan),
ParsingRequirements::empty(),
FeatureFlags::empty(),
),
];
}

View file

@ -458,7 +458,10 @@ fn container_queries_enabled() -> bool {
#[cfg(feature = "gecko")]
return static_prefs::pref!("layout.css.container-queries.enabled");
#[cfg(feature = "servo")]
return false;
return servo_config::prefs::pref_map()
.get("layout.container-queries.enabled")
.as_bool()
.unwrap_or(false);
}
impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {

View file

@ -221,7 +221,6 @@ impl<'a> Context<'a> {
F: FnOnce(&Context) -> R,
{
let mut conditions = RuleCacheConditions::default();
let provider = get_metrics_provider_for_product();
let (container_info, style) = match container_info_and_style {
Some((ci, s)) => (Some(ci), Some(s)),
@ -232,7 +231,6 @@ impl<'a> Context<'a> {
let quirks_mode = device.quirks_mode();
let context = Context {
builder: StyleBuilder::for_inheritance(device, style, None),
font_metrics_provider: &provider,
cached_system_font: None,
in_media_query: true,
quirks_mode,