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 upLayout 2020: Implement `clip: rect` #27388
Conversation
highfive
commented
Jul 24, 2020
|
r? @SimonSapin or @pcwalton |
|
The last commit fixes the problem, but I'm not sure if it's the right fix. |
|
As discussed on Matrix https://drafts.csswg.org/css2/#clipping says
So this PR should also change |
| From::from(self.left.auto_is(|| Length::new(0.))), | ||
| From::from(self.top.auto_is(|| Length::new(0.))), |
This comment has been minimized.
This comment has been minimized.
| let clip = self.style.get_effects().clip; | ||
| if let ClipRectOrAuto::Rect(r) = clip { |
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jul 27, 2020
Member
https://drafts.csswg.org/css2/#clipping
The clip property applies only to absolutely positioned elements.
So this code should also check for position: absolute or position: fixed.
|
Let’s try this on top of #27399 @bors-servo try=wpt-2020 |
Layout 2020: Implement `clip: rect` This implements `clip: rect` Unfortunately, none of the tests pass yet, they are all broken due to #27387 Additionally, currently `clip` does not seem to clip the element itself, only its children. I'm not quite sure what to do about that, I patterned this off of the code in the layout 2013 which handled clip immediately after scroll overflow.
|
|
|
Sweet, a whole pile of PASS expected FAIL. Though i bet many of these would have been PASS expected FAIL before this PR, I plan to rebase and do a two-step test update. |
|
PR updated with tests |
|
So the clip-not-absolute-positioned tests are failing, because my impl seems to apply universally rather than to positioned elements |
|
Fixed |
|
More
|
|
@bors-servo r=SimonSapin |
|
|
Layout 2020: Implement `clip: rect` This implements `clip: rect` Unfortunately, none of the tests pass yet, they are all broken due to #27387 Additionally, currently `clip` does not seem to clip the element itself, only its children. I'm not quite sure what to do about that, I patterned this off of the code in the layout 2013 which handled clip immediately after scroll overflow.
|
|
|
@bors-servo retry
|
Layout 2020: Implement `clip: rect` This implements `clip: rect` Unfortunately, none of the tests pass yet, they are all broken due to #27387 Additionally, currently `clip` does not seem to clip the element itself, only its children. I'm not quite sure what to do about that, I patterned this off of the code in the layout 2013 which handled clip immediately after scroll overflow.
|
|
|
@bors-servo retry
|
|
|
Manishearth commentedJul 24, 2020
This implements
clip: rectUnfortunately, none of the tests pass yet, they are all broken due to #27387
Additionally, currently
clipdoes not seem to clip the element itself, only its children. I'm not quite sure what to do about that, I patterned this off of the code in the layout 2013 which handled clip immediately after scroll overflow.