mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Use Rect::inner_rect from euclid
Update euclid.
This commit is contained in:
parent
e654afbc3e
commit
5697171ed6
3 changed files with 49 additions and 76 deletions
61
Cargo.lock
generated
61
Cargo.lock
generated
|
@ -94,7 +94,7 @@ version = "0.25.0"
|
|||
source = "git+https://github.com/servo/rust-azure#78f3850ab31c2178d493c1f0fb47fb3d22484a0e"
|
||||
dependencies = [
|
||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo-skia 0.30000010.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -279,7 +279,7 @@ dependencies = [
|
|||
"canvas_traits 0.0.1",
|
||||
"compositing 0.0.1",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -296,7 +296,7 @@ name = "canvas_traits"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
|
@ -437,7 +437,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "compositing"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -470,7 +470,7 @@ dependencies = [
|
|||
"compositing 0.0.1",
|
||||
"debugger 0.0.1",
|
||||
"devtools_traits 0.0.1",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
|
||||
"gfx 0.0.1",
|
||||
"gfx_traits 0.0.1",
|
||||
|
@ -821,10 +821,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "euclid"
|
||||
version = "0.16.0"
|
||||
version = "0.16.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -973,7 +972,7 @@ dependencies = [
|
|||
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fontsan 0.4.0 (git+https://github.com/servo/fontsan)",
|
||||
"freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1337,7 +1336,7 @@ dependencies = [
|
|||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx 0.0.1",
|
||||
"gfx_traits 0.0.1",
|
||||
|
@ -1379,7 +1378,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx 0.0.1",
|
||||
"gfx_traits 0.0.1",
|
||||
|
@ -1486,7 +1485,7 @@ dependencies = [
|
|||
"devtools 0.0.1",
|
||||
"devtools_traits 0.0.1",
|
||||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
|
||||
"gfx 0.0.1",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1553,7 +1552,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashglobe 0.1.0",
|
||||
"mozjs 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1943,7 +1942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gl_generator 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2118,7 +2117,7 @@ version = "0.7.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -2359,7 +2358,7 @@ dependencies = [
|
|||
"dom_struct 0.0.1",
|
||||
"domobject_derive 0.0.1",
|
||||
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2428,7 +2427,7 @@ dependencies = [
|
|||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"canvas_traits 0.0.1",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2465,7 +2464,7 @@ dependencies = [
|
|||
name = "script_tests"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"script 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
|
@ -2480,7 +2479,7 @@ dependencies = [
|
|||
"canvas_traits 0.0.1",
|
||||
"cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"devtools_traits 0.0.1",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gfx_traits 0.0.1",
|
||||
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2578,7 +2577,7 @@ dependencies = [
|
|||
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"browserhtml 0.1.17 (git+https://github.com/browserhtml/browserhtml?branch=crate)",
|
||||
"compositing 0.0.1",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libservo 0.0.1",
|
||||
|
@ -2665,7 +2664,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glx 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2726,7 +2725,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"android_injected_glue 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.14 (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.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2744,7 +2743,7 @@ name = "servo_geometry"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
"webrender_api 0.57.0 (git+https://github.com/servo/webrender)",
|
||||
|
@ -2887,7 +2886,7 @@ dependencies = [
|
|||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fallible 0.0.1",
|
||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashglobe 0.1.0",
|
||||
|
@ -2946,7 +2945,7 @@ dependencies = [
|
|||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2968,7 +2967,7 @@ dependencies = [
|
|||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"malloc_size_of 0.0.1",
|
||||
"malloc_size_of_derive 0.0.1",
|
||||
"selectors 0.19.0",
|
||||
|
@ -2985,7 +2984,7 @@ dependencies = [
|
|||
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"geckoservo 0.0.1",
|
||||
"libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3290,7 +3289,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"image 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3320,7 +3319,7 @@ dependencies = [
|
|||
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gleam 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3347,7 +3346,7 @@ dependencies = [
|
|||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3359,7 +3358,7 @@ name = "webvr"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"canvas_traits 0.0.1",
|
||||
"euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
|
@ -3582,7 +3581,7 @@ dependencies = [
|
|||
"checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180"
|
||||
"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
|
||||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8"
|
||||
"checksum euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "926c639bfdff1f3063f76bb66245f6d2b691aa20fdbaabecc38b2947a13a4eba"
|
||||
"checksum euclid 0.16.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d33ed9630f5f7a86abb0849e96a585922cc5a640478a36f05f74d96a22655f"
|
||||
"checksum expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c470ccb972f2088549b023db8029ed9da9426f5affbf9b62efff7009ab8ed5b1"
|
||||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c"
|
||||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344"
|
||||
|
|
|
@ -16,7 +16,7 @@ app_units = "0.6.1"
|
|||
atomic_refcell = "0.1"
|
||||
bitflags = "1.0"
|
||||
canvas_traits = {path = "../canvas_traits"}
|
||||
euclid = "0.16"
|
||||
euclid = "0.16.4"
|
||||
fnv = "1.0"
|
||||
gfx = {path = "../gfx"}
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
|
|
|
@ -804,31 +804,6 @@ fn build_border_radius_for_inner_rect(
|
|||
calculate_inner_border_radii(radii, border_widths)
|
||||
}
|
||||
|
||||
fn build_inner_border_box_for_border_rect(
|
||||
border_box: &Rect<Au>,
|
||||
style: &ComputedValues,
|
||||
) -> Rect<Au> {
|
||||
let border_widths = style.logical_border_width().to_physical(style.writing_mode);
|
||||
let mut inner_border_box = *border_box;
|
||||
inner_border_box.origin.x += border_widths.left;
|
||||
inner_border_box.origin.y += border_widths.top;
|
||||
inner_border_box.size.width -= border_widths.right + border_widths.left;
|
||||
inner_border_box.size.height -= border_widths.bottom + border_widths.top;
|
||||
inner_border_box
|
||||
}
|
||||
|
||||
/// Subtract offsets from a bounding box.
|
||||
///
|
||||
/// As an example if the bounds are the border-box and the border
|
||||
/// is provided as offsets the result will be the padding-box.
|
||||
fn calculate_inner_bounds(mut bounds: Rect<Au>, offsets: SideOffsets2D<Au>) -> Rect<Au> {
|
||||
bounds.origin.x += offsets.left;
|
||||
bounds.origin.y += offsets.top;
|
||||
bounds.size.width -= offsets.horizontal();
|
||||
bounds.size.height -= offsets.vertical();
|
||||
bounds
|
||||
}
|
||||
|
||||
fn simple_normal_border(color: ColorF, style: webrender_api::BorderStyle) -> NormalBorder {
|
||||
let side = BorderSide { color, style };
|
||||
NormalBorder {
|
||||
|
@ -979,12 +954,12 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
BackgroundClip::BorderBox => {},
|
||||
BackgroundClip::PaddingBox => {
|
||||
let border = style.logical_border_width().to_physical(style.writing_mode);
|
||||
bounds = calculate_inner_bounds(bounds, border);
|
||||
bounds = bounds.inner_rect(border);
|
||||
border_radii = calculate_inner_border_radii(border_radii, border);
|
||||
},
|
||||
BackgroundClip::ContentBox => {
|
||||
let border_padding = self.border_padding.to_physical(style.writing_mode);
|
||||
bounds = calculate_inner_bounds(bounds, border_padding);
|
||||
bounds = bounds.inner_rect(border_padding);
|
||||
border_radii = calculate_inner_border_radii(border_radii, border_padding);
|
||||
},
|
||||
}
|
||||
|
@ -1106,27 +1081,21 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
|
||||
let css_clip = match bg_clip {
|
||||
BackgroundClip::BorderBox => absolute_bounds,
|
||||
BackgroundClip::PaddingBox => calculate_inner_bounds(
|
||||
absolute_bounds,
|
||||
style.logical_border_width().to_physical(style.writing_mode),
|
||||
),
|
||||
BackgroundClip::ContentBox => calculate_inner_bounds(
|
||||
absolute_bounds,
|
||||
self.border_padding.to_physical(style.writing_mode),
|
||||
),
|
||||
BackgroundClip::PaddingBox => absolute_bounds
|
||||
.inner_rect(style.logical_border_width().to_physical(style.writing_mode)),
|
||||
BackgroundClip::ContentBox => {
|
||||
absolute_bounds.inner_rect(self.border_padding.to_physical(style.writing_mode))
|
||||
},
|
||||
};
|
||||
|
||||
let mut bounds = match bg_attachment {
|
||||
BackgroundAttachment::Scroll => match bg_origin {
|
||||
BackgroundOrigin::BorderBox => absolute_bounds,
|
||||
BackgroundOrigin::PaddingBox => calculate_inner_bounds(
|
||||
absolute_bounds,
|
||||
style.logical_border_width().to_physical(style.writing_mode),
|
||||
),
|
||||
BackgroundOrigin::ContentBox => calculate_inner_bounds(
|
||||
absolute_bounds,
|
||||
self.border_padding.to_physical(style.writing_mode),
|
||||
),
|
||||
BackgroundOrigin::PaddingBox => absolute_bounds
|
||||
.inner_rect(style.logical_border_width().to_physical(style.writing_mode)),
|
||||
BackgroundOrigin::ContentBox => {
|
||||
absolute_bounds.inner_rect(self.border_padding.to_physical(style.writing_mode))
|
||||
},
|
||||
},
|
||||
BackgroundAttachment::Fixed => Rect::new(
|
||||
Point2D::origin(),
|
||||
|
@ -2739,7 +2708,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
ScrollSensitivity::ScriptAndInputEvents
|
||||
};
|
||||
|
||||
let clip_rect = build_inner_border_box_for_border_rect(&border_box, &self.fragment.style);
|
||||
let border_widths = self.fragment
|
||||
.style
|
||||
.logical_border_width()
|
||||
.to_physical(self.fragment.style.writing_mode);
|
||||
let clip_rect = border_box.inner_rect(border_widths);
|
||||
|
||||
let mut clip = ClippingRegion::from_rect(clip_rect.to_layout());
|
||||
let radii = build_border_radius_for_inner_rect(&border_box, &self.fragment.style);
|
||||
if !radii.is_zero() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue