Skip to content
Permalink
Browse files

Manual fixups so that the rustfmt output won't trigger tidy.

  • Loading branch information
bholley committed Apr 11, 2018
1 parent b292f78 commit f7ae1a37e3e004e156e5833551c486a7a5f189a0
Showing with 443 additions and 416 deletions.
  1. +1 −2 components/selectors/build.rs
  2. +1 −1 components/selectors/lib.rs
  3. +39 −34 components/selectors/parser.rs
  4. +10 −11 components/style/custom_properties.rs
  5. +2 −1 components/style/font_face.rs
  6. +20 −8 components/style/gecko/arc_types.rs
  7. +44 −46 components/style/gecko/conversions.rs
  8. +2 −2 components/style/gecko/data.rs
  9. +3 −2 components/style/gecko/media_queries.rs
  10. +2 −1 components/style/gecko/selector_parser.rs
  11. +2 −1 components/style/gecko/snapshot.rs
  12. +4 −4 components/style/gecko/wrapper.rs
  13. +6 −6 components/style/gecko_bindings/sugar/ns_style_coord.rs
  14. +2 −1 components/style/gecko_bindings/sugar/ns_timing_function.rs
  15. +2 −1 components/style/invalidation/element/element_wrapper.rs
  16. +1 −1 components/style/lib.rs
  17. +2 −1 components/style/stylesheets/document_rule.rs
  18. +3 −2 components/style/stylesheets/font_feature_values_rule.rs
  19. +2 −1 components/style/stylesheets/import_rule.rs
  20. +5 −3 components/style/stylesheets/keyframes_rule.rs
  21. +2 −1 components/style/stylesheets/media_rule.rs
  22. +4 −2 components/style/stylesheets/mod.rs
  23. +2 −1 components/style/stylesheets/page_rule.rs
  24. +5 −2 components/style/stylesheets/style_rule.rs
  25. +2 −1 components/style/stylesheets/stylesheet.rs
  26. +4 −2 components/style/stylesheets/supports_rule.rs
  27. +3 −4 components/style/traversal.rs
  28. +2 −2 components/style/values/computed/angle.rs
  29. +2 −1 components/style/values/computed/background.rs
  30. +8 −11 components/style/values/computed/basic_shape.rs
  31. +9 −12 components/style/values/computed/image.rs
  32. +2 −1 components/style/values/computed/text.rs
  33. +82 −85 components/style/values/computed/transform.rs
  34. +3 −4 components/style/values/generics/basic_shape.rs
  35. +4 −4 components/style/values/generics/transform.rs
  36. +23 −26 components/style/values/specified/basic_shape.rs
  37. +5 −3 components/style/values/specified/grid.rs
  38. +59 −52 components/style/values/specified/image.rs
  39. +4 −3 components/style/values/specified/mod.rs
  40. +65 −70 components/style/values/specified/transform.rs
