Changeset 68926 in webkit


Ignore:
Timestamp:
Oct 1, 2010 2:25:39 PM (14 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=47015

Reviewed by Sam Weinig.

Change FloatingObject to store its dimensions as a rect.
This will make it easier for logical access for block-flow later on if
top/bottom is no different from left/width. This change also simplifies
calling code a bit in places.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::addOverflowFromFloats):
(WebCore::RenderBlock::repaintOverhangingFloats):
(WebCore::RenderBlock::paintFloats):
(WebCore::RenderBlock::fillSelectionGaps):
(WebCore::RenderBlock::insertFloatingObject):
(WebCore::RenderBlock::removeFloatingObject):
(WebCore::RenderBlock::removeFloatingObjectsBelow):
(WebCore::RenderBlock::positionNewFloats):
(WebCore::RenderBlock::positionNewFloatOnLine):
(WebCore::RenderBlock::logicalLeftOffsetForLine):
(WebCore::RenderBlock::logicalRightOffsetForLine):
(WebCore::RenderBlock::nextFloatBottomBelow):
(WebCore::RenderBlock::floatBottom):
(WebCore::RenderBlock::lowestPosition):
(WebCore::RenderBlock::rightmostPosition):
(WebCore::RenderBlock::leftmostPosition):
(WebCore::RenderBlock::leftBottom):
(WebCore::RenderBlock::rightBottom):
(WebCore::RenderBlock::clearFloats):
(WebCore::RenderBlock::addOverhangingFloats):
(WebCore::RenderBlock::addIntrudingFloats):
(WebCore::RenderBlock::hitTestFloats):
(WebCore::RenderBlock::adjustForBorderFit):

  • rendering/RenderBlock.h:

