Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBackground follow ups #25594
Background follow ups #25594
Conversation
highfive
commented
Jan 24, 2020
|
Heads up! This PR modifies the following files:
|
|
This looks pretty good to me modulo a few small doubts. |
| use style::values::specified::background::BackgroundRepeatKeyword as Repeat; | ||
| use webrender_api::{self as wr, units}; | ||
|
|
||
| pub(super) struct Layer { |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 24, 2020
Member
Layer is pretty overloaded name. Maybe something like BackgroundLayer would be a bit less opaque?
This comment has been minimized.
This comment has been minimized.
|
|
||
| /// Abstract over the horizontal or vertical dimension | ||
| /// Coordinates (0, 0) for the purpose of this function are the positioning area’s origin. | ||
| fn layout_1d( |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 24, 2020
Member
Perhaps it makes sense to make this a factory method for Layout1DResult?
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 25, 2020
Author
Member
I think that would be slightly nicer API design, but perhaps not worth the rightwards drift for a private function called exactly twice
| tile_size: &mut f32, | ||
| tile_spacing: &mut f32, | ||
| mut repeat: Repeat, |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 24, 2020
Member
Any reason to have input/output parameters and a return struct here instead of simply returning these values in Layout1DResult?
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 25, 2020
Author
Member
I’ve done so for tile_spacing but kept tile_size since it already has a non-trivial value before this call and is only sometimes modified.
|
|
||
| // `{ x, y }` is now a vector of arbitrary length | ||
| // with the same direction as the gradient line. | ||
|
|
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| /// https://drafts.csswg.org/css-images-4/#color-stop-fixup | ||
| fn stops_fixup( |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| fn content_edge_clip(&self, builder: &mut DisplayListBuilder) -> Option<wr::ClipId> { | ||
| *self.content_edge_clip_id.init_once(|| { |
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| fn build(&mut self, builder: &mut DisplayListBuilder) { | ||
| let hit_info = hit_info(&self.fragment.style, self.fragment.tag, Cursor::Default); | ||
| if hit_info.is_some() { | ||
| let mut common = builder.common_properties(self.border_rect); | ||
| common.hit_info = hit_info; | ||
| self.with_border_edge_clip(builder, &mut common); | ||
| if let Some(clip_id) = self.border_edge_clip(builder) { |
This comment has been minimized.
This comment has been minimized.
mrobinson
Jan 24, 2020
Member
At some point it would be good to keep a stack of clips and spatial node ids, but for the moment I don't think it's necessary.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jan 25, 2020
Author
Member
Yes, having that stack on the call stack is the idea of:
servo/components/layout_2020/display_list.rs
Lines 63 to 70 in 12693b5
… which I copied from Layout 2013 code, but ended up not using for backgrounds because each background layer has a potentially-different background-clip value that only applies to one display item, so pushing/popping to the stack isn’t as useful.
|
@bors-servo r=mrobinson |
|
|
Background follow ups * Fix `background-clip` + `border-radius` * Fix `background-clip` + `background-color` * Render linear and radial gradients * Enable `css/css-background/` in WPT
|
|
|
@bors-servo retry |
|
@bors-servo p=10 |
|
@bors-servo r- |
|
@bors-servo r=mrobinson |
|
|
Background follow ups * Fix `background-clip` + `border-radius` * Fix `background-clip` + `background-color` * Render linear and radial gradients * Enable `css/css-background/` in WPT
|
|
|
What happened, here? https://community-tc.services.mozilla.com/tasks/groups/afsyHI-hQuC1cMli-ibEQQ was all green and d9cd4ab got a green Status but it wasn’t merged. Did Homu drop it on the floor? (After the second r+ Homu made an other merge commit 31eafad and https://community-tc.services.mozilla.com/tasks/groups/dvO_ldpRSwmaBBVTrhc06w re-used successful tasks from the previous task group, as intended.) |
|
I looked at all of the webhooks and github did not report having problems delivering all of them. The homu log on servo-master1 didn't show any useful information. It's a mystery! |
SimonSapin commentedJan 24, 2020
background-clip+border-radiusbackground-clip+background-colorcss/css-background/in WPT