mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Update WR (reference frames for fixed position elements).
This commit is contained in:
parent
fa32d50c7a
commit
750794eb77
7 changed files with 73 additions and 56 deletions
50
Cargo.lock
generated
50
Cargo.lock
generated
|
@ -283,7 +283,7 @@ dependencies = [
|
||||||
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"offscreen_gl_context 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_config 0.0.1",
|
"servo_config 0.0.1",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -297,7 +297,7 @@ dependencies = [
|
||||||
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -418,8 +418,8 @@ dependencies = [
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender 0.21.0 (git+https://github.com/servo/webrender)",
|
"webrender 0.22.1 (git+https://github.com/servo/webrender)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -452,7 +452,7 @@ dependencies = [
|
||||||
"servo_remutex 0.0.1",
|
"servo_remutex 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"webvr_traits 0.0.1",
|
"webvr_traits 0.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ dependencies = [
|
||||||
"servo_geometry 0.0.1",
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -994,7 +994,7 @@ dependencies = [
|
||||||
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"truetype 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"truetype 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1073,7 +1073,7 @@ dependencies = [
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x11 2.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -1375,7 +1375,7 @@ dependencies = [
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-script 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1415,7 +1415,7 @@ dependencies = [
|
||||||
"servo_geometry 0.0.1",
|
"servo_geometry 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1429,7 +1429,7 @@ dependencies = [
|
||||||
"profile_traits 0.0.1",
|
"profile_traits 0.0.1",
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1514,8 +1514,8 @@ dependencies = [
|
||||||
"style 0.0.1",
|
"style 0.0.1",
|
||||||
"style_traits 0.0.1",
|
"style_traits 0.0.1",
|
||||||
"webdriver_server 0.0.1",
|
"webdriver_server 0.0.1",
|
||||||
"webrender 0.21.0 (git+https://github.com/servo/webrender)",
|
"webrender 0.22.1 (git+https://github.com/servo/webrender)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"webvr 0.0.1",
|
"webvr 0.0.1",
|
||||||
"webvr_traits 0.0.1",
|
"webvr_traits 0.0.1",
|
||||||
]
|
]
|
||||||
|
@ -1662,7 +1662,7 @@ dependencies = [
|
||||||
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1701,7 +1701,7 @@ dependencies = [
|
||||||
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1760,7 +1760,7 @@ dependencies = [
|
||||||
"servo_url 0.0.1",
|
"servo_url 0.0.1",
|
||||||
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2298,7 +2298,7 @@ dependencies = [
|
||||||
"tinyfiledialogs 2.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tinyfiledialogs 2.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"uuid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"webvr 0.0.1",
|
"webvr 0.0.1",
|
||||||
"webvr_traits 0.0.1",
|
"webvr_traits 0.0.1",
|
||||||
"xml5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"xml5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3175,8 +3175,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webrender"
|
name = "webrender"
|
||||||
version = "0.21.0"
|
version = "0.22.1"
|
||||||
source = "git+https://github.com/servo/webrender#040805f31650527311c0a0d58ccf9620b0f3eca9"
|
source = "git+https://github.com/servo/webrender#68f5b72fb3f871f6930c772c7e2705412512dde2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bincode 1.0.0-alpha2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bincode 1.0.0-alpha2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3198,13 +3198,13 @@ dependencies = [
|
||||||
"thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"threadpool 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
"time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webrender_traits"
|
name = "webrender_traits"
|
||||||
version = "0.22.0"
|
version = "0.23.1"
|
||||||
source = "git+https://github.com/servo/webrender#040805f31650527311c0a0d58ccf9620b0f3eca9"
|
source = "git+https://github.com/servo/webrender#68f5b72fb3f871f6930c772c7e2705412512dde2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3228,7 +3228,7 @@ dependencies = [
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"script_traits 0.0.1",
|
"script_traits 0.0.1",
|
||||||
"servo_config 0.0.1",
|
"servo_config 0.0.1",
|
||||||
"webrender_traits 0.22.0 (git+https://github.com/servo/webrender)",
|
"webrender_traits 0.23.1 (git+https://github.com/servo/webrender)",
|
||||||
"webvr_traits 0.0.1",
|
"webvr_traits 0.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3568,8 +3568,8 @@ dependencies = [
|
||||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"
|
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff"
|
||||||
"checksum webdriver 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdc28802daddee94267a657ffeac2593a33881fb7a3a44fedd320b1319efcaf6"
|
"checksum webdriver 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cdc28802daddee94267a657ffeac2593a33881fb7a3a44fedd320b1319efcaf6"
|
||||||
"checksum webrender 0.21.0 (git+https://github.com/servo/webrender)" = "<none>"
|
"checksum webrender 0.22.1 (git+https://github.com/servo/webrender)" = "<none>"
|
||||||
"checksum webrender_traits 0.22.0 (git+https://github.com/servo/webrender)" = "<none>"
|
"checksum webrender_traits 0.23.1 (git+https://github.com/servo/webrender)" = "<none>"
|
||||||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
||||||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
||||||
"checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8"
|
"checksum ws 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "04614a58714f3fd4a8b1da4bcae9f031c532d35988c3d39627619248113f8be8"
|
||||||
|
|
|
@ -182,17 +182,25 @@ impl DisplayList {
|
||||||
*client_point
|
*client_point
|
||||||
} else {
|
} else {
|
||||||
let point = *translated_point - stacking_context.bounds.origin;
|
let point = *translated_point - stacking_context.bounds.origin;
|
||||||
let inv_transform = match stacking_context.transform.inverse() {
|
|
||||||
Some(transform) => transform,
|
match stacking_context.transform {
|
||||||
None => {
|
Some(transform) => {
|
||||||
// If a transform function causes the current transformation matrix of an object
|
let inv_transform = match transform.inverse() {
|
||||||
// to be non-invertible, the object and its content do not get displayed.
|
Some(transform) => transform,
|
||||||
return;
|
None => {
|
||||||
|
// If a transform function causes the current transformation matrix of an object
|
||||||
|
// to be non-invertible, the object and its content do not get displayed.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let frac_point = inv_transform.transform_point(&Point2D::new(point.x.to_f32_px(),
|
||||||
|
point.y.to_f32_px()));
|
||||||
|
Point2D::new(Au::from_f32_px(frac_point.x), Au::from_f32_px(frac_point.y))
|
||||||
}
|
}
|
||||||
};
|
None => {
|
||||||
let frac_point = inv_transform.transform_point(&Point2D::new(point.x.to_f32_px(),
|
point
|
||||||
point.y.to_f32_px()));
|
}
|
||||||
Point2D::new(Au::from_f32_px(frac_point.x), Au::from_f32_px(frac_point.y))
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,10 +368,10 @@ pub struct StackingContext {
|
||||||
pub blend_mode: mix_blend_mode::T,
|
pub blend_mode: mix_blend_mode::T,
|
||||||
|
|
||||||
/// A transform to be applied to this stacking context.
|
/// A transform to be applied to this stacking context.
|
||||||
pub transform: Matrix4D<f32>,
|
pub transform: Option<Matrix4D<f32>>,
|
||||||
|
|
||||||
/// The perspective matrix to be applied to children.
|
/// The perspective matrix to be applied to children.
|
||||||
pub perspective: Matrix4D<f32>,
|
pub perspective: Option<Matrix4D<f32>>,
|
||||||
|
|
||||||
/// Whether this stacking context creates a new 3d rendering context.
|
/// Whether this stacking context creates a new 3d rendering context.
|
||||||
pub establishes_3d_context: bool,
|
pub establishes_3d_context: bool,
|
||||||
|
@ -385,8 +393,8 @@ impl StackingContext {
|
||||||
z_index: i32,
|
z_index: i32,
|
||||||
filters: filter::T,
|
filters: filter::T,
|
||||||
blend_mode: mix_blend_mode::T,
|
blend_mode: mix_blend_mode::T,
|
||||||
transform: Matrix4D<f32>,
|
transform: Option<Matrix4D<f32>>,
|
||||||
perspective: Matrix4D<f32>,
|
perspective: Option<Matrix4D<f32>>,
|
||||||
establishes_3d_context: bool,
|
establishes_3d_context: bool,
|
||||||
scroll_policy: ScrollPolicy,
|
scroll_policy: ScrollPolicy,
|
||||||
parent_scroll_id: ScrollRootId)
|
parent_scroll_id: ScrollRootId)
|
||||||
|
@ -416,8 +424,8 @@ impl StackingContext {
|
||||||
0,
|
0,
|
||||||
filter::T::new(Vec::new()),
|
filter::T::new(Vec::new()),
|
||||||
mix_blend_mode::T::normal,
|
mix_blend_mode::T::normal,
|
||||||
Matrix4D::identity(),
|
None,
|
||||||
Matrix4D::identity(),
|
None,
|
||||||
true,
|
true,
|
||||||
ScrollPolicy::Scrollable,
|
ScrollPolicy::Scrollable,
|
||||||
ScrollRootId::root())
|
ScrollRootId::root())
|
||||||
|
|
|
@ -31,7 +31,7 @@ use app_units::{Au, MAX_AU};
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list_builder::{BorderPaintingMode, DisplayListBuildState, FragmentDisplayListBuilding};
|
use display_list_builder::{BorderPaintingMode, DisplayListBuildState, FragmentDisplayListBuilding};
|
||||||
use display_list_builder::BlockFlowDisplayListBuilding;
|
use display_list_builder::BlockFlowDisplayListBuilding;
|
||||||
use euclid::{Point2D, Rect, Size2D};
|
use euclid::{Matrix4D, Point2D, Rect, Size2D};
|
||||||
use floats::{ClearType, FloatKind, Floats, PlacementInfo};
|
use floats::{ClearType, FloatKind, Floats, PlacementInfo};
|
||||||
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag};
|
use flow::{self, BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag};
|
||||||
use flow::{BLOCK_POSITION_IS_STATIC, CLEARS_LEFT, CLEARS_RIGHT};
|
use flow::{BLOCK_POSITION_IS_STATIC, CLEARS_LEFT, CLEARS_RIGHT};
|
||||||
|
@ -1811,6 +1811,7 @@ impl BlockFlow {
|
||||||
}
|
}
|
||||||
let transform = match self.fragment
|
let transform = match self.fragment
|
||||||
.transform_matrix(&stacking_relative_border_box)
|
.transform_matrix(&stacking_relative_border_box)
|
||||||
|
.unwrap_or(Matrix4D::identity())
|
||||||
.inverse() {
|
.inverse() {
|
||||||
Some(transform) => transform,
|
Some(transform) => transform,
|
||||||
None => {
|
None => {
|
||||||
|
|
|
@ -29,7 +29,7 @@ use app_units::Au;
|
||||||
use block::{BlockFlow, FormattingContextType};
|
use block::{BlockFlow, FormattingContextType};
|
||||||
use context::LayoutContext;
|
use context::LayoutContext;
|
||||||
use display_list_builder::DisplayListBuildState;
|
use display_list_builder::DisplayListBuildState;
|
||||||
use euclid::{Point2D, Size2D};
|
use euclid::{Matrix4D, Point2D, Size2D};
|
||||||
use flex::FlexFlow;
|
use flex::FlexFlow;
|
||||||
use floats::{Floats, SpeculatedFloatPlacement};
|
use floats::{Floats, SpeculatedFloatPlacement};
|
||||||
use flow_list::{FlowList, MutFlowListIterator};
|
use flow_list::{FlowList, MutFlowListIterator};
|
||||||
|
@ -272,7 +272,11 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
||||||
|
|
||||||
// TODO: Take into account 3d transforms, even though it's a fairly
|
// TODO: Take into account 3d transforms, even though it's a fairly
|
||||||
// uncommon case.
|
// uncommon case.
|
||||||
let transform_2d = self.as_block().fragment.transform_matrix(&position).to_2d();
|
let transform_2d = self.as_block()
|
||||||
|
.fragment
|
||||||
|
.transform_matrix(&position)
|
||||||
|
.unwrap_or(Matrix4D::identity())
|
||||||
|
.to_2d();
|
||||||
let transformed_overflow = Overflow {
|
let transformed_overflow = Overflow {
|
||||||
paint: f32_rect_to_au_rect(transform_2d.transform_rect(
|
paint: f32_rect_to_au_rect(transform_2d.transform_rect(
|
||||||
&au_rect_to_f32_rect(overflow.paint))),
|
&au_rect_to_f32_rect(overflow.paint))),
|
||||||
|
|
|
@ -2873,13 +2873,13 @@ impl Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the 4D matrix representing this fragment's transform.
|
/// Returns the 4D matrix representing this fragment's transform.
|
||||||
pub fn transform_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Matrix4D<f32> {
|
pub fn transform_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Option<Matrix4D<f32>> {
|
||||||
let mut transform = Matrix4D::identity();
|
|
||||||
let operations = match self.style.get_box().transform.0 {
|
let operations = match self.style.get_box().transform.0 {
|
||||||
None => return transform,
|
None => return None,
|
||||||
Some(ref operations) => operations,
|
Some(ref operations) => operations,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut transform = Matrix4D::identity();
|
||||||
let transform_origin = &self.style.get_box().transform_origin;
|
let transform_origin = &self.style.get_box().transform_origin;
|
||||||
let transform_origin_x = model::specified(transform_origin.horizontal,
|
let transform_origin_x = model::specified(transform_origin.horizontal,
|
||||||
stacking_relative_border_box.size
|
stacking_relative_border_box.size
|
||||||
|
@ -2928,11 +2928,11 @@ impl Fragment {
|
||||||
transform = transform.pre_mul(&matrix);
|
transform = transform.pre_mul(&matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
pre_transform.pre_mul(&transform).pre_mul(&post_transform)
|
Some(pre_transform.pre_mul(&transform).pre_mul(&post_transform))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the 4D matrix representing this fragment's perspective.
|
/// Returns the 4D matrix representing this fragment's perspective.
|
||||||
pub fn perspective_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Matrix4D<f32> {
|
pub fn perspective_matrix(&self, stacking_relative_border_box: &Rect<Au>) -> Option<Matrix4D<f32>> {
|
||||||
match self.style().get_box().perspective {
|
match self.style().get_box().perspective {
|
||||||
Either::First(length) => {
|
Either::First(length) => {
|
||||||
let perspective_origin = self.style().get_box().perspective_origin;
|
let perspective_origin = self.style().get_box().perspective_origin;
|
||||||
|
@ -2951,10 +2951,10 @@ impl Fragment {
|
||||||
|
|
||||||
let perspective_matrix = create_perspective_matrix(length);
|
let perspective_matrix = create_perspective_matrix(length);
|
||||||
|
|
||||||
pre_transform.pre_mul(&perspective_matrix).pre_mul(&post_transform)
|
Some(pre_transform.pre_mul(&perspective_matrix).pre_mul(&post_transform))
|
||||||
}
|
}
|
||||||
Either::Second(values::None_) => {
|
Either::Second(values::None_) => {
|
||||||
Matrix4D::identity()
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -381,12 +381,19 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
vec![],
|
vec![],
|
||||||
None);
|
None);
|
||||||
|
|
||||||
|
let transform = stacking_context.transform.map(|transform| {
|
||||||
|
LayoutTransform::from_untyped(&transform).into()
|
||||||
|
});
|
||||||
|
let perspective = stacking_context.perspective.map(|perspective| {
|
||||||
|
LayoutTransform::from_untyped(&perspective)
|
||||||
|
});
|
||||||
|
|
||||||
builder.push_stacking_context(stacking_context.scroll_policy,
|
builder.push_stacking_context(stacking_context.scroll_policy,
|
||||||
stacking_context.bounds.to_rectf(),
|
stacking_context.bounds.to_rectf(),
|
||||||
clip,
|
clip,
|
||||||
stacking_context.z_index,
|
stacking_context.z_index,
|
||||||
LayoutTransform::from_untyped(&stacking_context.transform).into(),
|
transform,
|
||||||
LayoutTransform::from_untyped(&stacking_context.perspective),
|
perspective,
|
||||||
stacking_context.blend_mode.to_blend_mode(),
|
stacking_context.blend_mode.to_blend_mode(),
|
||||||
stacking_context.filters.to_filter_ops());
|
stacking_context.filters.to_filter_ops());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[mix-blend-mode-parent-element-overflow-scroll.htm]
|
|
||||||
type: reftest
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue