cargo fix --edition --features gecko

This commit is contained in:
Simon Sapin 2018-11-06 22:33:52 +01:00
parent a15d33a10e
commit b1822a39fa
87 changed files with 614 additions and 585 deletions

View file

@ -172,8 +172,8 @@ impl DocumentMatchingFunction {
#[cfg(feature = "gecko")]
/// Evaluate a URL matching function.
pub fn evaluate(&self, device: &Device) -> bool {
use gecko_bindings::bindings::Gecko_DocumentRule_UseForPresentation;
use gecko_bindings::structs::DocumentMatchingFunction as GeckoDocumentMatchingFunction;
use crate::gecko_bindings::bindings::Gecko_DocumentRule_UseForPresentation;
use crate::gecko_bindings::structs::DocumentMatchingFunction as GeckoDocumentMatchingFunction;
use nsstring::nsCStr;
let func = match *self {
@ -253,8 +253,8 @@ impl DocumentCondition {
#[cfg(feature = "gecko")]
fn allowed_in(&self, context: &ParserContext) -> bool {
use gecko_bindings::structs;
use stylesheets::Origin;
use crate::gecko_bindings::structs;
use crate::stylesheets::Origin;
if context.stylesheet_origin != Origin::Author {
return true;

View file

@ -7,6 +7,10 @@
//! [font-feature-values]: https://drafts.csswg.org/css-fonts-3/#at-font-feature-values-rule
use crate::error_reporting::ContextualParseError;
#[cfg(feature = "gecko")]
use crate::gecko_bindings::bindings::Gecko_AppendFeatureValueHashEntry;
#[cfg(feature = "gecko")]
use crate::gecko_bindings::structs::{self, gfxFontFeatureValueSet, nsTArray};
use crate::parser::{Parse, ParserContext};
use crate::shared_lock::{SharedRwLockReadGuard, ToCssWithGuard};
use crate::str::CssStringWriter;
@ -17,10 +21,6 @@ use crate::Atom;
use cssparser::{AtRuleParser, AtRuleType, BasicParseErrorKind, CowRcStr};
use cssparser::{DeclarationListParser, DeclarationParser, Parser};
use cssparser::{QualifiedRuleParser, RuleListParser, SourceLocation, Token};
#[cfg(feature = "gecko")]
use gecko_bindings::bindings::Gecko_AppendFeatureValueHashEntry;
#[cfg(feature = "gecko")]
use gecko_bindings::structs::{self, gfxFontFeatureValueSet, nsTArray};
use std::fmt::{self, Write};
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};

View file

@ -30,7 +30,7 @@ pub struct PendingSheet {
#[derive(Debug)]
pub enum ImportSheet {
/// A bonafide stylesheet.
Sheet(::gecko::data::GeckoStyleSheet),
Sheet(crate::gecko::data::GeckoStyleSheet),
/// An @import created while parsing off-main-thread, whose Gecko sheet has
/// yet to be created and attached.
Pending(PendingSheet),
@ -39,7 +39,7 @@ pub enum ImportSheet {
#[cfg(feature = "gecko")]
impl ImportSheet {
/// Creates a new ImportSheet from a GeckoStyleSheet.
pub fn new(sheet: ::gecko::data::GeckoStyleSheet) -> Self {
pub fn new(sheet: crate::gecko::data::GeckoStyleSheet) -> Self {
ImportSheet::Sheet(sheet)
}
@ -53,7 +53,7 @@ impl ImportSheet {
/// Returns a reference to the GeckoStyleSheet in this ImportSheet, if it
/// exists.
pub fn as_sheet(&self) -> Option<&::gecko::data::GeckoStyleSheet> {
pub fn as_sheet(&self) -> Option<&crate::gecko::data::GeckoStyleSheet> {
match *self {
ImportSheet::Sheet(ref s) => Some(s),
ImportSheet::Pending(_) => None,
@ -69,8 +69,8 @@ impl DeepCloneWithLock for ImportSheet {
_guard: &SharedRwLockReadGuard,
params: &DeepCloneParams,
) -> Self {
use gecko::data::GeckoStyleSheet;
use gecko_bindings::bindings;
use crate::gecko::data::GeckoStyleSheet;
use crate::gecko_bindings::bindings;
match *self {
ImportSheet::Sheet(ref s) => {
let clone = unsafe {

View file

@ -63,7 +63,7 @@ pub type UrlExtraData = ::servo_url::ServoUrl;
#[cfg(feature = "gecko")]
#[derive(Clone, PartialEq)]
pub struct UrlExtraData(
pub ::gecko_bindings::sugar::refptr::RefPtr<::gecko_bindings::structs::URLExtraData>,
pub crate::gecko_bindings::sugar::refptr::RefPtr<crate::gecko_bindings::structs::URLExtraData>,
);
#[cfg(feature = "gecko")]
@ -80,7 +80,7 @@ impl UrlExtraData {
///
/// This method doesn't touch refcount.
#[inline]
pub unsafe fn from_ptr_ref(ptr: &*mut ::gecko_bindings::structs::URLExtraData) -> &Self {
pub unsafe fn from_ptr_ref(ptr: &*mut crate::gecko_bindings::structs::URLExtraData) -> &Self {
::std::mem::transmute(ptr)
}
}
@ -88,7 +88,7 @@ impl UrlExtraData {
#[cfg(feature = "gecko")]
impl fmt::Debug for UrlExtraData {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
use gecko_bindings::{bindings, structs};
use crate::gecko_bindings::{bindings, structs};
struct DebugURI(*mut structs::nsIURI);
impl fmt::Debug for DebugURI {

View file

@ -222,8 +222,8 @@ impl SupportsCondition {
#[cfg(feature = "gecko")]
fn eval_moz_bool_pref(name: &CStr, cx: &ParserContext) -> bool {
use gecko_bindings::bindings;
use stylesheets::Origin;
use crate::gecko_bindings::bindings;
use crate::stylesheets::Origin;
if cx.stylesheet_origin != Origin::UserAgent && !cx.chrome_rules_enabled() {
return false;
}
@ -325,7 +325,7 @@ impl RawSelector {
#[cfg(feature = "gecko")]
{
if unsafe {
!::gecko_bindings::structs::StaticPrefs_sVarCache_layout_css_supports_selector_enabled
!crate::gecko_bindings::structs::StaticPrefs_sVarCache_layout_css_supports_selector_enabled
} {
return false;
}
@ -347,7 +347,7 @@ impl RawSelector {
#[cfg(feature = "gecko")]
{
use selector_parser::PseudoElement;
use crate::selector_parser::PseudoElement;
use selectors::parser::Component;
let has_any_unknown_webkit_pseudo = selector.has_pseudo_element() && selector