mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fix Gecko build.
This commit is contained in:
parent
14bda8078e
commit
e6b4ceca07
2 changed files with 29 additions and 18 deletions
|
@ -72,7 +72,7 @@ use crate::values::computed::Length;
|
|||
use crate::values::specified::length::FontBaseSize;
|
||||
use crate::CaseSensitivityExt;
|
||||
use app_units::Au;
|
||||
use atomic_refcell::{AtomicRefCell, AtomicRefMut};
|
||||
use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
|
||||
use selectors::attr::{AttrSelectorOperation, AttrSelectorOperator};
|
||||
use selectors::attr::{CaseSensitivity, NamespaceConstraint};
|
||||
use selectors::matching::VisitedHandlingMode;
|
||||
|
@ -557,8 +557,9 @@ impl<'le> fmt::Debug for GeckoElement<'le> {
|
|||
}
|
||||
|
||||
impl<'le> GeckoElement<'le> {
|
||||
/// Gets the raw `ElementData` refcell for the element.
|
||||
#[inline(always)]
|
||||
fn get_data(&self) -> Option<&AtomicRefCell<ElementData>> {
|
||||
pub fn get_data(&self) -> Option<&AtomicRefCell<ElementData>> {
|
||||
unsafe { self.0.mServoData.get().as_ref() }
|
||||
}
|
||||
|
||||
|
@ -1391,21 +1392,6 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
panic!("Atomic child count not implemented in Gecko");
|
||||
}
|
||||
|
||||
/// Whether there is an ElementData container.
|
||||
fn has_data(&self) -> bool {
|
||||
self.get_data().is_some()
|
||||
}
|
||||
|
||||
/// Immutably borrows the ElementData.
|
||||
fn borrow_data(&self) -> Option<AtomicRef<ElementData>> {
|
||||
self.get_data().map(|x| x.borrow())
|
||||
}
|
||||
|
||||
/// Mutably borrows the ElementData.
|
||||
fn mutate_data(&self) -> Option<AtomicRefMut<ElementData>> {
|
||||
self.get_data().map(|x| x.borrow_mut())
|
||||
}
|
||||
|
||||
unsafe fn ensure_data(&self) -> AtomicRefMut<ElementData> {
|
||||
if !self.has_data() {
|
||||
debug!("Creating ElementData for {:?}", self);
|
||||
|
@ -1642,6 +1628,22 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
.any(|property| !transitions_to_keep.contains(*property))
|
||||
}
|
||||
|
||||
/// Whether there is an ElementData container.
|
||||
#[inline]
|
||||
fn has_data(&self) -> bool {
|
||||
self.get_data().is_some()
|
||||
}
|
||||
|
||||
/// Immutably borrows the ElementData.
|
||||
fn borrow_data(&self) -> Option<AtomicRef<ElementData>> {
|
||||
self.get_data().map(|x| x.borrow())
|
||||
}
|
||||
|
||||
/// Mutably borrows the ElementData.
|
||||
fn mutate_data(&self) -> Option<AtomicRefMut<ElementData>> {
|
||||
self.get_data().map(|x| x.borrow_mut())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn lang_attr(&self) -> Option<AttrValue> {
|
||||
let ptr = unsafe { bindings::Gecko_LangValue(self.0) };
|
||||
|
|
|
@ -703,7 +703,7 @@ pub type FontVariationSettings = FontSettings<VariationValue<Number>>;
|
|||
/// (see http://www.microsoft.com/typography/otspec/languagetags.htm).
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, ToResolvedValue)]
|
||||
#[repr(C)]
|
||||
pub struct FontLanguageOverride(u32);
|
||||
pub struct FontLanguageOverride(pub u32);
|
||||
|
||||
impl FontLanguageOverride {
|
||||
#[inline]
|
||||
|
@ -762,6 +762,15 @@ impl ToCss for FontLanguageOverride {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME(emilio): Make Gecko use the cbindgen'd fontLanguageOverride, then
|
||||
// remove this.
|
||||
#[cfg(feature = "gecko")]
|
||||
impl From<u32> for FontLanguageOverride {
|
||||
fn from(v: u32) -> Self {
|
||||
unsafe { Self::from_u32(v) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
impl From<FontLanguageOverride> for u32 {
|
||||
fn from(v: FontLanguageOverride) -> u32 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue