Bug 119462 - Force elements with perspective or preserve-3d to disallow direct composited backgrounds
Summary: Force elements with perspective or preserve-3d to disallow direct composited ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-02 16:10 PDT by Dean Jackson
Modified: 2013-08-02 17:07 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.61 KB, patch)
2013-08-02 16:13 PDT, Dean Jackson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>