Bug 129478 - [CSSRegions] Children of inline-block content-node are not displayed in regions
Summary: [CSSRegions] Children of inline-block content-node are not displayed in regions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 130229 130249 130392
Blocks: 57312
  Show dependency treegraph
 
Reported: 2014-02-28 02:19 PST by Mihnea Ovidenie
Modified: 2014-03-19 23:06 PDT (History)
1 user (show)

See Also:


Attachments
WIP1 (29.24 KB, patch)
2014-02-28 02:20 PST, Mihnea Ovidenie
no flags Details | Formatted Diff | Diff
WIP2 (34.82 KB, patch)
2014-03-07 00:42 PST, Mihnea Ovidenie
no flags Details | Formatted Diff | Diff
Patch 3 (35.79 KB, patch)
2014-03-11 08:07 PDT, Mihnea Ovidenie
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mihnea Ovidenie 2014-02-28 02:19:28 PST
In the following situation, #div2 is not displayed at all and it should be.
<html>
    <head>
        <style>
            #region1 { -webkit-flow-from: flow; position: absolute; top: 100px; left: 100px; width: 100px; height: 100px; border: 5px solid black; }
            #region2 { -webkit-flow-from: flow; position: absolute; top: 100px; left: 300px; width: 100px; height: 100px; border: 5px solid black; }

            #content1 { -webkit-flow-into: flow; display: inline-block; }

            #div1, #div2 { width: 100px; height: 100px; }
            #div1 { background-color: salmon; }
            #div2 { background-color: orange; }
        </style>
    </head>
    <body>
        <div id="region1"></div>
        <div id="region2"></div>
        <div id="content1">
            <div id="div1"></div>
            <div id="div2"></div>
        </div>
    </body>
</html>

We have to fix region ranges computation for inline-blocks and their children too.
Comment 1 Mihnea Ovidenie 2014-02-28 02:20:10 PST
Created attachment 225449 [details]
WIP1
Comment 2 Mihnea Ovidenie 2014-03-07 00:42:40 PST
Created attachment 226092 [details]
WIP2
Comment 3 Mihnea Ovidenie 2014-03-11 08:07:02 PDT
Created attachment 226427 [details]
Patch 3

WIP3:
* for a box in block flow, attempts to compute the range only if the parent has a computed region range
* modified getRegionRangeForBox to return false if the region range was not cached - either in region range map or stored in a corresponding RootInlineBox. If unable to retrieve the range from the cached information, try to see if the box has a parent that is unsplittable and try to get the first region from that parent range
* modified RenderObject::locateFlowThreadContainingBlock to check the flowThreadState of the object and the flow on the stack, in those cases in which we have a multi-column element inside a named flow and locateFlowThreadContainingBlock would return the multicolumn-flowthread for elements outside the multicolumn-flowthread
Comment 4 Andrei Bucur 2014-03-11 09:08:56 PDT
Comment on attachment 226427 [details]
Patch 3

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

> Source/WebCore/rendering/RenderBoxModelObject.h:-183
> -    bool canHaveBoxInfoInRegion() const { return !isFloating() && !isReplaced() && !isInline() && !hasColumns() && !isTableCell() && isRenderBlock() && !isRenderSVGBlock(); }

I don't think we want to remove the isInline check. We just want to allow inline blocks. Maybe isInlineBlockOrInlineTable is good enough?

> Source/WebCore/rendering/RenderFlowThread.cpp:594
> +    for (auto& region : m_regionList)

Why have you changed this code? There shouldn't be any region box info outside the range. If there is, we can catch it with the assert later on.

> Source/WebCore/rendering/RenderFlowThread.cpp:790
> +    } while (!cb->isRenderFlowThread());

This is correct but I think we can stop earlier, at the first line with a containing region. However, I like this more for the sake of simplicity.
Comment 5 Mihnea Ovidenie 2014-03-19 23:06:26 PDT
Landed the patches containing the split work.