mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
Compare commits
4 Commits
6e4a9e85a2
...
layout-rev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
229bc398c4 | ||
|
|
81f4908d23 | ||
|
|
681ad64160 | ||
|
|
da25b3dc5f |
181
Cargo.lock
generated
181
Cargo.lock
generated
@@ -5,10 +5,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.6.5"
|
||||
version = "0.6.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -114,19 +114,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
version = "0.2.3"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "azure"
|
||||
version = "0.35.0"
|
||||
source = "git+https://github.com/servo/rust-azure#a85619e40463ed6139ccc8186ef306e8c62a496d"
|
||||
dependencies = [
|
||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -141,7 +139,7 @@ version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -181,21 +179,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.39.0"
|
||||
version = "0.43.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clang-sys 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cexpr 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clang-sys 0.26.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clap 2.28.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -239,7 +237,7 @@ version = "0.0.1"
|
||||
dependencies = [
|
||||
"embedder_traits 0.0.1",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -347,7 +345,7 @@ dependencies = [
|
||||
name = "canvas"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"azure 0.35.0 (git+https://github.com/servo/rust-azure)",
|
||||
"azure 0.35.0",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"compositing 0.0.1",
|
||||
@@ -391,7 +389,7 @@ name = "caseless"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -407,15 +405,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "cexpr"
|
||||
version = "0.2.0"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nom 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "0.1.2"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -439,7 +437,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "0.23.0"
|
||||
version = "0.26.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -453,7 +451,7 @@ version = "2.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -524,7 +522,7 @@ dependencies = [
|
||||
"ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -684,7 +682,7 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -698,7 +696,7 @@ version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -711,7 +709,7 @@ version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -723,7 +721,7 @@ name = "crossbeam-utils"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -975,7 +973,7 @@ name = "encoding_rs"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1043,13 +1041,25 @@ name = "env_logger"
|
||||
version = "0.5.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "error-chain"
|
||||
version = "0.12.0"
|
||||
@@ -1372,7 +1382,7 @@ version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2031,6 +2041,7 @@ dependencies = [
|
||||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"script_layout_interface 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"webrender_api 0.57.2 (git+https://github.com/servo/webrender)",
|
||||
@@ -2204,7 +2215,7 @@ name = "log"
|
||||
version = "0.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2292,10 +2303,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.0.1"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2465,16 +2478,16 @@ dependencies = [
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mozjs_sys 0.61.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mozjs_sys 0.61.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mozjs_sys"
|
||||
version = "0.61.2"
|
||||
version = "0.61.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bindgen 0.39.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bindgen 0.43.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2561,7 +2574,7 @@ name = "net2"
|
||||
version = "0.2.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -2613,7 +2626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -2625,8 +2638,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "1.2.4"
|
||||
version = "4.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-derive"
|
||||
@@ -2730,7 +2746,7 @@ version = "0.10.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2793,7 +2809,7 @@ name = "packed_simd"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2948,7 +2964,7 @@ dependencies = [
|
||||
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"profile_traits 0.0.1",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_allocator 0.0.1",
|
||||
@@ -3097,19 +3113,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.0.1"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex-syntax 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.1"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -3255,7 +3271,7 @@ dependencies = [
|
||||
"profile_traits 0.0.1",
|
||||
"ref_filter_map 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ref_slice 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"script_layout_interface 0.0.1",
|
||||
"script_plugins 0.0.1",
|
||||
"script_traits 0.0.1",
|
||||
@@ -3529,7 +3545,7 @@ dependencies = [
|
||||
"gstreamer-audio 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gstreamer-player 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo-media-audio 0.1.0 (git+https://github.com/servo/media)",
|
||||
"servo-media-player 0.1.0 (git+https://github.com/servo/media)",
|
||||
"zip 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -3809,10 +3825,10 @@ dependencies = [
|
||||
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bindgen 0.39.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bindgen 0.43.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -3838,7 +3854,7 @@ dependencies = [
|
||||
"parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"selectors 0.20.0",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_arc 0.1.1",
|
||||
@@ -3901,6 +3917,7 @@ dependencies = [
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
"selectors 0.20.0",
|
||||
@@ -3994,6 +4011,14 @@ dependencies = [
|
||||
"wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termion"
|
||||
version = "1.5.1"
|
||||
@@ -4019,11 +4044,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "0.3.5"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4366,7 +4390,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "utf8-ranges"
|
||||
version = "1.0.0"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@@ -4481,7 +4505,7 @@ dependencies = [
|
||||
"http 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.12.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -4507,7 +4531,7 @@ dependencies = [
|
||||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
"pixels 0.0.1",
|
||||
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"script_traits 0.0.1",
|
||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -4528,7 +4552,7 @@ dependencies = [
|
||||
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-foundation 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-text 13.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -4652,6 +4676,15 @@ dependencies = [
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wincolor"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winit"
|
||||
version = "0.18.0"
|
||||
@@ -4785,7 +4818,7 @@ dependencies = [
|
||||
|
||||
[metadata]
|
||||
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
|
||||
"checksum aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0ba20154ea1f47ce2793322f049c5646cc6d0fa9759d5f333f286e507bf8080"
|
||||
"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
|
||||
"checksum alloc-no-stdlib 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71877e174a5d78c969228d628c4f7f3b545d13452bd3d9393fa07aacfb7c6894"
|
||||
"checksum andrew 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "62ea7024f6f4d203bede7c0c9cdafa3cbda3a9e0fa04d349008496cc95b8f11b"
|
||||
"checksum android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407"
|
||||
@@ -4801,14 +4834,13 @@ dependencies = [
|
||||
"checksum arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2f0ef4a9820019a0c91d918918c93dc71d469f581a49b47ddc1d285d4270bbe2"
|
||||
"checksum ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae7d751998c189c1d4468cf0a39bb2eae052a9c58d50ebb3b9591ee3813ad50"
|
||||
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
|
||||
"checksum atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"
|
||||
"checksum azure 0.35.0 (git+https://github.com/servo/rust-azure)" = "<none>"
|
||||
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
|
||||
"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
|
||||
"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
|
||||
"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9"
|
||||
"checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff"
|
||||
"checksum bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bda13183df33055cbb84b847becce220d392df502ebe7a4a78d7021771ed94d0"
|
||||
"checksum bindgen 0.39.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eac4ed5f2de9efc3c87cb722468fa49d0763e98f999d539bfc5e452c13d85c91"
|
||||
"checksum bindgen 0.43.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d52d263eacd15d26cbcf215d254b410bd58212aaa2d3c453a04b2d3b3adcf41"
|
||||
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
|
||||
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
|
||||
"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab"
|
||||
@@ -4829,11 +4861,11 @@ dependencies = [
|
||||
"checksum caseless 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "808dab3318747be122cb31d36de18d4d1c81277a76f8332a02b81a3d73463d7f"
|
||||
"checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275"
|
||||
"checksum cesu8 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
|
||||
"checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d"
|
||||
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
|
||||
"checksum cexpr 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8fc0086be9ca82f7fc89fc873435531cb898b86e850005850de1f820e2db6e9b"
|
||||
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
|
||||
"checksum cgl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "55e7ec0b74fe5897894cbc207092c577e87c52f8a59e8ca8d97ef37551f60a49"
|
||||
"checksum chrono 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cce36c92cb605414e9b824f866f5babe0a0368e39ea07393b9b63cf3844c0e6"
|
||||
"checksum clang-sys 0.23.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d7f7c04e52c35222fffcc3a115b5daf5f7e2bfb71c13c4e2321afe1fc71859c2"
|
||||
"checksum clang-sys 0.26.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5ca71038e58142b85c1b4f06a61f3b7a6e3ca035330a249f80164d37ea44de0"
|
||||
"checksum clap 2.28.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc34bf7d5d66268b466b9852bca925ec1d2650654dab4da081e63fd230145c2e"
|
||||
"checksum clipboard 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "25a904646c0340239dcf7c51677b33928bf24fdf424b79a57909c0109075b2e7"
|
||||
"checksum clipboard-win 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14cc3e6c075926b96490d5f90d4a5af7be8012a4d8a8698e619655085a7641a3"
|
||||
@@ -4881,6 +4913,7 @@ dependencies = [
|
||||
"checksum enum-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85012092e543e198a02f3ac3d587798253e8ec374bc9c3d7da5319cf579ea4c6"
|
||||
"checksum enum-iterator-derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "719423964c7a03e4ce4c67115d6e44a5b2dd9b51789a575dfbad68b490b0f0a0"
|
||||
"checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a"
|
||||
"checksum env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e"
|
||||
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
|
||||
"checksum euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70a2ebdf55fb9d6329046e026329a55ef8fbaae5ea833f56e170beb3125a8a5f"
|
||||
"checksum expat-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa"
|
||||
@@ -4979,7 +5012,7 @@ dependencies = [
|
||||
"checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
|
||||
"checksum markup5ever 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c220b3a3d75543b76e5c1fcab6635a8430ab5f9bfa011d003c3787ae0abf4ffa"
|
||||
"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1"
|
||||
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
|
||||
"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
|
||||
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
|
||||
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
|
||||
"checksum mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "0a907b83e7b9e987032439a387e187119cddafc92d5c2aaeb1d92580a793f630"
|
||||
@@ -4994,14 +5027,14 @@ dependencies = [
|
||||
"checksum mitochondria 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9de3eca27871df31c33b807f834b94ef7d000956f57aa25c5aed9c5f0aae8f6f"
|
||||
"checksum mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "45a8a18a41cfab0fde25cc2f43ea89064d211a0fbb33225b8ff93ab20406e0e7"
|
||||
"checksum mozjs 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d1db0edead699324dd1768f74054a5a759de36a8ce92b15e8b179ec2549d19e"
|
||||
"checksum mozjs_sys 0.61.2 (registry+https://github.com/rust-lang/crates.io-index)" = "28276d28cc79226f3a26c790f00c8ce74459d097d3698f17df05ab9f683c1e52"
|
||||
"checksum mozjs_sys 0.61.4 (registry+https://github.com/rust-lang/crates.io-index)" = "45ee1707ef1005ba37d2a489b30af4741922452715c2b8f66db78d1db6dce835"
|
||||
"checksum msdos_time 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729"
|
||||
"checksum muldiv 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "451a9a05d2a32c566c897835e0ea95cf79ed2fdfe957924045a1721a36c9980f"
|
||||
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
|
||||
"checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4"
|
||||
"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
|
||||
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
|
||||
"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce"
|
||||
"checksum nom 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9c349f68f25f596b9f44cf0e7c69752a5c633b0550c3ff849518bfba0233774a"
|
||||
"checksum num-derive 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d2c31b75c36a993d30c7a13d70513cb93f02acafdd5b7ba250f9b0e18615de7"
|
||||
"checksum num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac0ea58d64a89d9d6b7688031b3be9358d6c919badcf7fbb0527ccfd891ee45"
|
||||
"checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124"
|
||||
@@ -5051,8 +5084,8 @@ dependencies = [
|
||||
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
||||
"checksum ref_filter_map 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b5ceb840e4009da4841ed22a15eb49f64fdd00a2138945c5beacf506b2fb5ed"
|
||||
"checksum ref_slice 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "825740057197b7d43025e7faf6477eaabc03434e153233da02d1f44602f71527"
|
||||
"checksum regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13c93d55961981ba9226a213b385216f83ab43bd6ac53ab16b2eeb47e337cf4e"
|
||||
"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54"
|
||||
"checksum regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ee84f70c8c08744ea9641a731c7fadb475bf2ecc52d7f627feb833e0b3990467"
|
||||
"checksum regex-syntax 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fbc557aac2b708fe84121caf261346cc2eed71978024337e42eb46b8a252ac6e"
|
||||
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
|
||||
"checksum ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "da06feaa07f69125ab9ddc769b11de29090122170b402547f64b86fe16ebc399"
|
||||
"checksum rust-webvr 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6f4efd6a755313ce3499781c64a8ec947df1591362ded272f84f1568eed3df89"
|
||||
@@ -5102,10 +5135,11 @@ dependencies = [
|
||||
"checksum tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47776f63b85777d984a50ce49d6b9e58826b6a3766a449fc95bc66cd5663c15b"
|
||||
"checksum tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9de21546595a0873061940d994bbbc5c35f024ae4fd61ec5c5b159115684f508"
|
||||
"checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83"
|
||||
"checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
|
||||
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
|
||||
"checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"
|
||||
"checksum thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
|
||||
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
|
||||
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
|
||||
"checksum thread_profiler 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5920e77802b177479ab5795767fa48e68f61b2f516c2ac0041e2978dd8efe483"
|
||||
"checksum threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "59f6d3eff89920113dac9db44dde461d71d01e88a5b57b258a0466c32b5d7fe1"
|
||||
"checksum tiff 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a2cc6c4fd13cb1cfd20abdb196e794ceccb29371855b7e7f575945f920a5b3c2"
|
||||
@@ -5144,7 +5178,7 @@ dependencies = [
|
||||
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
|
||||
"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47"
|
||||
"checksum utf-8 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f923c601c7ac48ef1d66f7d5b5b2d9a7ba9c51333ab75a3ddf8d0309185a56"
|
||||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
|
||||
"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
|
||||
"checksum uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dab5c5526c5caa3d106653401a267fed923e7046f35895ffcb5ca42db64942e6"
|
||||
"checksum vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9e0a7d8bed3178a8fb112199d466eeca9ed09a14ba8ad67718179b4fd5487d0b"
|
||||
"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
|
||||
@@ -5168,6 +5202,7 @@ dependencies = [
|
||||
"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab"
|
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
"checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767"
|
||||
"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba"
|
||||
"checksum winit 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "27aa86a5723951d6a08c2acb9f10e25cb39ceb5b1987d7daf74e181b21f8f50b"
|
||||
"checksum winres 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "27d9192d6356d7efe8405dec6c5506b67543cf64b6049968f39f4c4623b4f25d"
|
||||
"checksum ws 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "329d3e6dd450a9c5c73024e1047f0be7e24121a68484eb0b5368977bee3cf8c3"
|
||||
|
||||
@@ -22,4 +22,4 @@ opt-level = 3
|
||||
# Or for a git dependency:
|
||||
#
|
||||
# [patch."https://github.com/servo/<repository>"]
|
||||
# <crate> = { path = "/path/to/local/checkout" }
|
||||
# <crate> = { path = "/path/to/local/checkout" }
|
||||
@@ -15,7 +15,7 @@ use gfx::font_cache_thread::FontCacheThread;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use ipc_channel::Error;
|
||||
use layout_traits::LayoutThreadFactory;
|
||||
use layout_traits::{LayoutGlobalInfo, LayoutThreadFactory};
|
||||
use metrics::PaintTimeMetrics;
|
||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
||||
use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespaceId};
|
||||
@@ -25,8 +25,8 @@ use net_traits::{IpcSend, ResourceThreads};
|
||||
use profile_traits::mem as profile_mem;
|
||||
use profile_traits::time;
|
||||
use script_traits::{ConstellationControlMsg, DiscardBrowsingContext, ScriptToConstellationChan};
|
||||
use script_traits::{DocumentActivity, InitialScriptState};
|
||||
use script_traits::{LayoutControlMsg, LayoutMsg, LoadData};
|
||||
use script_traits::{DocumentActivity, FrameType, InitialScriptState};
|
||||
use script_traits::{LayoutControlMsg, LayoutMsg, LayoutPerThreadInfo, LoadData};
|
||||
use script_traits::{NewLayoutInfo, SWManagerMsg, SWManagerSenders};
|
||||
use script_traits::{ScriptThreadFactory, TimerSchedulerMsg, WindowSizeData};
|
||||
use servo_config::opts::{self, Opts};
|
||||
@@ -493,7 +493,7 @@ impl UnprivilegedPipelineContent {
|
||||
self.script_chan.clone(),
|
||||
self.load_data.url.clone(),
|
||||
);
|
||||
let layout_pair = STF::create(
|
||||
let (script_to_layout_sender, script_to_layout_receiver) = STF::create(
|
||||
InitialScriptState {
|
||||
id: self.id,
|
||||
browsing_context_id: self.browsing_context_id,
|
||||
@@ -522,30 +522,43 @@ impl UnprivilegedPipelineContent {
|
||||
self.load_data.clone(),
|
||||
);
|
||||
|
||||
LTF::create(
|
||||
self.id,
|
||||
self.top_level_browsing_context_id,
|
||||
self.load_data.url,
|
||||
self.parent_pipeline_id.is_some(),
|
||||
layout_pair,
|
||||
self.pipeline_port,
|
||||
self.layout_to_constellation_chan,
|
||||
self.script_chan,
|
||||
image_cache.clone(),
|
||||
self.font_cache_thread,
|
||||
self.time_profiler_chan,
|
||||
self.mem_profiler_chan,
|
||||
Some(self.layout_content_process_shutdown_chan),
|
||||
self.webrender_api_sender,
|
||||
self.webrender_document,
|
||||
self.prefs
|
||||
.get("layout.threads")
|
||||
.expect("exists")
|
||||
.value()
|
||||
.as_u64()
|
||||
.expect("count") as usize,
|
||||
let frame_type = match self.parent_pipeline_id {
|
||||
None => FrameType::RootWindow,
|
||||
Some(_) => FrameType::IFrame,
|
||||
};
|
||||
|
||||
let layout_thread_count = self.prefs
|
||||
.get("layout.threads")
|
||||
.expect("exists")
|
||||
.value()
|
||||
.as_u64()
|
||||
.expect("count") as usize;
|
||||
|
||||
// Proxy IPC messages from the pipeline to the layout thread.
|
||||
let pipeline_receiver =
|
||||
ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(self.pipeline_port);
|
||||
|
||||
LTF::create(LayoutPerThreadInfo {
|
||||
local_pipeline_id: self.id,
|
||||
current_url: self.load_data.url,
|
||||
layout_thread_count,
|
||||
frame_type,
|
||||
script_to_layout_sender,
|
||||
script_to_layout_receiver,
|
||||
pipeline_receiver,
|
||||
constellation_sender: self.layout_to_constellation_chan,
|
||||
layout_to_script_sender: self.script_chan,
|
||||
content_process_shutdown_sender: Some(self.layout_content_process_shutdown_chan),
|
||||
image_cache,
|
||||
paint_time_metrics,
|
||||
);
|
||||
}, LayoutGlobalInfo {
|
||||
top_level_context_id: self.top_level_browsing_context_id,
|
||||
font_cache_thread: self.font_cache_thread,
|
||||
time_profiler_sender: self.time_profiler_chan,
|
||||
mem_profiler_sender: self.mem_profiler_chan,
|
||||
webrender_api_sender: self.webrender_api_sender,
|
||||
webrender_document: self.webrender_document,
|
||||
});
|
||||
|
||||
if wait_for_completion {
|
||||
let _ = self.script_content_process_shutdown_port.recv();
|
||||
|
||||
@@ -15,13 +15,12 @@ use crate::block::BlockFlow;
|
||||
use crate::context::{with_thread_local_font_context, LayoutContext};
|
||||
use crate::data::{LayoutData, LayoutDataFlags};
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::flex::FlexFlow;
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{AbsoluteDescendants, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::flow::{AbsoluteDescendants, Flow, GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::flow::{FlowFlags, MutableFlowUtils, MutableOwnedFlowUtils};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::{
|
||||
CanvasFragmentInfo, Fragment, FragmentFlags, GeneratedContentInfo, IframeFragmentInfo,
|
||||
CanvasFragmentInfo, Fragment, GeneratedContentInfo, IframeFragmentInfo,
|
||||
};
|
||||
use crate::fragment::{
|
||||
ImageFragmentInfo, InlineAbsoluteFragmentInfo, InlineAbsoluteHypotheticalFragmentInfo,
|
||||
@@ -30,20 +29,11 @@ use crate::fragment::{
|
||||
InlineBlockFragmentInfo, MediaFragmentInfo, SpecificFragmentInfo, SvgFragmentInfo,
|
||||
};
|
||||
use crate::fragment::{
|
||||
TableColumnFragmentInfo, UnscannedTextFragmentInfo, WhitespaceStrippingResult,
|
||||
UnscannedTextFragmentInfo, WhitespaceStrippingResult,
|
||||
};
|
||||
use crate::inline::{InlineFlow, InlineFragmentNodeFlags, InlineFragmentNodeInfo};
|
||||
use crate::linked_list::prepend_from;
|
||||
use crate::list_item::{ListItemFlow, ListStyleTypeContent};
|
||||
use crate::multicol::{MulticolColumnFlow, MulticolFlow};
|
||||
use crate::parallel;
|
||||
use crate::table::TableFlow;
|
||||
use crate::table_caption::TableCaptionFlow;
|
||||
use crate::table_cell::TableCellFlow;
|
||||
use crate::table_colgroup::TableColGroupFlow;
|
||||
use crate::table_row::TableRowFlow;
|
||||
use crate::table_rowgroup::TableRowGroupFlow;
|
||||
use crate::table_wrapper::TableWrapperFlow;
|
||||
use crate::text::TextRunScanner;
|
||||
use crate::traversal::PostorderNodeMutTraversal;
|
||||
use crate::wrapper::{LayoutNodeLayoutData, TextContent, ThreadSafeLayoutNodeHelpers};
|
||||
@@ -59,20 +49,15 @@ use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::caption_side::T as CaptionSide;
|
||||
use style::computed_values::display::T as Display;
|
||||
use style::computed_values::empty_cells::T as EmptyCells;
|
||||
use style::computed_values::float::T as Float;
|
||||
use style::computed_values::list_style_position::T as ListStylePosition;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::context::SharedStyleContext;
|
||||
use style::dom::TElement;
|
||||
use style::logical_geometry::Direction;
|
||||
use style::properties::ComputedValues;
|
||||
use style::selector_parser::{PseudoElement, RestyleDamage};
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::generics::counters::ContentItem;
|
||||
use style::values::generics::url::UrlOrNone as ImageUrlOrNone;
|
||||
|
||||
/// The results of flow construction for a DOM node.
|
||||
#[derive(Clone)]
|
||||
@@ -124,8 +109,6 @@ pub enum ConstructionItem {
|
||||
ServoArc<ComputedValues>,
|
||||
RestyleDamage,
|
||||
),
|
||||
/// TableColumn Fragment
|
||||
TableColumnFragment(Fragment),
|
||||
}
|
||||
|
||||
/// Represents inline fragments and {ib} splits that are bubbling up from an inline.
|
||||
@@ -427,19 +410,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
));
|
||||
SpecificFragmentInfo::Image(image_info)
|
||||
},
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLTableElement)) => {
|
||||
SpecificFragmentInfo::TableWrapper
|
||||
},
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLTableColElement)) => {
|
||||
SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node))
|
||||
},
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLTableCellElement)) => {
|
||||
SpecificFragmentInfo::TableCell
|
||||
},
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLTableRowElement)) |
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLTableSectionElement)) => {
|
||||
SpecificFragmentInfo::TableRow
|
||||
},
|
||||
Some(LayoutNodeType::Element(LayoutElementType::HTMLCanvasElement)) => {
|
||||
let data = node.canvas_data().unwrap();
|
||||
SpecificFragmentInfo::Canvas(Box::new(CanvasFragmentInfo::new(data)))
|
||||
@@ -566,38 +536,30 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
match kid.get_construction_result() {
|
||||
ConstructionResult::None => {},
|
||||
ConstructionResult::Flow(kid_flow, kid_abs_descendants) => {
|
||||
// If kid_flow is TableCaptionFlow, kid_flow should be added under
|
||||
// TableWrapperFlow.
|
||||
if flow.is_table() && kid_flow.is_table_caption() {
|
||||
let construction_result =
|
||||
ConstructionResult::Flow(kid_flow, AbsoluteDescendants::new());
|
||||
self.set_flow_construction_result(&kid, construction_result)
|
||||
} else {
|
||||
if !kid_flow
|
||||
.base()
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
|
||||
{
|
||||
// Flush any inline fragments that we were gathering up. This allows us to
|
||||
// handle {ib} splits.
|
||||
let old_inline_fragment_accumulator = mem::replace(
|
||||
inline_fragment_accumulator,
|
||||
InlineFragmentsAccumulator::new(),
|
||||
);
|
||||
self.flush_inline_fragments_to_flow(
|
||||
old_inline_fragment_accumulator,
|
||||
flow,
|
||||
abs_descendants,
|
||||
legalizer,
|
||||
node,
|
||||
);
|
||||
}
|
||||
legalizer.add_child::<ConcreteThreadSafeLayoutNode::ConcreteElement>(
|
||||
self.style_context(),
|
||||
if !kid_flow
|
||||
.base()
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
|
||||
{
|
||||
// Flush any inline fragments that we were gathering up. This allows us to
|
||||
// handle {ib} splits.
|
||||
let old_inline_fragment_accumulator = mem::replace(
|
||||
inline_fragment_accumulator,
|
||||
InlineFragmentsAccumulator::new(),
|
||||
);
|
||||
self.flush_inline_fragments_to_flow(
|
||||
old_inline_fragment_accumulator,
|
||||
flow,
|
||||
kid_flow,
|
||||
)
|
||||
abs_descendants,
|
||||
legalizer,
|
||||
node,
|
||||
);
|
||||
}
|
||||
legalizer.add_child::<ConcreteThreadSafeLayoutNode::ConcreteElement>(
|
||||
self.style_context(),
|
||||
flow,
|
||||
kid_flow,
|
||||
);
|
||||
abs_descendants.push_descendants(kid_abs_descendants);
|
||||
},
|
||||
ConstructionResult::ConstructionItem(ConstructionItem::InlineFragments(
|
||||
@@ -670,10 +632,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
.fragments
|
||||
.push_back(fragment);
|
||||
},
|
||||
ConstructionResult::ConstructionItem(ConstructionItem::TableColumnFragment(_)) => {
|
||||
// TODO: Implement anonymous table objects for missing parents
|
||||
// CSS 2.1 § 17.2.1, step 3-2
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -870,10 +828,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
float_kind: Option<FloatKind>,
|
||||
) -> ConstructionResult {
|
||||
if node.style(self.style_context()).is_multicol() {
|
||||
return self.build_flow_for_multicol(node, float_kind);
|
||||
}
|
||||
|
||||
let fragment = self.build_fragment_for_block(node);
|
||||
let flow = FlowRef::new(Arc::new(BlockFlow::from_fragment_and_float_kind(
|
||||
fragment, float_kind,
|
||||
@@ -1004,10 +958,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
);
|
||||
fragment_accumulator.fragments.fragments.push_back(fragment)
|
||||
},
|
||||
ConstructionResult::ConstructionItem(ConstructionItem::TableColumnFragment(_)) => {
|
||||
// TODO: Implement anonymous table objects for missing parents
|
||||
// CSS 2.1 § 17.2.1, step 3-2
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1129,8 +1079,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
) -> ConstructionResult {
|
||||
let block_flow_result = match display {
|
||||
Display::InlineBlock => self.build_flow_for_block(node, None),
|
||||
Display::InlineFlex => self.build_flow_for_flex(node, None),
|
||||
_ => panic!("The flag should be inline-block or inline-flex"),
|
||||
_ => panic!("The flag should be inline-block"),
|
||||
};
|
||||
let (block_flow, abs_descendants) = match block_flow_result {
|
||||
ConstructionResult::Flow(block_flow, abs_descendants) => (block_flow, abs_descendants),
|
||||
@@ -1242,390 +1191,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||
}
|
||||
}
|
||||
|
||||
/// Places any table captions found under the given table wrapper, if the value of their
|
||||
/// `caption-side` property is equal to the given `side`.
|
||||
fn place_table_caption_under_table_wrapper_on_side(
|
||||
&mut self,
|
||||
table_wrapper_flow: &mut FlowRef,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
side: CaptionSide,
|
||||
) {
|
||||
// Only flows that are table captions are matched here.
|
||||
for kid in node.children() {
|
||||
match kid.get_construction_result() {
|
||||
ConstructionResult::Flow(kid_flow, _) => {
|
||||
if kid_flow.is_table_caption() &&
|
||||
kid_flow
|
||||
.as_block()
|
||||
.fragment
|
||||
.style()
|
||||
.get_inherited_table()
|
||||
.caption_side ==
|
||||
side
|
||||
{
|
||||
table_wrapper_flow.add_new_child(kid_flow);
|
||||
}
|
||||
},
|
||||
ConstructionResult::None | ConstructionResult::ConstructionItem(_) => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `column-count` or `column-width` non-`auto`.
|
||||
/// This yields a `MulticolFlow` with a single `MulticolColumnFlow` underneath it.
|
||||
fn build_flow_for_multicol(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
float_kind: Option<FloatKind>,
|
||||
) -> ConstructionResult {
|
||||
let fragment = Fragment::new(node, SpecificFragmentInfo::Multicol, self.layout_context);
|
||||
let mut flow = FlowRef::new(Arc::new(MulticolFlow::from_fragment(fragment, float_kind)));
|
||||
|
||||
let column_fragment = Fragment::new(
|
||||
node,
|
||||
SpecificFragmentInfo::MulticolColumn,
|
||||
self.layout_context,
|
||||
);
|
||||
let column_flow =
|
||||
FlowRef::new(Arc::new(MulticolColumnFlow::from_fragment(column_fragment)));
|
||||
|
||||
// First populate the column flow with its children.
|
||||
let construction_result = self.build_flow_for_block_like(column_flow, node);
|
||||
|
||||
let mut abs_descendants = AbsoluteDescendants::new();
|
||||
|
||||
if let ConstructionResult::Flow(column_flow, column_abs_descendants) = construction_result {
|
||||
flow.add_new_child(column_flow);
|
||||
abs_descendants.push_descendants(column_abs_descendants);
|
||||
}
|
||||
|
||||
// The flow is done.
|
||||
flow.finish();
|
||||
if flow.is_absolute_containing_block() {
|
||||
// This is the containing block for all the absolute descendants.
|
||||
flow.set_absolute_descendants(abs_descendants);
|
||||
|
||||
abs_descendants = AbsoluteDescendants::new();
|
||||
|
||||
if flow
|
||||
.base()
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
|
||||
{
|
||||
// This is now the only absolute flow in the subtree which hasn't yet
|
||||
// reached its containing block.
|
||||
abs_descendants.push(flow.clone());
|
||||
}
|
||||
}
|
||||
|
||||
ConstructionResult::Flow(flow, abs_descendants)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: table`. This yields a `TableWrapperFlow` with
|
||||
/// possibly other `TableCaptionFlow`s or `TableFlow`s underneath it.
|
||||
fn build_flow_for_table(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
float_value: Float,
|
||||
) -> ConstructionResult {
|
||||
let mut legalizer = Legalizer::new();
|
||||
|
||||
let table_style;
|
||||
let wrapper_style;
|
||||
{
|
||||
let context = self.style_context();
|
||||
table_style = node.style(context);
|
||||
wrapper_style = context
|
||||
.stylist
|
||||
.style_for_anonymous::<ConcreteThreadSafeLayoutNode::ConcreteElement>(
|
||||
&context.guards,
|
||||
&PseudoElement::ServoTableWrapper,
|
||||
&table_style,
|
||||
);
|
||||
}
|
||||
let wrapper_fragment = Fragment::from_opaque_node_and_style(
|
||||
node.opaque(),
|
||||
PseudoElementType::Normal,
|
||||
wrapper_style,
|
||||
node.selected_style(),
|
||||
node.restyle_damage(),
|
||||
SpecificFragmentInfo::TableWrapper,
|
||||
);
|
||||
let wrapper_float_kind = FloatKind::from_property(float_value);
|
||||
let mut wrapper_flow = FlowRef::new(Arc::new(
|
||||
TableWrapperFlow::from_fragment_and_float_kind(wrapper_fragment, wrapper_float_kind),
|
||||
));
|
||||
|
||||
let table_fragment = Fragment::new(node, SpecificFragmentInfo::Table, self.layout_context);
|
||||
let table_flow = FlowRef::new(Arc::new(TableFlow::from_fragment(table_fragment)));
|
||||
|
||||
// First populate the table flow with its children.
|
||||
let construction_result = self.build_flow_for_block_like(table_flow, node);
|
||||
|
||||
let mut abs_descendants = AbsoluteDescendants::new();
|
||||
|
||||
// The order of the caption and the table are not necessarily the same order as in the DOM
|
||||
// tree. All caption blocks are placed before or after the table flow, depending on the
|
||||
// value of `caption-side`.
|
||||
self.place_table_caption_under_table_wrapper_on_side(
|
||||
&mut wrapper_flow,
|
||||
node,
|
||||
CaptionSide::Top,
|
||||
);
|
||||
|
||||
if let ConstructionResult::Flow(table_flow, table_abs_descendants) = construction_result {
|
||||
legalizer.add_child::<ConcreteThreadSafeLayoutNode::ConcreteElement>(
|
||||
self.style_context(),
|
||||
&mut wrapper_flow,
|
||||
table_flow,
|
||||
);
|
||||
abs_descendants.push_descendants(table_abs_descendants);
|
||||
}
|
||||
|
||||
// If the value of `caption-side` is `bottom`, place it now.
|
||||
self.place_table_caption_under_table_wrapper_on_side(
|
||||
&mut wrapper_flow,
|
||||
node,
|
||||
CaptionSide::Bottom,
|
||||
);
|
||||
|
||||
// The flow is done.
|
||||
legalizer.finish(&mut wrapper_flow);
|
||||
wrapper_flow.finish();
|
||||
|
||||
if wrapper_flow.is_absolute_containing_block() {
|
||||
// This is the containing block for all the absolute descendants.
|
||||
wrapper_flow.set_absolute_descendants(abs_descendants);
|
||||
|
||||
abs_descendants = AbsoluteDescendants::new();
|
||||
|
||||
if wrapper_flow
|
||||
.base()
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
|
||||
{
|
||||
// This is now the only absolute flow in the subtree which hasn't yet
|
||||
// reached its containing block.
|
||||
abs_descendants.push(wrapper_flow.clone());
|
||||
}
|
||||
}
|
||||
|
||||
ConstructionResult::Flow(wrapper_flow, abs_descendants)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: table-caption`. This yields a `TableCaptionFlow`
|
||||
/// with possibly other `BlockFlow`s or `InlineFlow`s underneath it.
|
||||
fn build_flow_for_table_caption(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
) -> ConstructionResult {
|
||||
let fragment = self.build_fragment_for_block(node);
|
||||
let flow = FlowRef::new(Arc::new(TableCaptionFlow::from_fragment(fragment)));
|
||||
self.build_flow_for_block_like(flow, node)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: table-row-group`. This yields a `TableRowGroupFlow`
|
||||
/// with possibly other `TableRowFlow`s underneath it.
|
||||
fn build_flow_for_table_rowgroup(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
) -> ConstructionResult {
|
||||
let fragment = Fragment::new(node, SpecificFragmentInfo::TableRow, self.layout_context);
|
||||
let flow = FlowRef::new(Arc::new(TableRowGroupFlow::from_fragment(fragment)));
|
||||
self.build_flow_for_block_like(flow, node)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: table-row`. This yields a `TableRowFlow` with
|
||||
/// possibly other `TableCellFlow`s underneath it.
|
||||
fn build_flow_for_table_row(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
) -> ConstructionResult {
|
||||
let fragment = Fragment::new(node, SpecificFragmentInfo::TableRow, self.layout_context);
|
||||
let flow = FlowRef::new(Arc::new(TableRowFlow::from_fragment(fragment)));
|
||||
self.build_flow_for_block_like(flow, node)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: table-cell`. This yields a `TableCellFlow` with
|
||||
/// possibly other `BlockFlow`s or `InlineFlow`s underneath it.
|
||||
fn build_flow_for_table_cell(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
) -> ConstructionResult {
|
||||
let fragment = Fragment::new(node, SpecificFragmentInfo::TableCell, self.layout_context);
|
||||
|
||||
// Determine if the table cell should be hidden. Per CSS 2.1 § 17.6.1.1, this will be true
|
||||
// if the cell has any in-flow elements (even empty ones!) and has `empty-cells` set to
|
||||
// `hide`.
|
||||
let hide = node
|
||||
.style(self.style_context())
|
||||
.get_inherited_table()
|
||||
.empty_cells ==
|
||||
EmptyCells::Hide &&
|
||||
node.children().all(|kid| {
|
||||
let position = kid.style(self.style_context()).get_box().position;
|
||||
!kid.is_content() || position == Position::Absolute || position == Position::Fixed
|
||||
});
|
||||
|
||||
let flow = FlowRef::new(Arc::new(
|
||||
TableCellFlow::from_node_fragment_and_visibility_flag(node, fragment, !hide),
|
||||
));
|
||||
self.build_flow_for_block_like(flow, node)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: list-item`. This yields a `ListItemFlow` with
|
||||
/// possibly other `BlockFlow`s or `InlineFlow`s underneath it.
|
||||
fn build_flow_for_list_item(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
flotation: Float,
|
||||
) -> ConstructionResult {
|
||||
let flotation = FloatKind::from_property(flotation);
|
||||
let marker_fragments = match node.style(self.style_context()).get_list().list_style_image {
|
||||
ImageUrlOrNone::Url(ref url_value) => {
|
||||
let image_info = Box::new(ImageFragmentInfo::new(
|
||||
url_value.url().map(|u| u.clone()),
|
||||
None,
|
||||
node,
|
||||
&self.layout_context,
|
||||
));
|
||||
vec![Fragment::new(
|
||||
node,
|
||||
SpecificFragmentInfo::Image(image_info),
|
||||
self.layout_context,
|
||||
)]
|
||||
},
|
||||
ImageUrlOrNone::None => match ListStyleTypeContent::from_list_style_type(
|
||||
node.style(self.style_context()).get_list().list_style_type,
|
||||
) {
|
||||
ListStyleTypeContent::None => Vec::new(),
|
||||
ListStyleTypeContent::StaticText(ch) => {
|
||||
let text = format!("{}\u{a0}", ch);
|
||||
let mut unscanned_marker_fragments = LinkedList::new();
|
||||
unscanned_marker_fragments.push_back(Fragment::new(
|
||||
node,
|
||||
SpecificFragmentInfo::UnscannedText(Box::new(
|
||||
UnscannedTextFragmentInfo::new(Box::<str>::from(text), None),
|
||||
)),
|
||||
self.layout_context,
|
||||
));
|
||||
let marker_fragments =
|
||||
with_thread_local_font_context(self.layout_context, |mut font_context| {
|
||||
TextRunScanner::new()
|
||||
.scan_for_runs(&mut font_context, unscanned_marker_fragments)
|
||||
});
|
||||
marker_fragments.fragments
|
||||
},
|
||||
ListStyleTypeContent::GeneratedContent(info) => vec![Fragment::new(
|
||||
node,
|
||||
SpecificFragmentInfo::GeneratedContent(info),
|
||||
self.layout_context,
|
||||
)],
|
||||
},
|
||||
};
|
||||
|
||||
// If the list marker is outside, it becomes the special "outside fragment" that list item
|
||||
// flows have. If it's inside, it's just a plain old fragment. Note that this means that
|
||||
// we adopt Gecko's behavior rather than WebKit's when the marker causes an {ib} split,
|
||||
// which has caused some malaise (Bugzilla #36854) but CSS 2.1 § 12.5.1 lets me do it, so
|
||||
// there.
|
||||
let mut initial_fragments = IntermediateInlineFragments::new();
|
||||
let main_fragment = self.build_fragment_for_block(node);
|
||||
let flow = match node
|
||||
.style(self.style_context())
|
||||
.get_list()
|
||||
.list_style_position
|
||||
{
|
||||
ListStylePosition::Outside => Arc::new(ListItemFlow::from_fragments_and_flotation(
|
||||
main_fragment,
|
||||
marker_fragments,
|
||||
flotation,
|
||||
)),
|
||||
ListStylePosition::Inside => {
|
||||
for marker_fragment in marker_fragments {
|
||||
initial_fragments.fragments.push_back(marker_fragment)
|
||||
}
|
||||
Arc::new(ListItemFlow::from_fragments_and_flotation(
|
||||
main_fragment,
|
||||
vec![],
|
||||
flotation,
|
||||
))
|
||||
},
|
||||
};
|
||||
|
||||
self.build_flow_for_block_starting_with_fragments(
|
||||
FlowRef::new(flow),
|
||||
node,
|
||||
initial_fragments,
|
||||
)
|
||||
}
|
||||
|
||||
/// Creates a fragment for a node with `display: table-column`.
|
||||
fn build_fragments_for_table_column(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
) -> ConstructionResult {
|
||||
// CSS 2.1 § 17.2.1. Treat all child fragments of a `table-column` as `display: none`.
|
||||
for kid in node.children() {
|
||||
self.set_flow_construction_result(&kid, ConstructionResult::None)
|
||||
}
|
||||
|
||||
let specific = SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node));
|
||||
let construction_item = ConstructionItem::TableColumnFragment(Fragment::new(
|
||||
node,
|
||||
specific,
|
||||
self.layout_context,
|
||||
));
|
||||
ConstructionResult::ConstructionItem(construction_item)
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with `display: table-column-group`.
|
||||
/// This yields a `TableColGroupFlow`.
|
||||
fn build_flow_for_table_colgroup(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
) -> ConstructionResult {
|
||||
let fragment = Fragment::new(
|
||||
node,
|
||||
SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node)),
|
||||
self.layout_context,
|
||||
);
|
||||
let mut col_fragments = vec![];
|
||||
for kid in node.children() {
|
||||
// CSS 2.1 § 17.2.1. Treat all non-column child fragments of `table-column-group`
|
||||
// as `display: none`.
|
||||
if let ConstructionResult::ConstructionItem(ConstructionItem::TableColumnFragment(
|
||||
fragment,
|
||||
)) = kid.get_construction_result()
|
||||
{
|
||||
col_fragments.push(fragment)
|
||||
}
|
||||
}
|
||||
if col_fragments.is_empty() {
|
||||
debug!("add SpecificFragmentInfo::TableColumn for empty colgroup");
|
||||
let specific = SpecificFragmentInfo::TableColumn(TableColumnFragmentInfo::new(node));
|
||||
col_fragments.push(Fragment::new(node, specific, self.layout_context));
|
||||
}
|
||||
let mut flow = FlowRef::new(Arc::new(TableColGroupFlow::from_fragments(
|
||||
fragment,
|
||||
col_fragments,
|
||||
)));
|
||||
flow.finish();
|
||||
|
||||
ConstructionResult::Flow(flow, AbsoluteDescendants::new())
|
||||
}
|
||||
|
||||
/// Builds a flow for a node with 'display: flex'.
|
||||
fn build_flow_for_flex(
|
||||
&mut self,
|
||||
node: &ConcreteThreadSafeLayoutNode,
|
||||
float_kind: Option<FloatKind>,
|
||||
) -> ConstructionResult {
|
||||
let fragment = self.build_fragment_for_block(node);
|
||||
let flow = FlowRef::new(Arc::new(FlexFlow::from_fragment(fragment, float_kind)));
|
||||
self.build_flow_for_block_like(flow, node)
|
||||
}
|
||||
|
||||
/// Attempts to perform incremental repair to account for recent changes to this node. This
|
||||
/// can fail and return false, indicating that flows will need to be reconstructed.
|
||||
///
|
||||
@@ -1835,12 +1400,6 @@ where
|
||||
self.set_flow_construction_result(node, ConstructionResult::None);
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::Table, float_value, _) => {
|
||||
let construction_result = self.build_flow_for_table(node, float_value);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Absolutely positioned elements will have computed value of
|
||||
// `float` as 'none' and `display` as per the table.
|
||||
// Only match here for block items. If an item is absolutely
|
||||
@@ -1852,12 +1411,6 @@ where
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// List items contribute their own special flows.
|
||||
(Display::ListItem, float_value, _) => {
|
||||
let construction_result = self.build_flow_for_list_item(node, float_value);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Inline items that are absolutely-positioned contribute inline fragment construction
|
||||
// results with a hypothetical fragment.
|
||||
(Display::Inline, _, Position::Absolute) |
|
||||
@@ -1882,57 +1435,6 @@ where
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::TableCaption, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_caption(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::TableColumnGroup, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_colgroup(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::TableColumn, _, _) => {
|
||||
let construction_result = self.build_fragments_for_table_column(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::TableRowGroup, _, _) |
|
||||
(Display::TableHeaderGroup, _, _) |
|
||||
(Display::TableFooterGroup, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_rowgroup(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::TableRow, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_row(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Table items contribute table flow construction results.
|
||||
(Display::TableCell, _, _) => {
|
||||
let construction_result = self.build_flow_for_table_cell(node);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Flex items contribute flex flow construction results.
|
||||
(Display::Flex, float_value, _) => {
|
||||
let float_kind = FloatKind::from_property(float_value);
|
||||
let construction_result = self.build_flow_for_flex(node, float_kind);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
(Display::InlineFlex, _, _) => {
|
||||
let construction_result =
|
||||
self.build_fragment_for_inline_block_or_inline_flex(node, Display::InlineFlex);
|
||||
self.set_flow_construction_result(node, construction_result)
|
||||
},
|
||||
|
||||
// Block flows that are not floated contribute block flow construction results.
|
||||
//
|
||||
// TODO(pcwalton): Make this only trigger for blocks and handle the other `display`
|
||||
@@ -2264,10 +1766,6 @@ impl Legalizer {
|
||||
}
|
||||
self.flush_top_of_stack(parent)
|
||||
}
|
||||
|
||||
while !self.try_to_add_child::<E>(context, parent, &mut child) {
|
||||
self.push_next_anonymous_flow::<E>(context, parent)
|
||||
}
|
||||
}
|
||||
|
||||
/// Flushes all flows we've been gathering up.
|
||||
@@ -2294,78 +1792,8 @@ impl Legalizer {
|
||||
{
|
||||
let parent = self.stack.last_mut().unwrap_or(parent);
|
||||
let (parent_class, child_class) = (parent.class(), child.class());
|
||||
match (parent_class, child_class) {
|
||||
(FlowClass::TableWrapper, FlowClass::Table) |
|
||||
(FlowClass::Table, FlowClass::TableColGroup) |
|
||||
(FlowClass::Table, FlowClass::TableRowGroup) |
|
||||
(FlowClass::Table, FlowClass::TableRow) |
|
||||
(FlowClass::Table, FlowClass::TableCaption) |
|
||||
(FlowClass::TableRowGroup, FlowClass::TableRow) |
|
||||
(FlowClass::TableRow, FlowClass::TableCell) => {
|
||||
parent.add_new_child((*child).clone());
|
||||
true
|
||||
},
|
||||
|
||||
(FlowClass::TableWrapper, _) |
|
||||
(FlowClass::Table, _) |
|
||||
(FlowClass::TableRowGroup, _) |
|
||||
(FlowClass::TableRow, _) |
|
||||
(_, FlowClass::Table) |
|
||||
(_, FlowClass::TableColGroup) |
|
||||
(_, FlowClass::TableRowGroup) |
|
||||
(_, FlowClass::TableRow) |
|
||||
(_, FlowClass::TableCaption) |
|
||||
(_, FlowClass::TableCell) => false,
|
||||
|
||||
(FlowClass::Flex, FlowClass::Inline) => {
|
||||
FlowRef::deref_mut(child)
|
||||
.mut_base()
|
||||
.flags
|
||||
.insert(FlowFlags::MARGINS_CANNOT_COLLAPSE);
|
||||
let mut block_wrapper = Legalizer::create_anonymous_flow::<E, _>(
|
||||
context,
|
||||
parent,
|
||||
&[PseudoElement::ServoAnonymousBlock],
|
||||
SpecificFragmentInfo::Generic,
|
||||
BlockFlow::from_fragment,
|
||||
);
|
||||
|
||||
{
|
||||
let flag = if parent.as_flex().main_mode() == Direction::Inline {
|
||||
FragmentFlags::IS_INLINE_FLEX_ITEM
|
||||
} else {
|
||||
FragmentFlags::IS_BLOCK_FLEX_ITEM
|
||||
};
|
||||
let block = FlowRef::deref_mut(&mut block_wrapper).as_mut_block();
|
||||
block.base.flags.insert(FlowFlags::MARGINS_CANNOT_COLLAPSE);
|
||||
block.fragment.flags.insert(flag);
|
||||
}
|
||||
block_wrapper.add_new_child((*child).clone());
|
||||
block_wrapper.finish();
|
||||
parent.add_new_child(block_wrapper);
|
||||
true
|
||||
},
|
||||
|
||||
(FlowClass::Flex, _) => {
|
||||
{
|
||||
let flag = if parent.as_flex().main_mode() == Direction::Inline {
|
||||
FragmentFlags::IS_INLINE_FLEX_ITEM
|
||||
} else {
|
||||
FragmentFlags::IS_BLOCK_FLEX_ITEM
|
||||
};
|
||||
let block = FlowRef::deref_mut(child).as_mut_block();
|
||||
block.base.flags.insert(FlowFlags::MARGINS_CANNOT_COLLAPSE);
|
||||
block.fragment.flags.insert(flag);
|
||||
}
|
||||
parent.add_new_child((*child).clone());
|
||||
true
|
||||
},
|
||||
|
||||
_ => {
|
||||
parent.add_new_child((*child).clone());
|
||||
true
|
||||
},
|
||||
}
|
||||
parent.add_new_child((*child).clone());
|
||||
true
|
||||
}
|
||||
|
||||
/// Finalizes the flow on the top of the stack.
|
||||
@@ -2375,70 +1803,6 @@ impl Legalizer {
|
||||
self.stack.last_mut().unwrap_or(parent).add_new_child(child)
|
||||
}
|
||||
|
||||
/// Adds the anonymous flow that would be necessary to make an illegal child of `parent` legal
|
||||
/// to the stack.
|
||||
fn push_next_anonymous_flow<E>(&mut self, context: &SharedStyleContext, parent: &FlowRef)
|
||||
where
|
||||
E: TElement,
|
||||
{
|
||||
let parent_class = self.stack.last().unwrap_or(parent).class();
|
||||
match parent_class {
|
||||
FlowClass::TableRow => self.push_new_anonymous_flow::<E, _>(
|
||||
context,
|
||||
parent,
|
||||
&[PseudoElement::ServoAnonymousTableCell],
|
||||
SpecificFragmentInfo::TableCell,
|
||||
TableCellFlow::from_fragment,
|
||||
),
|
||||
FlowClass::Table | FlowClass::TableRowGroup => self.push_new_anonymous_flow::<E, _>(
|
||||
context,
|
||||
parent,
|
||||
&[PseudoElement::ServoAnonymousTableRow],
|
||||
SpecificFragmentInfo::TableRow,
|
||||
TableRowFlow::from_fragment,
|
||||
),
|
||||
FlowClass::TableWrapper => self.push_new_anonymous_flow::<E, _>(
|
||||
context,
|
||||
parent,
|
||||
&[PseudoElement::ServoAnonymousTable],
|
||||
SpecificFragmentInfo::Table,
|
||||
TableFlow::from_fragment,
|
||||
),
|
||||
_ => self.push_new_anonymous_flow::<E, _>(
|
||||
context,
|
||||
parent,
|
||||
&[
|
||||
PseudoElement::ServoTableWrapper,
|
||||
PseudoElement::ServoAnonymousTableWrapper,
|
||||
],
|
||||
SpecificFragmentInfo::TableWrapper,
|
||||
TableWrapperFlow::from_fragment,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates an anonymous flow and pushes it onto the stack.
|
||||
fn push_new_anonymous_flow<E, F>(
|
||||
&mut self,
|
||||
context: &SharedStyleContext,
|
||||
reference: &FlowRef,
|
||||
pseudos: &[PseudoElement],
|
||||
specific_fragment_info: SpecificFragmentInfo,
|
||||
constructor: fn(Fragment) -> F,
|
||||
) where
|
||||
E: TElement,
|
||||
F: Flow,
|
||||
{
|
||||
let new_flow = Self::create_anonymous_flow::<E, _>(
|
||||
context,
|
||||
reference,
|
||||
pseudos,
|
||||
specific_fragment_info,
|
||||
constructor,
|
||||
);
|
||||
self.stack.push(new_flow)
|
||||
}
|
||||
|
||||
/// Creates a new anonymous flow. The new flow is identical to `reference` except with all
|
||||
/// styles applying to every pseudo-element in `pseudos` applied.
|
||||
///
|
||||
|
||||
@@ -24,15 +24,12 @@ use crate::display_list::items::{PopAllTextShadowsDisplayItem, PushTextShadowDis
|
||||
use crate::display_list::items::{StackingContext, StackingContextType, StickyFrameData};
|
||||
use crate::display_list::items::{TextOrientation, WebRenderImageInfo};
|
||||
use crate::display_list::ToLayout;
|
||||
use crate::flex::FlexFlow;
|
||||
use crate::flow::{BaseFlow, Flow, FlowFlags};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::SpecificFragmentInfo;
|
||||
use crate::fragment::{CanvasFragmentSource, CoordinateSystem, Fragment, ScannedTextFragmentInfo};
|
||||
use crate::inline::{InlineFlow, InlineFragmentNodeFlags};
|
||||
use crate::list_item::ListItemFlow;
|
||||
use crate::model::MaybeAuto;
|
||||
use crate::table_cell::CollapsedBordersForCell;
|
||||
use euclid::{rect, Point2D, Rect, SideOffsets2D, Size2D, TypedRect, TypedSize2D, Vector2D};
|
||||
use fnv::FnvHashMap;
|
||||
use gfx::text::glyph::ByteIndex;
|
||||
@@ -1275,7 +1272,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||
style: &ComputedValues,
|
||||
inline_info: Option<InlineNodeBorderInfo>,
|
||||
border_painting_mode: BorderPaintingMode,
|
||||
mut bounds: Rect<Au>,
|
||||
bounds: Rect<Au>,
|
||||
display_list_section: DisplayListSection,
|
||||
clip: Rect<Au>,
|
||||
) {
|
||||
@@ -1287,39 +1284,23 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||
|
||||
match border_painting_mode {
|
||||
BorderPaintingMode::Separate => {},
|
||||
BorderPaintingMode::Collapse(collapsed_borders) => {
|
||||
collapsed_borders.adjust_border_widths_for_painting(&mut border)
|
||||
},
|
||||
BorderPaintingMode::Hidden => return,
|
||||
}
|
||||
|
||||
let border_style_struct = style.get_border();
|
||||
let mut colors = SideOffsets2D::new(
|
||||
let colors = SideOffsets2D::new(
|
||||
border_style_struct.border_top_color,
|
||||
border_style_struct.border_right_color,
|
||||
border_style_struct.border_bottom_color,
|
||||
border_style_struct.border_left_color,
|
||||
);
|
||||
let mut border_style = SideOffsets2D::new(
|
||||
let border_style = SideOffsets2D::new(
|
||||
border_style_struct.border_top_style,
|
||||
border_style_struct.border_right_style,
|
||||
border_style_struct.border_bottom_style,
|
||||
border_style_struct.border_left_style,
|
||||
);
|
||||
|
||||
if let BorderPaintingMode::Collapse(collapsed_borders) = border_painting_mode {
|
||||
collapsed_borders.adjust_border_colors_and_styles_for_painting(
|
||||
&mut colors,
|
||||
&mut border_style,
|
||||
style.writing_mode,
|
||||
);
|
||||
}
|
||||
|
||||
// If this border collapses, then we draw outside the boundaries we were given.
|
||||
if let BorderPaintingMode::Collapse(collapsed_borders) = border_painting_mode {
|
||||
collapsed_borders.adjust_border_bounds_for_painting(&mut bounds, style.writing_mode)
|
||||
}
|
||||
|
||||
// Append the border to the display list.
|
||||
let base = state.create_base_display_item(
|
||||
bounds,
|
||||
@@ -1961,10 +1942,6 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||
},
|
||||
SpecificFragmentInfo::Generic |
|
||||
SpecificFragmentInfo::GeneratedContent(..) |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn |
|
||||
SpecificFragmentInfo::InlineBlock(_) |
|
||||
@@ -2078,9 +2055,6 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||
SpecificFragmentInfo::UnscannedText(_) => {
|
||||
panic!("Shouldn't see unscanned fragments here.")
|
||||
},
|
||||
SpecificFragmentInfo::TableColumn(_) => {
|
||||
panic!("Shouldn't see table column fragments here.")
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3179,46 +3153,6 @@ impl InlineFlowDisplayListBuilding for InlineFlow {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ListItemFlowDisplayListBuilding {
|
||||
fn build_display_list_for_list_item(&mut self, state: &mut DisplayListBuildState);
|
||||
}
|
||||
|
||||
impl ListItemFlowDisplayListBuilding for ListItemFlow {
|
||||
fn build_display_list_for_list_item(&mut self, state: &mut DisplayListBuildState) {
|
||||
// Draw the marker, if applicable.
|
||||
for marker in &mut self.marker_fragments {
|
||||
let stacking_relative_border_box = self
|
||||
.block_flow
|
||||
.base
|
||||
.stacking_relative_border_box_for_display_list(marker);
|
||||
marker.build_display_list(
|
||||
state,
|
||||
stacking_relative_border_box,
|
||||
BorderPaintingMode::Separate,
|
||||
DisplayListSection::Content,
|
||||
self.block_flow.base.clip,
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
||||
// Draw the rest of the block.
|
||||
self.block_flow
|
||||
.build_display_list_for_block(state, BorderPaintingMode::Separate)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait FlexFlowDisplayListBuilding {
|
||||
fn build_display_list_for_flex(&mut self, state: &mut DisplayListBuildState);
|
||||
}
|
||||
|
||||
impl FlexFlowDisplayListBuilding for FlexFlow {
|
||||
fn build_display_list_for_flex(&mut self, state: &mut DisplayListBuildState) {
|
||||
// Draw the rest of the block.
|
||||
self.as_mut_block()
|
||||
.build_display_list_for_block(state, BorderPaintingMode::Separate)
|
||||
}
|
||||
}
|
||||
|
||||
trait BaseFlowDisplayListBuilding {
|
||||
fn build_display_items_for_debugging_tint(
|
||||
&self,
|
||||
@@ -3320,11 +3254,9 @@ fn modify_border_width_for_inline_sides(
|
||||
|
||||
/// Describes how to paint the borders.
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum BorderPaintingMode<'a> {
|
||||
pub enum BorderPaintingMode {
|
||||
/// Paint borders separately (`border-collapse: separate`).
|
||||
Separate,
|
||||
/// Paint collapsed borders.
|
||||
Collapse(&'a CollapsedBordersForCell),
|
||||
/// Paint no borders.
|
||||
Hidden,
|
||||
}
|
||||
|
||||
@@ -5,10 +5,8 @@
|
||||
pub use self::builder::BlockFlowDisplayListBuilding;
|
||||
pub use self::builder::BorderPaintingMode;
|
||||
pub use self::builder::DisplayListBuildState;
|
||||
pub use self::builder::FlexFlowDisplayListBuilding;
|
||||
pub use self::builder::IndexableText;
|
||||
pub use self::builder::InlineFlowDisplayListBuilding;
|
||||
pub use self::builder::ListItemFlowDisplayListBuilding;
|
||||
pub use self::builder::StackingContextCollectionFlags;
|
||||
pub use self::builder::StackingContextCollectionState;
|
||||
pub use self::conversions::ToLayout;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,22 +30,13 @@ use crate::block::{BlockFlow, FormattingContextType};
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::items::ClippingAndScrolling;
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::flex::FlexFlow;
|
||||
use crate::floats::{Floats, SpeculatedFloatPlacement};
|
||||
use crate::flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
|
||||
use crate::flow_ref::{FlowRef, WeakFlowRef};
|
||||
use crate::fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::inline::InlineFlow;
|
||||
use crate::model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
|
||||
use crate::multicol::MulticolFlow;
|
||||
use crate::parallel::FlowParallelInfo;
|
||||
use crate::table::TableFlow;
|
||||
use crate::table_caption::TableCaptionFlow;
|
||||
use crate::table_cell::TableCellFlow;
|
||||
use crate::table_colgroup::TableColGroupFlow;
|
||||
use crate::table_row::TableRowFlow;
|
||||
use crate::table_rowgroup::TableRowGroupFlow;
|
||||
use crate::table_wrapper::TableWrapperFlow;
|
||||
use euclid::{Point2D, Rect, Size2D, Vector2D};
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use gfx_traits::StackingContextId;
|
||||
@@ -125,16 +116,6 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static {
|
||||
panic!("called as_mut_block() on a non-block flow")
|
||||
}
|
||||
|
||||
/// If this is a flex flow, returns the underlying object. Fails otherwise.
|
||||
fn as_flex(&self) -> &FlexFlow {
|
||||
panic!("called as_flex() on a non-flex flow")
|
||||
}
|
||||
|
||||
/// If this is a flex flow, returns the underlying object, borrowed mutably. Fails otherwise.
|
||||
fn as_mut_flex(&mut self) -> &mut FlexFlow {
|
||||
panic!("called as_mut_flex() on a non-flex flow")
|
||||
}
|
||||
|
||||
/// If this is an inline flow, returns the underlying object. Fails otherwise.
|
||||
fn as_inline(&self) -> &InlineFlow {
|
||||
panic!("called as_inline() on a non-inline flow")
|
||||
@@ -146,84 +127,6 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static {
|
||||
panic!("called as_mut_inline() on a non-inline flow")
|
||||
}
|
||||
|
||||
/// If this is a table wrapper flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_table_wrapper(&mut self) -> &mut TableWrapperFlow {
|
||||
panic!("called as_mut_table_wrapper() on a non-tablewrapper flow")
|
||||
}
|
||||
|
||||
/// If this is a table wrapper flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_wrapper(&self) -> &TableWrapperFlow {
|
||||
panic!("called as_table_wrapper() on a non-tablewrapper flow")
|
||||
}
|
||||
|
||||
/// If this is a table flow, returns the underlying object, borrowed mutably. Fails otherwise.
|
||||
fn as_mut_table(&mut self) -> &mut TableFlow {
|
||||
panic!("called as_mut_table() on a non-table flow")
|
||||
}
|
||||
|
||||
/// If this is a table flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table(&self) -> &TableFlow {
|
||||
panic!("called as_table() on a non-table flow")
|
||||
}
|
||||
|
||||
/// If this is a table colgroup flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_table_colgroup(&mut self) -> &mut TableColGroupFlow {
|
||||
panic!("called as_mut_table_colgroup() on a non-tablecolgroup flow")
|
||||
}
|
||||
|
||||
/// If this is a table colgroup flow, returns the underlying object. Fails
|
||||
/// otherwise.
|
||||
fn as_table_colgroup(&self) -> &TableColGroupFlow {
|
||||
panic!("called as_table_colgroup() on a non-tablecolgroup flow")
|
||||
}
|
||||
|
||||
/// If this is a table rowgroup flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_table_rowgroup(&mut self) -> &mut TableRowGroupFlow {
|
||||
panic!("called as_mut_table_rowgroup() on a non-tablerowgroup flow")
|
||||
}
|
||||
|
||||
/// If this is a table rowgroup flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_rowgroup(&self) -> &TableRowGroupFlow {
|
||||
panic!("called as_table_rowgroup() on a non-tablerowgroup flow")
|
||||
}
|
||||
|
||||
/// If this is a table row flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_table_row(&mut self) -> &mut TableRowFlow {
|
||||
panic!("called as_mut_table_row() on a non-tablerow flow")
|
||||
}
|
||||
|
||||
/// If this is a table row flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_row(&self) -> &TableRowFlow {
|
||||
panic!("called as_table_row() on a non-tablerow flow")
|
||||
}
|
||||
|
||||
/// If this is a table cell flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_table_caption(&mut self) -> &mut TableCaptionFlow {
|
||||
panic!("called as_mut_table_caption() on a non-tablecaption flow")
|
||||
}
|
||||
|
||||
/// If this is a table cell flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_table_cell(&mut self) -> &mut TableCellFlow {
|
||||
panic!("called as_mut_table_cell() on a non-tablecell flow")
|
||||
}
|
||||
|
||||
/// If this is a multicol flow, returns the underlying object, borrowed mutably. Fails
|
||||
/// otherwise.
|
||||
fn as_mut_multicol(&mut self) -> &mut MulticolFlow {
|
||||
panic!("called as_mut_multicol() on a non-multicol flow")
|
||||
}
|
||||
|
||||
/// If this is a table cell flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_cell(&self) -> &TableCellFlow {
|
||||
panic!("called as_table_cell() on a non-tablecell flow")
|
||||
}
|
||||
|
||||
// Main methods
|
||||
|
||||
/// Pass 1 of reflow: computes minimum and preferred inline-sizes.
|
||||
@@ -311,7 +214,7 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static {
|
||||
let mut overflow = self.base().overflow;
|
||||
|
||||
match self.class() {
|
||||
FlowClass::Block | FlowClass::TableCaption | FlowClass::TableCell => {},
|
||||
FlowClass::Block => {},
|
||||
_ => {
|
||||
overflow.translate(&position.origin.to_vector());
|
||||
return overflow;
|
||||
@@ -397,7 +300,7 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static {
|
||||
// Calculate overflow on a per-fragment basis.
|
||||
let mut overflow = self.compute_overflow();
|
||||
match self.class() {
|
||||
FlowClass::Block | FlowClass::TableCaption | FlowClass::TableCell => {
|
||||
FlowClass::Block => {
|
||||
for kid in self.mut_base().children.iter_mut() {
|
||||
overflow.union(&kid.get_overflow_in_parent_coordinates());
|
||||
}
|
||||
@@ -524,30 +427,6 @@ pub trait ImmutableFlowUtils {
|
||||
/// Returns true if this flow is a block flow or subclass thereof.
|
||||
fn is_block_like(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a table flow.
|
||||
fn is_table(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a table caption flow.
|
||||
fn is_table_caption(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a proper table child.
|
||||
fn is_proper_table_child(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a table row flow.
|
||||
fn is_table_row(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a table cell flow.
|
||||
fn is_table_cell(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a table colgroup flow.
|
||||
fn is_table_colgroup(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is a table rowgroup flow.
|
||||
fn is_table_rowgroup(self) -> bool;
|
||||
|
||||
/// Returns true if this flow is one of table-related flows.
|
||||
fn is_table_kind(self) -> bool;
|
||||
|
||||
/// Returns true if this flow has no children.
|
||||
fn is_leaf(self) -> bool;
|
||||
|
||||
@@ -608,31 +487,12 @@ pub trait MutableOwnedFlowUtils {
|
||||
pub enum FlowClass {
|
||||
Block,
|
||||
Inline,
|
||||
ListItem,
|
||||
TableWrapper,
|
||||
Table,
|
||||
TableColGroup,
|
||||
TableRowGroup,
|
||||
TableRow,
|
||||
TableCaption,
|
||||
TableCell,
|
||||
Multicol,
|
||||
MulticolColumn,
|
||||
Flex,
|
||||
}
|
||||
|
||||
impl FlowClass {
|
||||
fn is_block_like(self) -> bool {
|
||||
match self {
|
||||
FlowClass::Block |
|
||||
FlowClass::ListItem |
|
||||
FlowClass::Table |
|
||||
FlowClass::TableRowGroup |
|
||||
FlowClass::TableRow |
|
||||
FlowClass::TableCaption |
|
||||
FlowClass::TableCell |
|
||||
FlowClass::TableWrapper |
|
||||
FlowClass::Flex => true,
|
||||
FlowClass::Block => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
@@ -1252,81 +1112,6 @@ impl<'a> ImmutableFlowUtils for &'a dyn Flow {
|
||||
self.class().is_block_like()
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a proper table child.
|
||||
/// 'Proper table child' is defined as table-row flow, table-rowgroup flow,
|
||||
/// table-column-group flow, or table-caption flow.
|
||||
fn is_proper_table_child(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableRow |
|
||||
FlowClass::TableRowGroup |
|
||||
FlowClass::TableColGroup |
|
||||
FlowClass::TableCaption => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a table row flow.
|
||||
fn is_table_row(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableRow => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a table cell flow.
|
||||
fn is_table_cell(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableCell => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a table colgroup flow.
|
||||
fn is_table_colgroup(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableColGroup => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a table flow.
|
||||
fn is_table(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::Table => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a table caption flow.
|
||||
fn is_table_caption(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableCaption => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is a table rowgroup flow.
|
||||
fn is_table_rowgroup(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableRowGroup => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow is one of table-related flows.
|
||||
fn is_table_kind(self) -> bool {
|
||||
match self.class() {
|
||||
FlowClass::TableWrapper |
|
||||
FlowClass::Table |
|
||||
FlowClass::TableColGroup |
|
||||
FlowClass::TableRowGroup |
|
||||
FlowClass::TableRow |
|
||||
FlowClass::TableCaption |
|
||||
FlowClass::TableCell => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this flow has no children.
|
||||
fn is_leaf(self) -> bool {
|
||||
self.base().children.is_empty()
|
||||
@@ -1346,7 +1131,7 @@ impl<'a> ImmutableFlowUtils for &'a dyn Flow {
|
||||
fn is_block_container(self) -> bool {
|
||||
match self.class() {
|
||||
// TODO: Change this when inline-blocks are supported.
|
||||
FlowClass::Block | FlowClass::TableCaption | FlowClass::TableCell => {
|
||||
FlowClass::Block => {
|
||||
// FIXME: Actually check the type of the node
|
||||
self.child_count() != 0
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use crate::flow::{Flow, FlowClass};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use serde::ser::{Serialize, SerializeSeq, Serializer};
|
||||
use serde_json::{to_value, Map, Value};
|
||||
use serde_json::{to_value, Map};
|
||||
use std::collections::{linked_list, LinkedList};
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
@@ -32,19 +32,6 @@ impl Serialize for FlowList {
|
||||
let data = match f.class() {
|
||||
FlowClass::Block => to_value(f.as_block()).unwrap(),
|
||||
FlowClass::Inline => to_value(f.as_inline()).unwrap(),
|
||||
FlowClass::Table => to_value(f.as_table()).unwrap(),
|
||||
FlowClass::TableWrapper => to_value(f.as_table_wrapper()).unwrap(),
|
||||
FlowClass::TableRowGroup => to_value(f.as_table_rowgroup()).unwrap(),
|
||||
FlowClass::TableRow => to_value(f.as_table_row()).unwrap(),
|
||||
FlowClass::TableCell => to_value(f.as_table_cell()).unwrap(),
|
||||
FlowClass::Flex => to_value(f.as_flex()).unwrap(),
|
||||
FlowClass::ListItem |
|
||||
FlowClass::TableColGroup |
|
||||
FlowClass::TableCaption |
|
||||
FlowClass::Multicol |
|
||||
FlowClass::MulticolColumn => {
|
||||
Value::Null // Not implemented yet
|
||||
},
|
||||
};
|
||||
flow_val.insert("data".to_owned(), data);
|
||||
serializer.serialize_element(&flow_val)?;
|
||||
|
||||
@@ -31,9 +31,7 @@ use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image::base::{Image, ImageMetadata};
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use range::*;
|
||||
use script_layout_interface::wrapper_traits::{
|
||||
PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode,
|
||||
};
|
||||
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutNode};
|
||||
use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource, HTMLMediaData, SVGSVGData};
|
||||
use serde::ser::{Serialize, SerializeStruct, Serializer};
|
||||
use servo_url::ServoUrl;
|
||||
@@ -195,11 +193,6 @@ pub enum SpecificFragmentInfo {
|
||||
InlineAbsolute(InlineAbsoluteFragmentInfo),
|
||||
|
||||
ScannedText(Box<ScannedTextFragmentInfo>),
|
||||
Table,
|
||||
TableCell,
|
||||
TableColumn(TableColumnFragmentInfo),
|
||||
TableRow,
|
||||
TableWrapper,
|
||||
Multicol,
|
||||
MulticolColumn,
|
||||
UnscannedText(Box<UnscannedTextFragmentInfo>),
|
||||
@@ -221,11 +214,6 @@ impl SpecificFragmentInfo {
|
||||
SpecificFragmentInfo::Media(_) |
|
||||
SpecificFragmentInfo::ScannedText(_) |
|
||||
SpecificFragmentInfo::Svg(_) |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn |
|
||||
SpecificFragmentInfo::UnscannedText(_) |
|
||||
@@ -254,11 +242,6 @@ impl SpecificFragmentInfo {
|
||||
SpecificFragmentInfo::InlineBlock(_) => "SpecificFragmentInfo::InlineBlock",
|
||||
SpecificFragmentInfo::ScannedText(_) => "SpecificFragmentInfo::ScannedText",
|
||||
SpecificFragmentInfo::Svg(_) => "SpecificFragmentInfo::Svg",
|
||||
SpecificFragmentInfo::Table => "SpecificFragmentInfo::Table",
|
||||
SpecificFragmentInfo::TableCell => "SpecificFragmentInfo::TableCell",
|
||||
SpecificFragmentInfo::TableColumn(_) => "SpecificFragmentInfo::TableColumn",
|
||||
SpecificFragmentInfo::TableRow => "SpecificFragmentInfo::TableRow",
|
||||
SpecificFragmentInfo::TableWrapper => "SpecificFragmentInfo::TableWrapper",
|
||||
SpecificFragmentInfo::Multicol => "SpecificFragmentInfo::Multicol",
|
||||
SpecificFragmentInfo::MulticolColumn => "SpecificFragmentInfo::MulticolColumn",
|
||||
SpecificFragmentInfo::UnscannedText(_) => "SpecificFragmentInfo::UnscannedText",
|
||||
@@ -632,25 +615,6 @@ impl UnscannedTextFragmentInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/// A fragment that represents a table column.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct TableColumnFragmentInfo {
|
||||
/// the number of columns a <col> element should span
|
||||
pub span: u32,
|
||||
}
|
||||
|
||||
impl TableColumnFragmentInfo {
|
||||
/// Create the information specific to an table column fragment.
|
||||
pub fn new<N: ThreadSafeLayoutNode>(node: &N) -> TableColumnFragmentInfo {
|
||||
let element = node.as_element().unwrap();
|
||||
let span = element
|
||||
.get_attr(&ns!(), &local_name!("span"))
|
||||
.and_then(|string| string.parse().ok())
|
||||
.unwrap_or(0);
|
||||
TableColumnFragmentInfo { span: span }
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper for fragments that have been truncated by the `text-overflow` property.
|
||||
/// This may have an associated text node, or, if the fragment was completely truncated,
|
||||
/// it may act as an invisible marker for incremental reflow.
|
||||
@@ -881,44 +845,8 @@ impl Fragment {
|
||||
SpecificFragmentInfo::Svg(_) => {
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::all()
|
||||
}
|
||||
SpecificFragmentInfo::Table => {
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED |
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_PADDING |
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
|
||||
}
|
||||
SpecificFragmentInfo::TableCell => {
|
||||
let base_quantities = QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_PADDING |
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED;
|
||||
if self.style.get_inherited_table().border_collapse ==
|
||||
BorderCollapse::Separate {
|
||||
base_quantities | QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
|
||||
} else {
|
||||
base_quantities
|
||||
}
|
||||
}
|
||||
SpecificFragmentInfo::TableWrapper => {
|
||||
let base_quantities = QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_MARGINS |
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED;
|
||||
if self.style.get_inherited_table().border_collapse ==
|
||||
BorderCollapse::Separate {
|
||||
base_quantities | QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
|
||||
} else {
|
||||
base_quantities
|
||||
}
|
||||
}
|
||||
SpecificFragmentInfo::TableRow => {
|
||||
let base_quantities =
|
||||
QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_SPECIFIED;
|
||||
if self.style.get_inherited_table().border_collapse ==
|
||||
BorderCollapse::Separate {
|
||||
base_quantities | QuantitiesIncludedInIntrinsicInlineSizes::INTRINSIC_INLINE_SIZE_INCLUDES_BORDER
|
||||
} else {
|
||||
base_quantities
|
||||
}
|
||||
}
|
||||
SpecificFragmentInfo::TruncatedFragment(_) |
|
||||
SpecificFragmentInfo::ScannedText(_) |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::UnscannedText(_) |
|
||||
SpecificFragmentInfo::InlineAbsoluteHypothetical(_) |
|
||||
SpecificFragmentInfo::InlineBlock(_) |
|
||||
@@ -1309,10 +1237,6 @@ impl Fragment {
|
||||
/// (for example, via constraint solving for blocks).
|
||||
pub fn compute_inline_direction_margins(&mut self, containing_block_inline_size: Au) {
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::InlineAbsoluteHypothetical(_) => {
|
||||
self.margin.inline_start = Au(0);
|
||||
self.margin.inline_end = Au(0);
|
||||
@@ -1363,26 +1287,15 @@ impl Fragment {
|
||||
/// Do not use this method if the block direction margins are to be computed some other way
|
||||
/// (for example, via constraint solving for absolutely-positioned flows).
|
||||
pub fn compute_block_direction_margins(&mut self, containing_block_inline_size: Au) {
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableColumn(_) => {
|
||||
self.margin.block_start = Au(0);
|
||||
self.margin.block_end = Au(0)
|
||||
},
|
||||
_ => {
|
||||
// NB: Percentages are relative to containing block inline-size (not block-size)
|
||||
// per CSS 2.1.
|
||||
let margin = self.style().logical_margin();
|
||||
self.margin.block_start =
|
||||
MaybeAuto::from_style(margin.block_start, containing_block_inline_size)
|
||||
.specified_or_zero();
|
||||
self.margin.block_end =
|
||||
MaybeAuto::from_style(margin.block_end, containing_block_inline_size)
|
||||
.specified_or_zero();
|
||||
},
|
||||
}
|
||||
// NB: Percentages are relative to containing block inline-size (not block-size)
|
||||
// per CSS 2.1.
|
||||
let margin = self.style().logical_margin();
|
||||
self.margin.block_start =
|
||||
MaybeAuto::from_style(margin.block_start, containing_block_inline_size)
|
||||
.specified_or_zero();
|
||||
self.margin.block_end =
|
||||
MaybeAuto::from_style(margin.block_end, containing_block_inline_size)
|
||||
.specified_or_zero();
|
||||
}
|
||||
|
||||
/// Computes the border and padding in both inline and block directions from the containing
|
||||
@@ -1396,23 +1309,15 @@ impl Fragment {
|
||||
};
|
||||
|
||||
// Compute padding from the fragment's style.
|
||||
let padding_from_style = match self.specific {
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper => LogicalMargin::zero(self.style.writing_mode),
|
||||
_ => model::padding_from_style(
|
||||
self.style(),
|
||||
containing_block_inline_size,
|
||||
self.style().writing_mode,
|
||||
),
|
||||
};
|
||||
let padding_from_style = model::padding_from_style(
|
||||
self.style(),
|
||||
containing_block_inline_size,
|
||||
self.style().writing_mode,
|
||||
);
|
||||
|
||||
// Compute padding from the inline fragment context.
|
||||
let padding_from_inline_fragment_context = match (&self.specific, &self.inline_context) {
|
||||
(_, &None) |
|
||||
(&SpecificFragmentInfo::TableColumn(_), _) |
|
||||
(&SpecificFragmentInfo::TableRow, _) |
|
||||
(&SpecificFragmentInfo::TableWrapper, _) => {
|
||||
(_, &None) => {
|
||||
LogicalMargin::zero(self.style.writing_mode)
|
||||
},
|
||||
(_, &Some(ref inline_fragment_context)) => {
|
||||
@@ -1529,24 +1434,7 @@ impl Fragment {
|
||||
/// FIXME(#2262, pcwalton): I think this method is pretty bogus, because it won't work for
|
||||
/// inlines.
|
||||
pub fn inline_start_offset(&self) -> Au {
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::TableWrapper => self.margin.inline_start,
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableRow => self.border_padding.inline_start,
|
||||
SpecificFragmentInfo::TableColumn(_) => Au(0),
|
||||
_ => self.margin.inline_start + self.border_padding.inline_start,
|
||||
}
|
||||
}
|
||||
|
||||
/// If this is a Column fragment, get the col span
|
||||
///
|
||||
/// Panics for non-column fragments
|
||||
pub fn column_span(&self) -> u32 {
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::TableColumn(col_fragment) => max(col_fragment.span, 1),
|
||||
_ => panic!("non-table-column fragment inside table column?!"),
|
||||
}
|
||||
self.margin.inline_start + self.border_padding.inline_start
|
||||
}
|
||||
|
||||
/// Returns true if this element can be split. This is true for text fragments, unless
|
||||
@@ -1589,11 +1477,6 @@ impl Fragment {
|
||||
match self.specific {
|
||||
SpecificFragmentInfo::Generic |
|
||||
SpecificFragmentInfo::GeneratedContent(_) |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn |
|
||||
SpecificFragmentInfo::InlineAbsoluteHypothetical(_) => {},
|
||||
@@ -2068,15 +1951,8 @@ impl Fragment {
|
||||
SpecificFragmentInfo::TruncatedFragment(ref t) if t.text_info.is_none() => return,
|
||||
SpecificFragmentInfo::Generic |
|
||||
SpecificFragmentInfo::GeneratedContent(_) |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn => return,
|
||||
SpecificFragmentInfo::TableColumn(_) => {
|
||||
panic!("Table column fragments do not have inline size")
|
||||
},
|
||||
SpecificFragmentInfo::UnscannedText(_) => {
|
||||
panic!("Unscanned text fragments should have been scanned by now!")
|
||||
},
|
||||
@@ -2159,15 +2035,8 @@ impl Fragment {
|
||||
SpecificFragmentInfo::TruncatedFragment(ref t) if t.text_info.is_none() => return,
|
||||
SpecificFragmentInfo::Generic |
|
||||
SpecificFragmentInfo::GeneratedContent(_) |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn => return,
|
||||
SpecificFragmentInfo::TableColumn(_) => {
|
||||
panic!("Table column fragments do not have block size")
|
||||
},
|
||||
SpecificFragmentInfo::UnscannedText(_) => {
|
||||
panic!("Unscanned text fragments should have been scanned by now!")
|
||||
},
|
||||
@@ -2289,11 +2158,6 @@ impl Fragment {
|
||||
},
|
||||
SpecificFragmentInfo::TruncatedFragment(..) |
|
||||
SpecificFragmentInfo::InlineAbsolute(_) => InlineMetrics::new(Au(0), Au(0), Au(0)),
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn |
|
||||
SpecificFragmentInfo::UnscannedText(_) => {
|
||||
@@ -2585,8 +2449,7 @@ impl Fragment {
|
||||
SpecificFragmentInfo::InlineBlock(_) |
|
||||
SpecificFragmentInfo::InlineAbsoluteHypothetical(_) |
|
||||
SpecificFragmentInfo::InlineAbsolute(_) |
|
||||
SpecificFragmentInfo::MulticolColumn |
|
||||
SpecificFragmentInfo::TableWrapper => false,
|
||||
SpecificFragmentInfo::MulticolColumn => false,
|
||||
SpecificFragmentInfo::Canvas(_) |
|
||||
SpecificFragmentInfo::Generic |
|
||||
SpecificFragmentInfo::GeneratedContent(_) |
|
||||
@@ -2595,10 +2458,6 @@ impl Fragment {
|
||||
SpecificFragmentInfo::Media(_) |
|
||||
SpecificFragmentInfo::ScannedText(_) |
|
||||
SpecificFragmentInfo::Svg(_) |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TruncatedFragment(_) |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::UnscannedText(_) => true,
|
||||
@@ -3110,12 +2969,7 @@ impl Fragment {
|
||||
SpecificFragmentInfo::InlineAbsoluteHypothetical(_) |
|
||||
SpecificFragmentInfo::InlineBlock(_) |
|
||||
SpecificFragmentInfo::Multicol |
|
||||
SpecificFragmentInfo::MulticolColumn |
|
||||
SpecificFragmentInfo::Table |
|
||||
SpecificFragmentInfo::TableCell |
|
||||
SpecificFragmentInfo::TableColumn(_) |
|
||||
SpecificFragmentInfo::TableRow |
|
||||
SpecificFragmentInfo::TableWrapper => false,
|
||||
SpecificFragmentInfo::MulticolColumn => false,
|
||||
SpecificFragmentInfo::Canvas(_) |
|
||||
SpecificFragmentInfo::GeneratedContent(_) |
|
||||
SpecificFragmentInfo::Iframe(_) |
|
||||
|
||||
@@ -24,7 +24,6 @@ pub mod construct;
|
||||
pub mod context;
|
||||
pub mod data;
|
||||
pub mod display_list;
|
||||
mod flex;
|
||||
mod floats;
|
||||
pub mod flow;
|
||||
mod flow_list;
|
||||
@@ -34,21 +33,12 @@ mod generated_content;
|
||||
pub mod incremental;
|
||||
mod inline;
|
||||
mod linked_list;
|
||||
mod list_item;
|
||||
mod model;
|
||||
mod multicol;
|
||||
pub mod opaque_node;
|
||||
pub mod parallel;
|
||||
mod persistent_list;
|
||||
pub mod query;
|
||||
pub mod sequential;
|
||||
mod table;
|
||||
mod table_caption;
|
||||
mod table_cell;
|
||||
mod table_colgroup;
|
||||
mod table_row;
|
||||
mod table_rowgroup;
|
||||
mod table_wrapper;
|
||||
mod text;
|
||||
pub mod traversal;
|
||||
pub mod wrapper;
|
||||
|
||||
@@ -1,303 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! Layout for elements with a CSS `display` property of `list-item`. These elements consist of a
|
||||
//! block and an extra inline fragment for the marker.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::{with_thread_local_font_context, LayoutContext};
|
||||
use crate::display_list::StackingContextCollectionState;
|
||||
use crate::display_list::{DisplayListBuildState, ListItemFlowDisplayListBuilding};
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use crate::fragment::Overflow;
|
||||
use crate::fragment::{
|
||||
CoordinateSystem, Fragment, FragmentBorderBoxIterator, GeneratedContentInfo,
|
||||
};
|
||||
use crate::generated_content;
|
||||
use crate::inline::InlineFlow;
|
||||
use euclid::Point2D;
|
||||
use style::computed_values::list_style_type::T as ListStyleType;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for ListItemFlow {}
|
||||
|
||||
/// A block with the CSS `display` property equal to `list-item`.
|
||||
#[derive(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct ListItemFlow {
|
||||
/// Data common to all block flows.
|
||||
pub block_flow: BlockFlow,
|
||||
/// The marker, if outside. (Markers that are inside are instead just fragments on the interior
|
||||
/// `InlineFlow`.)
|
||||
pub marker_fragments: Vec<Fragment>,
|
||||
}
|
||||
|
||||
impl ListItemFlow {
|
||||
pub fn from_fragments_and_flotation(
|
||||
main_fragment: Fragment,
|
||||
marker_fragments: Vec<Fragment>,
|
||||
flotation: Option<FloatKind>,
|
||||
) -> ListItemFlow {
|
||||
let mut this = ListItemFlow {
|
||||
block_flow: BlockFlow::from_fragment_and_float_kind(main_fragment, flotation),
|
||||
marker_fragments: marker_fragments,
|
||||
};
|
||||
|
||||
if let Some(ref marker) = this.marker_fragments.first() {
|
||||
match marker.style().get_list().list_style_type {
|
||||
ListStyleType::Disc |
|
||||
ListStyleType::None |
|
||||
ListStyleType::Circle |
|
||||
ListStyleType::Square |
|
||||
ListStyleType::DisclosureOpen |
|
||||
ListStyleType::DisclosureClosed => {},
|
||||
_ => this
|
||||
.block_flow
|
||||
.base
|
||||
.restyle_damage
|
||||
.insert(ServoRestyleDamage::RESOLVE_GENERATED_CONTENT),
|
||||
}
|
||||
}
|
||||
|
||||
this
|
||||
}
|
||||
|
||||
/// Assign inline size and position for the marker. This is done during the `assign_block_size`
|
||||
/// traversal because floats will impact the marker position. Therefore we need to have already
|
||||
/// called `assign_block_size` on the list item's block flow, in order to know which floats
|
||||
/// impact the position.
|
||||
///
|
||||
/// Per CSS 2.1 § 12.5.1, the marker position is not precisely specified, but it must be on the
|
||||
/// left side of the content (for ltr direction). However, flowing the marker around floats
|
||||
/// matches the rendering of Gecko and Blink.
|
||||
fn assign_marker_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
let base = &self.block_flow.base;
|
||||
let available_rect = base.floats.available_rect(
|
||||
-base.position.size.block,
|
||||
base.position.size.block,
|
||||
base.block_container_inline_size,
|
||||
);
|
||||
let mut marker_inline_start = available_rect
|
||||
.unwrap_or(self.block_flow.fragment.border_box)
|
||||
.start
|
||||
.i;
|
||||
|
||||
for marker in self.marker_fragments.iter_mut().rev() {
|
||||
let container_block_size = self
|
||||
.block_flow
|
||||
.explicit_block_containing_size(layout_context.shared_context());
|
||||
marker.assign_replaced_inline_size_if_necessary(
|
||||
base.block_container_inline_size,
|
||||
container_block_size,
|
||||
);
|
||||
|
||||
// Do this now. There's no need to do this in bubble-widths, since markers do not
|
||||
// contribute to the inline size of this flow.
|
||||
let intrinsic_inline_sizes = marker.compute_intrinsic_inline_sizes();
|
||||
|
||||
marker.border_box.size.inline = intrinsic_inline_sizes
|
||||
.content_intrinsic_sizes
|
||||
.preferred_inline_size;
|
||||
marker_inline_start = marker_inline_start - marker.border_box.size.inline;
|
||||
marker.border_box.start.i = marker_inline_start;
|
||||
}
|
||||
}
|
||||
|
||||
fn assign_marker_block_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
// FIXME(pcwalton): Do this during flow construction, like `InlineFlow` does?
|
||||
let marker_line_metrics = with_thread_local_font_context(layout_context, |font_context| {
|
||||
InlineFlow::minimum_line_metrics_for_fragments(
|
||||
&self.marker_fragments,
|
||||
font_context,
|
||||
&*self.block_flow.fragment.style,
|
||||
)
|
||||
});
|
||||
|
||||
for marker in &mut self.marker_fragments {
|
||||
marker.assign_replaced_block_size_if_necessary();
|
||||
let marker_inline_metrics = marker.aligned_inline_metrics(
|
||||
layout_context,
|
||||
&marker_line_metrics,
|
||||
Some(&marker_line_metrics),
|
||||
);
|
||||
marker.border_box.start.b =
|
||||
marker_line_metrics.space_above_baseline - marker_inline_metrics.ascent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for ListItemFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::ListItem
|
||||
}
|
||||
|
||||
fn as_mut_block(&mut self) -> &mut BlockFlow {
|
||||
&mut self.block_flow
|
||||
}
|
||||
|
||||
fn as_block(&self) -> &BlockFlow {
|
||||
&self.block_flow
|
||||
}
|
||||
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
// The marker contributes no intrinsic inline-size, so…
|
||||
self.block_flow.bubble_inline_sizes()
|
||||
}
|
||||
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow.assign_inline_sizes(layout_context);
|
||||
}
|
||||
|
||||
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow.assign_block_size(layout_context);
|
||||
self.assign_marker_inline_sizes(layout_context);
|
||||
self.assign_marker_block_sizes(layout_context);
|
||||
}
|
||||
|
||||
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow
|
||||
.compute_stacking_relative_position(layout_context)
|
||||
}
|
||||
|
||||
fn place_float_if_applicable<'a>(&mut self) {
|
||||
self.block_flow.place_float_if_applicable()
|
||||
}
|
||||
|
||||
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
|
||||
self.block_flow.contains_roots_of_absolute_flow_tree()
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
self.block_flow.is_absolute_containing_block()
|
||||
}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_inline_position_if_necessary(inline_position)
|
||||
}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, block_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_block_position_if_necessary(block_position)
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
|
||||
self.build_display_list_for_list_item(state);
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.block_flow.collect_stacking_contexts(state);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
let mut overflow = self.block_flow.compute_overflow();
|
||||
let flow_size = self
|
||||
.block_flow
|
||||
.base
|
||||
.position
|
||||
.size
|
||||
.to_physical(self.block_flow.base.writing_mode);
|
||||
let relative_containing_block_size = &self
|
||||
.block_flow
|
||||
.base
|
||||
.early_absolute_position_info
|
||||
.relative_containing_block_size;
|
||||
|
||||
for fragment in &self.marker_fragments {
|
||||
overflow.union(&fragment.compute_overflow(&flow_size, &relative_containing_block_size))
|
||||
}
|
||||
overflow
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
self.block_flow.generated_containing_block_size(flow)
|
||||
}
|
||||
|
||||
/// The 'position' property of this flow.
|
||||
fn positioning(&self) -> Position {
|
||||
self.block_flow.positioning()
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
iterator: &mut dyn FragmentBorderBoxIterator,
|
||||
level: i32,
|
||||
stacking_context_position: &Point2D<Au>,
|
||||
) {
|
||||
self.block_flow.iterate_through_fragment_border_boxes(
|
||||
iterator,
|
||||
level,
|
||||
stacking_context_position,
|
||||
);
|
||||
|
||||
for marker in &self.marker_fragments {
|
||||
if iterator.should_process(marker) {
|
||||
iterator.process(
|
||||
marker,
|
||||
level,
|
||||
&marker
|
||||
.stacking_relative_border_box(
|
||||
&self.block_flow.base.stacking_relative_position,
|
||||
&self
|
||||
.block_flow
|
||||
.base
|
||||
.early_absolute_position_info
|
||||
.relative_containing_block_size,
|
||||
self.block_flow
|
||||
.base
|
||||
.early_absolute_position_info
|
||||
.relative_containing_block_mode,
|
||||
CoordinateSystem::Own,
|
||||
)
|
||||
.translate(&stacking_context_position.to_vector()),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment)) {
|
||||
self.block_flow.mutate_fragments(mutator);
|
||||
|
||||
for marker in &mut self.marker_fragments {
|
||||
(*mutator)(marker)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The kind of content that `list-style-type` results in.
|
||||
pub enum ListStyleTypeContent {
|
||||
None,
|
||||
StaticText(char),
|
||||
GeneratedContent(Box<GeneratedContentInfo>),
|
||||
}
|
||||
|
||||
impl ListStyleTypeContent {
|
||||
/// Returns the content to be used for the given value of the `list-style-type` property.
|
||||
pub fn from_list_style_type(list_style_type: ListStyleType) -> ListStyleTypeContent {
|
||||
// Just to keep things simple, use a nonbreaking space (Unicode 0xa0) to provide the marker
|
||||
// separation.
|
||||
match list_style_type {
|
||||
ListStyleType::None => ListStyleTypeContent::None,
|
||||
ListStyleType::Disc |
|
||||
ListStyleType::Circle |
|
||||
ListStyleType::Square |
|
||||
ListStyleType::DisclosureOpen |
|
||||
ListStyleType::DisclosureClosed => {
|
||||
let text = generated_content::static_representation(list_style_type);
|
||||
ListStyleTypeContent::StaticText(text)
|
||||
},
|
||||
_ => ListStyleTypeContent::GeneratedContent(Box::new(GeneratedContentInfo::ListItem)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,378 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! CSS Multi-column layout http://dev.w3.org/csswg/css-multicol/
|
||||
|
||||
use app_units::Au;
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{Flow, FlowClass, FragmentationContext, GetBaseFlow, OpaqueFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::ServoArc;
|
||||
use euclid::{Point2D, Vector2D};
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use style::values::generics::column::ColumnCount;
|
||||
use style::values::Either;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for MulticolFlow {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct MulticolFlow {
|
||||
pub block_flow: BlockFlow,
|
||||
|
||||
/// Length between the inline-start edge of a column and that of the next.
|
||||
/// That is, the used column-width + used column-gap.
|
||||
pub column_pitch: Au,
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for MulticolColumnFlow {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct MulticolColumnFlow {
|
||||
pub block_flow: BlockFlow,
|
||||
}
|
||||
|
||||
impl MulticolFlow {
|
||||
pub fn from_fragment(fragment: Fragment, float_kind: Option<FloatKind>) -> MulticolFlow {
|
||||
MulticolFlow {
|
||||
block_flow: BlockFlow::from_fragment_and_float_kind(fragment, float_kind),
|
||||
column_pitch: Au(0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl MulticolColumnFlow {
|
||||
pub fn from_fragment(fragment: Fragment) -> MulticolColumnFlow {
|
||||
MulticolColumnFlow {
|
||||
block_flow: BlockFlow::from_fragment(fragment),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for MulticolFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::Multicol
|
||||
}
|
||||
|
||||
fn as_mut_block(&mut self) -> &mut BlockFlow {
|
||||
&mut self.block_flow
|
||||
}
|
||||
|
||||
fn as_block(&self) -> &BlockFlow {
|
||||
&self.block_flow
|
||||
}
|
||||
|
||||
fn as_mut_multicol(&mut self) -> &mut MulticolFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
// FIXME(SimonSapin) http://dev.w3.org/csswg/css-sizing/#multicol-intrinsic
|
||||
self.block_flow.bubble_inline_sizes();
|
||||
}
|
||||
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
debug!(
|
||||
"assign_inline_sizes({}): assigning inline_size for flow",
|
||||
"multicol"
|
||||
);
|
||||
let shared_context = layout_context.shared_context();
|
||||
self.block_flow.compute_inline_sizes(shared_context);
|
||||
|
||||
// Move in from the inline-start border edge.
|
||||
let inline_start_content_edge = self.block_flow.fragment.border_box.start.i +
|
||||
self.block_flow.fragment.border_padding.inline_start;
|
||||
|
||||
// Distance from the inline-end margin edge to the inline-end content edge.
|
||||
let inline_end_content_edge = self.block_flow.fragment.margin.inline_end +
|
||||
self.block_flow.fragment.border_padding.inline_end;
|
||||
|
||||
self.block_flow.assign_inline_sizes(layout_context);
|
||||
let padding_and_borders = self.block_flow.fragment.border_padding.inline_start_end();
|
||||
let content_inline_size =
|
||||
self.block_flow.fragment.border_box.size.inline - padding_and_borders;
|
||||
let column_width;
|
||||
{
|
||||
let style = &self.block_flow.fragment.style;
|
||||
let column_gap = match style.get_position().column_gap {
|
||||
Either::First(len) => len.0.to_pixel_length(content_inline_size).into(),
|
||||
Either::Second(_normal) => {
|
||||
self.block_flow.fragment.style.get_font().font_size.size()
|
||||
},
|
||||
};
|
||||
|
||||
let column_style = style.get_column();
|
||||
let mut column_count;
|
||||
if let Either::First(column_width) = column_style.column_width {
|
||||
let column_width = Au::from(column_width);
|
||||
column_count = max(
|
||||
1,
|
||||
(content_inline_size + column_gap).0 / (column_width + column_gap).0,
|
||||
);
|
||||
if let ColumnCount::Integer(specified_column_count) = column_style.column_count {
|
||||
column_count = min(column_count, specified_column_count.0 as i32);
|
||||
}
|
||||
} else {
|
||||
column_count = match column_style.column_count {
|
||||
ColumnCount::Integer(n) => n.0,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
column_width = max(
|
||||
Au(0),
|
||||
(content_inline_size + column_gap) / column_count - column_gap,
|
||||
);
|
||||
self.column_pitch = column_width + column_gap;
|
||||
}
|
||||
|
||||
self.block_flow.fragment.border_box.size.inline = content_inline_size + padding_and_borders;
|
||||
|
||||
self.block_flow.propagate_assigned_inline_size_to_children(
|
||||
shared_context,
|
||||
inline_start_content_edge,
|
||||
inline_end_content_edge,
|
||||
column_width,
|
||||
|_, _, _, _, _, _| {},
|
||||
);
|
||||
}
|
||||
|
||||
fn assign_block_size(&mut self, ctx: &LayoutContext) {
|
||||
debug!("assign_block_size: assigning block_size for multicol");
|
||||
|
||||
let fragmentation_context = Some(FragmentationContext {
|
||||
this_fragment_is_empty: true,
|
||||
available_block_size: {
|
||||
let style = &self.block_flow.fragment.style;
|
||||
if let LengthOrPercentageOrAuto::Length(length) = style.content_block_size() {
|
||||
Au::from(length)
|
||||
} else if let LengthOrPercentageOrNone::Length(length) = style.max_block_size() {
|
||||
Au::from(length)
|
||||
} else {
|
||||
// FIXME: do column balancing instead
|
||||
// FIXME: (until column balancing) substract margins/borders/padding
|
||||
LogicalSize::from_physical(
|
||||
self.block_flow.base.writing_mode,
|
||||
ctx.shared_context().viewport_size(),
|
||||
)
|
||||
.block
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Before layout, everything is in a single "column"
|
||||
assert_eq!(self.block_flow.base.children.len(), 1);
|
||||
let mut column = self.block_flow.base.children.pop_front_arc().unwrap();
|
||||
|
||||
// Pretend there is no children for this:
|
||||
self.block_flow.assign_block_size(ctx);
|
||||
|
||||
loop {
|
||||
let remaining = Arc::get_mut(&mut column)
|
||||
.unwrap()
|
||||
.fragment(ctx, fragmentation_context);
|
||||
self.block_flow.base.children.push_back_arc(column);
|
||||
column = match remaining {
|
||||
Some(remaining) => remaining,
|
||||
None => break,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow
|
||||
.compute_stacking_relative_position(layout_context);
|
||||
let pitch = LogicalSize::new(self.block_flow.base.writing_mode, self.column_pitch, Au(0));
|
||||
let pitch = pitch.to_physical(self.block_flow.base.writing_mode);
|
||||
for (i, child) in self.block_flow.base.children.iter_mut().enumerate() {
|
||||
let point = &mut child.mut_base().stacking_relative_position;
|
||||
*point = *point + Vector2D::new(pitch.width * i as i32, pitch.height * i as i32);
|
||||
}
|
||||
}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_inline_position_if_necessary(inline_position)
|
||||
}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, block_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_block_position_if_necessary(block_position)
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
|
||||
debug!("build_display_list_multicol");
|
||||
self.block_flow.build_display_list(state);
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.block_flow.collect_stacking_contexts(state);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
|
||||
self.block_flow.contains_roots_of_absolute_flow_tree()
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
self.block_flow.is_absolute_containing_block()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
self.block_flow.generated_containing_block_size(flow)
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
iterator: &mut dyn FragmentBorderBoxIterator,
|
||||
level: i32,
|
||||
stacking_context_position: &Point2D<Au>,
|
||||
) {
|
||||
self.block_flow.iterate_through_fragment_border_boxes(
|
||||
iterator,
|
||||
level,
|
||||
stacking_context_position,
|
||||
);
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment)) {
|
||||
self.block_flow.mutate_fragments(mutator);
|
||||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
self.block_flow.print_extra_flow_children(print_tree);
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for MulticolColumnFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::MulticolColumn
|
||||
}
|
||||
|
||||
fn as_mut_block(&mut self) -> &mut BlockFlow {
|
||||
&mut self.block_flow
|
||||
}
|
||||
|
||||
fn as_block(&self) -> &BlockFlow {
|
||||
&self.block_flow
|
||||
}
|
||||
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
self.block_flow.bubble_inline_sizes();
|
||||
}
|
||||
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
debug!(
|
||||
"assign_inline_sizes({}): assigning inline_size for flow",
|
||||
"multicol column"
|
||||
);
|
||||
self.block_flow.assign_inline_sizes(layout_context);
|
||||
}
|
||||
|
||||
fn assign_block_size(&mut self, ctx: &LayoutContext) {
|
||||
debug!("assign_block_size: assigning block_size for multicol column");
|
||||
self.block_flow.assign_block_size(ctx);
|
||||
}
|
||||
|
||||
fn fragment(
|
||||
&mut self,
|
||||
layout_context: &LayoutContext,
|
||||
fragmentation_context: Option<FragmentationContext>,
|
||||
) -> Option<Arc<dyn Flow>> {
|
||||
Flow::fragment(&mut self.block_flow, layout_context, fragmentation_context)
|
||||
}
|
||||
|
||||
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow
|
||||
.compute_stacking_relative_position(layout_context)
|
||||
}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_inline_position_if_necessary(inline_position)
|
||||
}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, block_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_block_position_if_necessary(block_position)
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
|
||||
debug!("build_display_list_multicol column");
|
||||
self.block_flow.build_display_list(state);
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.block_flow.collect_stacking_contexts(state);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
|
||||
self.block_flow.contains_roots_of_absolute_flow_tree()
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
self.block_flow.is_absolute_containing_block()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
self.block_flow.generated_containing_block_size(flow)
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
iterator: &mut dyn FragmentBorderBoxIterator,
|
||||
level: i32,
|
||||
stacking_context_position: &Point2D<Au>,
|
||||
) {
|
||||
self.block_flow.iterate_through_fragment_border_boxes(
|
||||
iterator,
|
||||
level,
|
||||
stacking_context_position,
|
||||
);
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment)) {
|
||||
self.block_flow.mutate_fragments(mutator);
|
||||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
self.block_flow.print_extra_flow_children(print_tree);
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for MulticolFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "MulticolFlow: {:?}", self.block_flow)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for MulticolColumnFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "MulticolColumnFlow: {:?}", self.block_flow)
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ use crate::context::LayoutContext;
|
||||
use crate::display_list::items::{DisplayList, OpaqueNode, ScrollOffsetMap};
|
||||
use crate::display_list::IndexableText;
|
||||
use crate::flow::{Flow, GetBaseFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator};
|
||||
use crate::inline::InlineFragmentNodeFlags;
|
||||
use crate::opaque_node::OpaqueNodeMethods;
|
||||
use crate::sequential;
|
||||
@@ -636,8 +636,6 @@ impl FragmentBorderBoxIterator for ParentOffsetBorderBoxIterator {
|
||||
// 2) Is static position *and* is a table or table cell
|
||||
// 3) Is not static position
|
||||
(true, _, _) |
|
||||
(false, Position::Static, &SpecificFragmentInfo::Table) |
|
||||
(false, Position::Static, &SpecificFragmentInfo::TableCell) |
|
||||
(false, Position::Sticky, _) |
|
||||
(false, Position::Absolute, _) |
|
||||
(false, Position::Relative, _) |
|
||||
@@ -1078,17 +1076,7 @@ fn inner_text_collection_steps<N: LayoutNode>(
|
||||
}
|
||||
|
||||
match display {
|
||||
Display::TableCell if !is_last_table_cell() => {
|
||||
// Step 6.
|
||||
items.push(InnerTextItem::Text(String::from("\u{0009}" /* tab */)));
|
||||
},
|
||||
Display::TableRow if !is_last_table_row() => {
|
||||
// Step 7.
|
||||
items.push(InnerTextItem::Text(String::from(
|
||||
"\u{000A}", /* line feed */
|
||||
)));
|
||||
},
|
||||
Display::Block | Display::Flex | Display::TableCaption | Display::Table => {
|
||||
Display::Block | Display::Flex => {
|
||||
// Step 9.
|
||||
items.insert(0, InnerTextItem::RequiredLineBreakCount(1));
|
||||
items.push(InnerTextItem::RequiredLineBreakCount(1));
|
||||
@@ -1099,13 +1087,3 @@ fn inner_text_collection_steps<N: LayoutNode>(
|
||||
|
||||
results.append(&mut items);
|
||||
}
|
||||
|
||||
fn is_last_table_cell() -> bool {
|
||||
// FIXME(ferjm) Implement this.
|
||||
false
|
||||
}
|
||||
|
||||
fn is_last_table_row() -> bool {
|
||||
// FIXME(ferjm) Implement this.
|
||||
false
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,142 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! CSS table formatting contexts.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
|
||||
use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
|
||||
use crate::flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use euclid::Point2D;
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use std::fmt;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for TableCaptionFlow {}
|
||||
|
||||
/// A table formatting context.
|
||||
#[repr(C)]
|
||||
pub struct TableCaptionFlow {
|
||||
pub block_flow: BlockFlow,
|
||||
}
|
||||
|
||||
impl TableCaptionFlow {
|
||||
pub fn from_fragment(fragment: Fragment) -> TableCaptionFlow {
|
||||
TableCaptionFlow {
|
||||
block_flow: BlockFlow::from_fragment(fragment),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for TableCaptionFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::TableCaption
|
||||
}
|
||||
|
||||
fn as_mut_table_caption(&mut self) -> &mut TableCaptionFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn as_mut_block(&mut self) -> &mut BlockFlow {
|
||||
&mut self.block_flow
|
||||
}
|
||||
|
||||
fn as_block(&self) -> &BlockFlow {
|
||||
&self.block_flow
|
||||
}
|
||||
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
self.block_flow.bubble_inline_sizes();
|
||||
}
|
||||
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
debug!(
|
||||
"assign_inline_sizes({}): assigning inline_size for flow",
|
||||
"table_caption"
|
||||
);
|
||||
self.block_flow.assign_inline_sizes(layout_context);
|
||||
}
|
||||
|
||||
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
|
||||
debug!("assign_block_size: assigning block_size for table_caption");
|
||||
self.block_flow.assign_block_size(layout_context);
|
||||
}
|
||||
|
||||
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow
|
||||
.compute_stacking_relative_position(layout_context)
|
||||
}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_inline_position_if_necessary(inline_position)
|
||||
}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, block_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_block_position_if_necessary(block_position)
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
|
||||
debug!("build_display_list_table_caption: same process as block flow");
|
||||
self.block_flow.build_display_list(state);
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.block_flow
|
||||
.collect_stacking_contexts_for_block(state, StackingContextCollectionFlags::empty());
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
|
||||
self.block_flow.contains_roots_of_absolute_flow_tree()
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
self.block_flow.is_absolute_containing_block()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
self.block_flow.generated_containing_block_size(flow)
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
iterator: &mut dyn FragmentBorderBoxIterator,
|
||||
level: i32,
|
||||
stacking_context_position: &Point2D<Au>,
|
||||
) {
|
||||
self.block_flow.iterate_through_fragment_border_boxes(
|
||||
iterator,
|
||||
level,
|
||||
stacking_context_position,
|
||||
)
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment)) {
|
||||
self.block_flow.mutate_fragments(mutator)
|
||||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
self.block_flow.print_extra_flow_children(print_tree);
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for TableCaptionFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableCaptionFlow: {:?}", self.block_flow)
|
||||
}
|
||||
}
|
||||
@@ -1,498 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! CSS table formatting contexts.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::block::{BlockFlow, ISizeAndMarginsComputer, MarginsMayCollapseFlag};
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
|
||||
use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
|
||||
use crate::flow::{Flow, FlowClass, FlowFlags, GetBaseFlow, OpaqueFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::layout_debug;
|
||||
use crate::model::MaybeAuto;
|
||||
use crate::table::InternalTable;
|
||||
use crate::table_row::{CollapsedBorder, CollapsedBorderProvenance};
|
||||
use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use script_layout_interface::wrapper_traits::ThreadSafeLayoutNode;
|
||||
use std::fmt;
|
||||
use style::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Color;
|
||||
use style::values::generics::box_::VerticalAlign;
|
||||
use style::values::specified::BorderStyle;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for TableCellFlow {}
|
||||
|
||||
/// A table formatting context.
|
||||
#[derive(Serialize)]
|
||||
#[repr(C)]
|
||||
pub struct TableCellFlow {
|
||||
/// Data common to all block flows.
|
||||
pub block_flow: BlockFlow,
|
||||
|
||||
/// Border collapse information for the cell.
|
||||
pub collapsed_borders: CollapsedBordersForCell,
|
||||
|
||||
/// The column span of this cell.
|
||||
pub column_span: u32,
|
||||
|
||||
/// The rows spanned by this cell.
|
||||
pub row_span: u32,
|
||||
|
||||
/// Whether this cell is visible. If false, the value of `empty-cells` means that we must not
|
||||
/// display this cell.
|
||||
pub visible: bool,
|
||||
}
|
||||
|
||||
impl TableCellFlow {
|
||||
pub fn from_fragment(fragment: Fragment) -> TableCellFlow {
|
||||
TableCellFlow {
|
||||
block_flow: BlockFlow::from_fragment(fragment),
|
||||
collapsed_borders: CollapsedBordersForCell::new(),
|
||||
column_span: 1,
|
||||
row_span: 1,
|
||||
visible: true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_node_fragment_and_visibility_flag<N: ThreadSafeLayoutNode>(
|
||||
node: &N,
|
||||
fragment: Fragment,
|
||||
visible: bool,
|
||||
) -> TableCellFlow {
|
||||
TableCellFlow {
|
||||
block_flow: BlockFlow::from_fragment(fragment),
|
||||
collapsed_borders: CollapsedBordersForCell::new(),
|
||||
column_span: node.get_colspan(),
|
||||
row_span: node.get_rowspan(),
|
||||
visible: visible,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fragment(&mut self) -> &Fragment {
|
||||
&self.block_flow.fragment
|
||||
}
|
||||
|
||||
pub fn mut_fragment(&mut self) -> &mut Fragment {
|
||||
&mut self.block_flow.fragment
|
||||
}
|
||||
|
||||
/// Assign block-size for table-cell flow.
|
||||
///
|
||||
/// inline(always) because this is only ever called by in-order or non-in-order top-level
|
||||
/// methods.
|
||||
#[inline(always)]
|
||||
fn assign_block_size_table_cell_base(&mut self, layout_context: &LayoutContext) {
|
||||
let remaining = self.block_flow.assign_block_size_block_base(
|
||||
layout_context,
|
||||
None,
|
||||
MarginsMayCollapseFlag::MarginsMayNotCollapse,
|
||||
);
|
||||
debug_assert!(remaining.is_none());
|
||||
}
|
||||
|
||||
/// Position this cell's children according to vertical-align.
|
||||
pub fn valign_children(&mut self) {
|
||||
// Note to the reader: this code has been tested with negative margins.
|
||||
// We end up with a "end" that's before the "start," but the math still works out.
|
||||
let mut extents = None;
|
||||
for kid in self.base().children.iter() {
|
||||
let kid_base = kid.base();
|
||||
if kid_base.flags.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED) {
|
||||
continue;
|
||||
}
|
||||
let start = kid_base.position.start.b - kid_base
|
||||
.collapsible_margins
|
||||
.block_start_margin_for_noncollapsible_context();
|
||||
let end = kid_base.position.start.b + kid_base.position.size.block + kid_base
|
||||
.collapsible_margins
|
||||
.block_end_margin_for_noncollapsible_context();
|
||||
match extents {
|
||||
Some((ref mut first_start, ref mut last_end)) => {
|
||||
if start < *first_start {
|
||||
*first_start = start
|
||||
}
|
||||
if end > *last_end {
|
||||
*last_end = end
|
||||
}
|
||||
},
|
||||
None => extents = Some((start, end)),
|
||||
}
|
||||
}
|
||||
let (first_start, last_end) = match extents {
|
||||
Some(extents) => extents,
|
||||
None => return,
|
||||
};
|
||||
|
||||
let kids_size = last_end - first_start;
|
||||
let self_size = self.base().position.size.block -
|
||||
self.block_flow.fragment.border_padding.block_start_end();
|
||||
let kids_self_gap = self_size - kids_size;
|
||||
|
||||
// This offset should also account for VerticalAlign::Baseline.
|
||||
// Need max cell ascent from the first row of this cell.
|
||||
let offset = match self.block_flow.fragment.style().get_box().vertical_align {
|
||||
VerticalAlign::Middle => kids_self_gap / 2,
|
||||
VerticalAlign::Bottom => kids_self_gap,
|
||||
_ => Au(0),
|
||||
};
|
||||
if offset == Au(0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for kid in self.mut_base().children.iter_mut() {
|
||||
let kid_base = kid.mut_base();
|
||||
if !kid_base.flags.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED) {
|
||||
kid_base.position.start.b += offset
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Total block size of child
|
||||
//
|
||||
// Call after block size calculation
|
||||
pub fn total_block_size(&mut self) -> Au {
|
||||
// TODO: Percentage block-size
|
||||
let specified = MaybeAuto::from_style(self.fragment().style().content_block_size(), Au(0))
|
||||
.specified_or_zero();
|
||||
specified + self.fragment().border_padding.block_start_end()
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for TableCellFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::TableCell
|
||||
}
|
||||
|
||||
fn as_mut_table_cell(&mut self) -> &mut TableCellFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn as_table_cell(&self) -> &TableCellFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn as_mut_block(&mut self) -> &mut BlockFlow {
|
||||
&mut self.block_flow
|
||||
}
|
||||
|
||||
fn as_block(&self) -> &BlockFlow {
|
||||
&self.block_flow
|
||||
}
|
||||
|
||||
/// Minimum/preferred inline-sizes set by this function are used in automatic table layout
|
||||
/// calculation.
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
let _scope = layout_debug_scope!(
|
||||
"table_cell::bubble_inline_sizes {:x}",
|
||||
self.block_flow.base.debug_id()
|
||||
);
|
||||
|
||||
self.block_flow.bubble_inline_sizes_for_block(true);
|
||||
let specified_inline_size = MaybeAuto::from_style(
|
||||
self.block_flow.fragment.style().content_inline_size(),
|
||||
Au(0),
|
||||
)
|
||||
.specified_or_zero();
|
||||
if self
|
||||
.block_flow
|
||||
.base
|
||||
.intrinsic_inline_sizes
|
||||
.minimum_inline_size <
|
||||
specified_inline_size
|
||||
{
|
||||
self.block_flow
|
||||
.base
|
||||
.intrinsic_inline_sizes
|
||||
.minimum_inline_size = specified_inline_size
|
||||
}
|
||||
if self
|
||||
.block_flow
|
||||
.base
|
||||
.intrinsic_inline_sizes
|
||||
.preferred_inline_size <
|
||||
self.block_flow
|
||||
.base
|
||||
.intrinsic_inline_sizes
|
||||
.minimum_inline_size
|
||||
{
|
||||
self.block_flow
|
||||
.base
|
||||
.intrinsic_inline_sizes
|
||||
.preferred_inline_size = self
|
||||
.block_flow
|
||||
.base
|
||||
.intrinsic_inline_sizes
|
||||
.minimum_inline_size;
|
||||
}
|
||||
}
|
||||
|
||||
/// Recursively (top-down) determines the actual inline-size of child contexts and fragments.
|
||||
/// When called on this context, the context has had its inline-size set by the parent table
|
||||
/// row.
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
let _scope = layout_debug_scope!(
|
||||
"table_cell::assign_inline_sizes {:x}",
|
||||
self.block_flow.base.debug_id()
|
||||
);
|
||||
debug!(
|
||||
"assign_inline_sizes({}): assigning inline_size for flow",
|
||||
"table_cell"
|
||||
);
|
||||
|
||||
let shared_context = layout_context.shared_context();
|
||||
// The position was set to the column inline-size by the parent flow, table row flow.
|
||||
let containing_block_inline_size = self.block_flow.base.block_container_inline_size;
|
||||
|
||||
let inline_size_computer = InternalTable;
|
||||
inline_size_computer.compute_used_inline_size(
|
||||
&mut self.block_flow,
|
||||
shared_context,
|
||||
containing_block_inline_size,
|
||||
);
|
||||
|
||||
let inline_start_content_edge = self.block_flow.fragment.border_box.start.i +
|
||||
self.block_flow.fragment.border_padding.inline_start;
|
||||
let inline_end_content_edge = self.block_flow.base.block_container_inline_size -
|
||||
self.block_flow.fragment.border_padding.inline_start_end() -
|
||||
self.block_flow.fragment.border_box.size.inline;
|
||||
let padding_and_borders = self.block_flow.fragment.border_padding.inline_start_end();
|
||||
let content_inline_size =
|
||||
self.block_flow.fragment.border_box.size.inline - padding_and_borders;
|
||||
|
||||
self.block_flow.propagate_assigned_inline_size_to_children(
|
||||
shared_context,
|
||||
inline_start_content_edge,
|
||||
inline_end_content_edge,
|
||||
content_inline_size,
|
||||
|_, _, _, _, _, _| {},
|
||||
);
|
||||
}
|
||||
|
||||
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
|
||||
debug!("assign_block_size: assigning block_size for table_cell");
|
||||
self.assign_block_size_table_cell_base(layout_context);
|
||||
}
|
||||
|
||||
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow
|
||||
.compute_stacking_relative_position(layout_context)
|
||||
}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_inline_position_if_necessary(inline_position)
|
||||
}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, block_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_block_position_if_necessary(block_position)
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, _: &mut DisplayListBuildState) {
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
// This is handled by TableCellStyleInfo::build_display_list()
|
||||
// when the containing table builds its display list
|
||||
|
||||
// we skip setting the damage in TableCellStyleInfo::build_display_list()
|
||||
// because we only have immutable access
|
||||
self.block_flow
|
||||
.fragment
|
||||
.restyle_damage
|
||||
.remove(ServoRestyleDamage::REPAINT);
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.block_flow
|
||||
.collect_stacking_contexts_for_block(state, StackingContextCollectionFlags::empty());
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
|
||||
self.block_flow.contains_roots_of_absolute_flow_tree()
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
self.block_flow.is_absolute_containing_block()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
self.block_flow.generated_containing_block_size(flow)
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
iterator: &mut dyn FragmentBorderBoxIterator,
|
||||
level: i32,
|
||||
stacking_context_position: &Point2D<Au>,
|
||||
) {
|
||||
self.block_flow.iterate_through_fragment_border_boxes(
|
||||
iterator,
|
||||
level,
|
||||
stacking_context_position,
|
||||
)
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment)) {
|
||||
self.block_flow.mutate_fragments(mutator)
|
||||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
self.block_flow.print_extra_flow_children(print_tree);
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for TableCellFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableCellFlow: {:?}", self.block_flow)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
pub struct CollapsedBordersForCell {
|
||||
pub inline_start_border: CollapsedBorder,
|
||||
pub inline_end_border: CollapsedBorder,
|
||||
pub block_start_border: CollapsedBorder,
|
||||
pub block_end_border: CollapsedBorder,
|
||||
pub inline_start_width: Au,
|
||||
pub inline_end_width: Au,
|
||||
pub block_start_width: Au,
|
||||
pub block_end_width: Au,
|
||||
}
|
||||
|
||||
impl CollapsedBordersForCell {
|
||||
fn new() -> CollapsedBordersForCell {
|
||||
CollapsedBordersForCell {
|
||||
inline_start_border: CollapsedBorder::new(),
|
||||
inline_end_border: CollapsedBorder::new(),
|
||||
block_start_border: CollapsedBorder::new(),
|
||||
block_end_border: CollapsedBorder::new(),
|
||||
inline_start_width: Au(0),
|
||||
inline_end_width: Au(0),
|
||||
block_start_width: Au(0),
|
||||
block_end_width: Au(0),
|
||||
}
|
||||
}
|
||||
|
||||
fn should_paint_inline_start_border(&self) -> bool {
|
||||
self.inline_start_border.provenance != CollapsedBorderProvenance::FromPreviousTableCell
|
||||
}
|
||||
|
||||
fn should_paint_inline_end_border(&self) -> bool {
|
||||
self.inline_end_border.provenance != CollapsedBorderProvenance::FromNextTableCell
|
||||
}
|
||||
|
||||
fn should_paint_block_start_border(&self) -> bool {
|
||||
self.block_start_border.provenance != CollapsedBorderProvenance::FromPreviousTableCell
|
||||
}
|
||||
|
||||
fn should_paint_block_end_border(&self) -> bool {
|
||||
self.block_end_border.provenance != CollapsedBorderProvenance::FromNextTableCell
|
||||
}
|
||||
|
||||
pub fn adjust_border_widths_for_painting(&self, border_widths: &mut LogicalMargin<Au>) {
|
||||
border_widths.inline_start = if !self.should_paint_inline_start_border() {
|
||||
Au(0)
|
||||
} else {
|
||||
self.inline_start_border.width
|
||||
};
|
||||
border_widths.inline_end = if !self.should_paint_inline_end_border() {
|
||||
Au(0)
|
||||
} else {
|
||||
self.inline_end_border.width
|
||||
};
|
||||
border_widths.block_start = if !self.should_paint_block_start_border() {
|
||||
Au(0)
|
||||
} else {
|
||||
self.block_start_border.width
|
||||
};
|
||||
border_widths.block_end = if !self.should_paint_block_end_border() {
|
||||
Au(0)
|
||||
} else {
|
||||
self.block_end_border.width
|
||||
}
|
||||
}
|
||||
|
||||
pub fn adjust_border_bounds_for_painting(
|
||||
&self,
|
||||
border_bounds: &mut Rect<Au>,
|
||||
writing_mode: WritingMode,
|
||||
) {
|
||||
let inline_start_divisor = if self.should_paint_inline_start_border() {
|
||||
2
|
||||
} else {
|
||||
-2
|
||||
};
|
||||
let inline_start_offset =
|
||||
self.inline_start_width / 2 + self.inline_start_border.width / inline_start_divisor;
|
||||
let inline_end_divisor = if self.should_paint_inline_end_border() {
|
||||
2
|
||||
} else {
|
||||
-2
|
||||
};
|
||||
let inline_end_offset =
|
||||
self.inline_end_width / 2 + self.inline_end_border.width / inline_end_divisor;
|
||||
let block_start_divisor = if self.should_paint_block_start_border() {
|
||||
2
|
||||
} else {
|
||||
-2
|
||||
};
|
||||
let block_start_offset =
|
||||
self.block_start_width / 2 + self.block_start_border.width / block_start_divisor;
|
||||
let block_end_divisor = if self.should_paint_block_end_border() {
|
||||
2
|
||||
} else {
|
||||
-2
|
||||
};
|
||||
let block_end_offset =
|
||||
self.block_end_width / 2 + self.block_end_border.width / block_end_divisor;
|
||||
|
||||
// FIXME(pcwalton): Get the real container size.
|
||||
let mut logical_bounds =
|
||||
LogicalRect::from_physical(writing_mode, *border_bounds, Size2D::new(Au(0), Au(0)));
|
||||
logical_bounds.start.i = logical_bounds.start.i - inline_start_offset;
|
||||
logical_bounds.start.b = logical_bounds.start.b - block_start_offset;
|
||||
logical_bounds.size.inline =
|
||||
logical_bounds.size.inline + inline_start_offset + inline_end_offset;
|
||||
logical_bounds.size.block =
|
||||
logical_bounds.size.block + block_start_offset + block_end_offset;
|
||||
*border_bounds = logical_bounds.to_physical(writing_mode, Size2D::new(Au(0), Au(0)))
|
||||
}
|
||||
|
||||
pub fn adjust_border_colors_and_styles_for_painting(
|
||||
&self,
|
||||
border_colors: &mut SideOffsets2D<Color>,
|
||||
border_styles: &mut SideOffsets2D<BorderStyle>,
|
||||
writing_mode: WritingMode,
|
||||
) {
|
||||
let logical_border_colors = LogicalMargin::new(
|
||||
writing_mode,
|
||||
self.block_start_border.color,
|
||||
self.inline_end_border.color,
|
||||
self.block_end_border.color,
|
||||
self.inline_start_border.color,
|
||||
);
|
||||
*border_colors = logical_border_colors.to_physical(writing_mode);
|
||||
|
||||
let logical_border_styles = LogicalMargin::new(
|
||||
writing_mode,
|
||||
self.block_start_border.style,
|
||||
self.inline_end_border.style,
|
||||
self.block_end_border.style,
|
||||
self.inline_start_border.style,
|
||||
);
|
||||
*border_styles = logical_border_styles.to_physical(writing_mode);
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! CSS table formatting contexts.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::flow::{BaseFlow, Flow, FlowClass, ForceNonfloatedFlag, OpaqueFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::layout_debug;
|
||||
use euclid::Point2D;
|
||||
use std::fmt;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for TableColGroupFlow {}
|
||||
|
||||
/// A table formatting context.
|
||||
#[repr(C)]
|
||||
pub struct TableColGroupFlow {
|
||||
/// Data common to all flows.
|
||||
pub base: BaseFlow,
|
||||
|
||||
/// The associated fragment.
|
||||
pub fragment: Option<Fragment>,
|
||||
|
||||
/// The table column fragments
|
||||
pub cols: Vec<Fragment>,
|
||||
|
||||
/// The specified inline-sizes of table columns. (We use `LengthOrPercentageOrAuto` here in
|
||||
/// lieu of `ColumnInlineSize` because column groups do not establish minimum or preferred
|
||||
/// inline sizes.)
|
||||
pub inline_sizes: Vec<LengthOrPercentageOrAuto>,
|
||||
}
|
||||
|
||||
impl TableColGroupFlow {
|
||||
pub fn from_fragments(fragment: Fragment, fragments: Vec<Fragment>) -> TableColGroupFlow {
|
||||
let writing_mode = fragment.style().writing_mode;
|
||||
TableColGroupFlow {
|
||||
base: BaseFlow::new(
|
||||
Some(fragment.style()),
|
||||
writing_mode,
|
||||
ForceNonfloatedFlag::ForceNonfloated,
|
||||
),
|
||||
fragment: Some(fragment),
|
||||
cols: fragments,
|
||||
inline_sizes: vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for TableColGroupFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::TableColGroup
|
||||
}
|
||||
|
||||
fn as_mut_table_colgroup(&mut self) -> &mut TableColGroupFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn as_table_colgroup(&self) -> &TableColGroupFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
let _scope = layout_debug_scope!(
|
||||
"table_colgroup::bubble_inline_sizes {:x}",
|
||||
self.base.debug_id()
|
||||
);
|
||||
|
||||
for fragment in &self.cols {
|
||||
// Retrieve the specified value from the appropriate CSS property.
|
||||
let inline_size = fragment.style().content_inline_size();
|
||||
for _ in 0..fragment.column_span() {
|
||||
self.inline_sizes.push(inline_size)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Table column inline-sizes are assigned in the table flow and propagated to table row flows
|
||||
/// and/or rowgroup flows. Therefore, table colgroup flows do not need to assign inline-sizes.
|
||||
fn assign_inline_sizes(&mut self, _: &LayoutContext) {}
|
||||
|
||||
/// Table columns do not have block-size.
|
||||
fn assign_block_size(&mut self, _: &LayoutContext) {}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, _: Au) {}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, _: Au) {}
|
||||
|
||||
// Table columns are invisible.
|
||||
fn build_display_list(&mut self, _: &mut DisplayListBuildState) {}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.base.stacking_context_id = state.current_stacking_context_id;
|
||||
self.base.clipping_and_scrolling = Some(state.current_clipping_and_scrolling);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, _: &crate::ServoArc<ComputedValues>) {}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
Overflow::new()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, _: OpaqueFlow) -> LogicalSize<Au> {
|
||||
panic!("Table column groups can't be containing blocks!")
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
_: &mut dyn FragmentBorderBoxIterator,
|
||||
_: i32,
|
||||
_: &Point2D<Au>,
|
||||
) {
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, _: &mut dyn FnMut(&mut Fragment)) {}
|
||||
}
|
||||
|
||||
impl fmt::Debug for TableColGroupFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self.fragment {
|
||||
Some(ref rb) => write!(f, "TableColGroupFlow: {:?}", rb),
|
||||
None => write!(f, "TableColGroupFlow"),
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,273 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
//! CSS table formatting contexts.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::block::{BlockFlow, ISizeAndMarginsComputer};
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{BlockFlowDisplayListBuilding, DisplayListBuildState};
|
||||
use crate::display_list::{StackingContextCollectionFlags, StackingContextCollectionState};
|
||||
use crate::flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::layout_debug;
|
||||
use crate::table::{ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
|
||||
use euclid::Point2D;
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use serde::{Serialize, Serializer};
|
||||
use std::fmt;
|
||||
use std::iter::{IntoIterator, Iterator, Peekable};
|
||||
use style::computed_values::{border_collapse, border_spacing};
|
||||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for TableRowGroupFlow {}
|
||||
|
||||
/// A table formatting context.
|
||||
#[repr(C)]
|
||||
pub struct TableRowGroupFlow {
|
||||
/// Fields common to all block flows.
|
||||
pub block_flow: BlockFlow,
|
||||
|
||||
/// Information about the intrinsic inline-sizes of each column.
|
||||
pub column_intrinsic_inline_sizes: Vec<ColumnIntrinsicInlineSize>,
|
||||
|
||||
/// The spacing for this rowgroup.
|
||||
pub spacing: border_spacing::T,
|
||||
|
||||
/// The final width of the borders in the inline direction for each cell, computed by the
|
||||
/// entire table and pushed down into each row during inline size computation.
|
||||
pub collapsed_inline_direction_border_widths_for_table: Vec<Au>,
|
||||
|
||||
/// The final width of the borders in the block direction for each cell, computed by the
|
||||
/// entire table and pushed down into each row during inline size computation.
|
||||
pub collapsed_block_direction_border_widths_for_table: Vec<Au>,
|
||||
}
|
||||
|
||||
impl Serialize for TableRowGroupFlow {
|
||||
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
self.block_flow.serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
||||
impl TableRowGroupFlow {
|
||||
pub fn from_fragment(fragment: Fragment) -> TableRowGroupFlow {
|
||||
TableRowGroupFlow {
|
||||
block_flow: BlockFlow::from_fragment(fragment),
|
||||
column_intrinsic_inline_sizes: Vec::new(),
|
||||
spacing: border_spacing::T::zero(),
|
||||
collapsed_inline_direction_border_widths_for_table: Vec::new(),
|
||||
collapsed_block_direction_border_widths_for_table: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn populate_collapsed_border_spacing<'a, I>(
|
||||
&mut self,
|
||||
collapsed_inline_direction_border_widths_for_table: &[Au],
|
||||
collapsed_block_direction_border_widths_for_table: &mut Peekable<I>,
|
||||
) where
|
||||
I: Iterator<Item = &'a Au>,
|
||||
{
|
||||
self.collapsed_inline_direction_border_widths_for_table
|
||||
.clear();
|
||||
self.collapsed_inline_direction_border_widths_for_table
|
||||
.extend(
|
||||
collapsed_inline_direction_border_widths_for_table
|
||||
.into_iter()
|
||||
.map(|x| *x),
|
||||
);
|
||||
|
||||
for _ in 0..self.block_flow.base.children.len() {
|
||||
if let Some(collapsed_block_direction_border_width_for_table) =
|
||||
collapsed_block_direction_border_widths_for_table.next()
|
||||
{
|
||||
self.collapsed_block_direction_border_widths_for_table
|
||||
.push(*collapsed_block_direction_border_width_for_table)
|
||||
}
|
||||
}
|
||||
if let Some(collapsed_block_direction_border_width_for_table) =
|
||||
collapsed_block_direction_border_widths_for_table.peek()
|
||||
{
|
||||
self.collapsed_block_direction_border_widths_for_table
|
||||
.push(**collapsed_block_direction_border_width_for_table)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Flow for TableRowGroupFlow {
|
||||
fn class(&self) -> FlowClass {
|
||||
FlowClass::TableRowGroup
|
||||
}
|
||||
|
||||
fn as_mut_table_rowgroup(&mut self) -> &mut TableRowGroupFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn as_table_rowgroup(&self) -> &TableRowGroupFlow {
|
||||
self
|
||||
}
|
||||
|
||||
fn as_mut_block(&mut self) -> &mut BlockFlow {
|
||||
&mut self.block_flow
|
||||
}
|
||||
|
||||
fn as_block(&self) -> &BlockFlow {
|
||||
&self.block_flow
|
||||
}
|
||||
|
||||
fn bubble_inline_sizes(&mut self) {
|
||||
let _scope = layout_debug_scope!(
|
||||
"table_rowgroup::bubble_inline_sizes {:x}",
|
||||
self.block_flow.base.debug_id()
|
||||
);
|
||||
// Proper calculation of intrinsic sizes in table layout requires access to the entire
|
||||
// table, which we don't have yet. Defer to our parent.
|
||||
}
|
||||
|
||||
/// Recursively (top-down) determines the actual inline-size of child contexts and fragments.
|
||||
/// When called on this context, the context has had its inline-size set by the parent context.
|
||||
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
|
||||
let _scope = layout_debug_scope!(
|
||||
"table_rowgroup::assign_inline_sizes {:x}",
|
||||
self.block_flow.base.debug_id()
|
||||
);
|
||||
debug!(
|
||||
"assign_inline_sizes({}): assigning inline_size for flow",
|
||||
"table_rowgroup"
|
||||
);
|
||||
|
||||
let shared_context = layout_context.shared_context();
|
||||
// The position was set to the containing block by the flow's parent.
|
||||
let containing_block_inline_size = self.block_flow.base.block_container_inline_size;
|
||||
let (inline_start_content_edge, inline_end_content_edge) = (Au(0), Au(0));
|
||||
let content_inline_size = containing_block_inline_size;
|
||||
|
||||
let border_collapse = self
|
||||
.block_flow
|
||||
.fragment
|
||||
.style
|
||||
.get_inherited_table()
|
||||
.border_collapse;
|
||||
let inline_size_computer = InternalTable;
|
||||
inline_size_computer.compute_used_inline_size(
|
||||
&mut self.block_flow,
|
||||
shared_context,
|
||||
containing_block_inline_size,
|
||||
);
|
||||
|
||||
let collapsed_inline_direction_border_widths_for_table =
|
||||
&self.collapsed_inline_direction_border_widths_for_table;
|
||||
let mut collapsed_block_direction_border_widths_for_table = self
|
||||
.collapsed_block_direction_border_widths_for_table
|
||||
.iter()
|
||||
.peekable();
|
||||
self.block_flow.propagate_assigned_inline_size_to_children(
|
||||
shared_context,
|
||||
inline_start_content_edge,
|
||||
inline_end_content_edge,
|
||||
content_inline_size,
|
||||
|child_flow,
|
||||
_child_index,
|
||||
_content_inline_size,
|
||||
_writing_mode,
|
||||
_inline_start_margin_edge,
|
||||
_inline_end_margin_edge| {
|
||||
if border_collapse == border_collapse::T::Collapse {
|
||||
let child_table_row = child_flow.as_mut_table_row();
|
||||
child_table_row.populate_collapsed_border_spacing(
|
||||
collapsed_inline_direction_border_widths_for_table,
|
||||
&mut collapsed_block_direction_border_widths_for_table,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
fn assign_block_size(&mut self, lc: &LayoutContext) {
|
||||
debug!("assign_block_size: assigning block_size for table_rowgroup");
|
||||
self.block_flow
|
||||
.assign_block_size_for_table_like_flow(self.spacing.vertical(), lc);
|
||||
}
|
||||
|
||||
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
|
||||
self.block_flow
|
||||
.compute_stacking_relative_position(layout_context)
|
||||
}
|
||||
|
||||
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_inline_position_if_necessary(inline_position)
|
||||
}
|
||||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, block_position: Au) {
|
||||
self.block_flow
|
||||
.update_late_computed_block_position_if_necessary(block_position)
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, _: &mut DisplayListBuildState) {
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
|
||||
// we skip setting the damage in TableCellStyleInfo::build_display_list()
|
||||
// because we only have immutable access
|
||||
self.block_flow
|
||||
.fragment
|
||||
.restyle_damage
|
||||
.remove(ServoRestyleDamage::REPAINT);
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self, state: &mut StackingContextCollectionState) {
|
||||
self.block_flow.collect_stacking_contexts_for_block(
|
||||
state,
|
||||
StackingContextCollectionFlags::POSITION_NEVER_CREATES_CONTAINING_BLOCK,
|
||||
);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
fn compute_overflow(&self) -> Overflow {
|
||||
self.block_flow.compute_overflow()
|
||||
}
|
||||
|
||||
fn contains_roots_of_absolute_flow_tree(&self) -> bool {
|
||||
self.block_flow.contains_roots_of_absolute_flow_tree()
|
||||
}
|
||||
|
||||
fn is_absolute_containing_block(&self) -> bool {
|
||||
self.block_flow.is_absolute_containing_block()
|
||||
}
|
||||
|
||||
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
|
||||
self.block_flow.generated_containing_block_size(flow)
|
||||
}
|
||||
|
||||
fn iterate_through_fragment_border_boxes(
|
||||
&self,
|
||||
iterator: &mut dyn FragmentBorderBoxIterator,
|
||||
level: i32,
|
||||
stacking_context_position: &Point2D<Au>,
|
||||
) {
|
||||
self.block_flow.iterate_through_fragment_border_boxes(
|
||||
iterator,
|
||||
level,
|
||||
stacking_context_position,
|
||||
)
|
||||
}
|
||||
|
||||
fn mutate_fragments(&mut self, mutator: &mut dyn FnMut(&mut Fragment)) {
|
||||
self.block_flow.mutate_fragments(mutator)
|
||||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
self.block_flow.print_extra_flow_children(print_tree);
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for TableRowGroupFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "TableRowGroupFlow: {:?}", self.block_flow)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ metrics = {path = "../metrics"}
|
||||
msg = {path = "../msg"}
|
||||
net_traits = {path = "../net_traits"}
|
||||
profile_traits = {path = "../profile_traits"}
|
||||
script_layout_interface = {path = "../script_layout_interface"}
|
||||
script_traits = {path = "../script_traits"}
|
||||
servo_url = {path = "../url"}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
||||
@@ -16,9 +16,11 @@ use metrics::PaintTimeMetrics;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use msg::constellation_msg::TopLevelBrowsingContextId;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use profile_traits::{mem, time};
|
||||
use profile_traits::mem::ProfilerChan as MemProfilerSender;
|
||||
use profile_traits::time::ProfilerChan as TimeProfilerSender;
|
||||
use script_layout_interface::message::Msg;
|
||||
use script_traits::LayoutMsg as ConstellationMsg;
|
||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg};
|
||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutPerThreadInfo};
|
||||
use servo_url::ServoUrl;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -26,23 +28,16 @@ use std::sync::Arc;
|
||||
// Here to remove the compositor -> layout dependency
|
||||
pub trait LayoutThreadFactory {
|
||||
type Message;
|
||||
fn create(
|
||||
id: PipelineId,
|
||||
top_level_browsing_context_id: TopLevelBrowsingContextId,
|
||||
url: ServoUrl,
|
||||
is_iframe: bool,
|
||||
chan: (Sender<Self::Message>, Receiver<Self::Message>),
|
||||
pipeline_port: IpcReceiver<LayoutControlMsg>,
|
||||
constellation_chan: IpcSender<ConstellationMsg>,
|
||||
script_chan: IpcSender<ConstellationControlMsg>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
font_cache_thread: FontCacheThread,
|
||||
time_profiler_chan: time::ProfilerChan,
|
||||
mem_profiler_chan: mem::ProfilerChan,
|
||||
content_process_shutdown_chan: Option<IpcSender<()>>,
|
||||
webrender_api_sender: webrender_api::RenderApiSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
layout_threads: usize,
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
);
|
||||
fn create(thread_info: LayoutPerThreadInfo<Self::Message, PaintTimeMetrics>,
|
||||
global_info: LayoutGlobalInfo);
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LayoutGlobalInfo {
|
||||
pub top_level_context_id: TopLevelBrowsingContextId,
|
||||
pub font_cache_thread: FontCacheThread,
|
||||
pub time_profiler_sender: TimeProfilerSender,
|
||||
pub mem_profiler_sender: MemProfilerSender,
|
||||
pub webrender_api_sender: webrender_api::RenderApiSender,
|
||||
pub webrender_document: webrender_api::DocumentId,
|
||||
}
|
||||
|
||||
@@ -2366,7 +2366,8 @@ impl Document {
|
||||
return vec![];
|
||||
};
|
||||
|
||||
self.window.layout().nodes_from_point_response()
|
||||
// TODO(pcwalton)
|
||||
return vec![];
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#look-up-a-custom-element-definition>
|
||||
|
||||
@@ -467,7 +467,9 @@ impl HTMLElementMethods for HTMLElement {
|
||||
window.layout_reflow(QueryMsg::ElementInnerTextQuery(
|
||||
node.to_trusted_node_address(),
|
||||
));
|
||||
DOMString::from(window.layout().element_inner_text())
|
||||
|
||||
// TODO(pcwalton)
|
||||
DOMString::from("")
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#the-innertext-idl-attribute
|
||||
|
||||
@@ -93,7 +93,8 @@ use num_traits::ToPrimitive;
|
||||
use profile_traits::ipc as ProfiledIpc;
|
||||
use profile_traits::mem::ProfilerChan as MemProfilerChan;
|
||||
use profile_traits::time::ProfilerChan as TimeProfilerChan;
|
||||
use script_layout_interface::message::{Msg, QueryMsg, Reflow, ReflowGoal, ScriptReflow};
|
||||
use script_layout_interface::message::{Msg, QueryMsg, Reflow, ReflowComplete};
|
||||
use script_layout_interface::message::{ReflowGoal, ScriptReflow};
|
||||
use script_layout_interface::reporter::CSSErrorReporter;
|
||||
use script_layout_interface::rpc::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC};
|
||||
use script_layout_interface::rpc::{
|
||||
@@ -213,10 +214,6 @@ pub struct Window {
|
||||
#[ignore_malloc_size_of = "channels are hard"]
|
||||
layout_chan: Sender<Msg>,
|
||||
|
||||
/// A handle to perform RPC calls into the layout, quickly.
|
||||
#[ignore_malloc_size_of = "trait objects are hard"]
|
||||
layout_rpc: Box<LayoutRPC + Send + 'static>,
|
||||
|
||||
/// The current size of the window, in pixels.
|
||||
window_size: Cell<Option<WindowSizeData>>,
|
||||
|
||||
@@ -1426,7 +1423,11 @@ impl Window {
|
||||
let complete = match join_port.try_recv() {
|
||||
Err(TryRecvError::Empty) => {
|
||||
info!("script: waiting on layout");
|
||||
join_port.recv().unwrap()
|
||||
// TODO(pcwalton)
|
||||
ReflowComplete {
|
||||
pending_images: vec![],
|
||||
newly_transitioning_nodes: vec![],
|
||||
}
|
||||
},
|
||||
Ok(reflow_complete) => reflow_complete,
|
||||
Err(TryRecvError::Disconnected) => {
|
||||
@@ -1509,12 +1510,8 @@ impl Window {
|
||||
// If window_size is `None`, we don't reflow, so the document stays
|
||||
// dirty. Otherwise, we shouldn't need a reflow immediately after a
|
||||
// reflow, except if we're waiting for a deferred paint.
|
||||
assert!(
|
||||
!self.Document().needs_reflow() ||
|
||||
(!for_display && self.Document().needs_paint()) ||
|
||||
self.window_size.get().is_none() ||
|
||||
self.suppress_reflow.get()
|
||||
);
|
||||
//
|
||||
// TODO(pcwalton)
|
||||
} else {
|
||||
debug!(
|
||||
"Document doesn't need reflow - skipping it (reason {:?})",
|
||||
@@ -1563,38 +1560,36 @@ impl Window {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn layout(&self) -> &dyn LayoutRPC {
|
||||
&*self.layout_rpc
|
||||
}
|
||||
|
||||
pub fn content_box_query(&self, content_box_request: TrustedNodeAddress) -> Option<Rect<Au>> {
|
||||
if !self.layout_reflow(QueryMsg::ContentBoxQuery(content_box_request)) {
|
||||
return None;
|
||||
}
|
||||
let ContentBoxResponse(rect) = self.layout_rpc.content_box();
|
||||
rect
|
||||
// TODO(pcwalton)
|
||||
return None;
|
||||
}
|
||||
|
||||
pub fn content_boxes_query(&self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>> {
|
||||
if !self.layout_reflow(QueryMsg::ContentBoxesQuery(content_boxes_request)) {
|
||||
return vec![];
|
||||
}
|
||||
let ContentBoxesResponse(rects) = self.layout_rpc.content_boxes();
|
||||
rects
|
||||
// TODO(pcwalton)
|
||||
return vec![];
|
||||
}
|
||||
|
||||
pub fn client_rect_query(&self, node_geometry_request: TrustedNodeAddress) -> Rect<i32> {
|
||||
if !self.layout_reflow(QueryMsg::NodeGeometryQuery(node_geometry_request)) {
|
||||
return Rect::zero();
|
||||
}
|
||||
self.layout_rpc.node_geometry().client_rect
|
||||
// TODO(pcwalton)
|
||||
return Rect::zero();
|
||||
}
|
||||
|
||||
pub fn scroll_area_query(&self, node: TrustedNodeAddress) -> Rect<i32> {
|
||||
if !self.layout_reflow(QueryMsg::NodeScrollGeometryQuery(node)) {
|
||||
return Rect::zero();
|
||||
}
|
||||
self.layout_rpc.node_scroll_area().client_rect
|
||||
// TODO(pcwalton)
|
||||
return Rect::zero();
|
||||
}
|
||||
|
||||
pub fn scroll_offset_query(&self, node: &Node) -> Vector2D<f32> {
|
||||
@@ -1622,16 +1617,7 @@ impl Window {
|
||||
Vector2D::new(x_ as f32, y_ as f32),
|
||||
);
|
||||
|
||||
let NodeScrollIdResponse(scroll_id) = self.layout_rpc.node_scroll_id();
|
||||
|
||||
// Step 12
|
||||
self.perform_a_scroll(
|
||||
x_.to_f32().unwrap_or(0.0f32),
|
||||
y_.to_f32().unwrap_or(0.0f32),
|
||||
scroll_id,
|
||||
behavior,
|
||||
None,
|
||||
);
|
||||
// TODO(pcwalton)
|
||||
}
|
||||
|
||||
pub fn resolved_style_query(
|
||||
@@ -1643,8 +1629,8 @@ impl Window {
|
||||
if !self.layout_reflow(QueryMsg::ResolvedStyleQuery(element, pseudo, property)) {
|
||||
return DOMString::new();
|
||||
}
|
||||
let ResolvedStyleResponse(resolved) = self.layout_rpc.resolved_style();
|
||||
DOMString::from(resolved)
|
||||
// TODO(pcwalton)
|
||||
return DOMString::new();
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
@@ -1656,21 +1642,16 @@ impl Window {
|
||||
return (None, Rect::zero());
|
||||
}
|
||||
|
||||
let response = self.layout_rpc.offset_parent();
|
||||
let js_runtime = self.js_runtime.borrow();
|
||||
let js_runtime = js_runtime.as_ref().unwrap();
|
||||
let element = response.node_address.and_then(|parent_node_address| {
|
||||
let node = unsafe { from_untrusted_node_address(js_runtime.rt(), parent_node_address) };
|
||||
DomRoot::downcast(node)
|
||||
});
|
||||
(element, response.rect)
|
||||
// TODO(pcwalton)
|
||||
return (None, Rect::zero());
|
||||
}
|
||||
|
||||
pub fn style_query(&self, node: TrustedNodeAddress) -> Option<servo_arc::Arc<ComputedValues>> {
|
||||
if !self.layout_reflow(QueryMsg::StyleQuery(node)) {
|
||||
return None;
|
||||
}
|
||||
self.layout_rpc.style().0
|
||||
// TODO(pcwalton)
|
||||
return None;
|
||||
}
|
||||
|
||||
pub fn text_index_query(
|
||||
@@ -1681,7 +1662,8 @@ impl Window {
|
||||
if !self.layout_reflow(QueryMsg::TextIndexQuery(node, point_in_node)) {
|
||||
return TextIndexResponse(None);
|
||||
}
|
||||
self.layout_rpc.text_index()
|
||||
// TODO(pcwalton)
|
||||
return TextIndexResponse(None);
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
@@ -2027,11 +2009,6 @@ impl Window {
|
||||
webrender_document: DocumentId,
|
||||
webrender_api_sender: RenderApiSender,
|
||||
) -> DomRoot<Self> {
|
||||
let layout_rpc: Box<dyn LayoutRPC + Send> = {
|
||||
let (rpc_send, rpc_recv) = unbounded();
|
||||
layout_chan.send(Msg::GetRPC(rpc_send)).unwrap();
|
||||
rpc_recv.recv().unwrap()
|
||||
};
|
||||
let error_reporter = CSSErrorReporter {
|
||||
pipelineid,
|
||||
script_chan: Arc::new(Mutex::new(control_chan)),
|
||||
@@ -2074,7 +2051,6 @@ impl Window {
|
||||
page_clip_rect: Cell::new(MaxRect::max_rect()),
|
||||
resize_event: Default::default(),
|
||||
layout_chan,
|
||||
layout_rpc,
|
||||
window_size: Cell::new(window_size),
|
||||
current_viewport: Cell::new(Rect::zero()),
|
||||
suppress_reflow: Cell::new(true),
|
||||
|
||||
@@ -113,14 +113,14 @@ use net_traits::{
|
||||
};
|
||||
use profile_traits::mem::{self as profile_mem, OpaqueSender, ReportsChan};
|
||||
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
||||
use script_layout_interface::message::{self, Msg, NewLayoutThreadInfo, ReflowGoal};
|
||||
use script_layout_interface::message::{self, Msg, ReflowGoal};
|
||||
use script_traits::webdriver_msg::WebDriverScriptCommand;
|
||||
use script_traits::CompositorEvent::{
|
||||
CompositionEvent, KeyboardEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent, TouchEvent,
|
||||
};
|
||||
use script_traits::{CompositorEvent, ConstellationControlMsg};
|
||||
use script_traits::{DiscardBrowsingContext, DocumentActivity, EventResult};
|
||||
use script_traits::{InitialScriptState, JsEvalResult, LayoutMsg, LoadData};
|
||||
use script_traits::{DiscardBrowsingContext, DocumentActivity, EventResult, FrameType};
|
||||
use script_traits::{InitialScriptState, JsEvalResult, LayoutMsg, LayoutPerThreadInfo, LoadData};
|
||||
use script_traits::{MouseButton, MouseEventType, NewLayoutInfo};
|
||||
use script_traits::{Painter, ProgressiveWebMetricType, ScriptMsg, ScriptThreadFactory};
|
||||
use script_traits::{ScriptToConstellationChan, TimerEvent, TimerSchedulerMsg};
|
||||
@@ -1846,20 +1846,23 @@ impl ScriptThread {
|
||||
layout_threads,
|
||||
} = new_layout_info;
|
||||
|
||||
let layout_pair = unbounded();
|
||||
let layout_chan = layout_pair.0.clone();
|
||||
let (script_to_layout_sender, script_to_layout_receiver) = unbounded();
|
||||
|
||||
let msg = message::Msg::CreateLayoutThread(NewLayoutThreadInfo {
|
||||
id: new_pipeline_id,
|
||||
url: load_data.url.clone(),
|
||||
is_parent: false,
|
||||
layout_pair: layout_pair,
|
||||
pipeline_port: pipeline_port,
|
||||
constellation_chan: self.layout_to_constellation_chan.clone(),
|
||||
script_chan: self.control_chan.clone(),
|
||||
// Proxy IPC messages from the pipeline to the layout thread.
|
||||
let pipeline_receiver = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(pipeline_port);
|
||||
|
||||
let msg = message::Msg::CreateLayoutThread(LayoutPerThreadInfo {
|
||||
local_pipeline_id: new_pipeline_id,
|
||||
current_url: load_data.url.clone(),
|
||||
frame_type: FrameType::RootWindow,
|
||||
script_to_layout_sender: script_to_layout_sender.clone(),
|
||||
script_to_layout_receiver,
|
||||
pipeline_receiver,
|
||||
constellation_sender: self.layout_to_constellation_chan.clone(),
|
||||
layout_to_script_sender: self.control_chan.clone(),
|
||||
image_cache: self.image_cache.clone(),
|
||||
content_process_shutdown_chan: content_process_shutdown_chan,
|
||||
layout_threads: layout_threads,
|
||||
content_process_shutdown_sender: content_process_shutdown_chan,
|
||||
layout_thread_count: layout_threads,
|
||||
paint_time_metrics: PaintTimeMetrics::new(
|
||||
new_pipeline_id,
|
||||
self.time_profiler_chan.clone(),
|
||||
@@ -1896,7 +1899,7 @@ impl ScriptThread {
|
||||
top_level_browsing_context_id,
|
||||
parent_info,
|
||||
opener,
|
||||
layout_chan,
|
||||
script_to_layout_sender,
|
||||
window_size,
|
||||
load_data.url.clone(),
|
||||
origin,
|
||||
|
||||
@@ -13,9 +13,9 @@ use metrics::PaintTimeMetrics;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use profile_traits::mem::ReportsChan;
|
||||
use script_traits::Painter;
|
||||
use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg};
|
||||
use script_traits::{ScrollState, UntrustedNodeAddress, WindowSizeData};
|
||||
use script_traits::{LayoutPerThreadInfo, Painter, ScrollState};
|
||||
use script_traits::{UntrustedNodeAddress, WindowSizeData};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
@@ -81,7 +81,7 @@ pub enum Msg {
|
||||
/// Creates a new layout thread.
|
||||
///
|
||||
/// This basically exists to keep the script-layout dependency one-way.
|
||||
CreateLayoutThread(NewLayoutThreadInfo),
|
||||
CreateLayoutThread(LayoutPerThreadInfo<Msg, PaintTimeMetrics>),
|
||||
|
||||
/// Set the final Url.
|
||||
SetFinalUrl(ServoUrl),
|
||||
@@ -205,17 +205,3 @@ pub struct ScriptReflow {
|
||||
/// The number of objects in the dom #10110
|
||||
pub dom_count: u32,
|
||||
}
|
||||
|
||||
pub struct NewLayoutThreadInfo {
|
||||
pub id: PipelineId,
|
||||
pub url: ServoUrl,
|
||||
pub is_parent: bool,
|
||||
pub layout_pair: (Sender<Msg>, Receiver<Msg>),
|
||||
pub pipeline_port: IpcReceiver<LayoutControlMsg>,
|
||||
pub constellation_chan: IpcSender<ConstellationMsg>,
|
||||
pub script_chan: IpcSender<ConstellationControlMsg>,
|
||||
pub image_cache: Arc<dyn ImageCache>,
|
||||
pub content_process_shutdown_chan: Option<IpcSender<()>>,
|
||||
pub layout_threads: usize,
|
||||
pub paint_time_metrics: PaintTimeMetrics,
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#![deny(unsafe_code)]
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![feature(plugin)]
|
||||
#![feature(plugin_registrar)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
@@ -889,3 +889,28 @@ impl ScriptToConstellationChan {
|
||||
self.sender.send((self.pipeline_id, msg))
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(pcwalton): Document.
|
||||
#[allow(missing_docs)]
|
||||
pub struct LayoutPerThreadInfo<M, PTM> {
|
||||
pub local_pipeline_id: PipelineId,
|
||||
pub current_url: ServoUrl,
|
||||
pub layout_thread_count: usize,
|
||||
pub frame_type: FrameType,
|
||||
pub script_to_layout_sender: Sender<M>,
|
||||
pub script_to_layout_receiver: Receiver<M>,
|
||||
pub pipeline_receiver: Receiver<LayoutControlMsg>,
|
||||
pub constellation_sender: IpcSender<LayoutMsg>,
|
||||
pub layout_to_script_sender: IpcSender<ConstellationControlMsg>,
|
||||
pub image_cache: Arc<dyn ImageCache>,
|
||||
pub content_process_shutdown_sender: Option<IpcSender<()>>,
|
||||
pub paint_time_metrics: PTM,
|
||||
}
|
||||
|
||||
// TODO(pcwalton): Document.
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Clone, Copy, PartialEq, Debug)]
|
||||
pub enum FrameType {
|
||||
RootWindow,
|
||||
IFrame,
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void = "1.0.2"
|
||||
[build-dependencies]
|
||||
lazy_static = "1"
|
||||
log = "0.4"
|
||||
bindgen = { version = "0.39", optional = true, default-features = false }
|
||||
bindgen = { version = "0.43", optional = true, default-features = false }
|
||||
regex = {version = "1.0", optional = true}
|
||||
walkdir = "2.1.4"
|
||||
toml = {version = "0.4.5", optional = true, default-features = false}
|
||||
|
||||
@@ -18,6 +18,7 @@ app_units = "0.7"
|
||||
cssparser = "0.25"
|
||||
bitflags = "1.0"
|
||||
euclid = "0.19"
|
||||
ipc-channel = "0.11"
|
||||
malloc_size_of = { path = "../malloc_size_of" }
|
||||
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
|
||||
selectors = { path = "../selectors" }
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
nightly-2018-10-05
|
||||
Reference in New Issue
Block a user