Skip to content

Commit 7835cd2

Browse files
committed
Bug 1906465 - Use markup5ever in Servo's Stylo instead of html5ever r=emilio
Use `markup5ever` in Servo. Note that this change should not affect Gecko at all. Differential Revision: https://phabricator.services.mozilla.com/D215844
1 parent 8449e37 commit 7835cd2

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

style/Cargo.toml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,21 @@ gecko = [
2727
"style_traits/gecko",
2828
"toml"
2929
]
30-
servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever",
31-
"cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union",
32-
"string_cache", "to_shmem/servo", "servo_arc/servo", "url"]
30+
servo = [
31+
"arrayvec/use_union",
32+
"cssparser/serde",
33+
"encoding_rs",
34+
"malloc_size_of/servo",
35+
"markup5ever",
36+
"serde",
37+
"servo_arc/servo",
38+
"servo_atoms",
39+
"servo_config",
40+
"string_cache",
41+
"style_traits/servo",
42+
"to_shmem/servo",
43+
"url"
44+
]
3345
gecko_debug = []
3446
gecko_refcount_logging = []
3547

@@ -46,7 +58,6 @@ new_debug_unreachable = "1.0"
4658
encoding_rs = {version = "0.8", optional = true}
4759
euclid = "0.22"
4860
fxhash = "0.2"
49-
html5ever = {version = "0.24", optional = true}
5061
icu_segmenter = { version = "1.5", default-features = false, features = ["auto", "compiled_data"] }
5162
indexmap = {version = "2", features = ["std"]}
5263
itertools = "0.10"
@@ -55,6 +66,7 @@ lazy_static = "1"
5566
log = "0.4"
5667
malloc_size_of = { path = "../malloc_size_of" }
5768
malloc_size_of_derive = { path = "../../../xpcom/rust/malloc_size_of_derive" }
69+
markup5ever = { version = "0.12", optional = true }
5870
matches = "0.1"
5971
nsstring = {path = "../../../xpcom/rust/nsstring/", optional = true}
6072
num_cpus = {version = "1.1.0"}

style/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ extern crate gecko_profiler;
3838
#[cfg(feature = "gecko")]
3939
#[macro_use]
4040
pub mod gecko_string_cache;
41-
#[cfg(feature = "servo")]
42-
#[macro_use]
43-
extern crate html5ever;
4441
#[macro_use]
4542
extern crate lazy_static;
4643
#[macro_use]
@@ -49,6 +46,9 @@ extern crate log;
4946
extern crate malloc_size_of;
5047
#[macro_use]
5148
extern crate malloc_size_of_derive;
49+
#[cfg(feature = "servo")]
50+
#[macro_use]
51+
extern crate markup5ever;
5252
#[allow(unused_extern_crates)]
5353
#[macro_use]
5454
extern crate matches;
@@ -155,13 +155,13 @@ pub use servo_atoms::Atom;
155155

156156
#[cfg(feature = "servo")]
157157
#[allow(missing_docs)]
158-
pub type LocalName = crate::values::GenericAtomIdent<html5ever::LocalNameStaticSet>;
158+
pub type LocalName = crate::values::GenericAtomIdent<markup5ever::LocalNameStaticSet>;
159159
#[cfg(feature = "servo")]
160160
#[allow(missing_docs)]
161-
pub type Namespace = crate::values::GenericAtomIdent<html5ever::NamespaceStaticSet>;
161+
pub type Namespace = crate::values::GenericAtomIdent<markup5ever::NamespaceStaticSet>;
162162
#[cfg(feature = "servo")]
163163
#[allow(missing_docs)]
164-
pub type Prefix = crate::values::GenericAtomIdent<html5ever::PrefixStaticSet>;
164+
pub type Prefix = crate::values::GenericAtomIdent<markup5ever::PrefixStaticSet>;
165165

166166
pub use style_traits::arc_slice::ArcSlice;
167167
pub use style_traits::owned_slice::OwnedSlice;

style/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ macro_rules! try_match_ident_ignore_ascii_case {
4141
#[cfg(feature = "servo")]
4242
macro_rules! local_name {
4343
($s:tt) => {
44-
$crate::values::GenericAtomIdent(html5ever::local_name!($s))
44+
$crate::values::GenericAtomIdent(markup5ever::local_name!($s))
4545
};
4646
}
4747

4848
#[cfg(feature = "servo")]
4949
macro_rules! ns {
5050
() => {
51-
$crate::values::GenericAtomIdent(html5ever::ns!())
51+
$crate::values::GenericAtomIdent(markup5ever::ns!())
5252
};
5353
($s:tt) => {
54-
$crate::values::GenericAtomIdent(html5ever::ns!($s))
54+
$crate::values::GenericAtomIdent(markup5ever::ns!($s))
5555
};
5656
}
5757

0 commit comments

Comments
 (0)