[Webkit-unassigned] [Bug 126160] New: [CSS Blending] Webkit-blend-mode fails for accelerated parent with overflow:hidden

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 23 06:21:16 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=126160

           Summary: [CSS Blending] Webkit-blend-mode fails for accelerated
                    parent with overflow:hidden
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mitica at adobe.com
                CC: WebkitBugTracker at adobe.com


-webkit-blend-mode fails for accelerated parents with overflow:hidden, for example:

<div class="parent" style="overflow:hidden; -webkit-transform: translateZ(0)">
    <div class="blendedChild" style="-webkit-blend-mode: difference"></div>
    <div class="nonBlendedChild"></div>
</div>

For this particular case, the parent element creates a clipping layer (m_childContainmentLayer), meaning that the blended child won't get an m_ancestorClippingLayer, breaking the previous functionality.
Setting the blend mode on the parent clipping layer is wrong because it would cause all of the parent's children to blend, instead of just the ones that have blending set.

To address this problem, I've found the following solution, which I've managed to validate with a prototype:

When detecting an element that should create a clipping layer, while also having blended children, we disallow the clipping layer creation and mark the element.

For each child layer, we check whether it has a blend mode or a subtree with a blended child.
If so, we create an ancestor clipping layer (m_ancestorClippingLayer) and set its size/location according the what the clipping layer for the parent should have been.
Otherwise, we have detected a child that doesn't have blending (neither the current element, nor its children), so we create a clipping layer.

When setting the blend mode for the layer, we check for the existence of an ancestor clipping layer.
If it exists, we set the CAFilter on it, otherwise we set the filter on the main graphics layer.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list