@@ -14,8 +14,7 @@ fn main() {
.join("ascii_case_insensitive_html_attributes.rs");
let mut file = BufWriter::new(File::create(&path).unwrap());

write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ",
).unwrap();
write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ").unwrap();
let mut set = phf_codegen::Set::new();
for name in ASCII_CASE_INSENSITIVE_HTML_ATTRIBUTES.split_whitespace() {
set.entry(name);
@@ -7,9 +7,9 @@

#[macro_use] extern crate bitflags;
#[macro_use] extern crate cssparser;
extern crate fnv;
#[macro_use] extern crate log;
#[macro_use] extern crate matches;
extern crate fnv;
extern crate phf;
extern crate precomputed_hash;
extern crate servo_arc;
@@ -9,7 +9,8 @@ use builder::{SelectorBuilder, SpecificityAndFlags};
use context::QuirksMode;
use cssparser::{ParseError, ParseErrorKind, BasicParseError, BasicParseErrorKind};
use cssparser::{SourceLocation, CowRcStr, Delimiter};
use cssparser::{Token, Parser as CssParser, parse_nth, ToCss, serialize_identifier, CssStringWriter};
use cssparser::{Token, Parser as CssParser, ToCss, CssStringWriter};
use cssparser::{parse_nth, serialize_identifier};
use precomputed_hash::PrecomputedHash;
use servo_arc::ThinArc;
use sink::Push;
@@ -1300,7 +1301,8 @@ impl<Impl: SelectorImpl> Selector<Impl> {
{
let selector = parse_selector(parser, input)?;
if selector.has_pseudo_element() {
return Err(input.new_custom_error(SelectorParseErrorKind::PseudoElementInComplexSelector))
let e = SelectorParseErrorKind::PseudoElementInComplexSelector;
return Err(input.new_custom_error(e))
}
Ok(selector)
}
@@ -1428,9 +1430,8 @@ where
Ok(OptionalQName::Some(namespace, Some(local_name.clone())))
}
Ok(t) if in_attr_selector => {
Err(location.new_custom_error(
SelectorParseErrorKind::InvalidQualNameInAttr(t.clone())
))
let e = SelectorParseErrorKind::InvalidQualNameInAttr(t.clone());
Err(location.new_custom_error(e))
}
Ok(t) => {
Err(location.new_custom_error(
@@ -1694,7 +1695,8 @@ where
},
Some(SimpleSelectorParseResult::PseudoElement(_)) |
Some(SimpleSelectorParseResult::SlottedPseudo(_)) => {
return Err(input.new_custom_error(SelectorParseErrorKind::NonSimpleSelectorInNegation));
let e = SelectorParseErrorKind::NonSimpleSelectorInNegation;
return Err(input.new_custom_error(e));
}
}
}
@@ -1759,10 +1761,10 @@ where
match input.next_including_whitespace() {
Ok(&Token::Colon) => {},
Ok(&Token::WhiteSpace(_)) | Err(_) => break,
Ok(t) =>
return Err(location.new_custom_error(
SelectorParseErrorKind::PseudoElementExpectedColon(t.clone())
)),
Ok(t) => {
let e = SelectorParseErrorKind::PseudoElementExpectedColon(t.clone());
return Err(location.new_custom_error(e));
},
}

let location = input.current_source_location();
@@ -1903,9 +1905,10 @@ where
let class = Component::Class(class.as_ref().into());
Ok(Some(SimpleSelectorParseResult::SimpleSelector(class)))
}
ref t => Err(location.new_custom_error(
SelectorParseErrorKind::ClassNeedsIdent(t.clone())
)),
ref t => {
let e = SelectorParseErrorKind::ClassNeedsIdent(t.clone());
Err(location.new_custom_error(e))
},
}
}
Ok(Token::SquareBracketBlock) => {
@@ -1921,33 +1924,32 @@ where
let (name, is_functional) = match next_token {
Token::Ident(name) => (name, false),
Token::Function(name) => (name, true),
t => return Err(input.new_custom_error(
SelectorParseErrorKind::PseudoElementExpectedIdent(t)
)),
t => {
let e = SelectorParseErrorKind::PseudoElementExpectedIdent(t);
return Err(input.new_custom_error(e));
},
};
let is_pseudo_element = !is_single_colon ||
P::pseudo_element_allows_single_colon(&name);
if is_pseudo_element {
let parse_result = if is_functional {
if P::parse_slotted(parser) && name.eq_ignore_ascii_case("slotted") {
SimpleSelectorParseResult::SlottedPseudo(
input.parse_nested_block(|input| {
parse_inner_compound_selector(
parser,
input,
)
})?
)
let selector = input.parse_nested_block(|input| {
parse_inner_compound_selector(
parser,
input,
)
})?;
SimpleSelectorParseResult::SlottedPseudo(selector)
} else {
SimpleSelectorParseResult::PseudoElement(
input.parse_nested_block(|input| {
P::parse_functional_pseudo_element(
parser,
name,
input,
)
})?
)
let selector = input.parse_nested_block(|input| {
P::parse_functional_pseudo_element(
parser,
name,
input,
)
})?;
SimpleSelectorParseResult::PseudoElement(selector)
}
} else {
SimpleSelectorParseResult::PseudoElement(
@@ -2158,7 +2160,10 @@ pub mod tests {
parser: &mut CssParser<'i, 't>,
) -> Result<PseudoClass, SelectorParseError<'i>> {
match_ignore_ascii_case! { &name,
"lang" => return Ok(PseudoClass::Lang(parser.expect_ident_or_string()?.as_ref().to_owned())),
"lang" => {
let lang = parser.expect_ident_or_string()?.as_ref().to_owned();
return Ok(PseudoClass::Lang(lang));
},
_ => {}
}
Err(parser.new_custom_error(SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name)))
@@ -366,25 +366,24 @@ fn parse_declaration_value_block<'i, 't>(
token.serialization_type()
}
Token::BadUrl(u) => {
return Err(input.new_custom_error(StyleParseErrorKind::BadUrlInDeclarationValueBlock(u)))
let e = StyleParseErrorKind::BadUrlInDeclarationValueBlock(u);
return Err(input.new_custom_error(e))
}
Token::BadString(s) => {
return Err(input.new_custom_error(StyleParseErrorKind::BadStringInDeclarationValueBlock(s)))
let e = StyleParseErrorKind::BadStringInDeclarationValueBlock(s);
return Err(input.new_custom_error(e))
}
Token::CloseParenthesis => {
return Err(input.new_custom_error(
StyleParseErrorKind::UnbalancedCloseParenthesisInDeclarationValueBlock
))
let e = StyleParseErrorKind::UnbalancedCloseParenthesisInDeclarationValueBlock;
return Err(input.new_custom_error(e))
}
Token::CloseSquareBracket => {
return Err(input.new_custom_error(
StyleParseErrorKind::UnbalancedCloseSquareBracketInDeclarationValueBlock
))
let e = StyleParseErrorKind::UnbalancedCloseSquareBracketInDeclarationValueBlock;
return Err(input.new_custom_error(e))
}
Token::CloseCurlyBracket => {
return Err(input.new_custom_error(
StyleParseErrorKind::UnbalancedCloseCurlyBracketInDeclarationValueBlock
))
let e = StyleParseErrorKind::UnbalancedCloseCurlyBracketInDeclarationValueBlock;
return Err(input.new_custom_error(e))
}
Token::Function(ref name) => {
if name.eq_ignore_ascii_case("var") {
@@ -12,8 +12,9 @@
use computed_values::{font_stretch, font_style, font_weight};
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use cssparser::{SourceLocation, CowRcStr};
#[cfg(feature = "gecko")]
use cssparser::UnicodeRange;
use error_reporting::{ContextualParseError, ParseErrorReporter};
#[cfg(feature = "gecko")] use cssparser::UnicodeRange;
use parser::{ParserContext, ParserErrorContext, Parse};
#[cfg(feature = "gecko")]
use properties::longhands::font_language_override;
@@ -8,13 +8,25 @@

#![allow(non_snake_case, missing_docs)]

use gecko_bindings::bindings::{RawServoCounterStyleRule, RawServoFontFeatureValuesRule, RawServoImportRule};
use gecko_bindings::bindings::{RawServoKeyframe, RawServoKeyframesRule, RawServoSupportsRule};
use gecko_bindings::bindings::{RawServoMediaRule, RawServoNamespaceRule, RawServoPageRule};
use gecko_bindings::bindings::{RawServoRuleNode, RawServoRuleNodeStrong, RawServoDocumentRule};
use gecko_bindings::bindings::RawServoCounterStyleRule;
use gecko_bindings::bindings::RawServoDocumentRule;
use gecko_bindings::bindings::RawServoFontFeatureValuesRule;
use gecko_bindings::bindings::RawServoImportRule;
use gecko_bindings::bindings::RawServoKeyframe;
use gecko_bindings::bindings::RawServoKeyframesRule;
use gecko_bindings::bindings::RawServoMediaRule;
use gecko_bindings::bindings::RawServoNamespaceRule;
use gecko_bindings::bindings::RawServoPageRule;
use gecko_bindings::bindings::RawServoRuleNode;
use gecko_bindings::bindings::RawServoRuleNodeStrong;
use gecko_bindings::bindings::RawServoSupportsRule;
use gecko_bindings::bindings::ServoCssRules;
use gecko_bindings::structs::{RawServoAnimationValue, RawServoDeclarationBlock, RawServoFontFaceRule};
use gecko_bindings::structs::{RawServoMediaList, RawServoStyleRule, RawServoStyleSheetContents};
use gecko_bindings::structs::RawServoAnimationValue;
use gecko_bindings::structs::RawServoDeclarationBlock;
use gecko_bindings::structs::RawServoFontFaceRule;
use gecko_bindings::structs::RawServoMediaList;
use gecko_bindings::structs::RawServoStyleRule;
use gecko_bindings::structs::RawServoStyleSheetContents;
use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI, Strong};
use media_queries::MediaList;
use properties::{ComputedValues, PropertyDeclarationBlock};
@@ -24,8 +36,8 @@ use servo_arc::{Arc, ArcBorrow};
use shared_lock::Locked;
use std::{mem, ptr};
use stylesheets::{CssRules, CounterStyleRule, FontFaceRule, FontFeatureValuesRule};
use stylesheets::{ImportRule, KeyframesRule, MediaRule, StylesheetContents, StyleRule};
use stylesheets::{NamespaceRule, PageRule, SupportsRule, DocumentRule};
use stylesheets::{DocumentRule, ImportRule, KeyframesRule, MediaRule, NamespaceRule, PageRule};
use stylesheets::{StylesheetContents, StyleRule, SupportsRule};
use stylesheets::keyframes_rule::Keyframe;

macro_rules! impl_arc_ffi {

0 comments on commit f7ae1a3

Please sign in to comment.
You can’t perform that action at this time.