Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE

Backs out https://github.com/servo/servo/pull/18809
This commit is contained in:
Gecko Backout 2017-10-19 21:26:51 +00:00 committed by moz-servo-sync
parent fe16c1d5c3
commit 11c64178d8
142 changed files with 1635 additions and 1685 deletions

View file

@ -9,7 +9,7 @@ description = "Rust bindings to xpcom string types"
# Revendoring nsstring from m-c into Servo
[dependencies]
bitflags = "1.0"
bitflags = "0.8"
[features]
gecko_debug = []

View file

@ -138,13 +138,13 @@ mod data_flags {
// While this has the same layout as u16, it cannot be passed
// over FFI safely as a u16.
#[repr(C)]
pub struct DataFlags : u16 {
const TERMINATED = 1 << 0; // IsTerminated returns true
const VOIDED = 1 << 1; // IsVoid returns true
const SHARED = 1 << 2; // mData points to a heap-allocated, shared buffer
const OWNED = 1 << 3; // mData points to a heap-allocated, raw buffer
const INLINE = 1 << 4; // mData points to a writable, inline buffer
const LITERAL = 1 << 5; // mData points to a string literal; TERMINATED will also be set
pub flags DataFlags : u16 {
const TERMINATED = 1 << 0, // IsTerminated returns true
const VOIDED = 1 << 1, // IsVoid returns true
const SHARED = 1 << 2, // mData points to a heap-allocated, shared buffer
const OWNED = 1 << 3, // mData points to a heap-allocated, raw buffer
const INLINE = 1 << 4, // mData points to a writable, inline buffer
const LITERAL = 1 << 5, // mData points to a string literal; TERMINATED will also be set
}
}
}
@ -154,9 +154,9 @@ mod class_flags {
// While this has the same layout as u16, it cannot be passed
// over FFI safely as a u16.
#[repr(C)]
pub struct ClassFlags : u16 {
const INLINE = 1 << 0; // |this|'s buffer is inline
const NULL_TERMINATED = 1 << 1; // |this| requires its buffer is null-terminated
pub flags ClassFlags : u16 {
const INLINE = 1 << 0, // |this|'s buffer is inline
const NULL_TERMINATED = 1 << 1, // |this| requires its buffer is null-terminated
}
}
}
@ -212,7 +212,7 @@ macro_rules! define_string_types {
$StringRepr {
data: &NUL,
length: 0,
dataflags: DataFlags::TERMINATED | DataFlags::LITERAL,
dataflags: data_flags::TERMINATED | data_flags::LITERAL,
classflags: classflags,
}
}
@ -536,7 +536,7 @@ macro_rules! define_string_types {
impl $String {
pub fn new() -> $String {
$String {
hdr: $StringRepr::new(ClassFlags::NULL_TERMINATED),
hdr: $StringRepr::new(class_flags::NULL_TERMINATED),
}
}
}
@ -618,8 +618,8 @@ macro_rules! define_string_types {
hdr: $StringRepr {
data: ptr,
length: length,
dataflags: DataFlags::OWNED | DataFlags::TERMINATED,
classflags: ClassFlags::NULL_TERMINATED,
dataflags: data_flags::OWNED | data_flags::TERMINATED,
classflags: class_flags::NULL_TERMINATED,
}
}
}

View file

@ -13,9 +13,9 @@ use stylesheets::OriginSet;
/// Checks that the values for OriginFlags are the ones we expect.
pub fn assert_flags_match() {
use 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());
debug_assert_eq!(OriginFlags_UserAgent.0, ORIGIN_USER_AGENT.bits());
debug_assert_eq!(OriginFlags_Author.0, ORIGIN_AUTHOR.bits());
debug_assert_eq!(OriginFlags_User.0, ORIGIN_USER.bits());
}
impl From<OriginFlags> for OriginSet {