-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(button): fix rendering issue with borders and webkit browsers #9449
Conversation
97b83fd
to
6629801
Compare
Can you add a bit more detail to the commit message about why the old hack was there and why this is an improvement? Otherwise LGTM 👍 |
86976ac
to
df35c54
Compare
@ThomasBurleson Ready for your review. Carlos and I have both done manual testing on various browsers. |
I've done a bit more research on the issue. There is a webkit issue with one element bleeding through a parent element (ripple bleeding through corner). The previous fix created used a 1x1 pixel When you add a mask to an image, the browser will break up the elements into layers and overlay a mask layer over the element. Technically, yes, we are going to force 3D, but for the express objective of making sure the element has a compositing layer, eliminating the overlay bleed issue. There are many ways to force a composition layer, and transform3D is just another one, that's much safer than applying a mask. References: @devversion ping, you brought up concerns. Basically, before it was 3D + mask layer. Now it's just 3D (no mask needed) |
@clshortfuse This sounds valid. LGTM then! |
c786f94
to
3c1ec60
Compare
Well, well, well. Seems like it was right to retest all this stuff with Browserstack. Safari 8 needs both compositing and image mask, not just compositing. (Safari 9 and Chrome are okay with just Sure, I've rewritten the code and commit, using this codepen for reviewing: http://codepen.io/shortfuse/full/dpYQaz |
@@ -170,11 +156,13 @@ button.md-button::-moz-focus-inner { | |||
} | |||
|
|||
.md-ripple-container { | |||
border-radius: $button-border-radius; | |||
border-radius: inherit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we inherit? we want it to always be 50%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
border-radius
isn't the shape of the ripple, it's the border limit to which the ripple will reach on its container. See #9154
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if they use md-cornered
, then it shouldn't be 50%
, it should be 0
.
cf42675
to
c80dbb1
Compare
I reverted back to using |
@clshortfuse what's the status on this? Your patch is working great for us in Chrome. Do we just need some manual testing in other browsers? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…gular#9449) Webkit has a rendering bug with child elements whos parent uses a rounded corner. In this case, this is a ripple on a rounded button. To circumvent this issue, we applied a 1x1 PNG image mask on the ripple element. The image mask is causing issues with Chrome rendering opaque under certain conditions. An image mask is only needed for Safari 8, which is no longer supported. Instead we will just Safari and Chrome to use a compositing layer by forcing an empty Z-axis translation. * Inherit border radius from buttons * Remove image mask CSS * Use translateZ to force webkit to create a compositing layer Fixes angular#9154, angular#10086 References: https://bugs.webkit.org/show_bug.cgi?id=30475
) Webkit has a rendering bug with child elements whos parent uses a rounded corner. In this case, this is a ripple on a rounded button. To circumvent this issue, we applied a 1x1 PNG image mask on the ripple element. The image mask is causing issues with Chrome rendering opaque under certain conditions. An image mask is only needed for Safari 8, which is no longer supported. Instead we will just Safari and Chrome to use a compositing layer by forcing an empty Z-axis translation. * Inherit border radius from buttons * Remove image mask CSS * Use translateZ to force webkit to create a compositing layer Fixes #9154, #10086 References: https://bugs.webkit.org/show_bug.cgi?id=30475
Webkit has a rendering bug with child elements whos parent uses a
rounded corner. In this case, this is a ripple on a rounded button.
To circumvent this issue, we applied a 1x1 PNG image mask on the
ripple element.
The image mask is causing issues with Chrome rendering opaque under
certain conditions. An image mask is only needed for Safari 8, which
is no longer supported. Instead we will just Safari and Chrome to
use a compositing layer by forcing an empty Z-axis translation.
Fixes #9154, #10086
References:
https://bugs.webkit.org/show_bug.cgi?id=30475