mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
geckolib: fix geckolib build by implementing display on Atoms.
This commit is contained in:
parent
2d566ef0ef
commit
e015e87697
4 changed files with 15 additions and 3 deletions
|
@ -6,12 +6,11 @@ use euclid::Size2D;
|
|||
use euclid::size::TypedSize2D;
|
||||
use gecko_bindings::bindings::RawServoStyleSet;
|
||||
use num_cpus;
|
||||
use selector_impl::{Stylist, Stylesheet, SharedStyleContext};
|
||||
use selector_impl::{GeckoSelectorImpl, Stylist, Stylesheet, SharedStyleContext};
|
||||
use std::cmp;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||
use std::sync::{Arc, RwLock};
|
||||
use style::animation::Animation;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::media_queries::{Device, MediaType};
|
||||
use style::parallel::WorkQueueData;
|
||||
|
@ -19,6 +18,8 @@ use util::geometry::ViewportPx;
|
|||
use util::thread_state;
|
||||
use util::workqueue::WorkQueue;
|
||||
|
||||
pub type Animation = ::style::animation::Animation<GeckoSelectorImpl>;
|
||||
|
||||
pub struct PerDocumentStyleData {
|
||||
/// Rule processor.
|
||||
pub stylist: Arc<Stylist>,
|
||||
|
|
|
@ -39,7 +39,7 @@ use values::{StyleCoordHelpers, ToGeckoStyleCoord, convert_nscolor_to_rgba};
|
|||
use values::{convert_rgba_to_nscolor, debug_assert_unit_is_safe_to_copy};
|
||||
use values::round_border_to_device_pixels;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct GeckoComputedValues {
|
||||
% for style_struct in data.style_structs:
|
||||
${style_struct.ident}: Arc<${style_struct.gecko_struct_name}>,
|
||||
|
|
|
@ -16,6 +16,7 @@ pub type PrivateStyleData = style::data::PrivateStyleData<GeckoSelectorImpl, Gec
|
|||
#[cfg(feature = "servo_features")]
|
||||
known_heap_size!(0, GeckoSelectorImpl, PseudoElement, NonTSPseudoClass);
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct GeckoSelectorImpl;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
|
|
|
@ -15,6 +15,7 @@ use gecko_bindings::structs::nsIAtom;
|
|||
use heapsize::HeapSizeOf;
|
||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::borrow::Cow;
|
||||
use std::char;
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::marker::PhantomData;
|
||||
|
@ -206,6 +207,15 @@ impl fmt::Debug for Atom {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Atom {
|
||||
fn fmt(&self, w: &mut fmt::Formatter) -> fmt::Result {
|
||||
for c in char::decode_utf16(self.as_slice().iter().cloned()) {
|
||||
try!(write!(w, "{}", c.unwrap_or(char::REPLACEMENT_CHARACTER)))
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for Atom {
|
||||
#[inline]
|
||||
fn from(string: &str) -> Atom {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue