Bug 119462

Summary: Force elements with perspective or preserve-3d to disallow direct composited backgrounds
Product: WebKit Reporter: Dean Jackson <dino>
Component: Layout and RenderingAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kondapallykalyan, noam, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch simon.fraser: review+

Description Dean Jackson 2013-08-02 16:10:06 PDT
As a stop-gap measure to address Bug 119461, make sure elements that have a perspective or preserve-3d don't allow directly composited backgrounds.
Comment 1 Dean Jackson 2013-08-02 16:13:19 PDT
Created attachment 208053 [details]
Patch
Comment 2 Dean Jackson 2013-08-02 16:15:37 PDT
<rdar://problem/14607548>
Comment 3 Simon Fraser (smfr) 2013-08-02 16:25:25 PDT
Comment on attachment 208053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=208053&action=review

> Source/WebCore/rendering/RenderLayerBacking.cpp:1518
> +    if (hasPerspectiveOrPreserves3D(renderer->style()))
> +        return false;

I think we need to do the same thing for simple image layers; they should show the same bug.
Comment 4 Dean Jackson 2013-08-02 16:32:38 PDT
(In reply to comment #3)
> (From update of attachment 208053 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=208053&action=review
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:1518
> > +    if (hasPerspectiveOrPreserves3D(renderer->style()))
> > +        return false;
> 
> I think we need to do the same thing for simple image layers; they should show the same bug.

Simple image layers can't have children, so nothing to intersect with.
Comment 5 Simon Fraser (smfr) 2013-08-02 16:36:07 PDT
Comment on attachment 208053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=208053&action=review

>>> Source/WebCore/rendering/RenderLayerBacking.cpp:1518
>>> +        return false;
>> 
>> I think we need to do the same thing for simple image layers; they should show the same bug.
> 
> Simple image layers can't have children, so nothing to intersect with.

True dat!

> LayoutTests/compositing/background-color/no-composited-background-color-when-perspective-expected.html:16
> +    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAMAAAC6sdbXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAAA////pdmf3QAAAA5JREFUeNpiYMAHAAIMAAAeAAHMILKLAAAAAElFTkSuQmCC");

This might fall into a future background-image optimization. Maybe better to use border: 5px solid black and box-sizing: foo.
Comment 6 Dean Jackson 2013-08-02 16:39:56 PDT
Comment on attachment 208053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=208053&action=review

>> LayoutTests/compositing/background-color/no-composited-background-color-when-perspective-expected.html:16
>> +    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAMAAAC6sdbXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAAA////pdmf3QAAAA5JREFUeNpiYMAHAAIMAAAeAAHMILKLAAAAAElFTkSuQmCC");
> 
> This might fall into a future background-image optimization. Maybe better to use border: 5px solid black and box-sizing: foo.

Yeah, but unfortunately that slightly changes either the perspective origin or the transform origin. I'm not sure why this is - sounds like a bug!
Comment 7 Dean Jackson 2013-08-02 17:07:20 PDT
Committed r153681: <http://trac.webkit.org/changeset/153681>