mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Upgrade to html5ever 0.16
This commit is contained in:
parent
f284a15e4b
commit
6c518c89b9
104 changed files with 363 additions and 471 deletions
61
Cargo.lock
generated
61
Cargo.lock
generated
|
@ -1150,33 +1150,17 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "html5ever"
|
name = "html5ever"
|
||||||
version = "0.15.0"
|
version = "0.16.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"markup5ever 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "html5ever-atoms"
|
|
||||||
version = "0.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
dependencies = [
|
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"string_cache 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "httparse"
|
name = "httparse"
|
||||||
version = "1.2.1"
|
version = "1.2.1"
|
||||||
|
@ -1378,7 +1362,7 @@ dependencies = [
|
||||||
"gfx 0.0.1",
|
"gfx 0.0.1",
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1573,6 +1557,21 @@ dependencies = [
|
||||||
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "markup5ever"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"string_cache 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "matches"
|
name = "matches"
|
||||||
version = "0.1.4"
|
version = "0.1.4"
|
||||||
|
@ -2279,8 +2278,7 @@ dependencies = [
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"hyper 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hyper 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"image 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"image 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2328,7 +2326,7 @@ dependencies = [
|
||||||
"webrender_traits 0.36.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.36.0 (git+https://github.com/servo/webrender)",
|
||||||
"webvr 0.0.1",
|
"webvr 0.0.1",
|
||||||
"webvr_traits 0.0.1",
|
"webvr_traits 0.0.1",
|
||||||
"xml5ever 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xml5ever 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2343,7 +2341,7 @@ dependencies = [
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2768,7 +2766,7 @@ dependencies = [
|
||||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2803,7 +2801,7 @@ dependencies = [
|
||||||
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3327,15 +3325,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xml5ever"
|
name = "xml5ever"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"markup5ever 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -3439,8 +3434,7 @@ dependencies = [
|
||||||
"checksum heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "46f96d52fb1564059fc97b85ef6165728cc30198ab60073bf114c66c4c89bb5d"
|
"checksum heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "46f96d52fb1564059fc97b85ef6165728cc30198ab60073bf114c66c4c89bb5d"
|
||||||
"checksum heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad003ce233955e9d95f2c69cde84e68302ba9ba4a673d351c9bff93c738aadc"
|
"checksum heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad003ce233955e9d95f2c69cde84e68302ba9ba4a673d351c9bff93c738aadc"
|
||||||
"checksum heartbeats-simple-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1a408c0011427cc0e0049f7861c70377819aedfc006e8c901b1c70fd98fb1a4"
|
"checksum heartbeats-simple-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1a408c0011427cc0e0049f7861c70377819aedfc006e8c901b1c70fd98fb1a4"
|
||||||
"checksum html5ever 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "89a83ad398346d1f25b21979dd79ed7b5c345796194665b34321b5551726347e"
|
"checksum html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83d2f9d3abeac56d8b4de9fd033473f6183b89ea91e635326b2807b6a14e98b9"
|
||||||
"checksum html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e4a291981feff7291514f8219d5cd2c740d0c042d75cff248a7c00a025f9d40"
|
|
||||||
"checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d"
|
"checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d"
|
||||||
"checksum hyper 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)" = "94da93321c171e26481afeebe8288757b0501901b7c5492648163d8ec4942ec5"
|
"checksum hyper 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)" = "94da93321c171e26481afeebe8288757b0501901b7c5492648163d8ec4942ec5"
|
||||||
"checksum hyper-openssl 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "85a372eb692590b3fe014c196c30f9f52d4c42f58cd49dd94caeee1593c9cc37"
|
"checksum hyper-openssl 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "85a372eb692590b3fe014c196c30f9f52d4c42f58cd49dd94caeee1593c9cc37"
|
||||||
|
@ -3470,6 +3464,7 @@ dependencies = [
|
||||||
"checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084"
|
"checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084"
|
||||||
"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
|
"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
|
||||||
"checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
|
"checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
|
||||||
|
"checksum markup5ever 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a614f301a2d5583894d1915a8c6bd2c473e80fba69263a60cf2677dbc49936f8"
|
||||||
"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1"
|
"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1"
|
||||||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
|
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
|
||||||
"checksum metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829fffe7ea1d747e23f64be972991bc516b2f1ac2ae4a3b33d8bea150c410151"
|
"checksum metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829fffe7ea1d747e23f64be972991bc516b2f1ac2ae4a3b33d8bea150c410151"
|
||||||
|
@ -3606,4 +3601,4 @@ dependencies = [
|
||||||
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61"
|
"checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61"
|
||||||
"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1"
|
"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1"
|
||||||
"checksum xml-rs 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b15eed12692bd59d15e98ee7f8dc8408465b992d8ddb4d1672c24865132ec7"
|
"checksum xml-rs 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b15eed12692bd59d15e98ee7f8dc8408465b992d8ddb4d1672c24865132ec7"
|
||||||
"checksum xml5ever 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1aae5379a4a7ffb580300bb725696ce238bec993a7bad872ec09ea00ec1c4a5"
|
"checksum xml5ever 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b5bbbde15cfe438463d4e48dc0c752e427a29766d144e3304594ad0c5813cbf9"
|
||||||
|
|
|
@ -20,7 +20,7 @@ fnv = "1.0"
|
||||||
gfx = {path = "../gfx"}
|
gfx = {path = "../gfx"}
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
heapsize = "0.3.0"
|
heapsize = "0.3.0"
|
||||||
html5ever-atoms = "0.3"
|
html5ever = "0.16"
|
||||||
ipc-channel = "0.7"
|
ipc-channel = "0.7"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
log = "0.3.5"
|
log = "0.3.5"
|
||||||
|
|
|
@ -22,7 +22,7 @@ extern crate fnv;
|
||||||
extern crate gfx;
|
extern crate gfx;
|
||||||
extern crate gfx_traits;
|
extern crate gfx_traits;
|
||||||
extern crate heapsize;
|
extern crate heapsize;
|
||||||
#[macro_use] extern crate html5ever_atoms;
|
#[macro_use] extern crate html5ever;
|
||||||
extern crate ipc_channel;
|
extern crate ipc_channel;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -46,8 +46,7 @@ fnv = "1.0"
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
heapsize = "0.3.6"
|
heapsize = "0.3.6"
|
||||||
heapsize_derive = "0.1"
|
heapsize_derive = "0.1"
|
||||||
html5ever = {version = "0.15", features = ["heap_size", "unstable"]}
|
html5ever = {version = "0.16", features = ["heap_size", "unstable"]}
|
||||||
html5ever-atoms = {version = "0.3", features = ["heap_size"]}
|
|
||||||
hyper = "0.10"
|
hyper = "0.10"
|
||||||
hyper_serde = "0.6"
|
hyper_serde = "0.6"
|
||||||
image = "0.12"
|
image = "0.12"
|
||||||
|
@ -88,7 +87,7 @@ time = "0.1.12"
|
||||||
unicode-segmentation = "1.1.0"
|
unicode-segmentation = "1.1.0"
|
||||||
url = {version = "1.2", features = ["heap_size", "query_encoding"]}
|
url = {version = "1.2", features = ["heap_size", "query_encoding"]}
|
||||||
uuid = {version = "0.4", features = ["v4"]}
|
uuid = {version = "0.4", features = ["v4"]}
|
||||||
xml5ever = {version = "0.5", features = ["unstable"]}
|
xml5ever = {version = "0.6", features = ["unstable"]}
|
||||||
webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||||
webvr = {path = "../webvr"}
|
webvr = {path = "../webvr"}
|
||||||
webvr_traits = {path = "../webvr_traits"}
|
webvr_traits = {path = "../webvr_traits"}
|
||||||
|
|
|
@ -13,7 +13,7 @@ use dom::element::{AttributeMutation, Element};
|
||||||
use dom::virtualmethods::vtable_for;
|
use dom::virtualmethods::vtable_for;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::{Prefix, LocalName, Namespace};
|
use html5ever::{Prefix, LocalName, Namespace};
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::cell::Ref;
|
use std::cell::Ref;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
//! The `ByteString` struct.
|
//! The `ByteString` struct.
|
||||||
|
|
||||||
use html5ever_atoms::{LocalName, Namespace};
|
use html5ever::{LocalName, Namespace};
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::{Borrow, Cow, ToOwned};
|
use std::borrow::{Borrow, Cow, ToOwned};
|
||||||
|
|
|
@ -47,8 +47,8 @@ use euclid::{Matrix2D, Matrix4D, Point2D};
|
||||||
use euclid::length::Length as EuclidLength;
|
use euclid::length::Length as EuclidLength;
|
||||||
use euclid::rect::Rect;
|
use euclid::rect::Rect;
|
||||||
use euclid::size::Size2D;
|
use euclid::size::Size2D;
|
||||||
use html5ever::tokenizer::buffer_queue::BufferQueue;
|
use html5ever::{Prefix, LocalName, Namespace, QualName};
|
||||||
use html5ever_atoms::{Prefix, LocalName, Namespace, QualName};
|
use html5ever::buffer_queue::BufferQueue;
|
||||||
use hyper::header::Headers;
|
use hyper::header::Headers;
|
||||||
use hyper::method::Method;
|
use hyper::method::Method;
|
||||||
use hyper::mime::Mime;
|
use hyper::mime::Mime;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
use dom::bindings::error::{Error, ErrorResult, Fallible};
|
use dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use html5ever_atoms::{Prefix, LocalName, Namespace};
|
use html5ever::{Prefix, LocalName, Namespace};
|
||||||
|
|
||||||
/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details.
|
/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details.
|
||||||
pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {
|
pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {
|
||||||
|
|
|
@ -77,7 +77,7 @@ use dom::htmlulistelement::HTMLUListElement;
|
||||||
use dom::htmlunknownelement::HTMLUnknownElement;
|
use dom::htmlunknownelement::HTMLUnknownElement;
|
||||||
use dom::htmlvideoelement::HTMLVideoElement;
|
use dom::htmlvideoelement::HTMLVideoElement;
|
||||||
use dom::svgsvgelement::SVGSVGElement;
|
use dom::svgsvgelement::SVGSVGElement;
|
||||||
use html5ever_atoms::{Prefix, QualName};
|
use html5ever::QualName;
|
||||||
use servo_config::prefs::PREFS;
|
use servo_config::prefs::PREFS;
|
||||||
|
|
||||||
fn create_svg_element(name: QualName,
|
fn create_svg_element(name: QualName,
|
||||||
|
@ -274,13 +274,12 @@ fn create_html_element(name: QualName,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_element(name: QualName,
|
pub fn create_element(name: QualName,
|
||||||
prefix: Option<Prefix>,
|
|
||||||
document: &Document,
|
document: &Document,
|
||||||
creator: ElementCreator)
|
creator: ElementCreator)
|
||||||
-> Root<Element> {
|
-> Root<Element> {
|
||||||
// FIXME(ajeffrey): Convert directly from Prefix to DOMString.
|
// FIXME(ajeffrey): Convert directly from Prefix to DOMString.
|
||||||
|
|
||||||
let prefix = prefix.map(|p| DOMString::from(&*p));
|
let prefix = name.prefix.as_ref().map(|p| DOMString::from(&**p));
|
||||||
|
|
||||||
match name.ns {
|
match name.ns {
|
||||||
ns!(html) => create_html_element(name, prefix, document, creator),
|
ns!(html) => create_html_element(name, prefix, document, creator),
|
||||||
|
|
|
@ -93,7 +93,7 @@ use dom_struct::dom_struct;
|
||||||
use encoding::EncodingRef;
|
use encoding::EncodingRef;
|
||||||
use encoding::all::UTF_8;
|
use encoding::all::UTF_8;
|
||||||
use euclid::point::Point2D;
|
use euclid::point::Point2D;
|
||||||
use html5ever_atoms::{LocalName, QualName};
|
use html5ever::{LocalName, QualName};
|
||||||
use hyper::header::{Header, SetCookie};
|
use hyper::header::{Header, SetCookie};
|
||||||
use hyper_serde::Serde;
|
use hyper_serde::Serde;
|
||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
|
@ -2733,7 +2733,7 @@ impl DocumentMethods for Document {
|
||||||
-> Root<HTMLCollection> {
|
-> Root<HTMLCollection> {
|
||||||
let ns = namespace_from_domstring(maybe_ns);
|
let ns = namespace_from_domstring(maybe_ns);
|
||||||
let local = LocalName::from(tag_name);
|
let local = LocalName::from(tag_name);
|
||||||
let qname = QualName::new(ns, local);
|
let qname = QualName::new(None, ns, local);
|
||||||
match self.tagns_map.borrow_mut().entry(qname.clone()) {
|
match self.tagns_map.borrow_mut().entry(qname.clone()) {
|
||||||
Occupied(entry) => Root::from_ref(entry.get()),
|
Occupied(entry) => Root::from_ref(entry.get()),
|
||||||
Vacant(entry) => {
|
Vacant(entry) => {
|
||||||
|
@ -2782,8 +2782,8 @@ impl DocumentMethods for Document {
|
||||||
ns!()
|
ns!()
|
||||||
};
|
};
|
||||||
|
|
||||||
let name = QualName::new(ns, LocalName::from(local_name));
|
let name = QualName::new(None, ns, LocalName::from(local_name));
|
||||||
Ok(Element::create(name, None, self, ElementCreator::ScriptCreated))
|
Ok(Element::create(name, self, ElementCreator::ScriptCreated))
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-document-createelementns
|
// https://dom.spec.whatwg.org/#dom-document-createelementns
|
||||||
|
@ -2793,8 +2793,8 @@ impl DocumentMethods for Document {
|
||||||
-> Fallible<Root<Element>> {
|
-> Fallible<Root<Element>> {
|
||||||
let (namespace, prefix, local_name) = try!(validate_and_extract(namespace,
|
let (namespace, prefix, local_name) = try!(validate_and_extract(namespace,
|
||||||
&qualified_name));
|
&qualified_name));
|
||||||
let name = QualName::new(namespace, local_name);
|
let name = QualName::new(prefix, namespace, local_name);
|
||||||
Ok(Element::create(name, prefix, self, ElementCreator::ScriptCreated))
|
Ok(Element::create(name, self, ElementCreator::ScriptCreated))
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-document-createattribute
|
// https://dom.spec.whatwg.org/#dom-document-createattribute
|
||||||
|
@ -3047,8 +3047,8 @@ impl DocumentMethods for Document {
|
||||||
match elem {
|
match elem {
|
||||||
Some(elem) => Root::upcast::<Node>(elem),
|
Some(elem) => Root::upcast::<Node>(elem),
|
||||||
None => {
|
None => {
|
||||||
let name = QualName::new(ns!(svg), local_name!("title"));
|
let name = QualName::new(None, ns!(svg), local_name!("title"));
|
||||||
let elem = Element::create(name, None, self, ElementCreator::ScriptCreated);
|
let elem = Element::create(name, self, ElementCreator::ScriptCreated);
|
||||||
let parent = root.upcast::<Node>();
|
let parent = root.upcast::<Node>();
|
||||||
let child = elem.upcast::<Node>();
|
let child = elem.upcast::<Node>();
|
||||||
parent.InsertBefore(child, parent.GetFirstChild().r())
|
parent.InsertBefore(child, parent.GetFirstChild().r())
|
||||||
|
@ -3064,9 +3064,8 @@ impl DocumentMethods for Document {
|
||||||
None => {
|
None => {
|
||||||
match self.GetHead() {
|
match self.GetHead() {
|
||||||
Some(head) => {
|
Some(head) => {
|
||||||
let name = QualName::new(ns!(html), local_name!("title"));
|
let name = QualName::new(None, ns!(html), local_name!("title"));
|
||||||
let elem = Element::create(name,
|
let elem = Element::create(name,
|
||||||
None,
|
|
||||||
self,
|
self,
|
||||||
ElementCreator::ScriptCreated);
|
ElementCreator::ScriptCreated);
|
||||||
head.upcast::<Node>()
|
head.upcast::<Node>()
|
||||||
|
|
|
@ -12,7 +12,7 @@ use dom::bindings::str::DOMString;
|
||||||
use dom::element::Element;
|
use dom::element::Element;
|
||||||
use dom::node::window_from_node;
|
use dom::node::window_from_node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
use style::str::HTML_SPACE_CHARACTERS;
|
use style::str::HTML_SPACE_CHARACTERS;
|
||||||
|
|
||||||
|
|
|
@ -75,11 +75,11 @@ use dom::validation::Validatable;
|
||||||
use dom::virtualmethods::{VirtualMethods, vtable_for};
|
use dom::virtualmethods::{VirtualMethods, vtable_for};
|
||||||
use dom::window::ReflowReason;
|
use dom::window::ReflowReason;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
|
use html5ever::{Prefix, LocalName, Namespace, QualName};
|
||||||
use html5ever::serialize;
|
use html5ever::serialize;
|
||||||
use html5ever::serialize::SerializeOpts;
|
use html5ever::serialize::SerializeOpts;
|
||||||
use html5ever::serialize::TraversalScope;
|
use html5ever::serialize::TraversalScope;
|
||||||
use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
|
use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
|
||||||
use html5ever_atoms::{Prefix, LocalName, Namespace, QualName};
|
|
||||||
use js::jsapi::{HandleValue, JSAutoCompartment};
|
use js::jsapi::{HandleValue, JSAutoCompartment};
|
||||||
use net_traits::request::CorsSettings;
|
use net_traits::request::CorsSettings;
|
||||||
use ref_filter_map::ref_filter_map;
|
use ref_filter_map::ref_filter_map;
|
||||||
|
@ -195,10 +195,10 @@ impl<'a> TryFrom<&'a str> for AdjacentPosition {
|
||||||
// Element methods
|
// Element methods
|
||||||
//
|
//
|
||||||
impl Element {
|
impl Element {
|
||||||
pub fn create(name: QualName, prefix: Option<Prefix>,
|
pub fn create(name: QualName,
|
||||||
document: &Document, creator: ElementCreator)
|
document: &Document, creator: ElementCreator)
|
||||||
-> Root<Element> {
|
-> Root<Element> {
|
||||||
create_element(name, prefix, document, creator)
|
create_element(name, document, creator)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_inherited(local_name: LocalName,
|
pub fn new_inherited(local_name: LocalName,
|
||||||
|
@ -1955,8 +1955,8 @@ impl ElementMethods for Element {
|
||||||
|
|
||||||
// Step 4.
|
// Step 4.
|
||||||
NodeTypeId::DocumentFragment => {
|
NodeTypeId::DocumentFragment => {
|
||||||
let body_elem = Element::create(QualName::new(ns!(html), local_name!("body")),
|
let body_elem = Element::create(QualName::new(None, ns!(html), local_name!("body")),
|
||||||
None, &context_document,
|
&context_document,
|
||||||
ElementCreator::ScriptCreated);
|
ElementCreator::ScriptCreated);
|
||||||
Root::upcast(body_elem)
|
Root::upcast(body_elem)
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,7 @@ use dom::file::File;
|
||||||
use dom::globalscope::GlobalScope;
|
use dom::globalscope::GlobalScope;
|
||||||
use dom::htmlformelement::{HTMLFormElement, FormDatumValue, FormDatum};
|
use dom::htmlformelement::{HTMLFormElement, FormDatumValue, FormDatum};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||||
use std::iter;
|
use std::iter;
|
||||||
|
|
|
@ -25,7 +25,7 @@ use dom::node::{Node, document_from_node};
|
||||||
use dom::urlhelper::UrlHelper;
|
use dom::urlhelper::UrlHelper;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use net_traits::ReferrerPolicy;
|
use net_traits::ReferrerPolicy;
|
||||||
use num_traits::ToPrimitive;
|
use num_traits::ToPrimitive;
|
||||||
use script_traits::MozBrowserEvent;
|
use script_traits::MozBrowserEvent;
|
||||||
|
|
|
@ -12,7 +12,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -20,7 +20,7 @@ use dom::node::{Node, document_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use euclid::point::Point2D;
|
use euclid::point::Point2D;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use net_traits::ReferrerPolicy;
|
use net_traits::ReferrerPolicy;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::f32;
|
use std::f32;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlmediaelement::HTMLMediaElement;
|
use dom::htmlmediaelement::HTMLMediaElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLAudioElement {
|
pub struct HTMLAudioElement {
|
||||||
|
|
|
@ -14,7 +14,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{Node, UnbindContext, document_from_node};
|
use dom::node::{Node, UnbindContext, document_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{Node, document_from_node, window_from_node};
|
use dom::node::{Node, document_from_node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use script_traits::ScriptMsg as ConstellationMsg;
|
use script_traits::ScriptMsg as ConstellationMsg;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLBRElement {
|
pub struct HTMLBRElement {
|
||||||
|
|
|
@ -24,7 +24,7 @@ use dom::validation::Validatable;
|
||||||
use dom::validitystate::{ValidityState, ValidationFlags};
|
use dom::validitystate::{ValidityState, ValidationFlags};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use style::element_state::*;
|
use style::element_state::*;
|
||||||
|
|
|
@ -27,7 +27,7 @@ use dom::virtualmethods::VirtualMethods;
|
||||||
use dom::webglrenderingcontext::{LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext};
|
use dom::webglrenderingcontext::{LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use euclid::size::Size2D;
|
use euclid::size::Size2D;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use image::ColorType;
|
use image::ColorType;
|
||||||
use image::png::PNGEncoder;
|
use image::png::PNGEncoder;
|
||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
|
|
|
@ -14,7 +14,7 @@ use dom::element::Element;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::{LocalName, QualName};
|
use html5ever::{LocalName, QualName};
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use style::str::split_html_space_chars;
|
use style::str::split_html_space_chars;
|
||||||
|
@ -164,7 +164,7 @@ impl HTMLCollection {
|
||||||
maybe_ns: Option<DOMString>) -> Root<HTMLCollection> {
|
maybe_ns: Option<DOMString>) -> Root<HTMLCollection> {
|
||||||
let local = LocalName::from(tag);
|
let local = LocalName::from(tag);
|
||||||
let ns = namespace_from_domstring(maybe_ns);
|
let ns = namespace_from_domstring(maybe_ns);
|
||||||
let qname = QualName::new(ns, local);
|
let qname = QualName::new(None, ns, local);
|
||||||
HTMLCollection::by_qual_tag_name(window, root, qname)
|
HTMLCollection::by_qual_tag_name(window, root, qname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLDataElement {
|
pub struct HTMLDataElement {
|
||||||
|
|
|
@ -14,7 +14,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::htmloptionelement::HTMLOptionElement;
|
use dom::htmloptionelement::HTMLOptionElement;
|
||||||
use dom::node::{Node, window_from_node};
|
use dom::node::{Node, window_from_node};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLDataListElement {
|
pub struct HTMLDataListElement {
|
||||||
|
|
|
@ -16,7 +16,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{Node, window_from_node};
|
use dom::node::{Node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use script_thread::Runnable;
|
use script_thread::Runnable;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use task_source::TaskSource;
|
use task_source::TaskSource;
|
||||||
|
|
|
@ -14,7 +14,7 @@ use dom::eventtarget::EventTarget;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{Node, window_from_node};
|
use dom::node::{Node, window_from_node};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLDialogElement {
|
pub struct HTMLDialogElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLDirectoryElement {
|
pub struct HTMLDirectoryElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLDivElement {
|
pub struct HTMLDivElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLDListElement {
|
pub struct HTMLDListElement {
|
||||||
|
|
|
@ -30,7 +30,7 @@ use dom::node::{document_from_node, window_from_node};
|
||||||
use dom::nodelist::NodeList;
|
use dom::nodelist::NodeList;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLEmbedElement {
|
pub struct HTMLEmbedElement {
|
||||||
|
|
|
@ -18,7 +18,7 @@ use dom::node::{Node, window_from_node};
|
||||||
use dom::validitystate::ValidityState;
|
use dom::validitystate::ValidityState;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use style::element_state::*;
|
use style::element_state::*;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use servo_atoms::Atom;
|
use servo_atoms::Atom;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
use style::str::{HTML_SPACE_CHARACTERS, read_numbers};
|
use style::str::{HTML_SPACE_CHARACTERS, read_numbers};
|
||||||
|
|
|
@ -45,7 +45,7 @@ use dom_struct::dom_struct;
|
||||||
use encoding::EncodingRef;
|
use encoding::EncodingRef;
|
||||||
use encoding::all::UTF_8;
|
use encoding::all::UTF_8;
|
||||||
use encoding::label::encoding_from_whatwg_label;
|
use encoding::label::encoding_from_whatwg_label;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use hyper::header::{Charset, ContentDisposition, ContentType, DispositionParam, DispositionType};
|
use hyper::header::{Charset, ContentDisposition, ContentType, DispositionParam, DispositionType};
|
||||||
use hyper::method::Method;
|
use hyper::method::Method;
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLFrameElement {
|
pub struct HTMLFrameElement {
|
||||||
|
|
|
@ -12,7 +12,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{Node, document_from_node};
|
use dom::node::{Node, document_from_node};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLFrameSetElement {
|
pub struct HTMLFrameSetElement {
|
||||||
|
|
|
@ -15,7 +15,7 @@ use dom::node::{Node, document_from_node};
|
||||||
use dom::userscripts::load_script;
|
use dom::userscripts::load_script;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLHeadElement {
|
pub struct HTMLHeadElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[derive(JSTraceable, HeapSizeOf)]
|
#[derive(JSTraceable, HeapSizeOf)]
|
||||||
pub enum HeadingLevel {
|
pub enum HeadingLevel {
|
||||||
|
|
|
@ -13,7 +13,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLHtmlElement {
|
pub struct HTMLHtmlElement {
|
||||||
|
|
|
@ -36,7 +36,7 @@ use dom::node::{Node, NodeDamage, UnbindContext, document_from_node, window_from
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom::window::{ReflowReason, Window};
|
use dom::window::{ReflowReason, Window};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use js::jsapi::{JSAutoCompartment, JSContext, MutableHandleValue};
|
use js::jsapi::{JSAutoCompartment, JSContext, MutableHandleValue};
|
||||||
use js::jsval::{NullValue, UndefinedValue};
|
use js::jsval::{NullValue, UndefinedValue};
|
||||||
|
|
|
@ -35,7 +35,7 @@ use dom::virtualmethods::VirtualMethods;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use euclid::point::Point2D;
|
use euclid::point::Point2D;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use net_traits::{FetchResponseListener, FetchMetadata, NetworkError, FetchResponseMsg};
|
use net_traits::{FetchResponseListener, FetchMetadata, NetworkError, FetchResponseMsg};
|
||||||
|
|
|
@ -37,7 +37,7 @@ use dom::validation::Validatable;
|
||||||
use dom::validitystate::ValidationFlags;
|
use dom::validitystate::ValidationFlags;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
use mime_guess;
|
use mime_guess;
|
||||||
use net_traits::{CoreResourceMsg, IpcSend};
|
use net_traits::{CoreResourceMsg, IpcSend};
|
||||||
|
|
|
@ -18,7 +18,7 @@ use dom::htmlformelement::{FormControl, FormControlElementHelpers, HTMLFormEleme
|
||||||
use dom::node::{document_from_node, Node};
|
use dom::node::{document_from_node, Node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -16,7 +16,7 @@ use dom::htmlformelement::{HTMLFormElement, FormControl};
|
||||||
use dom::node::{Node, UnbindContext};
|
use dom::node::{Node, UnbindContext};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLLegendElement {
|
pub struct HTMLLegendElement {
|
||||||
|
|
|
@ -12,7 +12,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -22,7 +22,7 @@ use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
|
||||||
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use net_traits::ReferrerPolicy;
|
use net_traits::ReferrerPolicy;
|
||||||
use script_layout_interface::message::Msg;
|
use script_layout_interface::message::Msg;
|
||||||
use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg};
|
use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg};
|
||||||
|
|
|
@ -11,7 +11,7 @@ use dom::htmlareaelement::HTMLAreaElement;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLMapElement {
|
pub struct HTMLMapElement {
|
||||||
|
|
|
@ -28,7 +28,7 @@ use dom::mediaerror::MediaError;
|
||||||
use dom::node::{window_from_node, document_from_node, Node, UnbindContext};
|
use dom::node::{window_from_node, document_from_node, Node, UnbindContext};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError};
|
use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError};
|
||||||
|
|
|
@ -18,7 +18,7 @@ use dom::htmlheadelement::HTMLHeadElement;
|
||||||
use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
|
use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use servo_config::prefs::PREFS;
|
use servo_config::prefs::PREFS;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -11,7 +11,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::nodelist::NodeList;
|
use dom::nodelist::NodeList;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLMeterElement {
|
pub struct HTMLMeterElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLModElement {
|
pub struct HTMLModElement {
|
||||||
|
|
|
@ -18,7 +18,7 @@ use dom::validation::Validatable;
|
||||||
use dom::validitystate::{ValidityState, ValidationFlags};
|
use dom::validitystate::{ValidityState, ValidationFlags};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use net_traits::image::base::Image;
|
use net_traits::image::base::Image;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLOListElement {
|
pub struct HTMLOListElement {
|
||||||
|
|
|
@ -15,7 +15,7 @@ use dom::htmloptionelement::HTMLOptionElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::element_state::*;
|
use style::element_state::*;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -23,7 +23,7 @@ use dom::node::{Node, UnbindContext};
|
||||||
use dom::text::Text;
|
use dom::text::Text;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use style::element_state::*;
|
use style::element_state::*;
|
||||||
use style::str::{split_html_space_chars, str_join};
|
use style::str::{split_html_space_chars, str_join};
|
||||||
|
|
|
@ -17,7 +17,7 @@ use dom::nodelist::NodeList;
|
||||||
use dom::validitystate::ValidityState;
|
use dom::validitystate::ValidityState;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLOutputElement {
|
pub struct HTMLOutputElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLParagraphElement {
|
pub struct HTMLParagraphElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLParamElement {
|
pub struct HTMLParamElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLPreElement {
|
pub struct HTMLPreElement {
|
||||||
|
|
|
@ -11,7 +11,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::nodelist::NodeList;
|
use dom::nodelist::NodeList;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLProgressElement {
|
pub struct HTMLProgressElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLQuoteElement {
|
pub struct HTMLQuoteElement {
|
||||||
|
|
|
@ -26,7 +26,7 @@ use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use encoding::label::encoding_from_whatwg_label;
|
use encoding::label::encoding_from_whatwg_label;
|
||||||
use encoding::types::{DecoderTrap, EncodingRef};
|
use encoding::types::{DecoderTrap, EncodingRef};
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use ipc_channel::ipc;
|
use ipc_channel::ipc;
|
||||||
use ipc_channel::router::ROUTER;
|
use ipc_channel::router::ROUTER;
|
||||||
use js::jsval::UndefinedValue;
|
use js::jsval::UndefinedValue;
|
||||||
|
|
|
@ -31,7 +31,7 @@ use dom::validation::Validatable;
|
||||||
use dom::validitystate::{ValidityState, ValidationFlags};
|
use dom::validitystate::{ValidityState, ValidationFlags};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLSourceElement {
|
pub struct HTMLSourceElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLSpanElement {
|
pub struct HTMLSpanElement {
|
||||||
|
|
|
@ -19,7 +19,7 @@ use dom::node::{ChildrenMutation, Node, UnbindContext, document_from_node, windo
|
||||||
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use net_traits::ReferrerPolicy;
|
use net_traits::ReferrerPolicy;
|
||||||
use script_layout_interface::message::Msg;
|
use script_layout_interface::message::Msg;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTableCaptionElement {
|
pub struct HTMLTableCaptionElement {
|
||||||
|
|
|
@ -15,7 +15,7 @@ use dom::htmltablerowelement::HTMLTableRowElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||||
|
|
||||||
const DEFAULT_COLSPAN: u32 = 1;
|
const DEFAULT_COLSPAN: u32 = 1;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTableColElement {
|
pub struct HTMLTableColElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTableDataCellElement {
|
pub struct HTMLTableDataCellElement {
|
||||||
|
|
|
@ -23,7 +23,7 @@ use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||||
use dom::node::{Node, document_from_node, window_from_node};
|
use dom::node::{Node, document_from_node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_unsigned_integer};
|
use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_unsigned_integer};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmltablecellelement::HTMLTableCellElement;
|
use dom::htmltablecellelement::HTMLTableCellElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTableHeaderCellElement {
|
pub struct HTMLTableHeaderCellElement {
|
||||||
|
|
|
@ -22,7 +22,7 @@ use dom::htmltablesectionelement::HTMLTableSectionElement;
|
||||||
use dom::node::{Node, window_from_node};
|
use dom::node::{Node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
#[derive(JSTraceable)]
|
#[derive(JSTraceable)]
|
||||||
|
|
|
@ -17,7 +17,7 @@ use dom::htmltablerowelement::HTMLTableRowElement;
|
||||||
use dom::node::{Node, window_from_node};
|
use dom::node::{Node, window_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -15,7 +15,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{CloneChildrenFlag, Node, document_from_node};
|
use dom::node::{CloneChildrenFlag, Node, document_from_node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTemplateElement {
|
pub struct HTMLTemplateElement {
|
||||||
|
|
|
@ -26,7 +26,7 @@ use dom::nodelist::NodeList;
|
||||||
use dom::validation::Validatable;
|
use dom::validation::Validatable;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use ipc_channel::ipc::IpcSender;
|
use ipc_channel::ipc::IpcSender;
|
||||||
use script_traits::ScriptMsg as ConstellationMsg;
|
use script_traits::ScriptMsg as ConstellationMsg;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
|
@ -10,7 +10,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTimeElement {
|
pub struct HTMLTimeElement {
|
||||||
|
|
|
@ -13,7 +13,7 @@ use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::{ChildrenMutation, Node};
|
use dom::node::{ChildrenMutation, Node};
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTitleElement {
|
pub struct HTMLTitleElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLTrackElement {
|
pub struct HTMLTrackElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLUListElement {
|
pub struct HTMLUListElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlelement::HTMLElement;
|
use dom::htmlelement::HTMLElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLUnknownElement {
|
pub struct HTMLUnknownElement {
|
||||||
|
|
|
@ -9,7 +9,7 @@ use dom::document::Document;
|
||||||
use dom::htmlmediaelement::HTMLMediaElement;
|
use dom::htmlmediaelement::HTMLMediaElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLVideoElement {
|
pub struct HTMLVideoElement {
|
||||||
|
|
|
@ -14,7 +14,7 @@ use dom::bindings::xmlname::namespace_from_domstring;
|
||||||
use dom::element::Element;
|
use dom::element::Element;
|
||||||
use dom::window::Window;
|
use dom::window::Window;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -58,7 +58,7 @@ use euclid::point::Point2D;
|
||||||
use euclid::rect::Rect;
|
use euclid::rect::Rect;
|
||||||
use euclid::size::Size2D;
|
use euclid::size::Size2D;
|
||||||
use heapsize::{HeapSizeOf, heap_size_of};
|
use heapsize::{HeapSizeOf, heap_size_of};
|
||||||
use html5ever_atoms::{Prefix, Namespace, QualName};
|
use html5ever::{Prefix, Namespace, QualName};
|
||||||
use js::jsapi::{JSContext, JSObject, JSRuntime};
|
use js::jsapi::{JSContext, JSObject, JSRuntime};
|
||||||
use libc::{self, c_void, uintptr_t};
|
use libc::{self, c_void, uintptr_t};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
|
@ -1749,11 +1749,11 @@ impl Node {
|
||||||
NodeTypeId::Element(..) => {
|
NodeTypeId::Element(..) => {
|
||||||
let element = node.downcast::<Element>().unwrap();
|
let element = node.downcast::<Element>().unwrap();
|
||||||
let name = QualName {
|
let name = QualName {
|
||||||
|
prefix: element.prefix().map(|p| Prefix::from(&**p)),
|
||||||
ns: element.namespace().clone(),
|
ns: element.namespace().clone(),
|
||||||
local: element.local_name().clone()
|
local: element.local_name().clone()
|
||||||
};
|
};
|
||||||
let element = Element::create(name,
|
let element = Element::create(name,
|
||||||
element.prefix().map(|p| Prefix::from(&**p)),
|
|
||||||
&document, ElementCreator::ScriptCreated);
|
&document, ElementCreator::ScriptCreated);
|
||||||
Root::upcast::<Node>(element)
|
Root::upcast::<Node>(element)
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,38 +5,28 @@
|
||||||
#![allow(unrooted_must_root)]
|
#![allow(unrooted_must_root)]
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
|
use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
|
||||||
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
|
||||||
use dom::bindings::inheritance::{Castable, CharacterDataTypeId, NodeTypeId};
|
use dom::bindings::inheritance::{Castable, CharacterDataTypeId, NodeTypeId};
|
||||||
use dom::bindings::js::{JS, Root};
|
use dom::bindings::js::{JS, Root};
|
||||||
use dom::bindings::str::DOMString;
|
|
||||||
use dom::bindings::trace::JSTraceable;
|
use dom::bindings::trace::JSTraceable;
|
||||||
use dom::characterdata::CharacterData;
|
use dom::characterdata::CharacterData;
|
||||||
use dom::comment::Comment;
|
|
||||||
use dom::document::Document;
|
use dom::document::Document;
|
||||||
use dom::documenttype::DocumentType;
|
use dom::documenttype::DocumentType;
|
||||||
use dom::element::{Element, ElementCreator};
|
use dom::element::Element;
|
||||||
use dom::htmlformelement::{FormControlElementHelpers, HTMLFormElement};
|
|
||||||
use dom::htmlscriptelement::HTMLScriptElement;
|
use dom::htmlscriptelement::HTMLScriptElement;
|
||||||
use dom::htmltemplateelement::HTMLTemplateElement;
|
use dom::htmltemplateelement::HTMLTemplateElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::processinginstruction::ProcessingInstruction;
|
use dom::processinginstruction::ProcessingInstruction;
|
||||||
use dom::virtualmethods::vtable_for;
|
use dom::servoparser::Sink;
|
||||||
use html5ever::Attribute;
|
|
||||||
use html5ever::QualName;
|
use html5ever::QualName;
|
||||||
use html5ever::serialize::{AttrRef, Serializable, Serializer};
|
use html5ever::buffer_queue::BufferQueue;
|
||||||
|
use html5ever::serialize::{AttrRef, Serialize, Serializer};
|
||||||
use html5ever::serialize::TraversalScope;
|
use html5ever::serialize::TraversalScope;
|
||||||
use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
|
use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode};
|
||||||
use html5ever::tendril::StrTendril;
|
|
||||||
use html5ever::tokenizer::{Tokenizer as HtmlTokenizer, TokenizerOpts, TokenizerResult};
|
use html5ever::tokenizer::{Tokenizer as HtmlTokenizer, TokenizerOpts, TokenizerResult};
|
||||||
use html5ever::tokenizer::buffer_queue::BufferQueue;
|
use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts};
|
||||||
use html5ever::tree_builder::{NodeOrText, QuirksMode};
|
|
||||||
use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts, TreeSink};
|
|
||||||
use js::jsapi::JSTracer;
|
use js::jsapi::JSTracer;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::ascii::AsciiExt;
|
use std::io;
|
||||||
use std::borrow::Cow;
|
|
||||||
use std::io::{self, Write};
|
|
||||||
use style::context::QuirksMode as ServoQuirksMode;
|
|
||||||
|
|
||||||
#[derive(HeapSizeOf, JSTraceable)]
|
#[derive(HeapSizeOf, JSTraceable)]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
@ -55,6 +45,7 @@ impl Tokenizer {
|
||||||
base_url: url,
|
base_url: url,
|
||||||
document: JS::from_ref(document),
|
document: JS::from_ref(document),
|
||||||
current_line: 1,
|
current_line: 1,
|
||||||
|
script: Default::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let options = TreeBuilderOpts {
|
let options = TreeBuilderOpts {
|
||||||
|
@ -124,179 +115,18 @@ unsafe impl JSTraceable for HtmlTokenizer<TreeBuilder<JS<Node>, Sink>> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(JSTraceable, HeapSizeOf)]
|
impl<'a> Serialize for &'a Node {
|
||||||
#[must_root]
|
fn serialize<S: Serializer>(&self, serializer: &mut S,
|
||||||
struct Sink {
|
traversal_scope: TraversalScope) -> io::Result<()> {
|
||||||
base_url: ServoUrl,
|
|
||||||
document: JS<Document>,
|
|
||||||
current_line: u64,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl TreeSink for Sink {
|
|
||||||
type Output = Self;
|
|
||||||
fn finish(self) -> Self { self }
|
|
||||||
|
|
||||||
type Handle = JS<Node>;
|
|
||||||
|
|
||||||
fn get_document(&mut self) -> JS<Node> {
|
|
||||||
JS::from_ref(self.document.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_template_contents(&mut self, target: JS<Node>) -> JS<Node> {
|
|
||||||
let template = target.downcast::<HTMLTemplateElement>()
|
|
||||||
.expect("tried to get template contents of non-HTMLTemplateElement in HTML parsing");
|
|
||||||
JS::from_ref(template.Content().upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn same_node(&self, x: JS<Node>, y: JS<Node>) -> bool {
|
|
||||||
x == y
|
|
||||||
}
|
|
||||||
|
|
||||||
fn elem_name(&self, target: JS<Node>) -> QualName {
|
|
||||||
let elem = target.downcast::<Element>()
|
|
||||||
.expect("tried to get name of non-Element in HTML parsing");
|
|
||||||
QualName {
|
|
||||||
ns: elem.namespace().clone(),
|
|
||||||
local: elem.local_name().clone(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn same_tree(&self, x: JS<Node>, y: JS<Node>) -> bool {
|
|
||||||
let x = x.downcast::<Element>().expect("Element node expected");
|
|
||||||
let y = y.downcast::<Element>().expect("Element node expected");
|
|
||||||
|
|
||||||
x.is_in_same_home_subtree(y)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>)
|
|
||||||
-> JS<Node> {
|
|
||||||
let elem = Element::create(name, None, &*self.document,
|
|
||||||
ElementCreator::ParserCreated(self.current_line));
|
|
||||||
|
|
||||||
for attr in attrs {
|
|
||||||
elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None);
|
|
||||||
}
|
|
||||||
|
|
||||||
JS::from_ref(elem.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_comment(&mut self, text: StrTendril) -> JS<Node> {
|
|
||||||
let comment = Comment::new(DOMString::from(String::from(text)), &*self.document);
|
|
||||||
JS::from_ref(comment.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn has_parent_node(&self, node: JS<Node>) -> bool {
|
|
||||||
node.GetParentNode().is_some()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn associate_with_form(&mut self, target: JS<Node>, form: JS<Node>) {
|
|
||||||
let node = target;
|
|
||||||
let form = Root::downcast::<HTMLFormElement>(Root::from_ref(&*form))
|
|
||||||
.expect("Owner must be a form element");
|
|
||||||
|
|
||||||
let elem = node.downcast::<Element>();
|
|
||||||
let control = elem.as_ref().and_then(|e| e.as_maybe_form_control());
|
|
||||||
|
|
||||||
if let Some(control) = control {
|
|
||||||
control.set_form_owner_from_parser(&form);
|
|
||||||
} else {
|
|
||||||
// TODO remove this code when keygen is implemented.
|
|
||||||
assert!(node.NodeName() == "KEYGEN", "Unknown form-associatable element");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn append_before_sibling(&mut self,
|
|
||||||
sibling: JS<Node>,
|
|
||||||
new_node: NodeOrText<JS<Node>>) {
|
|
||||||
let parent = sibling.GetParentNode()
|
|
||||||
.expect("append_before_sibling called on node without parent");
|
|
||||||
|
|
||||||
super::insert(&parent, Some(&*sibling), new_node);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_error(&mut self, msg: Cow<'static, str>) {
|
|
||||||
debug!("Parse error: {}", msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_quirks_mode(&mut self, mode: QuirksMode) {
|
|
||||||
let mode = match mode {
|
|
||||||
QuirksMode::Quirks => ServoQuirksMode::Quirks,
|
|
||||||
QuirksMode::LimitedQuirks => ServoQuirksMode::LimitedQuirks,
|
|
||||||
QuirksMode::NoQuirks => ServoQuirksMode::NoQuirks,
|
|
||||||
};
|
|
||||||
self.document.set_quirks_mode(mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn append(&mut self, parent: JS<Node>, child: NodeOrText<JS<Node>>) {
|
|
||||||
super::insert(&parent, None, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril,
|
|
||||||
system_id: StrTendril) {
|
|
||||||
let doc = &*self.document;
|
|
||||||
let doctype = DocumentType::new(
|
|
||||||
DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))),
|
|
||||||
Some(DOMString::from(String::from(system_id))), doc);
|
|
||||||
doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn add_attrs_if_missing(&mut self, target: JS<Node>, attrs: Vec<Attribute>) {
|
|
||||||
let elem = target.downcast::<Element>()
|
|
||||||
.expect("tried to set attrs on non-Element in HTML parsing");
|
|
||||||
for attr in attrs {
|
|
||||||
elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn remove_from_parent(&mut self, target: JS<Node>) {
|
|
||||||
if let Some(ref parent) = target.GetParentNode() {
|
|
||||||
parent.RemoveChild(&*target).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn mark_script_already_started(&mut self, node: JS<Node>) {
|
|
||||||
let script = node.downcast::<HTMLScriptElement>();
|
|
||||||
script.map(|script| script.set_already_started(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
fn reparent_children(&mut self, node: JS<Node>, new_parent: JS<Node>) {
|
|
||||||
while let Some(ref child) = node.GetFirstChild() {
|
|
||||||
new_parent.AppendChild(&child).unwrap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://html.spec.whatwg.org/multipage/#html-integration-point
|
|
||||||
/// Specifically, the <annotation-xml> cases.
|
|
||||||
fn is_mathml_annotation_xml_integration_point(&self, handle: JS<Node>) -> bool {
|
|
||||||
let elem = handle.downcast::<Element>().unwrap();
|
|
||||||
elem.get_attribute(&ns!(), &local_name!("encoding")).map_or(false, |attr| {
|
|
||||||
attr.value().eq_ignore_ascii_case("text/html")
|
|
||||||
|| attr.value().eq_ignore_ascii_case("application/xhtml+xml")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_current_line(&mut self, line_number: u64) {
|
|
||||||
self.current_line = line_number;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn pop(&mut self, node: JS<Node>) {
|
|
||||||
let node = Root::from_ref(&*node);
|
|
||||||
vtable_for(&node).pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Serializable for &'a Node {
|
|
||||||
fn serialize<'wr, Wr: Write>(&self, serializer: &mut Serializer<'wr, Wr>,
|
|
||||||
traversal_scope: TraversalScope) -> io::Result<()> {
|
|
||||||
let node = *self;
|
let node = *self;
|
||||||
match (traversal_scope, node.type_id()) {
|
match (traversal_scope, node.type_id()) {
|
||||||
(_, NodeTypeId::Element(..)) => {
|
(_, NodeTypeId::Element(..)) => {
|
||||||
let elem = node.downcast::<Element>().unwrap();
|
let elem = node.downcast::<Element>().unwrap();
|
||||||
let name = QualName::new(elem.namespace().clone(),
|
let name = QualName::new(None, elem.namespace().clone(),
|
||||||
elem.local_name().clone());
|
elem.local_name().clone());
|
||||||
if traversal_scope == IncludeNode {
|
if traversal_scope == IncludeNode {
|
||||||
let attrs = elem.attrs().iter().map(|attr| {
|
let attrs = elem.attrs().iter().map(|attr| {
|
||||||
let qname = QualName::new(attr.namespace().clone(),
|
let qname = QualName::new(None, attr.namespace().clone(),
|
||||||
attr.local_name().clone());
|
attr.local_name().clone());
|
||||||
let value = attr.value().clone();
|
let value = attr.value().clone();
|
||||||
(qname, value)
|
(qname, value)
|
||||||
|
|
|
@ -6,27 +6,35 @@ use document_loader::{DocumentLoader, LoadType};
|
||||||
use dom::bindings::cell::DOMRefCell;
|
use dom::bindings::cell::DOMRefCell;
|
||||||
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState};
|
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState};
|
||||||
use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods;
|
use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods;
|
||||||
|
use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
|
||||||
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||||
use dom::bindings::codegen::Bindings::ServoParserBinding;
|
use dom::bindings::codegen::Bindings::ServoParserBinding;
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::js::{JS, Root, RootedReference};
|
use dom::bindings::js::{JS, MutNullableJS, Root, RootedReference};
|
||||||
use dom::bindings::refcounted::Trusted;
|
use dom::bindings::refcounted::Trusted;
|
||||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||||
use dom::bindings::str::DOMString;
|
use dom::bindings::str::DOMString;
|
||||||
use dom::characterdata::CharacterData;
|
use dom::characterdata::CharacterData;
|
||||||
|
use dom::comment::Comment;
|
||||||
use dom::document::{Document, DocumentSource, HasBrowsingContext, IsHTMLDocument};
|
use dom::document::{Document, DocumentSource, HasBrowsingContext, IsHTMLDocument};
|
||||||
use dom::element::Element;
|
use dom::documenttype::DocumentType;
|
||||||
|
use dom::element::{Element, ElementCreator};
|
||||||
use dom::globalscope::GlobalScope;
|
use dom::globalscope::GlobalScope;
|
||||||
use dom::htmlformelement::HTMLFormElement;
|
use dom::htmlformelement::{FormControlElementHelpers, HTMLFormElement};
|
||||||
use dom::htmlimageelement::HTMLImageElement;
|
use dom::htmlimageelement::HTMLImageElement;
|
||||||
use dom::htmlscriptelement::{HTMLScriptElement, ScriptResult};
|
use dom::htmlscriptelement::{HTMLScriptElement, ScriptResult};
|
||||||
|
use dom::htmltemplateelement::HTMLTemplateElement;
|
||||||
use dom::node::{Node, NodeSiblingIterator};
|
use dom::node::{Node, NodeSiblingIterator};
|
||||||
|
use dom::processinginstruction::ProcessingInstruction;
|
||||||
use dom::text::Text;
|
use dom::text::Text;
|
||||||
|
use dom::virtualmethods::vtable_for;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use encoding::all::UTF_8;
|
use encoding::all::UTF_8;
|
||||||
use encoding::types::{DecoderTrap, Encoding};
|
use encoding::types::{DecoderTrap, Encoding};
|
||||||
use html5ever::tokenizer::buffer_queue::BufferQueue;
|
use html5ever::{Attribute, QualName, ExpandedName};
|
||||||
use html5ever::tree_builder::NodeOrText;
|
use html5ever::buffer_queue::BufferQueue;
|
||||||
|
use html5ever::tendril::StrTendril;
|
||||||
|
use html5ever::tree_builder::{NodeOrText, TreeSink, NextParserState, QuirksMode, ElementFlags};
|
||||||
use hyper::header::ContentType;
|
use hyper::header::ContentType;
|
||||||
use hyper::mime::{Mime, SubLevel, TopLevel};
|
use hyper::mime::{Mime, SubLevel, TopLevel};
|
||||||
use hyper_serde::Serde;
|
use hyper_serde::Serde;
|
||||||
|
@ -40,8 +48,10 @@ use script_traits::DocumentActivity;
|
||||||
use servo_config::resource_files::read_resource_file;
|
use servo_config::resource_files::read_resource_file;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
|
use std::borrow::Cow;
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
use style::context::QuirksMode as ServoQuirksMode;
|
||||||
|
|
||||||
mod html;
|
mod html;
|
||||||
mod xml;
|
mod xml;
|
||||||
|
@ -671,3 +681,183 @@ fn insert(parent: &Node, reference_child: Option<&Node>, child: NodeOrText<JS<No
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(JSTraceable, HeapSizeOf)]
|
||||||
|
#[must_root]
|
||||||
|
pub struct Sink {
|
||||||
|
base_url: ServoUrl,
|
||||||
|
document: JS<Document>,
|
||||||
|
current_line: u64,
|
||||||
|
script: MutNullableJS<HTMLScriptElement>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unrooted_must_root)] // FIXME: really?
|
||||||
|
impl TreeSink for Sink {
|
||||||
|
type Output = Self;
|
||||||
|
fn finish(self) -> Self { self }
|
||||||
|
|
||||||
|
type Handle = JS<Node>;
|
||||||
|
|
||||||
|
fn get_document(&mut self) -> JS<Node> {
|
||||||
|
JS::from_ref(self.document.upcast())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_template_contents(&mut self, target: &JS<Node>) -> JS<Node> {
|
||||||
|
let template = target.downcast::<HTMLTemplateElement>()
|
||||||
|
.expect("tried to get template contents of non-HTMLTemplateElement in HTML parsing");
|
||||||
|
JS::from_ref(template.Content().upcast())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn same_node(&self, x: &JS<Node>, y: &JS<Node>) -> bool {
|
||||||
|
x == y
|
||||||
|
}
|
||||||
|
|
||||||
|
fn elem_name<'a>(&self, target: &'a JS<Node>) -> ExpandedName<'a> {
|
||||||
|
let elem = target.downcast::<Element>()
|
||||||
|
.expect("tried to get name of non-Element in HTML parsing");
|
||||||
|
ExpandedName {
|
||||||
|
ns: elem.namespace(),
|
||||||
|
local: elem.local_name(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn same_tree(&self, x: &JS<Node>, y: &JS<Node>) -> bool {
|
||||||
|
let x = x.downcast::<Element>().expect("Element node expected");
|
||||||
|
let y = y.downcast::<Element>().expect("Element node expected");
|
||||||
|
|
||||||
|
x.is_in_same_home_subtree(y)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>, _flags: ElementFlags)
|
||||||
|
-> JS<Node> {
|
||||||
|
let elem = Element::create(name, &*self.document,
|
||||||
|
ElementCreator::ParserCreated(self.current_line));
|
||||||
|
|
||||||
|
for attr in attrs {
|
||||||
|
elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None);
|
||||||
|
}
|
||||||
|
|
||||||
|
JS::from_ref(elem.upcast())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_comment(&mut self, text: StrTendril) -> JS<Node> {
|
||||||
|
let comment = Comment::new(DOMString::from(String::from(text)), &*self.document);
|
||||||
|
JS::from_ref(comment.upcast())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> JS<Node> {
|
||||||
|
let doc = &*self.document;
|
||||||
|
let pi = ProcessingInstruction::new(
|
||||||
|
DOMString::from(String::from(target)), DOMString::from(String::from(data)),
|
||||||
|
doc);
|
||||||
|
JS::from_ref(pi.upcast())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn has_parent_node(&self, node: &JS<Node>) -> bool {
|
||||||
|
node.GetParentNode().is_some()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn associate_with_form(&mut self, target: &JS<Node>, form: &JS<Node>) {
|
||||||
|
let node = target;
|
||||||
|
let form = Root::downcast::<HTMLFormElement>(Root::from_ref(&**form))
|
||||||
|
.expect("Owner must be a form element");
|
||||||
|
|
||||||
|
let elem = node.downcast::<Element>();
|
||||||
|
let control = elem.and_then(|e| e.as_maybe_form_control());
|
||||||
|
|
||||||
|
if let Some(control) = control {
|
||||||
|
control.set_form_owner_from_parser(&form);
|
||||||
|
} else {
|
||||||
|
// TODO remove this code when keygen is implemented.
|
||||||
|
assert!(node.NodeName() == "KEYGEN", "Unknown form-associatable element");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn append_before_sibling(&mut self,
|
||||||
|
sibling: &JS<Node>,
|
||||||
|
new_node: NodeOrText<JS<Node>>) {
|
||||||
|
let parent = sibling.GetParentNode()
|
||||||
|
.expect("append_before_sibling called on node without parent");
|
||||||
|
|
||||||
|
insert(&parent, Some(&*sibling), new_node);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn parse_error(&mut self, msg: Cow<'static, str>) {
|
||||||
|
debug!("Parse error: {}", msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_quirks_mode(&mut self, mode: QuirksMode) {
|
||||||
|
let mode = match mode {
|
||||||
|
QuirksMode::Quirks => ServoQuirksMode::Quirks,
|
||||||
|
QuirksMode::LimitedQuirks => ServoQuirksMode::LimitedQuirks,
|
||||||
|
QuirksMode::NoQuirks => ServoQuirksMode::NoQuirks,
|
||||||
|
};
|
||||||
|
self.document.set_quirks_mode(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn append(&mut self, parent: &JS<Node>, child: NodeOrText<JS<Node>>) {
|
||||||
|
insert(&parent, None, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril,
|
||||||
|
system_id: StrTendril) {
|
||||||
|
let doc = &*self.document;
|
||||||
|
let doctype = DocumentType::new(
|
||||||
|
DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))),
|
||||||
|
Some(DOMString::from(String::from(system_id))), doc);
|
||||||
|
doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn add_attrs_if_missing(&mut self, target: &JS<Node>, attrs: Vec<Attribute>) {
|
||||||
|
let elem = target.downcast::<Element>()
|
||||||
|
.expect("tried to set attrs on non-Element in HTML parsing");
|
||||||
|
for attr in attrs {
|
||||||
|
elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_from_parent(&mut self, target: &JS<Node>) {
|
||||||
|
if let Some(ref parent) = target.GetParentNode() {
|
||||||
|
parent.RemoveChild(&*target).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mark_script_already_started(&mut self, node: &JS<Node>) {
|
||||||
|
let script = node.downcast::<HTMLScriptElement>();
|
||||||
|
script.map(|script| script.set_already_started(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn complete_script(&mut self, node: &JS<Node>) -> NextParserState {
|
||||||
|
if let Some(script) = node.downcast() {
|
||||||
|
self.script.set(Some(script));
|
||||||
|
NextParserState::Suspend
|
||||||
|
} else {
|
||||||
|
NextParserState::Continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn reparent_children(&mut self, node: &JS<Node>, new_parent: &JS<Node>) {
|
||||||
|
while let Some(ref child) = node.GetFirstChild() {
|
||||||
|
new_parent.AppendChild(&child).unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// https://html.spec.whatwg.org/multipage/#html-integration-point
|
||||||
|
/// Specifically, the <annotation-xml> cases.
|
||||||
|
fn is_mathml_annotation_xml_integration_point(&self, handle: &JS<Node>) -> bool {
|
||||||
|
let elem = handle.downcast::<Element>().unwrap();
|
||||||
|
elem.get_attribute(&ns!(), &local_name!("encoding")).map_or(false, |attr| {
|
||||||
|
attr.value().eq_ignore_ascii_case("text/html")
|
||||||
|
|| attr.value().eq_ignore_ascii_case("application/xhtml+xml")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_current_line(&mut self, line_number: u64) {
|
||||||
|
self.current_line = line_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn pop(&mut self, node: &JS<Node>) {
|
||||||
|
let node = Root::from_ref(&**node);
|
||||||
|
vtable_for(&node).pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -4,29 +4,17 @@
|
||||||
|
|
||||||
#![allow(unrooted_must_root)]
|
#![allow(unrooted_must_root)]
|
||||||
|
|
||||||
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
use dom::bindings::js::{JS, Root};
|
||||||
use dom::bindings::inheritance::Castable;
|
|
||||||
use dom::bindings::js::{JS, MutNullableJS, Root};
|
|
||||||
use dom::bindings::str::DOMString;
|
|
||||||
use dom::bindings::trace::JSTraceable;
|
use dom::bindings::trace::JSTraceable;
|
||||||
use dom::comment::Comment;
|
|
||||||
use dom::document::Document;
|
use dom::document::Document;
|
||||||
use dom::documenttype::DocumentType;
|
|
||||||
use dom::element::{Element, ElementCreator};
|
|
||||||
use dom::htmlscriptelement::HTMLScriptElement;
|
use dom::htmlscriptelement::HTMLScriptElement;
|
||||||
use dom::node::Node;
|
use dom::node::Node;
|
||||||
use dom::processinginstruction::ProcessingInstruction;
|
use dom::servoparser::Sink;
|
||||||
use dom::virtualmethods::vtable_for;
|
|
||||||
use html5ever::tokenizer::buffer_queue::BufferQueue;
|
|
||||||
use html5ever::tree_builder::{NodeOrText as H5eNodeOrText};
|
|
||||||
use html5ever_atoms::{Prefix, QualName};
|
|
||||||
use js::jsapi::JSTracer;
|
use js::jsapi::JSTracer;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
use std::borrow::Cow;
|
use xml5ever::buffer_queue::BufferQueue;
|
||||||
use xml5ever::tendril::StrTendril;
|
use xml5ever::tokenizer::XmlTokenizer;
|
||||||
use xml5ever::tokenizer::{Attribute, QName, XmlTokenizer};
|
use xml5ever::tree_builder::{Tracer as XmlTracer, XmlTreeBuilder};
|
||||||
use xml5ever::tree_builder::{NextParserState, NodeOrText};
|
|
||||||
use xml5ever::tree_builder::{Tracer as XmlTracer, TreeSink, XmlTreeBuilder};
|
|
||||||
|
|
||||||
#[derive(HeapSizeOf, JSTraceable)]
|
#[derive(HeapSizeOf, JSTraceable)]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
@ -40,6 +28,7 @@ impl Tokenizer {
|
||||||
let sink = Sink {
|
let sink = Sink {
|
||||||
base_url: url,
|
base_url: url,
|
||||||
document: JS::from_ref(document),
|
document: JS::from_ref(document),
|
||||||
|
current_line: 1,
|
||||||
script: Default::default(),
|
script: Default::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -86,7 +75,7 @@ unsafe impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> {
|
||||||
impl XmlTracer for Tracer {
|
impl XmlTracer for Tracer {
|
||||||
type Handle = JS<Node>;
|
type Handle = JS<Node>;
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
fn trace_handle(&self, node: JS<Node>) {
|
fn trace_handle(&self, node: &JS<Node>) {
|
||||||
unsafe { node.trace(self.0); }
|
unsafe { node.trace(self.0); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,111 +85,3 @@ unsafe impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> {
|
||||||
tree_builder.sink().trace(trc);
|
tree_builder.sink().trace(trc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(JSTraceable, HeapSizeOf)]
|
|
||||||
#[must_root]
|
|
||||||
struct Sink {
|
|
||||||
base_url: ServoUrl,
|
|
||||||
document: JS<Document>,
|
|
||||||
script: MutNullableJS<HTMLScriptElement>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl TreeSink for Sink {
|
|
||||||
type Output = Self;
|
|
||||||
type Handle = JS<Node>;
|
|
||||||
|
|
||||||
fn finish(self) -> Self {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_error(&mut self, msg: Cow<'static, str>) {
|
|
||||||
debug!("Parse error: {}", msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_document(&mut self) -> JS<Node> {
|
|
||||||
JS::from_ref(self.document.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn elem_name(&self, target: &JS<Node>) -> QName {
|
|
||||||
let elem = target.downcast::<Element>()
|
|
||||||
.expect("tried to get name of non-Element in XML parsing");
|
|
||||||
QName {
|
|
||||||
prefix: elem.prefix().map_or(namespace_prefix!(""), |p| Prefix::from(&**p)),
|
|
||||||
namespace_url: elem.namespace().clone(),
|
|
||||||
local: elem.local_name().clone(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_element(&mut self, name: QName, attrs: Vec<Attribute>)
|
|
||||||
-> JS<Node> {
|
|
||||||
let prefix = if name.prefix == namespace_prefix!("") { None } else { Some(name.prefix) };
|
|
||||||
let name = QualName {
|
|
||||||
ns: name.namespace_url,
|
|
||||||
local: name.local,
|
|
||||||
};
|
|
||||||
//TODO: Add ability to track lines to API of xml5ever
|
|
||||||
let elem = Element::create(name, prefix, &*self.document,
|
|
||||||
ElementCreator::ParserCreated(1));
|
|
||||||
|
|
||||||
for attr in attrs {
|
|
||||||
let name = QualName {
|
|
||||||
ns: attr.name.namespace_url,
|
|
||||||
local: attr.name.local,
|
|
||||||
};
|
|
||||||
elem.set_attribute_from_parser(name, DOMString::from(String::from(attr.value)), None);
|
|
||||||
}
|
|
||||||
|
|
||||||
JS::from_ref(elem.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_comment(&mut self, text: StrTendril) -> JS<Node> {
|
|
||||||
let comment = Comment::new(DOMString::from(String::from(text)), &*self.document);
|
|
||||||
JS::from_ref(comment.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn append(&mut self, parent: JS<Node>, child: NodeOrText<JS<Node>>) {
|
|
||||||
let child = match child {
|
|
||||||
NodeOrText::AppendNode(n) => H5eNodeOrText::AppendNode(n),
|
|
||||||
NodeOrText::AppendText(s) => H5eNodeOrText::AppendText(s),
|
|
||||||
};
|
|
||||||
super::insert(&*parent, None, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril,
|
|
||||||
system_id: StrTendril) {
|
|
||||||
let doc = &*self.document;
|
|
||||||
let doctype = DocumentType::new(
|
|
||||||
DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))),
|
|
||||||
Some(DOMString::from(String::from(system_id))), doc);
|
|
||||||
doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> JS<Node> {
|
|
||||||
let doc = &*self.document;
|
|
||||||
let pi = ProcessingInstruction::new(
|
|
||||||
DOMString::from(String::from(target)), DOMString::from(String::from(data)),
|
|
||||||
doc);
|
|
||||||
JS::from_ref(pi.upcast())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn mark_script_already_started(&mut self, node: Self::Handle) {
|
|
||||||
let script = node.downcast::<HTMLScriptElement>();
|
|
||||||
if let Some(script) = script {
|
|
||||||
script.set_already_started(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn complete_script(&mut self, node: Self::Handle) -> NextParserState {
|
|
||||||
if let Some(script) = node.downcast() {
|
|
||||||
self.script.set(Some(script));
|
|
||||||
NextParserState::Suspend
|
|
||||||
} else {
|
|
||||||
NextParserState::Continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn pop(&mut self, node: Self::Handle) {
|
|
||||||
let node = Root::from_ref(&*node);
|
|
||||||
vtable_for(&node).pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ use dom::document::Document;
|
||||||
use dom::element::Element;
|
use dom::element::Element;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::element_state::ElementState;
|
use style::element_state::ElementState;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -8,7 +8,7 @@ use dom::document::Document;
|
||||||
use dom::svgelement::SVGElement;
|
use dom::svgelement::SVGElement;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::element_state::ElementState;
|
use style::element_state::ElementState;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
|
|
|
@ -13,7 +13,7 @@ use dom::node::Node;
|
||||||
use dom::svggraphicselement::SVGGraphicsElement;
|
use dom::svggraphicselement::SVGGraphicsElement;
|
||||||
use dom::virtualmethods::VirtualMethods;
|
use dom::virtualmethods::VirtualMethods;
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use script_layout_interface::SVGSVGData;
|
use script_layout_interface::SVGSVGData;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ use dom::htmltextareaelement::HTMLTextAreaElement;
|
||||||
use dom::htmltitleelement::HTMLTitleElement;
|
use dom::htmltitleelement::HTMLTitleElement;
|
||||||
use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, UnbindContext};
|
use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, UnbindContext};
|
||||||
use dom::svgsvgelement::SVGSVGElement;
|
use dom::svgsvgelement::SVGSVGElement;
|
||||||
use html5ever_atoms::LocalName;
|
use html5ever::LocalName;
|
||||||
use style::attr::AttrValue;
|
use style::attr::AttrValue;
|
||||||
|
|
||||||
/// Trait to allow DOM nodes to opt-in to overriding (or adding to) common
|
/// Trait to allow DOM nodes to opt-in to overriding (or adding to) common
|
||||||
|
|
|
@ -42,7 +42,7 @@ use dom::node::{CAN_BE_FRAGMENTED, DIRTY_ON_VIEWPORT_SIZE_CHANGE, HAS_DIRTY_DESC
|
||||||
use dom::node::{LayoutNodeHelpers, Node};
|
use dom::node::{LayoutNodeHelpers, Node};
|
||||||
use dom::text::Text;
|
use dom::text::Text;
|
||||||
use gfx_traits::ByteIndex;
|
use gfx_traits::ByteIndex;
|
||||||
use html5ever_atoms::{LocalName, Namespace};
|
use html5ever::{LocalName, Namespace};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use range::Range;
|
use range::Range;
|
||||||
use script_layout_interface::{HTMLCanvasData, LayoutNodeType, SVGSVGData, TrustedNodeAddress};
|
use script_layout_interface::{HTMLCanvasData, LayoutNodeType, SVGSVGData, TrustedNodeAddress};
|
||||||
|
|
|
@ -48,8 +48,7 @@ extern crate fnv;
|
||||||
extern crate gfx_traits;
|
extern crate gfx_traits;
|
||||||
extern crate heapsize;
|
extern crate heapsize;
|
||||||
#[macro_use] extern crate heapsize_derive;
|
#[macro_use] extern crate heapsize_derive;
|
||||||
extern crate html5ever;
|
#[macro_use] extern crate html5ever;
|
||||||
#[macro_use] extern crate html5ever_atoms;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate hyper;
|
extern crate hyper;
|
||||||
extern crate hyper_serde;
|
extern crate hyper_serde;
|
||||||
|
|
|
@ -18,7 +18,7 @@ euclid = "0.11"
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
heapsize = "0.3.0"
|
heapsize = "0.3.0"
|
||||||
heapsize_derive = "0.1"
|
heapsize_derive = "0.1"
|
||||||
html5ever-atoms = "0.3"
|
html5ever = "0.16"
|
||||||
ipc-channel = "0.7"
|
ipc-channel = "0.7"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
log = "0.3.5"
|
log = "0.3.5"
|
||||||
|
|
|
@ -19,7 +19,7 @@ extern crate euclid;
|
||||||
extern crate gfx_traits;
|
extern crate gfx_traits;
|
||||||
extern crate heapsize;
|
extern crate heapsize;
|
||||||
#[macro_use] extern crate heapsize_derive;
|
#[macro_use] extern crate heapsize_derive;
|
||||||
#[macro_use] extern crate html5ever_atoms;
|
#[macro_use] extern crate html5ever;
|
||||||
extern crate ipc_channel;
|
extern crate ipc_channel;
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -10,7 +10,7 @@ use OpaqueStyleAndLayoutData;
|
||||||
use SVGSVGData;
|
use SVGSVGData;
|
||||||
use atomic_refcell::AtomicRefCell;
|
use atomic_refcell::AtomicRefCell;
|
||||||
use gfx_traits::{ByteIndex, FragmentType, combine_id_with_fragment_type};
|
use gfx_traits::{ByteIndex, FragmentType, combine_id_with_fragment_type};
|
||||||
use html5ever_atoms::{Namespace, LocalName};
|
use html5ever::{Namespace, LocalName};
|
||||||
use msg::constellation_msg::PipelineId;
|
use msg::constellation_msg::PipelineId;
|
||||||
use range::Range;
|
use range::Range;
|
||||||
use servo_url::ServoUrl;
|
use servo_url::ServoUrl;
|
||||||
|
|
|
@ -16,7 +16,7 @@ doctest = false
|
||||||
gecko = ["nsstring_vendor", "rayon/unstable", "num_cpus"]
|
gecko = ["nsstring_vendor", "rayon/unstable", "num_cpus"]
|
||||||
use_bindgen = ["bindgen", "regex"]
|
use_bindgen = ["bindgen", "regex"]
|
||||||
servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive",
|
servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive",
|
||||||
"style_traits/servo", "servo_atoms", "servo_config", "html5ever-atoms",
|
"style_traits/servo", "servo_atoms", "servo_config", "html5ever",
|
||||||
"cssparser/heapsize", "cssparser/serde", "encoding", "smallvec/heapsizeof",
|
"cssparser/heapsize", "cssparser/serde", "encoding", "smallvec/heapsizeof",
|
||||||
"rayon/unstable", "servo_url"]
|
"rayon/unstable", "servo_url"]
|
||||||
testing = []
|
testing = []
|
||||||
|
@ -35,7 +35,7 @@ euclid = "0.11"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
heapsize = {version = "0.3.0", optional = true}
|
heapsize = {version = "0.3.0", optional = true}
|
||||||
heapsize_derive = {version = "0.1", optional = true}
|
heapsize_derive = {version = "0.1", optional = true}
|
||||||
html5ever-atoms = {version = "0.3", optional = true}
|
html5ever = {version = "0.16", optional = true}
|
||||||
lazy_static = "0.2"
|
lazy_static = "0.2"
|
||||||
log = "0.3"
|
log = "0.3"
|
||||||
matches = "0.1"
|
matches = "0.1"
|
||||||
|
|
|
@ -50,7 +50,7 @@ extern crate fnv;
|
||||||
#[cfg(feature = "gecko")] #[macro_use] pub mod gecko_string_cache;
|
#[cfg(feature = "gecko")] #[macro_use] pub mod gecko_string_cache;
|
||||||
#[cfg(feature = "servo")] extern crate heapsize;
|
#[cfg(feature = "servo")] extern crate heapsize;
|
||||||
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive;
|
#[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive;
|
||||||
#[cfg(feature = "servo")] #[macro_use] extern crate html5ever_atoms;
|
#[cfg(feature = "servo")] #[macro_use] extern crate html5ever;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -140,9 +140,9 @@ use style_traits::ToCss;
|
||||||
#[cfg(feature = "gecko")] pub use gecko_string_cache::Atom as LocalName;
|
#[cfg(feature = "gecko")] pub use gecko_string_cache::Atom as LocalName;
|
||||||
|
|
||||||
#[cfg(feature = "servo")] pub use servo_atoms::Atom;
|
#[cfg(feature = "servo")] pub use servo_atoms::Atom;
|
||||||
#[cfg(feature = "servo")] pub use html5ever_atoms::Prefix;
|
#[cfg(feature = "servo")] pub use html5ever::Prefix;
|
||||||
#[cfg(feature = "servo")] pub use html5ever_atoms::LocalName;
|
#[cfg(feature = "servo")] pub use html5ever::LocalName;
|
||||||
#[cfg(feature = "servo")] pub use html5ever_atoms::Namespace;
|
#[cfg(feature = "servo")] pub use html5ever::Namespace;
|
||||||
|
|
||||||
/// The CSS properties supported by the style system.
|
/// The CSS properties supported by the style system.
|
||||||
/// Generated from the properties.mako.rs template by build.rs
|
/// Generated from the properties.mako.rs template by build.rs
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue