mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Further changes required by Servo
This commit is contained in:
parent
bbf10a43b8
commit
9605ed7c74
5 changed files with 15 additions and 8 deletions
|
@ -452,6 +452,10 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
|
||||||
fn namespace(&self) -> &Namespace {
|
fn namespace(&self) -> &Namespace {
|
||||||
self.element.namespace()
|
self.element.namespace()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn primary_box_size(&self) -> euclid::default::Size2D<app_units::Au> {
|
||||||
|
todo!();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
|
impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
|
||||||
|
|
|
@ -440,9 +440,10 @@ ${helpers.predefined_type(
|
||||||
"container-type",
|
"container-type",
|
||||||
"ContainerType",
|
"ContainerType",
|
||||||
"computed::ContainerType::NONE",
|
"computed::ContainerType::NONE",
|
||||||
engines="gecko",
|
engines="gecko servo",
|
||||||
animation_value_type="none",
|
animation_value_type="none",
|
||||||
gecko_pref="layout.css.container-queries.enabled",
|
gecko_pref="layout.css.container-queries.enabled",
|
||||||
|
servo_pref="layout.container-queries.enabled",
|
||||||
spec="https://drafts.csswg.org/css-contain-3/#container-type",
|
spec="https://drafts.csswg.org/css-contain-3/#container-type",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -450,9 +451,10 @@ ${helpers.predefined_type(
|
||||||
"container-name",
|
"container-name",
|
||||||
"ContainerName",
|
"ContainerName",
|
||||||
"computed::ContainerName::none()",
|
"computed::ContainerName::none()",
|
||||||
engines="gecko",
|
engines="gecko servo",
|
||||||
animation_value_type="none",
|
animation_value_type="none",
|
||||||
gecko_pref="layout.css.container-queries.enabled",
|
gecko_pref="layout.css.container-queries.enabled",
|
||||||
|
servo_pref="layout.container-queries.enabled",
|
||||||
spec="https://drafts.csswg.org/css-contain-3/#container-name",
|
spec="https://drafts.csswg.org/css-contain-3/#container-name",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
use crate::context::QuirksMode;
|
use crate::context::QuirksMode;
|
||||||
use crate::custom_properties::CssEnvironment;
|
use crate::custom_properties::CssEnvironment;
|
||||||
use crate::font_metrics::FontMetrics;
|
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::media_queries::MediaType;
|
||||||
use crate::properties::ComputedValues;
|
use crate::properties::ComputedValues;
|
||||||
use crate::values::computed::CSSPixelLength;
|
use crate::values::computed::CSSPixelLength;
|
||||||
|
@ -259,13 +259,13 @@ lazy_static! {
|
||||||
atom!("width"),
|
atom!("width"),
|
||||||
AllowsRanges::Yes,
|
AllowsRanges::Yes,
|
||||||
Evaluator::Length(eval_width),
|
Evaluator::Length(eval_width),
|
||||||
ParsingRequirements::empty(),
|
FeatureFlags::empty(),
|
||||||
),
|
),
|
||||||
feature!(
|
feature!(
|
||||||
atom!("scan"),
|
atom!("scan"),
|
||||||
AllowsRanges::No,
|
AllowsRanges::No,
|
||||||
keyword_evaluator!(eval_scan, Scan),
|
keyword_evaluator!(eval_scan, Scan),
|
||||||
ParsingRequirements::empty(),
|
FeatureFlags::empty(),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,7 +458,10 @@ fn container_queries_enabled() -> bool {
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
return static_prefs::pref!("layout.css.container-queries.enabled");
|
return static_prefs::pref!("layout.css.container-queries.enabled");
|
||||||
#[cfg(feature = "servo")]
|
#[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> {
|
impl<'a, 'b, 'i> AtRuleParser<'i> for NestedRuleParser<'a, 'b> {
|
||||||
|
|
|
@ -221,7 +221,6 @@ impl<'a> Context<'a> {
|
||||||
F: FnOnce(&Context) -> R,
|
F: FnOnce(&Context) -> R,
|
||||||
{
|
{
|
||||||
let mut conditions = RuleCacheConditions::default();
|
let mut conditions = RuleCacheConditions::default();
|
||||||
let provider = get_metrics_provider_for_product();
|
|
||||||
|
|
||||||
let (container_info, style) = match container_info_and_style {
|
let (container_info, style) = match container_info_and_style {
|
||||||
Some((ci, s)) => (Some(ci), Some(s)),
|
Some((ci, s)) => (Some(ci), Some(s)),
|
||||||
|
@ -232,7 +231,6 @@ impl<'a> Context<'a> {
|
||||||
let quirks_mode = device.quirks_mode();
|
let quirks_mode = device.quirks_mode();
|
||||||
let context = Context {
|
let context = Context {
|
||||||
builder: StyleBuilder::for_inheritance(device, style, None),
|
builder: StyleBuilder::for_inheritance(device, style, None),
|
||||||
font_metrics_provider: &provider,
|
|
||||||
cached_system_font: None,
|
cached_system_font: None,
|
||||||
in_media_query: true,
|
in_media_query: true,
|
||||||
quirks_mode,
|
quirks_mode,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue