Changeset 104802 in webkit


Ignore:
Timestamp:
Jan 12, 2012 2:22:48 AM (12 years ago)
Author:
mihnea@adobe.com
Message:

Add RenderStyle::isPositioned() helper method
https://bugs.webkit.org/show_bug.cgi?id=75959

Reviewed by Tony Chang.

No new tests since this is refactoring of existing code.

Replace (style()->position() == AbsolutePosition
style()->position() == FixedPosition)

with (style()->isPositioned()).
Replace (style()->position() != AbsolutePosition && style()->position() != FixedPosition)
with (!style()->isPositioned()).

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::updateBoxModelInfoFromStyle):
(WebCore::RenderBox::offsetFromContainer):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::computeRectForRepaint):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::markContainingBlocksForLayout):
(WebCore::RenderObject::setPreferredLogicalWidthsDirty):
(WebCore::RenderObject::invalidateContainerPreferredLogicalWidths):

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyleBitfields::isPositioned):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104796 r104802  
     12012-01-12  Mihnea Ovidenie  <mihnea@adobe.com>
     2
     3        Add RenderStyle::isPositioned() helper method
     4        https://bugs.webkit.org/show_bug.cgi?id=75959
     5
     6        Reviewed by Tony Chang.
     7
     8        No new tests since this is refactoring of existing code.
     9        Replace (style()->position() == AbsolutePosition || style()->position() == FixedPosition)
     10        with (style()->isPositioned()).
     11        Replace (style()->position() != AbsolutePosition && style()->position() != FixedPosition)
     12        with (!style()->isPositioned()).
     13
     14        * rendering/RenderBox.cpp:
     15        (WebCore::RenderBox::updateBoxModelInfoFromStyle):
     16        (WebCore::RenderBox::offsetFromContainer):
     17        * rendering/RenderBoxModelObject.cpp:
     18        (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
     19        * rendering/RenderInline.cpp:
     20        (WebCore::RenderInline::computeRectForRepaint):
     21        * rendering/RenderObject.cpp:
     22        (WebCore::RenderObject::markContainingBlocksForLayout):
     23        (WebCore::RenderObject::setPreferredLogicalWidthsDirty):
     24        (WebCore::RenderObject::invalidateContainerPreferredLogicalWidths):
     25        * rendering/style/RenderStyle.h:
     26        (WebCore::RenderStyleBitfields::isPositioned):
     27
    1282012-01-11  KwangHyuk Kim  <hyuki.kim@samsung.com>
    229
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r104628 r104802  
    410410        setHasBoxDecorations(true);
    411411
    412     setPositioned(style()->position() == AbsolutePosition || style()->position() == FixedPosition);
     412    setPositioned(style()->isPositioned());
    413413    setFloating(style()->isFloating() && (!isPositioned() || style()->floating() == PositionedFloat));
    414414
     
    13981398
    13991399    if (!isInline() || isReplaced()) {
    1400         if (style()->position() != AbsolutePosition && style()->position() != FixedPosition && o->hasColumns()) {
     1400        if (!style()->isPositioned() && o->hasColumns()) {
    14011401            RenderBlock* block = toRenderBlock(o);
    14021402            LayoutRect columnRect(frameRect());
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r104123 r104802  
    27602760    LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint());
    27612761
    2762     if (style()->position() != AbsolutePosition && style()->position() != FixedPosition && o->hasColumns()) {
     2762    if (!style()->isPositioned() && o->hasColumns()) {
    27632763        RenderBlock* block = static_cast<RenderBlock*>(o);
    27642764        LayoutPoint point(roundedLayoutPoint(transformState.mappedPoint()));
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r104378 r104802  
    10541054    LayoutPoint topLeft = rect.location();
    10551055
    1056     if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition) {
     1056    if (o->isBlockFlow() && !style()->isPositioned()) {
    10571057        RenderBlock* cb = toRenderBlock(o);
    10581058        if (cb->hasColumns()) {
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r104628 r104802  
    627627        if (!container && !object->isRenderView())
    628628            return;
    629         if (!last->isText() && (last->style()->position() == FixedPosition || last->style()->position() == AbsolutePosition)) {
     629        if (!last->isText() && last->style()->isPositioned()) {
    630630            bool willSkipRelativelyPositionedInlines = !object->isRenderBlock();
    631631            while (object && !object->isRenderBlock()) // Skip relatively positioned inlines and get to the enclosing RenderBlock.
     
    667667    bool alreadyDirty = preferredLogicalWidthsDirty();
    668668    m_bitfields.setPreferredLogicalWidthsDirty(b);
    669     if (b && !alreadyDirty && markParents && (isText() || (style()->position() != FixedPosition && style()->position() != AbsolutePosition)))
     669    if (b && !alreadyDirty && markParents && (isText() || !style()->isPositioned()))
    670670        invalidateContainerPreferredLogicalWidths();
    671671}
     
    684684
    685685        o->m_bitfields.setPreferredLogicalWidthsDirty(true);
    686         if (o->style()->position() == FixedPosition || o->style()->position() == AbsolutePosition)
     686        if (o->style()->isPositioned())
    687687            // A positioned object has no effect on the min/max width of its containing block ever.
    688688            // We can optimize this case and not go up any further.
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r104625 r104802  
    509509
    510510    EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
     511    bool isPositioned() const { return position() == AbsolutePosition || position() == FixedPosition; }
    511512    EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
    512513
Note: See TracChangeset for help on using the changeset viewer.