mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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> {
|
||||
// FIXME: Derive Parse (probably with None_)
|
||||
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,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(t) = input.try(|i| TrackList::parse(context, i)) {
|
||||
return Ok(GridTemplateComponent::TrackList(t))
|
||||
if allow_grid_template_subgrids() {
|
||||
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