(WebCore::RenderBlock::FloatingObject::FloatingObject):
(WebCore::RenderBlock::FloatingObject::left):
(WebCore::RenderBlock::FloatingObject::right):
(WebCore::RenderBlock::FloatingObject::top):
(WebCore::RenderBlock::FloatingObject::bottom):
(WebCore::RenderBlock::FloatingObject::width):
(WebCore::RenderBlock::FloatingObject::height):
(WebCore::RenderBlock::FloatingObject::setLeft):
(WebCore::RenderBlock::FloatingObject::setTop):
(WebCore::RenderBlock::FloatingObject::setWidth):
(WebCore::RenderBlock::FloatingObject::setHeight):
(WebCore::RenderBlock::FloatingObject::frameRect):
(WebCore::RenderBlock::FloatingObject::setFrameRect):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::layoutInlineChildren):
(WebCore::RenderBlock::matchedEndLine):

Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r68923 r68926  
     12010-10-01  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=47015
     6       
     7        Change FloatingObject to store its dimensions as a rect.
     8        This will make it easier for logical access for block-flow later on if
     9        top/bottom is no different from left/width.  This change also simplifies
     10        calling code a bit in places.
     11
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::addOverflowFromFloats):
     14        (WebCore::RenderBlock::repaintOverhangingFloats):
     15        (WebCore::RenderBlock::paintFloats):
     16        (WebCore::RenderBlock::fillSelectionGaps):
     17        (WebCore::RenderBlock::insertFloatingObject):
     18        (WebCore::RenderBlock::removeFloatingObject):
     19        (WebCore::RenderBlock::removeFloatingObjectsBelow):
     20        (WebCore::RenderBlock::positionNewFloats):
     21        (WebCore::RenderBlock::positionNewFloatOnLine):
     22        (WebCore::RenderBlock::logicalLeftOffsetForLine):
     23        (WebCore::RenderBlock::logicalRightOffsetForLine):
     24        (WebCore::RenderBlock::nextFloatBottomBelow):
     25        (WebCore::RenderBlock::floatBottom):
     26        (WebCore::RenderBlock::lowestPosition):
     27        (WebCore::RenderBlock::rightmostPosition):
     28        (WebCore::RenderBlock::leftmostPosition):
     29        (WebCore::RenderBlock::leftBottom):
     30        (WebCore::RenderBlock::rightBottom):
     31        (WebCore::RenderBlock::clearFloats):
     32        (WebCore::RenderBlock::addOverhangingFloats):
     33        (WebCore::RenderBlock::addIntrudingFloats):
     34        (WebCore::RenderBlock::hitTestFloats):
     35        (WebCore::RenderBlock::adjustForBorderFit):
     36        * rendering/RenderBlock.h:
     37        (WebCore::RenderBlock::FloatingObject::FloatingObject):
     38        (WebCore::RenderBlock::FloatingObject::left):
     39        (WebCore::RenderBlock::FloatingObject::right):
     40        (WebCore::RenderBlock::FloatingObject::top):
     41        (WebCore::RenderBlock::FloatingObject::bottom):
     42        (WebCore::RenderBlock::FloatingObject::width):
     43        (WebCore::RenderBlock::FloatingObject::height):
     44        (WebCore::RenderBlock::FloatingObject::setLeft):
     45        (WebCore::RenderBlock::FloatingObject::setTop):
     46        (WebCore::RenderBlock::FloatingObject::setWidth):
     47        (WebCore::RenderBlock::FloatingObject::setHeight):
     48        (WebCore::RenderBlock::FloatingObject::frameRect):
     49        (WebCore::RenderBlock::FloatingObject::setFrameRect):
     50        * rendering/RenderBlockLineLayout.cpp:
     51        (WebCore::RenderBlock::layoutInlineChildren):
     52        (WebCore::RenderBlock::matchedEndLine):
     53
    1542010-10-01  Enrica Casucci  <enrica@apple.com>
    255
  • trunk/WebCore/rendering/RenderBlock.cpp

    r68900 r68926  
    13111311    for (; (r = it.current()); ++it) {
    13121312        if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer())
    1313             addOverflowFromChild(r->m_renderer, IntSize(r->m_left + r->m_renderer->marginLeft(), r->m_top + r->m_renderer->marginTop()));
     1313            addOverflowFromChild(r->m_renderer, IntSize(r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop()));
    13141314    }
    13151315    return;
     
    20762076            // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter
    20772077            // condition is replaced with being a descendant of us.
    2078             if (r->m_bottom > height() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r->m_shouldPaint) && !r->m_renderer->hasSelfPaintingLayer()) {
     2078            if (r->bottom() > height() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r->m_shouldPaint) && !r->m_renderer->hasSelfPaintingLayer()) {
    20792079                r->m_renderer->repaint();
    20802080                r->m_renderer->repaintOverhangingFloats();
     
    23882388            PaintInfo currentPaintInfo(paintInfo);
    23892389            currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
    2390             int currentTX = tx + r->m_left - r->m_renderer->x() + r->m_renderer->marginLeft();
    2391             int currentTY = ty + r->m_top - r->m_renderer->y() + r->m_renderer->marginTop();
     2390            int currentTX = tx + r->left() - r->m_renderer->x() + r->m_renderer->marginLeft();
     2391            int currentTY = ty + r->top() - r->m_renderer->y() + r->m_renderer->marginTop();
    23922392            r->m_renderer->paint(currentPaintInfo, currentTX, currentTY);
    23932393            if (!preservePhase) {
     
    25982598            for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) {
    25992599                FloatingObject* r = it.current();
    2600                 paintInfo->context->clipOut(IntRect(tx + r->m_left + r->m_renderer->marginLeft(),
    2601                                                     ty + r->m_top + r->m_renderer->marginTop(),
     2600                paintInfo->context->clipOut(IntRect(tx + r->left() + r->m_renderer->marginLeft(),
     2601                                                    ty + r->top() + r->m_renderer->marginTop(),
    26022602                                                    r->m_renderer->width(), r->m_renderer->height()));
    26032603            }
     
    29292929    FloatingObject* newObj = new FloatingObject(o->style()->floating() == FLEFT ? FloatingObject::FloatLeft : FloatingObject::FloatRight);
    29302930
    2931     newObj->m_top = -1;
    2932     newObj->m_bottom = -1;
     2931    newObj->setTop(-1);
    29332932   
    29342933    // Our location is irrelevant if we're unsplittable or no pagination is in effect.
     
    29412940        o->computeBlockDirectionMargins(this);
    29422941    }
    2943     newObj->m_width = o->width() + o->marginLeft() + o->marginRight();
     2942    newObj->setWidth(o->width() + o->marginLeft() + o->marginRight());
    29442943
    29452944    newObj->m_shouldPaint = !o->hasSelfPaintingLayer(); // If a layer exists, the float will paint itself.  Otherwise someone else will.
     
    29592958            if (it.current()->m_renderer == o) {
    29602959                if (childrenInline()) {
    2961                     int bottom = it.current()->m_bottom;
     2960                    int bottom = it.current()->bottom();
    29622961                    // Special-case zero- and less-than-zero-height floats: those don't touch
    29632962                    // the line that they're on, but it still needs to be dirtied. This is
    29642963                    // accomplished by pretending they have a height of 1.
    2965                     bottom = max(bottom, it.current()->m_top + 1);
     2964                    bottom = max(bottom, it.current()->top() + 1);
    29662965                    markLinesDirtyInVerticalRange(0, bottom);
    29672966                }
     
    29792978   
    29802979    FloatingObject* curr = m_floatingObjects->last();
    2981     while (curr != lastFloat && (curr->m_top == -1 || curr->m_top >= y)) {
     2980    while (curr != lastFloat && (curr->top() == -1 || curr->top() >= y)) {
    29822981        m_floatingObjects->removeLast();
    29832982        curr = m_floatingObjects->last();
     
    29932992
    29942993    // If all floats have already been positioned, then we have no work to do.
    2995     if (!f || f->m_top != -1)
     2994    if (!f || f->top() != -1)
    29962995        return false;
    29972996
     
    30002999    // the new floats that need it.
    30013000    FloatingObject* lastFloat = m_floatingObjects->getPrev();
    3002     while (lastFloat && lastFloat->m_top == -1) {
     3001    while (lastFloat && lastFloat->top() == -1) {
    30033002        f = m_floatingObjects->prev();
    30043003        lastFloat = m_floatingObjects->getPrev();
     
    30093008    // The float cannot start above the y position of the last positioned float.
    30103009    if (lastFloat)
    3011         y = max(lastFloat->m_top, y);
     3010        y = max(lastFloat->top(), y);
    30123011
    30133012    // Now walk through the set of unpositioned floats and place them.
     
    30243023        int ro = logicalRightOffsetForContent(); // Constant part of right offset.
    30253024        int lo = logicalLeftOffsetForContent(); // Constant part of left offset.
    3026         int fwidth = f->m_width; // The width we look for.
     3025        int fwidth = f->width(); // The width we look for.
    30273026        if (ro - lo < fwidth)
    30283027            fwidth = ro - lo; // Never look for more than what will be available.
     
    30443043            }
    30453044            fx = max(0, fx);
    3046             f->m_left = fx;
     3045            f->setLeft(fx);
    30473046            o->setLocation(fx + o->marginLeft(), y + o->marginTop());
    30483047        } else {
     
    30543053                fx = logicalRightOffsetForLine(y, ro, false, &heightRemainingRight);
    30553054            }
    3056             f->m_left = fx - f->m_width;
     3055            f->setLeft(fx - f->width());
    30573056            o->setLocation(fx - o->marginRight() - o->width(), y + o->marginTop());
    30583057        }
     
    30873086        }
    30883087
    3089         f->m_top = y;
    3090         f->m_bottom = f->m_top + o->marginTop() + o->height() + o->marginBottom();
    3091        
     3088        f->setTop(y);
     3089        f->setHeight(o->marginTop() + o->height() + o->marginBottom());
     3090
    30923091        // If the child moved, we have to repaint it.
    30933092        if (o->checkForRepaintDuringLayout())
     
    31053104        return didPosition;
    31063105   
    3107     int floatTop = newFloat->m_top;
     3106    int floatTop = newFloat->top();
    31083107    int paginationStrut = newFloat->m_paginationStrut;
    31093108    FloatingObject* f = m_floatingObjects->last();
     
    31153114
    31163115    for (f = m_floatingObjects->prev(); f && f != lastFloatFromPreviousLine; f = m_floatingObjects->prev()) {
    3117         if (f->m_top == height()) {
     3116        if (f->top() == height()) {
    31183117            ASSERT(!f->m_paginationStrut);
    31193118            f->m_paginationStrut = paginationStrut;
     
    31233122                toRenderBlock(o)->setChildNeedsLayout(true, false);
    31243123            o->layoutIfNeeded();
    3125             f->m_top += f->m_paginationStrut;
    3126             f->m_bottom += f->m_paginationStrut;
     3124            f->setTop(f->top() + f->m_paginationStrut);
    31273125        }
    31283126    }
     
    32223220        FloatingObject* r;
    32233221        DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    3224         for ( ; (r = it.current()); ++it )
    3225         {
    3226             if (r->m_top <= y && r->m_bottom > y &&
    3227                 r->type() == FloatingObject::FloatLeft &&
    3228                 r->m_left + r->m_width > left) {
    3229                 left = r->m_left + r->m_width;
    3230                 if ( heightRemaining ) *heightRemaining = r->m_bottom - y;
     3222        for ( ; (r = it.current()); ++it) {
     3223            if (r->top() <= y && r->bottom() > y
     3224                && r->type() == FloatingObject::FloatLeft
     3225                && r->right() > left) {
     3226                left = r->right();
     3227                if (heightRemaining)
     3228                    *heightRemaining = r->bottom() - y;
    32313229            }
    32323230        }
     
    32513249        FloatingObject* r;
    32523250        DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    3253         for ( ; (r = it.current()); ++it )
    3254         {
    3255             if (r->m_top <= y && r->m_bottom > y &&
    3256                 r->type() == FloatingObject::FloatRight &&
    3257                 r->m_left < right) {
    3258                 right = r->m_left;
    3259                 if ( heightRemaining ) *heightRemaining = r->m_bottom - y;
     3251        for ( ; (r = it.current()); ++it) {
     3252            if (r->top() <= y && r->bottom() > y
     3253                && r->type() == FloatingObject::FloatRight
     3254                && r->left() < right) {
     3255                right = r->left();
     3256                if (heightRemaining)
     3257                    *heightRemaining = r->bottom() - y;
    32603258            }
    32613259        }
     
    32883286    DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    32893287    for ( ; (r = it.current()); ++it) {
    3290         if (r->m_bottom > height)
    3291             bottom = min(r->m_bottom, bottom);
     3288        if (r->bottom() > height)
     3289            bottom = min(r->bottom(), bottom);
    32923290    }
    32933291
     
    33033301    DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    33043302    for ( ; (r = it.current()); ++it )
    3305         if (r->m_bottom>bottom)
    3306             bottom = r->m_bottom;
     3303        if (r->bottom() > bottom)
     3304            bottom = r->bottom();
    33073305    return bottom;
    33083306}
     
    33743372        for ( ; (r = it.current()); ++it ) {
    33753373            if (r->m_shouldPaint || r->m_renderer->hasSelfPaintingLayer()) {
    3376                 int lp = r->m_top + r->m_renderer->marginTop() + r->m_renderer->lowestPosition(false);
     3374                int lp = r->top() + r->m_renderer->marginTop() + r->m_renderer->lowestPosition(false);
    33773375                bottom = max(bottom, lp + relativeOffset);
    33783376            }
     
    34713469        for ( ; (r = it.current()); ++it ) {
    34723470            if (r->m_shouldPaint || r->m_renderer->hasSelfPaintingLayer()) {
    3473                 int rp = r->m_left + r->m_renderer->marginLeft() + r->m_renderer->rightmostPosition(false);
     3471                int rp = r->left() + r->m_renderer->marginLeft() + r->m_renderer->rightmostPosition(false);
    34743472                right = max(right, rp + relativeOffset);
    34753473            }
     
    35723570        for ( ; (r = it.current()); ++it ) {
    35733571            if (r->m_shouldPaint || r->m_renderer->hasSelfPaintingLayer()) {
    3574                 int lp = r->m_left + r->m_renderer->marginLeft() + r->m_renderer->leftmostPosition(false);
     3572                int lp = r->left() + r->m_renderer->marginLeft() + r->m_renderer->leftmostPosition(false);
    35753573                left = min(left, lp + relativeOffset);
    35763574            }
     
    35863584}
    35873585
    3588 int
    3589 RenderBlock::leftBottom()
     3586int RenderBlock::leftBottom()
    35903587{
    35913588    if (!m_floatingObjects) return 0;
     
    35933590    FloatingObject* r;
    35943591    DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    3595     for ( ; (r = it.current()); ++it )
    3596         if (r->m_bottom > bottom && r->type() == FloatingObject::FloatLeft)
    3597             bottom = r->m_bottom;
     3592    for ( ; (r = it.current()); ++it)
     3593        if (r->bottom() > bottom && r->type() == FloatingObject::FloatLeft)
     3594            bottom = r->bottom();
    35983595
    35993596    return bottom;
    36003597}
    36013598
    3602 int
    3603 RenderBlock::rightBottom()
     3599int RenderBlock::rightBottom()
    36043600{
    36053601    if (!m_floatingObjects) return 0;
     
    36073603    FloatingObject* r;
    36083604    DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    3609     for ( ; (r = it.current()); ++it )
    3610         if (r->m_bottom>bottom && r->type() == FloatingObject::FloatRight)
    3611             bottom = r->m_bottom;
     3605    for ( ; (r = it.current()); ++it)
     3606        if (r->bottom() > bottom && r->type() == FloatingObject::FloatRight)
     3607            bottom = r->bottom();
    36123608
    36133609    return bottom;
     
    37003696                FloatingObject* oldFloatingObject = floatMap.get(f->m_renderer);
    37013697                if (oldFloatingObject) {
    3702                     if (f->m_width != oldFloatingObject->m_width || f->m_left != oldFloatingObject->m_left) {
     3698                    if (f->width() != oldFloatingObject->width() || f->left() != oldFloatingObject->left()) {
    37033699                        changeTop = 0;
    3704                         changeBottom = max(changeBottom, max(f->m_bottom, oldFloatingObject->m_bottom));
    3705                     } else if (f->m_bottom != oldFloatingObject->m_bottom) {
    3706                         changeTop = min(changeTop, min(f->m_bottom, oldFloatingObject->m_bottom));
    3707                         changeBottom = max(changeBottom, max(f->m_bottom, oldFloatingObject->m_bottom));
     3700                        changeBottom = max(changeBottom, max(f->bottom(), oldFloatingObject->bottom()));
     3701                    } else if (f->bottom() != oldFloatingObject->bottom()) {
     3702                        changeTop = min(changeTop, min(f->bottom(), oldFloatingObject->bottom()));
     3703                        changeBottom = max(changeBottom, max(f->bottom(), oldFloatingObject->bottom()));
    37083704                    }
    37093705
     
    37123708                } else {
    37133709                    changeTop = 0;
    3714                     changeBottom = max(changeBottom, f->m_bottom);
     3710                    changeBottom = max(changeBottom, f->bottom());
    37153711                }
    37163712            }
     
    37223718            if (!floatingObject->m_isDescendant) {
    37233719                changeTop = 0;
    3724                 changeBottom = max(changeBottom, floatingObject->m_bottom);
     3720                changeBottom = max(changeBottom, floatingObject->bottom());
    37253721            }
    37263722        }
     
    37433739    DeprecatedPtrListIterator<FloatingObject> it(*child->m_floatingObjects);
    37443740    for (FloatingObject* r; (r = it.current()); ++it) {
    3745         int bottom = child->y() + r->m_bottom;
     3741        int bottom = child->y() + r->bottom();
    37463742        lowestFloatBottom = max(lowestFloatBottom, bottom);
    37473743
     
    37493745            // If the object is not in the list, we add it now.
    37503746            if (!containsFloat(r->m_renderer)) {
    3751                 FloatingObject *floatingObj = new FloatingObject(r->type());
    3752                 floatingObj->m_top = r->m_top - yoff;
    3753                 floatingObj->m_bottom = r->m_bottom - yoff;
    3754                 floatingObj->m_left = r->m_left - xoff;
    3755                 floatingObj->m_width = r->m_width;
     3747                FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->left() - xoff, r->top() - yoff, r->width(), r->height()));
    37563748                floatingObj->m_renderer = r->m_renderer;
    37573749
     
    37823774
    37833775        if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer())
    3784             child->addOverflowFromChild(r->m_renderer, IntSize(r->m_left + r->m_renderer->marginLeft(), r->m_top + r->m_renderer->marginTop()));
     3776            child->addOverflowFromChild(r->m_renderer, IntSize(r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop()));
    37853777    }
    37863778    return lowestFloatBottom;
     
    37953787    DeprecatedPtrListIterator<FloatingObject> it(*prev->m_floatingObjects);
    37963788    for (FloatingObject *r; (r = it.current()); ++it) {
    3797         if (r->m_bottom > yoff) {
     3789        if (r->bottom() > yoff) {
    37983790            // The object may already be in our list. Check for it up front to avoid
    37993791            // creating duplicate entries.
     
    38073799            }
    38083800            if (!f) {
    3809                 FloatingObject *floatingObj = new FloatingObject(r->type());
    3810                 floatingObj->m_top = r->m_top - yoff;
    3811                 floatingObj->m_bottom = r->m_bottom - yoff;
    3812                 floatingObj->m_left = r->m_left - xoff;
     3801                FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->left() - xoff - marginLeft(), r->top() - yoff, r->width(), r->height()));
     3802
    38133803                // Applying the child's margin makes no sense in the case where the child was passed in.
    38143804                // since his own margin was added already through the subtraction of the |xoff| variable
     
    38173807                // will get applied twice.
    38183808                if (prev != parent())
    3819                     floatingObj->m_left += prev->marginLeft();
    3820                 floatingObj->m_left -= marginLeft();
     3809                    floatingObj->setLeft(floatingObj->left() + prev->marginLeft());
     3810               
    38213811                floatingObj->m_shouldPaint = false;  // We are not in the direct inheritance chain for this float. We will never paint it.
    3822                 floatingObj->m_width = r->m_width;
    38233812                floatingObj->m_renderer = r->m_renderer;
    38243813               
     
    40514040    for (it.toLast(); (floatingObject = it.current()); --it) {
    40524041        if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) {
    4053             int xOffset = tx + floatingObject->m_left + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();
    4054             int yOffset =  ty + floatingObject->m_top + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();
     4042            int xOffset = tx + floatingObject->left() + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();
     4043            int yOffset =  ty + floatingObject->top() + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();
    40554044            if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), xOffset, yOffset)) {
    40564045                updateHitTestResult(result, IntPoint(x - xOffset, y - yOffset));
     
    55385527                // Only examine the object if our m_shouldPaint flag is set.
    55395528                if (r->m_shouldPaint) {
    5540                     int floatLeft = r->m_left - r->m_renderer->x() + r->m_renderer->marginLeft();
     5529                    int floatLeft = r->left() - r->m_renderer->x() + r->m_renderer->marginLeft();
    55415530                    int floatRight = floatLeft + r->m_renderer->width();
    55425531                    left = min(left, floatLeft);
  • trunk/WebCore/rendering/RenderBlock.h

    r68842 r68926  
    365365        };
    366366
    367         FloatingObject(Type type)
     367        FloatingObject(Type type, const IntRect& frameRect = IntRect())
    368368            : m_renderer(0)
    369             , m_top(0)
    370             , m_bottom(0)
    371             , m_left(0)
    372             , m_width(0)
     369            , m_frameRect(frameRect)
    373370            , m_paginationStrut(0)
    374371            , m_type(type)
     
    380377        Type type() { return static_cast<Type>(m_type); }
    381378
     379        int left() const { return m_frameRect.x(); }
     380        int right() const { return m_frameRect.right(); }
     381        int top() const { return m_frameRect.y(); }
     382        int bottom() const { return m_frameRect.bottom(); }
     383        int width() const { return m_frameRect.width(); }
     384        int height() const { return m_frameRect.height(); }
     385   
     386        void setLeft(int left) { m_frameRect.setX(left); }
     387        void setTop(int top) { m_frameRect.setY(top); }
     388        void setWidth(int width) { m_frameRect.setWidth(width); }
     389        void setHeight(int height) { m_frameRect.setHeight(height); }
     390
     391        const IntRect& frameRect() const { return m_frameRect; }
     392        void setFrameRect(const IntRect& frameRect) { m_frameRect = frameRect; }
     393
    382394        RenderBox* m_renderer;
    383         int m_top;
    384         int m_bottom;
    385         int m_left;
    386         int m_width;
     395        IntRect m_frameRect;
    387396        int m_paginationStrut;
    388397        unsigned m_type : 1; // Type (left or right aligned)
  • trunk/WebCore/rendering/RenderBlockLineLayout.cpp

    r68817 r68926  
    811811                    ASSERT(f->m_renderer == floats[floatIndex].object);
    812812                    // If a float's geometry has changed, give up on syncing with clean lines.
    813                     if (floats[floatIndex].rect != IntRect(f->m_left, f->m_top, f->m_width, f->m_bottom - f->m_top))
     813                    if (floats[floatIndex].rect != f->frameRect())
    814814                        checkForEndLineMatch = false;
    815815                    floatIndex++;
     
    11091109
    11101110        for (FloatingObject* f = m_floatingObjects->first(); f; f = m_floatingObjects->next()) {
    1111             if (f->m_bottom >= top && f->m_bottom < bottom)
     1111            if (f->bottom() >= top && f->bottom() < bottom)
    11121112                return false;
    11131113        }
     
    11431143
    11441144                for (FloatingObject* f = m_floatingObjects->first(); f; f = m_floatingObjects->next()) {
    1145                     if (f->m_bottom >= top && f->m_bottom < bottom)
     1145                    if (f->bottom() >= top && f->bottom() < bottom)
    11461146                        return false;
    11471147                }
Note: See TracChangeset for help on using the changeset viewer.