mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting * Reformat all imports
This commit is contained in:
parent
413da4ca69
commit
aad2dccc9c
802 changed files with 6861 additions and 6395 deletions
|
@ -3,8 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use ipc_channel::ipc;
|
||||
use metrics::{InteractiveFlag, InteractiveMetrics};
|
||||
use metrics::{ProfilerMetadataFactory, ProgressiveWebMetric};
|
||||
use metrics::{InteractiveFlag, InteractiveMetrics, ProfilerMetadataFactory, ProgressiveWebMetric};
|
||||
use profile_traits::time::{ProfilerChan, TimerMetadata};
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use ipc_channel::ipc;
|
||||
use profile::time;
|
||||
use profile_traits::ipc as ProfiledIpc;
|
||||
use profile_traits::time::{ProfilerCategory, ProfilerData, ProfilerMsg};
|
||||
use servo_config::opts::OutputOptions;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
#[test]
|
||||
fn time_profiler_smoke_test() {
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style::properties::longhands::background_size;
|
||||
use style::properties::longhands::{
|
||||
background_attachment, background_clip, background_color, background_image,
|
||||
};
|
||||
use style::properties::longhands::{
|
||||
background_origin, background_position_x, background_position_y, background_repeat,
|
||||
background_attachment, background_clip, background_color, background_image, background_origin,
|
||||
background_position_x, background_position_y, background_repeat, background_size,
|
||||
};
|
||||
use style::properties::shorthands::background;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn background_shorthand_should_parse_all_available_properties_when_specified() {
|
||||
let input = "url(\"http://servo/test.png\") top center / 200px 200px repeat-x fixed padding-box content-box red";
|
||||
|
|
|
@ -2,15 +2,18 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style::parser::Parse;
|
||||
use style::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
|
||||
use style::properties::longhands::{border_image_source, border_image_width};
|
||||
use style::properties::longhands::{
|
||||
border_image_outset, border_image_repeat, border_image_slice, border_image_source,
|
||||
border_image_width,
|
||||
};
|
||||
use style::properties::shorthands::border_image;
|
||||
use style::properties::MaybeBoxed;
|
||||
use style::values::specified::BorderRadius;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
macro_rules! assert_longhand {
|
||||
($parsed_shorthand: expr, $prop: ident, $value_string: expr) => {
|
||||
assert_eq!(
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_transform_translate() {
|
||||
use style::properties::longhands::transform;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_column_width() {
|
||||
use style::properties::longhands::column_width;
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style::properties::longhands::{perspective_origin, transform_origin};
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_clip() {
|
||||
use style::properties::longhands::clip;
|
||||
|
@ -49,9 +50,10 @@ fn test_effects_parser_exhaustion() {
|
|||
|
||||
#[test]
|
||||
fn test_parse_factor() {
|
||||
use crate::parsing::parse;
|
||||
use style::properties::longhands::filter;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
assert!(parse(filter::parse, "brightness(0)").is_ok());
|
||||
assert!(parse(filter::parse, "brightness(55)").is_ok());
|
||||
assert!(parse(filter::parse, "brightness(100)").is_ok());
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style::values::generics::text::Spacing;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn negative_letter_spacing_should_parse_properly() {
|
||||
use style::properties::longhands::letter_spacing;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_outline_style() {
|
||||
use style::properties::longhands::outline_style;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_text_overflow() {
|
||||
use style::properties::longhands::text_overflow;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style::properties::longhands::transition_duration;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_positive_transition_duration() {
|
||||
assert!(parse(transition_duration::parse, "5s").is_ok());
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::parsing::parse;
|
||||
use style::properties::longhands::transition_timing_function;
|
||||
use style_traits::ToCss;
|
||||
|
||||
use crate::parsing::parse;
|
||||
|
||||
#[test]
|
||||
fn test_cubic_bezier() {
|
||||
assert_roundtrip_with_context!(
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use serde_json::{self, Value};
|
||||
use std::env;
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
|
||||
use serde_json::{self, Value};
|
||||
|
||||
#[test]
|
||||
fn properties_list_json() {
|
||||
let top = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap())
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::cell::RefCell;
|
||||
|
||||
use cssparser::SourceLocation;
|
||||
use servo_arc::Arc;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::RefCell;
|
||||
use style::context::QuirksMode;
|
||||
use style::error_reporting::{ContextualParseError, ParseErrorReporter};
|
||||
use style::media_queries::MediaList;
|
||||
|
|
|
@ -3,22 +3,21 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::SourceLocation;
|
||||
use euclid::Scale;
|
||||
use euclid::Size2D;
|
||||
use euclid::{Scale, Size2D};
|
||||
use selectors::parser::{AncestorHashes, Selector};
|
||||
use servo_arc::Arc;
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
use style::context::QuirksMode;
|
||||
use style::media_queries::{Device, MediaType};
|
||||
use style::properties::{longhands, Importance};
|
||||
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock};
|
||||
use style::properties::{longhands, Importance, PropertyDeclaration, PropertyDeclarationBlock};
|
||||
use style::selector_map::SelectorMap;
|
||||
use style::selector_parser::{SelectorImpl, SelectorParser};
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylesheets::StyleRule;
|
||||
use style::stylist::needs_revalidation_for_testing;
|
||||
use style::stylist::{ContainerConditionId, LayerId, Rule, Stylist};
|
||||
use style::stylist::{
|
||||
needs_revalidation_for_testing, ContainerConditionId, LayerId, Rule, Stylist,
|
||||
};
|
||||
use style::thread_state::{self, ThreadState};
|
||||
|
||||
/// Helper method to get some Rules from selector strings.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue