mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
style: Remove some redundant use statements.
This commit is contained in:
parent
c106fb1231
commit
b268ef6aed
7 changed files with 4 additions and 20 deletions
|
@ -418,10 +418,8 @@ impl nsStyleImage {
|
|||
use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE as CLOSEST_SIDE;
|
||||
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER as FARTHEST_CORNER;
|
||||
use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE as FARTHEST_SIDE;
|
||||
use crate::values::computed::image::LineDirection;
|
||||
use crate::values::computed::position::Position;
|
||||
use crate::values::computed::Length;
|
||||
use crate::values::generics::image::{Circle, ColorStop, CompatMode, Ellipse};
|
||||
use crate::values::generics::image::{Circle, ColorStop, Ellipse};
|
||||
use crate::values::generics::image::{EndingShape, GradientKind, ShapeExtent};
|
||||
|
||||
let gecko_gradient = bindings::Gecko_GetGradientImageValue(self)
|
||||
|
@ -834,8 +832,7 @@ impl TrackSize<LengthPercentage> {
|
|||
/// Return TrackSize from given two nsStyleCoord
|
||||
pub fn from_gecko_style_coords<T: CoordData>(gecko_min: &T, gecko_max: &T) -> Self {
|
||||
use crate::gecko_bindings::structs::root::nsStyleUnit;
|
||||
use crate::values::computed::length::LengthPercentage;
|
||||
use crate::values::generics::grid::{TrackBreadth, TrackSize};
|
||||
use crate::values::generics::grid::TrackBreadth;
|
||||
|
||||
if gecko_min.unit() == nsStyleUnit::eStyleUnit_None {
|
||||
debug_assert!(
|
||||
|
@ -862,8 +859,6 @@ impl TrackSize<LengthPercentage> {
|
|||
|
||||
/// Save TrackSize to given gecko fields.
|
||||
pub fn to_gecko_style_coords<T: CoordDataMut>(&self, gecko_min: &mut T, gecko_max: &mut T) {
|
||||
use crate::values::generics::grid::TrackSize;
|
||||
|
||||
match *self {
|
||||
TrackSize::FitContent(ref lop) => {
|
||||
// Gecko sets min value to None and max value to the actual value in fit-content
|
||||
|
@ -893,8 +888,6 @@ impl TrackListValue<LengthPercentage, Integer> {
|
|||
|
||||
/// Save TrackSize to given gecko fields.
|
||||
pub fn to_gecko_style_coords<T: CoordDataMut>(&self, gecko_min: &mut T, gecko_max: &mut T) {
|
||||
use crate::values::generics::grid::TrackListValue;
|
||||
|
||||
match *self {
|
||||
TrackListValue::TrackSize(ref size) => size.to_gecko_style_coords(gecko_min, gecko_max),
|
||||
_ => unreachable!("Should only transform from track-size computed values"),
|
||||
|
@ -918,8 +911,6 @@ where
|
|||
pub fn from_gecko_rect(
|
||||
sides: &crate::gecko_bindings::structs::nsStyleSides,
|
||||
) -> Option<crate::values::generics::rect::Rect<T>> {
|
||||
use crate::values::generics::rect::Rect;
|
||||
|
||||
Some(Rect::new(
|
||||
T::from_gecko_style_coord(&sides.data_at(0)).expect("coord[0] cound not convert"),
|
||||
T::from_gecko_style_coord(&sides.data_at(1)).expect("coord[1] cound not convert"),
|
||||
|
|
|
@ -317,7 +317,6 @@ impl GeckoStyleCoordConvertible for ScrollSnapPoint<LengthPercentage> {
|
|||
|
||||
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
|
||||
use crate::gecko_bindings::structs::root::nsStyleUnit;
|
||||
use crate::values::generics::gecko::ScrollSnapPoint;
|
||||
|
||||
Some(match coord.unit() {
|
||||
nsStyleUnit::eStyleUnit_None => ScrollSnapPoint::None,
|
||||
|
|
|
@ -986,7 +986,6 @@ fn get_animation_rule(
|
|||
element: &GeckoElement,
|
||||
cascade_level: CascadeLevel,
|
||||
) -> Option<Arc<Locked<PropertyDeclarationBlock>>> {
|
||||
use crate::gecko_bindings::sugar::ownership::HasSimpleFFI;
|
||||
use crate::properties::longhands::ANIMATABLE_PROPERTY_COUNT;
|
||||
|
||||
// There's a very rough correlation between the number of effects
|
||||
|
|
|
@ -1239,7 +1239,7 @@ impl StrongRuleNode {
|
|||
use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BACKGROUND;
|
||||
use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_BORDER;
|
||||
use crate::gecko_bindings::structs::NS_AUTHOR_SPECIFIED_PADDING;
|
||||
use crate::properties::{CSSWideKeyword, LonghandId, LonghandIdSet};
|
||||
use crate::properties::{CSSWideKeyword, LonghandId};
|
||||
use crate::properties::{PropertyDeclaration, PropertyDeclarationId};
|
||||
use crate::values::specified::Color;
|
||||
use std::borrow::Cow;
|
||||
|
|
|
@ -211,8 +211,6 @@ where
|
|||
type Item = (&'a S, SheetRebuildKind);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
use std::mem;
|
||||
|
||||
loop {
|
||||
let potential_sheet = self.iter.next()?;
|
||||
|
||||
|
|
|
@ -307,8 +307,6 @@ pub fn resolve_style<E>(
|
|||
where
|
||||
E: TElement,
|
||||
{
|
||||
use crate::style_resolver::StyleResolverForElement;
|
||||
|
||||
debug_assert!(
|
||||
rule_inclusion == RuleInclusion::DefaultOnly ||
|
||||
pseudo.map_or(false, |p| p.is_before_or_after()) ||
|
||||
|
@ -406,7 +404,6 @@ pub fn recalc_style_at<E, D, F>(
|
|||
D: DomTraversal<E>,
|
||||
F: FnMut(E::ConcreteNode),
|
||||
{
|
||||
use crate::traversal_flags::TraversalFlags;
|
||||
use std::cmp;
|
||||
|
||||
let flags = context.shared.traversal_flags;
|
||||
|
|
|
@ -118,7 +118,7 @@ impl ToCss for FontTag {
|
|||
where
|
||||
W: Write,
|
||||
{
|
||||
use byteorder::{BigEndian, ByteOrder};
|
||||
use byteorder::ByteOrder;
|
||||
use std::str;
|
||||
|
||||
let mut raw = [0u8; 4];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue