mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
cargo fix --edition --features gecko
This commit is contained in:
parent
a15d33a10e
commit
b1822a39fa
87 changed files with 614 additions and 585 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
//! Little helpers for `nsCOMPtr`.
|
||||
|
||||
use gecko_bindings::structs::nsCOMPtr;
|
||||
use crate::gecko_bindings::structs::nsCOMPtr;
|
||||
|
||||
#[cfg(feature = "gecko_debug")]
|
||||
impl<T> nsCOMPtr<T> {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
//! Little helper for `nsCompatibility`.
|
||||
|
||||
use context::QuirksMode;
|
||||
use gecko_bindings::structs::nsCompatibility;
|
||||
use crate::context::QuirksMode;
|
||||
use crate::gecko_bindings::structs::nsCompatibility;
|
||||
|
||||
impl From<nsCompatibility> for QuirksMode {
|
||||
#[inline]
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
//! Rust helpers for Gecko's `nsCSSShadowArray`.
|
||||
|
||||
use gecko_bindings::bindings::Gecko_AddRefCSSShadowArrayArbitraryThread;
|
||||
use gecko_bindings::bindings::Gecko_NewCSSShadowArray;
|
||||
use gecko_bindings::bindings::Gecko_ReleaseCSSShadowArrayArbitraryThread;
|
||||
use gecko_bindings::structs::{nsCSSShadowArray, nsCSSShadowItem, RefPtr};
|
||||
use crate::gecko_bindings::bindings::Gecko_AddRefCSSShadowArrayArbitraryThread;
|
||||
use crate::gecko_bindings::bindings::Gecko_NewCSSShadowArray;
|
||||
use crate::gecko_bindings::bindings::Gecko_ReleaseCSSShadowArrayArbitraryThread;
|
||||
use crate::gecko_bindings::structs::{nsCSSShadowArray, nsCSSShadowItem, RefPtr};
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::{ptr, slice};
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
//! Rust helpers for Gecko's `nsCSSShadowItem`.
|
||||
|
||||
use app_units::Au;
|
||||
use gecko_bindings::structs::nsCSSShadowItem;
|
||||
use values::computed::effects::{BoxShadow, SimpleShadow};
|
||||
use crate::gecko_bindings::structs::nsCSSShadowItem;
|
||||
use crate::values::computed::effects::{BoxShadow, SimpleShadow};
|
||||
|
||||
impl nsCSSShadowItem {
|
||||
/// Sets this item from the given box shadow.
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
|
||||
//! Little helpers for `nsCSSValue`.
|
||||
|
||||
use gecko_bindings::bindings;
|
||||
use gecko_bindings::structs;
|
||||
use gecko_bindings::structs::{nsCSSUnit, nsCSSValue};
|
||||
use gecko_bindings::structs::{nsCSSValueList, nsCSSValue_Array};
|
||||
use gecko_string_cache::Atom;
|
||||
use crate::gecko_bindings::bindings;
|
||||
use crate::gecko_bindings::structs;
|
||||
use crate::gecko_bindings::structs::{nsCSSUnit, nsCSSValue};
|
||||
use crate::gecko_bindings::structs::{nsCSSValueList, nsCSSValue_Array};
|
||||
use crate::gecko_string_cache::Atom;
|
||||
use crate::values::computed::{Angle, Length, LengthOrPercentage, Percentage};
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice;
|
||||
use values::computed::{Angle, Length, LengthOrPercentage, Percentage};
|
||||
|
||||
impl nsCSSValue {
|
||||
/// Create a CSSValue with null unit, useful to be used as a return value.
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
//! Rust helpers for Gecko's `nsStyleAutoArray`.
|
||||
|
||||
use gecko_bindings::bindings::Gecko_EnsureStyleAnimationArrayLength;
|
||||
use gecko_bindings::bindings::Gecko_EnsureStyleTransitionArrayLength;
|
||||
use gecko_bindings::structs::nsStyleAutoArray;
|
||||
use gecko_bindings::structs::{StyleAnimation, StyleTransition};
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleAnimationArrayLength;
|
||||
use crate::gecko_bindings::bindings::Gecko_EnsureStyleTransitionArrayLength;
|
||||
use crate::gecko_bindings::structs::nsStyleAutoArray;
|
||||
use crate::gecko_bindings::structs::{StyleAnimation, StyleTransition};
|
||||
use std::iter::{once, Chain, IntoIterator, Once};
|
||||
use std::ops::{Index, IndexMut};
|
||||
use std::slice::{Iter, IterMut};
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
|
||||
//! Rust helpers for Gecko's `nsStyleCoord`.
|
||||
|
||||
use gecko_bindings::bindings;
|
||||
use gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
|
||||
use gecko_bindings::structs::{nsStyleCorners, nsStyleSides, nsStyleUnion, nsStyleUnit, nscoord};
|
||||
use crate::gecko_bindings::bindings;
|
||||
use crate::gecko_bindings::structs::{nsStyleCoord, nsStyleCoord_Calc, nsStyleCoord_CalcValue};
|
||||
use crate::gecko_bindings::structs::{
|
||||
nsStyleCorners, nsStyleSides, nsStyleUnion, nsStyleUnit, nscoord,
|
||||
};
|
||||
use std::mem;
|
||||
|
||||
impl nsStyleCoord {
|
||||
|
@ -266,7 +268,7 @@ pub unsafe trait CoordDataMut: CoordData {
|
|||
/// Useful for initializing uninits, given that `set_value` may segfault on
|
||||
/// uninits.
|
||||
fn leaky_set_null(&mut self) {
|
||||
use gecko_bindings::structs::nsStyleUnit::*;
|
||||
use crate::gecko_bindings::structs::nsStyleUnit::*;
|
||||
unsafe {
|
||||
let (unit, union) = self.values_mut();
|
||||
*unit = eStyleUnit_Null;
|
||||
|
@ -278,7 +280,7 @@ pub unsafe trait CoordDataMut: CoordData {
|
|||
/// Sets the inner value.
|
||||
fn set_value(&mut self, value: CoordDataValue) {
|
||||
use self::CoordDataValue::*;
|
||||
use gecko_bindings::structs::nsStyleUnit::*;
|
||||
use crate::gecko_bindings::structs::nsStyleUnit::*;
|
||||
self.reset();
|
||||
unsafe {
|
||||
let (unit, union) = self.values_mut();
|
||||
|
@ -365,7 +367,7 @@ pub unsafe trait CoordData {
|
|||
/// Get the appropriate value for this object.
|
||||
fn as_value(&self) -> CoordDataValue {
|
||||
use self::CoordDataValue::*;
|
||||
use gecko_bindings::structs::nsStyleUnit::*;
|
||||
use crate::gecko_bindings::structs::nsStyleUnit::*;
|
||||
unsafe {
|
||||
match self.unit() {
|
||||
eStyleUnit_Null => Null,
|
||||
|
@ -387,7 +389,7 @@ pub unsafe trait CoordData {
|
|||
#[inline]
|
||||
/// Pretend inner value is a float; obtain it.
|
||||
unsafe fn get_float(&self) -> f32 {
|
||||
use gecko_bindings::structs::nsStyleUnit::*;
|
||||
use crate::gecko_bindings::structs::nsStyleUnit::*;
|
||||
debug_assert!(
|
||||
self.unit() == eStyleUnit_Percent ||
|
||||
self.unit() == eStyleUnit_Factor ||
|
||||
|
@ -400,7 +402,7 @@ pub unsafe trait CoordData {
|
|||
#[inline]
|
||||
/// Pretend inner value is an int; obtain it.
|
||||
unsafe fn get_integer(&self) -> i32 {
|
||||
use gecko_bindings::structs::nsStyleUnit::*;
|
||||
use crate::gecko_bindings::structs::nsStyleUnit::*;
|
||||
debug_assert!(
|
||||
self.unit() == eStyleUnit_Coord ||
|
||||
self.unit() == eStyleUnit_Integer ||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
//! Rust helpers for Gecko's nsTArray.
|
||||
|
||||
use gecko_bindings::bindings;
|
||||
use gecko_bindings::structs::{nsTArray, nsTArrayHeader};
|
||||
use crate::gecko_bindings::bindings;
|
||||
use crate::gecko_bindings::structs::{nsTArray, nsTArrayHeader};
|
||||
use std::mem;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::slice;
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
//! Helper to iterate over `OriginFlags` bits.
|
||||
|
||||
use gecko_bindings::structs::OriginFlags;
|
||||
use gecko_bindings::structs::OriginFlags_Author;
|
||||
use gecko_bindings::structs::OriginFlags_User;
|
||||
use gecko_bindings::structs::OriginFlags_UserAgent;
|
||||
use stylesheets::OriginSet;
|
||||
use crate::gecko_bindings::structs::OriginFlags;
|
||||
use crate::gecko_bindings::structs::OriginFlags_Author;
|
||||
use crate::gecko_bindings::structs::OriginFlags_User;
|
||||
use crate::gecko_bindings::structs::OriginFlags_UserAgent;
|
||||
use crate::stylesheets::OriginSet;
|
||||
|
||||
/// Checks that the values for OriginFlags are the ones we expect.
|
||||
pub fn assert_flags_match() {
|
||||
use stylesheets::origin::*;
|
||||
use crate::stylesheets::origin::*;
|
||||
debug_assert_eq!(OriginFlags_UserAgent.0, OriginSet::ORIGIN_USER_AGENT.bits());
|
||||
debug_assert_eq!(OriginFlags_Author.0, OriginSet::ORIGIN_AUTHOR.bits());
|
||||
debug_assert_eq!(OriginFlags_User.0, OriginSet::ORIGIN_USER.bits());
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
//! A rust helper to ease the use of Gecko's refcounted types.
|
||||
|
||||
use gecko_bindings::sugar::ownership::HasArcFFI;
|
||||
use gecko_bindings::{bindings, structs};
|
||||
use crate::gecko_bindings::sugar::ownership::HasArcFFI;
|
||||
use crate::gecko_bindings::{bindings, structs};
|
||||
use crate::Atom;
|
||||
use servo_arc::Arc;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::{fmt, mem, ptr};
|
||||
use Atom;
|
||||
|
||||
/// Trait for all objects that have Addref() and Release
|
||||
/// methods and can be placed inside RefPtr<T>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
//! Rust helpers to interact with Gecko's StyleComplexColor.
|
||||
|
||||
use gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
|
||||
use gecko_bindings::structs::StyleComplexColor;
|
||||
use gecko_bindings::structs::StyleComplexColor_Tag as Tag;
|
||||
use values::computed::ui::ColorOrAuto;
|
||||
use values::computed::{Color as ComputedColor, RGBAColor as ComputedRGBA};
|
||||
use values::generics::color::{Color as GenericColor, ComplexColorRatios};
|
||||
use values::{Auto, Either};
|
||||
use crate::gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor};
|
||||
use crate::gecko_bindings::structs::StyleComplexColor;
|
||||
use crate::gecko_bindings::structs::StyleComplexColor_Tag as Tag;
|
||||
use crate::values::computed::ui::ColorOrAuto;
|
||||
use crate::values::computed::{Color as ComputedColor, RGBAColor as ComputedRGBA};
|
||||
use crate::values::generics::color::{Color as GenericColor, ComplexColorRatios};
|
||||
use crate::values::{Auto, Either};
|
||||
|
||||
impl StyleComplexColor {
|
||||
/// Create a `StyleComplexColor` value that represents `currentColor`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue