mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Fix gradient position if background-clip is present.
This commit is contained in:
parent
1c4ae53a88
commit
c9461985c1
1 changed files with 9 additions and 6 deletions
|
@ -409,6 +409,7 @@ pub trait FragmentDisplayListBuilding {
|
||||||
state: &mut DisplayListBuildState,
|
state: &mut DisplayListBuildState,
|
||||||
display_list_section: DisplayListSection,
|
display_list_section: DisplayListSection,
|
||||||
absolute_bounds: &Rect<Au>,
|
absolute_bounds: &Rect<Au>,
|
||||||
|
clip_bounds: &Rect<Au>,
|
||||||
clip: &ClippingRegion,
|
clip: &ClippingRegion,
|
||||||
gradient: &Gradient,
|
gradient: &Gradient,
|
||||||
style: &ServoComputedValues);
|
style: &ServoComputedValues);
|
||||||
|
@ -803,6 +804,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
Some(computed::Image::Gradient(ref gradient)) => {
|
Some(computed::Image::Gradient(ref gradient)) => {
|
||||||
self.build_display_list_for_background_gradient(state,
|
self.build_display_list_for_background_gradient(state,
|
||||||
display_list_section,
|
display_list_section,
|
||||||
|
&absolute_bounds,
|
||||||
&bounds,
|
&bounds,
|
||||||
&clip,
|
&clip,
|
||||||
gradient,
|
gradient,
|
||||||
|
@ -1132,18 +1134,19 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
state: &mut DisplayListBuildState,
|
state: &mut DisplayListBuildState,
|
||||||
display_list_section: DisplayListSection,
|
display_list_section: DisplayListSection,
|
||||||
absolute_bounds: &Rect<Au>,
|
absolute_bounds: &Rect<Au>,
|
||||||
|
clip_bounds: &Rect<Au>,
|
||||||
clip: &ClippingRegion,
|
clip: &ClippingRegion,
|
||||||
gradient: &Gradient,
|
gradient: &Gradient,
|
||||||
style: &ServoComputedValues) {
|
style: &ServoComputedValues) {
|
||||||
let mut clip = clip.clone();
|
let mut clip = clip.clone();
|
||||||
clip.intersect_rect(absolute_bounds);
|
clip.intersect_rect(clip_bounds);
|
||||||
|
|
||||||
let border = style.logical_border_width().to_physical(style.writing_mode);
|
let border_padding = self.border_padding.to_physical(style.writing_mode);
|
||||||
let mut bounds = *absolute_bounds;
|
let mut bounds = *absolute_bounds;
|
||||||
bounds.origin.x += border.left;
|
bounds.origin.x = bounds.origin.x + border_padding.left;
|
||||||
bounds.origin.y += border.top;
|
bounds.origin.y = bounds.origin.y + border_padding.top;
|
||||||
bounds.size.width -= border.horizontal();
|
bounds.size.width = bounds.size.width - border_padding.horizontal();
|
||||||
bounds.size.height -= border.vertical();
|
bounds.size.height = bounds.size.height - border_padding.vertical();
|
||||||
|
|
||||||
let base = state.create_base_display_item(&bounds,
|
let base = state.create_base_display_item(&bounds,
|
||||||
&clip,
|
&clip,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue