Changeset 209158 in webkit


Ignore:
Timestamp:
Nov 30, 2016 3:12:45 PM (7 years ago)
Author:
Alan Bujtas
Message:

ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
https://bugs.webkit.org/show_bug.cgi?id=155364
<rdar://problem/27720461>

Reviewed by David Hyatt.

Source/WebCore:

RenderNamedFlowThread is considered to be a root for the current renderer context so
we need to bail out from the containing block traversal here (like we do for the RenderView).

Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeReplacedLogicalHeightUsing):

LayoutTests:

  • fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt: Added.
  • fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r209155 r209158  
     12016-11-30  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
     4        https://bugs.webkit.org/show_bug.cgi?id=155364
     5        <rdar://problem/27720461>
     6
     7        Reviewed by David Hyatt.
     8
     9        * fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts-expected.txt: Added.
     10        * fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html: Added.
     11
    1122016-11-30  Jiewen Tan  <jiewen_tan@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r209157 r209158  
     12016-11-30  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: layoutState->m_renderer == this in WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage
     4        https://bugs.webkit.org/show_bug.cgi?id=155364
     5        <rdar://problem/27720461>
     6
     7        Reviewed by David Hyatt.
     8
     9        RenderNamedFlowThread is considered to be a root for the current renderer context so
     10        we need to bail out from the containing block traversal here (like we do for the RenderView).
     11
     12        Test: fast/replaced/replaced-element-with-percentage-width-inside-flow-asserts.html
     13
     14        * rendering/RenderBox.cpp:
     15        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     16
    1172016-11-30  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r208985 r209158  
    31423142        case Calculated:
    31433143        {
    3144             auto cb = isOutOfFlowPositioned() ? container() : containingBlock();
    3145             while (cb && cb->isAnonymous() && !is<RenderView>(*cb)) {
    3146                 cb = cb->containingBlock();
    3147                 downcast<RenderBlock>(*cb).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
     3144            auto* container = isOutOfFlowPositioned() ? this->container() : containingBlock();
     3145            while (container && container->isAnonymous()) {
     3146                // Stop at rendering context root.
     3147                if (is<RenderView>(*container) || is<RenderNamedFlowThread>(*container))
     3148                    break;
     3149                container = container->containingBlock();
     3150                downcast<RenderBlock>(*container).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
    31483151            }
    31493152
    31503153            // FIXME: This calculation is not patched for block-flow yet.
    31513154            // https://bugs.webkit.org/show_bug.cgi?id=46500
    3152             if (cb->isOutOfFlowPositioned() && cb->style().height().isAuto() && !(cb->style().top().isAuto() || cb->style().bottom().isAuto())) {
    3153                 ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock());
    3154                 RenderBlock& block = downcast<RenderBlock>(*cb);
     3155            if (container->isOutOfFlowPositioned()
     3156                && container->style().height().isAuto()
     3157                && !(container->style().top().isAuto() || container->style().bottom().isAuto())) {
     3158                ASSERT_WITH_SECURITY_IMPLICATION(container->isRenderBlock());
     3159                auto& block = downcast<RenderBlock>(*container);
    31553160                LogicalExtentComputedValues computedValues;
    31563161                block.computeLogicalHeight(block.logicalHeight(), 0, computedValues);
     
    31653170            LayoutUnit availableHeight;
    31663171            if (isOutOfFlowPositioned())
    3167                 availableHeight = containingBlockLogicalHeightForPositioned(downcast<RenderBoxModelObject>(*cb));
     3172                availableHeight = containingBlockLogicalHeightForPositioned(downcast<RenderBoxModelObject>(*container));
    31683173            else {
    31693174                availableHeight = containingBlockLogicalHeightForContent(IncludeMarginBorderPadding);
     
    31733178                // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
    31743179                // https://bugs.webkit.org/show_bug.cgi?id=46997
    3175                 while (cb && !is<RenderView>(*cb) && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercentOrCalculated())) {
    3176                     if (cb->isTableCell()) {
     3180                while (container && !is<RenderView>(*container)
     3181                    && (container->style().logicalHeight().isAuto() || container->style().logicalHeight().isPercentOrCalculated())) {
     3182                    if (container->isTableCell()) {
    31773183                        // Don't let table cells squeeze percent-height replaced elements
    31783184                        // <http://bugs.webkit.org/show_bug.cgi?id=15359>
     
    31803186                        return valueForLength(logicalHeight, availableHeight - borderAndPaddingLogicalHeight());
    31813187                    }
    3182                     downcast<RenderBlock>(*cb).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
    3183                     cb = cb->containingBlock();
     3188                    downcast<RenderBlock>(*container).addPercentHeightDescendant(const_cast<RenderBox&>(*this));
     3189                    container = container->containingBlock();
    31843190                }
    31853191            }
Note: See TracChangeset for help on using the changeset viewer.