mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
style: Fix indentation of the media query code.
Bug: 1396057 Reviewed-by: Manishearth MozReview-Commit-ID: BtdGHbQAzeS
This commit is contained in:
parent
bc58e18761
commit
a09f5208d4
1 changed files with 58 additions and 54 deletions
|
@ -439,7 +439,8 @@ impl MediaExpressionValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_feature<F>(mut f: F) -> Option<&'static nsMediaFeature>
|
fn find_feature<F>(mut f: F) -> Option<&'static nsMediaFeature>
|
||||||
where F: FnMut(&'static nsMediaFeature) -> bool,
|
where
|
||||||
|
F: FnMut(&'static nsMediaFeature) -> bool,
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut features = structs::nsMediaFeatures_features.as_ptr();
|
let mut features = structs::nsMediaFeatures_features.as_ptr();
|
||||||
|
@ -453,10 +454,12 @@ fn find_feature<F>(mut f: F) -> Option<&'static nsMediaFeature>
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn find_in_table<F>(mut current_entry: *const nsCSSProps_KTableEntry,
|
unsafe fn find_in_table<F>(
|
||||||
mut f: F)
|
mut current_entry: *const nsCSSProps_KTableEntry,
|
||||||
-> Option<(nsCSSKeyword, i16)>
|
mut f: F,
|
||||||
where F: FnMut(nsCSSKeyword, i16) -> bool
|
) -> Option<(nsCSSKeyword, i16)>
|
||||||
|
where
|
||||||
|
F: FnMut(nsCSSKeyword, i16) -> bool
|
||||||
{
|
{
|
||||||
loop {
|
loop {
|
||||||
let value = (*current_entry).mValue;
|
let value = (*current_entry).mValue;
|
||||||
|
@ -474,11 +477,12 @@ unsafe fn find_in_table<F>(mut current_entry: *const nsCSSProps_KTableEntry,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_feature_value<'i, 't>(feature: &nsMediaFeature,
|
fn parse_feature_value<'i, 't>(
|
||||||
|
feature: &nsMediaFeature,
|
||||||
feature_value_type: nsMediaFeature_ValueType,
|
feature_value_type: nsMediaFeature_ValueType,
|
||||||
context: &ParserContext,
|
context: &ParserContext,
|
||||||
input: &mut Parser<'i, 't>)
|
input: &mut Parser<'i, 't>,
|
||||||
-> Result<MediaExpressionValue, ParseError<'i>> {
|
) -> Result<MediaExpressionValue, ParseError<'i>> {
|
||||||
let value = match feature_value_type {
|
let value = match feature_value_type {
|
||||||
nsMediaFeature_ValueType::eLength => {
|
nsMediaFeature_ValueType::eLength => {
|
||||||
let length = Length::parse_non_negative(context, input)?;
|
let length = Length::parse_non_negative(context, input)?;
|
||||||
|
@ -532,8 +536,10 @@ fn parse_feature_value<'i, 't>(feature: &nsMediaFeature,
|
||||||
let location = input.current_source_location();
|
let location = input.current_source_location();
|
||||||
let keyword = input.expect_ident()?;
|
let keyword = input.expect_ident()?;
|
||||||
let keyword = unsafe {
|
let keyword = unsafe {
|
||||||
bindings::Gecko_LookupCSSKeyword(keyword.as_bytes().as_ptr(),
|
bindings::Gecko_LookupCSSKeyword(
|
||||||
keyword.len() as u32)
|
keyword.as_bytes().as_ptr(),
|
||||||
|
keyword.len() as u32,
|
||||||
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
let first_table_entry: *const nsCSSProps_KTableEntry = unsafe {
|
let first_table_entry: *const nsCSSProps_KTableEntry = unsafe {
|
||||||
|
@ -557,14 +563,12 @@ fn parse_feature_value<'i, 't>(feature: &nsMediaFeature,
|
||||||
|
|
||||||
impl Expression {
|
impl Expression {
|
||||||
/// Trivially construct a new expression.
|
/// Trivially construct a new expression.
|
||||||
fn new(feature: &'static nsMediaFeature,
|
fn new(
|
||||||
|
feature: &'static nsMediaFeature,
|
||||||
value: Option<MediaExpressionValue>,
|
value: Option<MediaExpressionValue>,
|
||||||
range: nsMediaExpression_Range) -> Self {
|
range: nsMediaExpression_Range,
|
||||||
Expression {
|
) -> Self {
|
||||||
feature: feature,
|
Self { feature, value, range }
|
||||||
value: value,
|
|
||||||
range: range,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a media expression of the form:
|
/// Parse a media expression of the form:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue