mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Only apply clip() to positioned elements
This commit is contained in:
parent
0bc10b8073
commit
b026dae8ac
5 changed files with 17 additions and 20 deletions
|
@ -715,6 +715,10 @@ impl BoxFragment {
|
||||||
builder: &mut StackingContextBuilder,
|
builder: &mut StackingContextBuilder,
|
||||||
containing_block_info: &ContainingBlockInfo,
|
containing_block_info: &ContainingBlockInfo,
|
||||||
) {
|
) {
|
||||||
|
let position = self.style.get_box().position;
|
||||||
|
// https://drafts.csswg.org/css2/#clipping
|
||||||
|
// The clip property applies only to absolutely positioned elements
|
||||||
|
if position == ComputedPosition::Absolute || position == ComputedPosition::Fixed {
|
||||||
let clip = self.style.get_effects().clip;
|
let clip = self.style.get_effects().clip;
|
||||||
if let ClipRectOrAuto::Rect(r) = clip {
|
if let ClipRectOrAuto::Rect(r) = clip {
|
||||||
let border_rect = self
|
let border_rect = self
|
||||||
|
@ -730,6 +734,7 @@ impl BoxFragment {
|
||||||
builder.wr.define_clip_rect(&parent, clip_rect);
|
builder.wr.define_clip_rect(&parent, clip_rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn build_scroll_frame_if_necessary<'a>(
|
fn build_scroll_frame_if_necessary<'a>(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[clip-not-absolute-positioned-001.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[clip-not-absolute-positioned-002.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[clip-not-absolute-positioned-003.html]
|
|
||||||
expected: FAIL
|
|
|
@ -1,2 +0,0 @@
|
||||||
[clip-not-absolute-positioned-004.html]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue