Bug 114268

Summary: [CSS Regions] Regions don't create a stacking context for their contents
Product: WebKit Reporter: Mihai Balan <mibalan>
Component: CSSAssignee: Max Vujovic <mvujovic>
Status: RESOLVED FIXED    
Severity: Normal CC: achicu, commit-queue, esprehn+autocc, glenn, WebkitBugTracker
Priority: P2 Keywords: AdobeTracked
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 57312    
Attachments:
Description Flags
W3C test showcasing the problem
none
Patch
achicu: review-, mvujovic: commit-queue-
Patch none

Description Mihai Balan 2013-04-09 05:00:43 PDT
Created attachment 197030 [details]
W3C test showcasing the problem

The CSS Regions spec states that regions should create a stacking context for their contents.
However, it currently doesn't look like this is happening

Steps to reproduce:
Open attached file in browser

EXPECTED
The purple square is drawn on top of the other squares

ACTUAL
The purple square is drawn under the yellow square (actually under all the other three squares)
Comment 1 Max Vujovic 2013-06-11 10:54:19 PDT
Created attachment 204343 [details]
Patch
Comment 2 Alexandru Chiculita 2013-06-11 11:41:04 PDT
Comment on attachment 204343 [details]
Patch

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

> Source/WebCore/rendering/RenderRegion.cpp:166
> +    bool isPaintingBackground = (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground);
> +    if (!isValid() || (!isPaintingBackground && paintInfo.phase != PaintPhaseSelection))

Let's extract this into something like "bool shouldPaint". It looks bad with so many negations in it.
Comment 3 Max Vujovic 2013-06-11 13:34:15 PDT
Created attachment 204356 [details]
Patch

Updated patch based on Alex's comments.
Comment 4 Max Vujovic 2013-06-11 13:37:05 PDT
(In reply to comment #2)
> (From update of attachment 204343 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=204343&action=review
> 
> > Source/WebCore/rendering/RenderRegion.cpp:166
> > +    bool isPaintingBackground = (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground);
> > +    if (!isValid() || (!isPaintingBackground && paintInfo.phase != PaintPhaseSelection))
> 
> Let's extract this into something like "bool shouldPaint". It looks bad with so many negations in it.

Good suggestion. I pulled the isValid() into it's own if statement. Now this if statement only contains the phase checking. I ended up not needing a boolean.
Comment 5 Alexandru Chiculita 2013-06-11 14:33:00 PDT
Comment on attachment 204356 [details]
Patch

r=me
Comment 6 Max Vujovic 2013-06-11 14:33:54 PDT
Comment on attachment 204356 [details]
Patch

Thanks for the review!

Setting cq+.
Comment 7 WebKit Commit Bot 2013-06-11 14:55:17 PDT
Comment on attachment 204356 [details]
Patch

Clearing flags on attachment: 204356

Committed r151475: <http://trac.webkit.org/changeset/151475>
Comment 8 WebKit Commit Bot 2013-06-11 14:55:19 PDT
All reviewed patches have been landed.  Closing bug.