servo: Merge #16774 - Unbust stylo (from emilio:unbust-stylo); r=Manishearth

Source-Repo: https://github.com/servo/servo
Source-Revision: fca15d378257c6ec558ee06527245c637a3eea8d

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 7c55e518e5b9fb06e42b1ba238bfab39588fd25d
This commit is contained in:
Emilio Cobos Álvarez 2017-05-08 18:59:33 -05:00
Родитель 4f401b87b4
Коммит 0b1cf902d6
8 изменённых файлов: 29660 добавлений и 22316 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -4,6 +4,8 @@ pub use nsstring::{nsACString, nsAString, nsString};
type nsACString_internal = nsACString; type nsACString_internal = nsACString;
type nsAString_internal = nsAString; type nsAString_internal = nsAString;
use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue; use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue;
#[allow(unused_imports)]
use gecko_bindings::structs::mozilla::css::ImageValue;
use gecko_bindings::structs::mozilla::css::URLValue; use gecko_bindings::structs::mozilla::css::URLValue;
use gecko_bindings::structs::mozilla::Side; use gecko_bindings::structs::mozilla::Side;
use gecko_bindings::structs::RawGeckoAnimationPropertySegment; use gecko_bindings::structs::RawGeckoAnimationPropertySegment;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1060,7 +1060,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
fn get_local_name(&self) -> &WeakAtom { fn get_local_name(&self) -> &WeakAtom {
unsafe { unsafe {
WeakAtom::new(self.as_node().node_info().mInner.mName.raw()) WeakAtom::new(self.as_node().node_info().mInner.mName.raw::<nsIAtom>())
} }
} }

Просмотреть файл

@ -6,18 +6,20 @@
use gecko_bindings::structs::nsCOMPtr; use gecko_bindings::structs::nsCOMPtr;
#[cfg(feature = "gecko_debug")]
impl<T> nsCOMPtr<T> { impl<T> nsCOMPtr<T> {
/// Get this pointer as a raw pointer. /// Get this pointer as a raw pointer.
#[cfg(feature = "gecko_debug")]
#[inline] #[inline]
pub fn raw(&self) -> *mut T { pub fn raw<U>(&self) -> *mut T {
self.mRawPtr self.mRawPtr
} }
}
#[cfg(not(feature = "gecko_debug"))]
impl nsCOMPtr {
/// Get this pointer as a raw pointer. /// Get this pointer as a raw pointer.
#[cfg(not(feature = "gecko_debug"))]
#[inline] #[inline]
pub fn raw(&self) -> *mut T { pub fn raw<T>(&self) -> *mut T {
self._base.mRawPtr as *mut _ self._base.mRawPtr as *mut _
} }
} }

Просмотреть файл

@ -2273,10 +2273,11 @@ fn static_assert() {
use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties; use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_no_properties;
use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable;
use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN;
use gecko_bindings::structs::nsIAtom;
let property = self.gecko.mTransitions[index].mProperty; let property = self.gecko.mTransitions[index].mProperty;
if property == eCSSProperty_UNKNOWN || property == eCSSPropertyExtra_variable { if property == eCSSProperty_UNKNOWN || property == eCSSPropertyExtra_variable {
let atom = self.gecko.mTransitions[index].mUnknownProperty.raw(); let atom = self.gecko.mTransitions[index].mUnknownProperty.raw::<nsIAtom>();
debug_assert!(!atom.is_null()); debug_assert!(!atom.is_null());
TransitionProperty::Unsupported(atom.into()) TransitionProperty::Unsupported(atom.into())
} else if property == eCSSPropertyExtra_no_properties { } else if property == eCSSPropertyExtra_no_properties {
@ -2295,6 +2296,7 @@ fn static_assert() {
pub fn copy_transition_property_from(&mut self, other: &Self) { pub fn copy_transition_property_from(&mut self, other: &Self) {
use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable; use gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_variable;
use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN; use gecko_bindings::structs::nsCSSPropertyID::eCSSProperty_UNKNOWN;
use gecko_bindings::structs::nsIAtom;
unsafe { self.gecko.mTransitions.ensure_len(other.gecko.mTransitions.len()) }; unsafe { self.gecko.mTransitions.ensure_len(other.gecko.mTransitions.len()) };
let count = other.gecko.mTransitionPropertyCount; let count = other.gecko.mTransitionPropertyCount;
@ -2304,7 +2306,7 @@ fn static_assert() {
transition.mProperty = other.gecko.mTransitions[index].mProperty; transition.mProperty = other.gecko.mTransitions[index].mProperty;
if transition.mProperty == eCSSProperty_UNKNOWN || if transition.mProperty == eCSSProperty_UNKNOWN ||
transition.mProperty == eCSSPropertyExtra_variable { transition.mProperty == eCSSPropertyExtra_variable {
let atom = other.gecko.mTransitions[index].mUnknownProperty.raw(); let atom = other.gecko.mTransitions[index].mUnknownProperty.raw::<nsIAtom>();
debug_assert!(!atom.is_null()); debug_assert!(!atom.is_null());
unsafe { Gecko_StyleTransition_SetUnsupportedProperty(transition, atom) }; unsafe { Gecko_StyleTransition_SetUnsupportedProperty(transition, atom) };
} }

Просмотреть файл

@ -695,7 +695,7 @@ ${helpers.single_keyword_system("font-variant-caps",
#[inline] #[inline]
fn to_computed_value(&self, cx: &Context) -> computed_value::T { fn to_computed_value(&self, cx: &Context) -> computed_value::T {
use gecko_bindings::bindings::Gecko_GetBaseSize; use gecko_bindings::bindings::Gecko_GetBaseSize;
use gecko_bindings::structs; use gecko_bindings::structs::{self, nsIAtom};
use values::specified::length::au_to_int_px; use values::specified::length::au_to_int_px;
// Data from nsRuleNode.cpp in Gecko // Data from nsRuleNode.cpp in Gecko
// Mapping from base size and HTML size to pixels // Mapping from base size and HTML size to pixels
@ -721,7 +721,7 @@ ${helpers.single_keyword_system("font-variant-caps",
// XXXManishearth handle quirks mode // XXXManishearth handle quirks mode
let ref gecko_font = cx.style().get_font().gecko(); let ref gecko_font = cx.style().get_font().gecko();
let base_size = unsafe { Atom::with(gecko_font.mLanguage.raw(), &mut |atom| { let base_size = unsafe { Atom::with(gecko_font.mLanguage.raw::<nsIAtom>(), &mut |atom| {
cx.font_metrics_provider.get_size(atom, gecko_font.mGenericID).0 cx.font_metrics_provider.get_size(atom, gecko_font.mGenericID).0
}) }; }) };