mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
stylo: Hide accidentally exposed subgrid behind prefs
This commit is contained in:
parent
c20fd7d58a
commit
1c48a3bedb
1 changed files with 18 additions and 3 deletions
|
@ -326,6 +326,19 @@ impl ToComputedValue for TrackList<LengthOrPercentage, Integer> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
|
#[inline]
|
||||||
|
fn allow_grid_template_subgrids() -> bool {
|
||||||
|
use gecko_bindings::structs::mozilla;
|
||||||
|
unsafe { mozilla::StylePrefs_sGridTemplateSubgridValueEnabled }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
|
#[inline]
|
||||||
|
fn allow_grid_template_subgrids() -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
impl Parse for GridTemplateComponent<LengthOrPercentage, Integer> {
|
impl Parse for GridTemplateComponent<LengthOrPercentage, Integer> {
|
||||||
// FIXME: Derive Parse (probably with None_)
|
// FIXME: Derive Parse (probably with None_)
|
||||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||||
|
@ -343,10 +356,12 @@ impl GridTemplateComponent<LengthOrPercentage, Integer> {
|
||||||
context: &ParserContext,
|
context: &ParserContext,
|
||||||
input: &mut Parser<'i, 't>,
|
input: &mut Parser<'i, 't>,
|
||||||
) -> Result<Self, ParseError<'i>> {
|
) -> Result<Self, ParseError<'i>> {
|
||||||
if let Ok(t) = input.try(|i| TrackList::parse(context, i)) {
|
if allow_grid_template_subgrids() {
|
||||||
return Ok(GridTemplateComponent::TrackList(t))
|
if let Ok(t) = input.try(|i| LineNameList::parse(context, i)) {
|
||||||
|
return Ok(GridTemplateComponent::Subgrid(t))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LineNameList::parse(context, input).map(GridTemplateComponent::Subgrid)
|
TrackList::parse(context, input).map(GridTemplateComponent::TrackList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue