Ignore:
Timestamp:
Oct 22, 2013, 7:50:37 AM (12 years ago)
Author:
[email protected]
Message:

[CSS Regions] Possible performance regression after r157567
https://bugs.webkit.org/show_bug.cgi?id=123016

Reviewed by Andreas Kling.

The revision 157567 http://trac.webkit.org/changeset/157567 may have regressed
Parser/html5-full-render by ~1.1% and Parser/html-parser by ~2%. These changes
try to optimize the initial patch, based on Andreas Kling's review.

The patch also adds a couple of refactorings that should make the code easier to read:

  • the CSS Shapes functions are now wrapped in a single #if clause
  • the CSS Shapes and CSS Regions pre-layout preparations are wrapped in a helper function

The RenderFlowThread::logicalWidthChangedInRegionsForBlock function is optimized by passing
it information about the state of the relayout children flag. If the flag is true already,
some of the steps are skipped.

Tests: no new tests.

  • dom/Element.cpp:

(WebCore::Element::webkitGetRegionFlowRanges):

  • inspector/InspectorOverlay.cpp:

(WebCore::buildObjectForElementInfo):

  • rendering/RenderBlock.cpp:

(WebCore::shapeInfoRequiresRelayout):
(WebCore::RenderBlock::updateShapesBeforeBlockLayout):
(WebCore::RenderBlock::computeShapeSize):
(WebCore::RenderBlock::prepareShapesAndPaginationBeforeBlockLayout):

  • rendering/RenderBlock.h:
  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
(WebCore::RenderBlockFlow::setRenderNamedFlowFragment):
(WebCore::RenderBlockFlow::ensureRareData):

  • rendering/RenderBlockFlow.h:

(WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData):
(WebCore::RenderElement::isRenderNamedFlowFragmentContainer):

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):

  • rendering/RenderElement.h:

(WebCore::RenderElement::generatingElement):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock):

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):

  • rendering/RenderFlowThread.h:
  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::layoutBlock):

  • rendering/RenderNamedFlowFragment.h:
  • rendering/RenderObject.cpp:
  • rendering/RenderObject.h:
  • rendering/RenderTreeAsText.cpp:

(WebCore::write):

  • style/StyleResolveTree.cpp:

(WebCore::Style::elementInsideRegionNeedsRenderer):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r157674 r157793  
    288288    LayoutStateMaintainer statePusher(&view(), this, locationOffset(), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());
    289289
    290     // Regions changing widths can force us to relayout our children.
    291     RenderFlowThread* flowThread = flowThreadContainingBlock();
    292     if (logicalWidthChangedInRegions(flowThread))
    293         relayoutChildren = true;
    294     if (updateShapesBeforeBlockLayout())
    295         relayoutChildren = true;
     290    prepareShapesAndPaginationBeforeBlockLayout(relayoutChildren);
    296291
    297292    LayoutSize previousSize = size();
Note: See TracChangeset for help on using the changeset viewer.