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 upPanic when a stacking context has an invalid transform. #418
Comments
|
I can grab this. According to https://drafts.csswg.org/css-transforms/#transform-function-lists
Would a reasonable implementation in the context of servo mean that the object doesn't show up in the display lists (similar to if it had |
|
It probably can be done in layout, however I think it's probably simpler to handle in WR. If we check in WR, it will also handle this case for any clients that aren't Servo. This piece of code (https://github.com/servo/webrender/blob/master/webrender/src/tiling.rs#L1822) concatenates the full stacking context transform, and also marks stacking contexts as visible or not. I suspect all you need to do is check if the transform is invertible here, and if not, bail out of the function and mark the stacking context as not visible. |
|
Okay! I agree that putting the change in WR would be useful for other clients. I originally asked because I had made the change you described and noticed that Servo still crashed because of hit-box stuff (i.e. that part of the DOM isn't rendered, but if you mouse in to the window then it panics.) I now think the correct solution is to do the check in multiple places. I'll PR the WR fix, open a related Servo issue this weekend. |
|
This sounds like servo/servo#13266 and servo/servo#14806 too. |
Do non-Servo clients want that behavior? |
Fix the panic when transform is non-invertible Fix the panic when transform is non-invertible. It also marks the `combined_local_viewport_rect` as not visible. Fixes #418. r? @glennw <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/823) <!-- Reviewable:end -->
If a transform matrix cannot be inverted, the webrender code will currently panic. Instead, it should detect this and not try to draw the stacking context.