Created attachment 330019 [details]
[CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
The blue layer should be clipped by the green rect.
GTK port: NG
Mac port: OK
Created attachment 330021 [details]
screenshot of GTK port
Created attachment 330022 [details]
screenshot of Mac port (OK)(trunk@225968)
This is due to a problem with ClipStack.
When painting the pieces of the blue rectangle that are out of the green one, a clipping area is set at (0,0) with size 0x0, which means that nothing should be rendered. But CliptStack doesn't apply that clipping area (doesn't call glScissor) because the area is empty, so the pieces that should not be rendered are rendered anyway. I'm not sure why ClipStack behaves that way though.
I see 2 ways to fix this, both of them fixing the issue:
- Remove the check for an empty area in ClipStack::apply(). This causes that nothing gets rendered when the clipping area is empty, which makes sense IMO.
- In TextureMapperLayer::paintSelfAndChildren(), if the layer clips its children, check whether the resulting clipping area is empty and, in that case, do not try to paint the layer children. This is more efficient, as we avoid painting layers that will be fully clipped.
Despite none of the fixes break any layout test, I'm trying to figure out possible side effects them. I'll upload a patch when I'm sure I'm not breaking anything.
Created attachment 332535 [details]
Comment on attachment 332535 [details]
Clearing flags on attachment: 332535
Committed r227729: <https://trac.webkit.org/changeset/227729>
All reviewed patches have been landed. Closing bug.