Changeset 167988 in webkit


Ignore:
Timestamp:
Apr 30, 2014 1:23:00 AM (10 years ago)
Author:
Manuel Rego Casasnovas
Message:

[CSS Grid Layout] Wrap some specific grid code under compilation flag
https://bugs.webkit.org/show_bug.cgi?id=132341

Reviewed by Benjamin Poulain.

Some static variables in RenderBox are only used for CSS Grid Layout code. Wrap them and the related methods
under ENABLE_CSS_GRID_LAYOUT compilation flag.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::containingBlockLogicalWidthForContent):
(WebCore::RenderBox::containingBlockLogicalHeightForContent):
(WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
(WebCore::RenderBox::computePercentageLogicalHeight):

  • rendering/RenderBox.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167983 r167988  
     12014-04-30  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [CSS Grid Layout] Wrap some specific grid code under compilation flag
     4        https://bugs.webkit.org/show_bug.cgi?id=132341
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Some static variables in RenderBox are only used for CSS Grid Layout code. Wrap them and the related methods
     9        under ENABLE_CSS_GRID_LAYOUT compilation flag.
     10
     11        * rendering/RenderBox.cpp:
     12        (WebCore::RenderBox::willBeDestroyed):
     13        (WebCore::RenderBox::containingBlockLogicalWidthForContent):
     14        (WebCore::RenderBox::containingBlockLogicalHeightForContent):
     15        (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
     16        (WebCore::RenderBox::computePercentageLogicalHeight):
     17        * rendering/RenderBox.h:
     18
    1192014-04-29  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r167930 r167988  
    7575static OverrideSizeMap* gOverrideWidthMap = 0;
    7676
     77#if ENABLE(CSS_GRID_LAYOUT)
    7778// Used by grid elements to properly size their grid items.
    78 static OverrideSizeMap* gOverrideContainingBlockLogicalHeightMap = 0;
    79 static OverrideSizeMap* gOverrideContainingBlockLogicalWidthMap = 0;
    80 
     79static OverrideSizeMap* gOverrideContainingBlockLogicalHeightMap = nullptr;
     80static OverrideSizeMap* gOverrideContainingBlockLogicalWidthMap = nullptr;
     81#endif
    8182
    8283// Size of border belt for autoscroll. When mouse pointer in border belt,
     
    217218
    218219    clearOverrideSize();
     220#if ENABLE(CSS_GRID_LAYOUT)
    219221    clearContainingBlockOverrideSize();
     222#endif
    220223
    221224    RenderBlock::removePercentHeightDescendantIfNeeded(*this);
     
    10311034}
    10321035
     1036#if ENABLE(CSS_GRID_LAYOUT)
    10331037LayoutUnit RenderBox::overrideContainingBlockContentLogicalWidth() const
    10341038{
     
    10791083        gOverrideContainingBlockLogicalHeightMap->remove(this);
    10801084}
     1085#endif // ENABLE(CSS_GRID_LAYOUT)
    10811086
    10821087LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const
     
    17731778LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const
    17741779{
     1780#if ENABLE(CSS_GRID_LAYOUT)
    17751781    if (hasOverrideContainingBlockLogicalWidth())
    17761782        return overrideContainingBlockContentLogicalWidth();
     1783#endif
    17771784
    17781785    RenderBlock* cb = containingBlock();
     
    17821789LayoutUnit RenderBox::containingBlockLogicalHeightForContent(AvailableLogicalHeightType heightType) const
    17831790{
     1791#if ENABLE(CSS_GRID_LAYOUT)
    17841792    if (hasOverrideContainingBlockLogicalHeight())
    17851793        return overrideContainingBlockContentLogicalHeight();
     1794#endif
    17861795
    17871796    RenderBlock* cb = containingBlock();
     
    18201829LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const
    18211830{
     1831#if ENABLE(CSS_GRID_LAYOUT)
    18221832    if (hasOverrideContainingBlockLogicalHeight())
    18231833        return overrideContainingBlockContentLogicalHeight();
     1834#endif
    18241835
    18251836    RenderBlock* cb = containingBlock();
     
    27592770    if (isHorizontal != cb->isHorizontalWritingMode())
    27602771        availableHeight = containingBlockChild->containingBlockLogicalWidthForContent();
     2772#if ENABLE(CSS_GRID_LAYOUT)
    27612773    else if (hasOverrideContainingBlockLogicalHeight())
    27622774        availableHeight = overrideContainingBlockContentLogicalHeight();
     2775#endif
    27632776    else if (cb->isTableCell()) {
    27642777        if (!skippedAutoHeightContainingBlock) {
  • trunk/Source/WebCore/rendering/RenderBox.h

    r167803 r167988  
    330330    void clearOverrideLogicalContentWidth();
    331331
     332#if ENABLE(CSS_GRID_LAYOUT)
    332333    LayoutUnit overrideContainingBlockContentLogicalWidth() const;
    333334    LayoutUnit overrideContainingBlockContentLogicalHeight() const;
     
    338339    void clearContainingBlockOverrideSize();
    339340    void clearOverrideContainingBlockContentLogicalHeight();
     341#endif
    340342
    341343    virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&, bool* offsetDependsOnPoint = 0) const override;
Note: See TracChangeset for help on using the changeset viewer.