New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very large box shadows cause rendering bugs #2061
Comments
Wow! Yes, clamping or ignoring the blur sounds reasonable. Do you have a suggested threshold value for blur radius we could use? |
Gecko seems to allow a maximum stddev of 300: https://searchfox.org/mozilla-central/rev/c633ffa4c4611f202ca11270dcddb7b29edddff8/layout/painting/nsCSSRendering.cpp#4412-4428 |
Oh, I think that's the maximum radius (not stddev), and the variable |
Added help wanted and easy tags - this is an easy task for a new contributor. We would need to clamp the blur radius, and add some wrench reftests for this case. |
We might as well also apply the max spread radius that Gecko uses in the above code. |
I think the max spread radius is only used when spreading has to be applied per-pixel. For most box-shadows, where the spread radius only affects the dimensions of the shape that's used for the shadow, the spread radius is not clamped. Gecko uses per-pixel spreading only if a box-shadow is applied on an elements with -moz-appearance (where the shape is unknown and up to the platform). With WebRender, such elements currently fall back to Gecko rendering. |
OK, that makes sense. Thanks! |
Would this be more involved than |
I think that's probably all that's needed, yep! |
Clamp the blur radius Fixes #2061 Still needs a reftest <!-- 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/2076) <!-- Reviewable:end -->
Testcase:
data:text/html,<div style="height:20px;box-shadow:0 0 2000px 2000px rgba(0,0,0,0.4)">
Loading this page in a WebRender Firefox renders a blank tab and makes text in the tab bar disappear. I think unreasonably large box-shadow blurs should be clamped, or the shadow should be rendered without a blur. In this case, the blur achieves nothing, but I ran into a website that did this anyway.
The text was updated successfully, but these errors were encountered: