Bug 143320

Summary: [New Block-Inside-Inline Model] Implement the correct painting order for blocks inside inlines
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch (just for ews)
none
Patch darin: review+

Description Dave Hyatt 2015-04-01 15:02:48 PDT
The painting order has to match the old continuation-based model.
Comment 1 Dave Hyatt 2015-04-01 15:03:15 PDT
Created attachment 249944 [details]
Patch (just for ews)
Comment 2 WebKit Commit Bot 2015-04-01 15:06:09 PDT
Attachment 249944 [details] did not pass style-queue:


ERROR: Source/WebCore/rendering/InlineFlowBox.cpp:1135:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dave Hyatt 2015-04-02 09:19:22 PDT
Created attachment 249984 [details]
Patch
Comment 4 Darin Adler 2015-04-02 09:40:26 PDT
Comment on attachment 249984 [details]
Patch

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

Is this enough testing to cover all the code?

> Source/WebCore/rendering/EllipsisBox.cpp:143
> +bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction hitTestAction)

Argument list here is getting out of hand. Can we further merge some of these intro structs and classes?

> Source/WebCore/rendering/InlineElementBox.cpp:74
> +        PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? PaintPhaseOutline : paintInfo.phase;
> +        newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChildBlockBackground : newPhase;

This seems like a strange way to write it. How about a switch?

    PaintInfo subtreePaintInfo = paintInfo;
    switch (subtreePaintInfo.phase) {
    case PaintPhaseChildOutlines:
        subtreePaintInfo.phase = PaintPhaseOutline;
        break;
    case PaintPhaseChildBlockBackgrounds:
        subtreePaintInfo.phase = PaintPhaseChildBlockBackground;
        break;
    default:
        break;
    }

Or if you want it to look more compact, you can use this kind of formatting (and we can change the coding style guidelines to allow it).

    switch (subtreePaintInfo.phase) {
    case PaintPhaseChildOutlines: subtreePaintInfo.phase = PaintPhaseOutline; break;
    case PaintPhaseChildBlockBackgrounds: subtreePaintInfo.phase = PaintPhaseChildBlockBackground; break;
    default: break;
    }

The ? : seem harder to read.
Comment 5 Dave Hyatt 2015-04-02 11:35:57 PDT
Fixed in r182279.