Changeset 18819 in webkit


Ignore:
Timestamp:
Jan 12, 2007, 2:53:40 PM (18 years ago)
Author:
hyatt
Message:

Fix for bug 11598, implement lightweight control clipping mechanism for
buttons, list boxes, and dropdown lists. Make sure list box respects
scrollLeft/Top/Width/Height as well as clientWidth/Height.

Fix bugs in RenderStyle::diff. CursorData was not being compared properly.
vertical-align had a non-inline display check that was wrong (preventing
dynamic changes to keyword-based vertical-align from working).

Reviewed by mitz

  • page/EventHandler.cpp: (WebCore::EventHandler::selectClosestWordFromMouseEvent):
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::layout): (WebCore::RenderBlock::layoutBlock): (WebCore::RenderBlock::determineHorizontalPosition): (WebCore::RenderBlock::layoutBlockChildren): (WebCore::RenderBlock::paint): (WebCore::RenderBlock::fillHorizontalSelectionGap): (WebCore::RenderBlock::nodeAtPoint): (WebCore::RenderBlock::layoutColumns):
  • rendering/RenderBox.cpp: (WebCore::RenderBox::computeAbsoluteRepaintRect):
  • rendering/RenderBox.h:
  • rendering/RenderButton.cpp: (WebCore::RenderButton::setStyle): (WebCore::RenderButton::controlClipRect):
  • rendering/RenderButton.h: (WebCore::RenderButton::hasControlClip):
  • rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::layoutHorizontalBox): (WebCore::RenderFlexibleBox::layoutVerticalBox):
  • rendering/RenderFlow.cpp: (WebCore::RenderFlow::addFocusRingRects):
  • rendering/RenderListBox.cpp: (WebCore::RenderListBox::itemBoundingBoxRect): (WebCore::RenderListBox::paintObject): (WebCore::RenderListBox::itemHeight): (WebCore::RenderListBox::verticalScrollbarWidth): (WebCore::RenderListBox::scrollWidth): (WebCore::RenderListBox::scrollHeight): (WebCore::RenderListBox::scrollLeft): (WebCore::RenderListBox::setScrollLeft): (WebCore::RenderListBox::scrollTop): (WebCore::RenderListBox::setScrollTop): (WebCore::RenderListBox::controlClipRect):
  • rendering/RenderListBox.h: (WebCore::RenderListBox::hasControlClip):
  • rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::setStyle): (WebCore::RenderMenuList::controlClipRect):
  • rendering/RenderMenuList.h: (WebCore::RenderMenuList::hasControlClip):
  • rendering/RenderObject.cpp: (WebCore::RenderObject::verticalScrollbarWidth): (WebCore::RenderObject::horizontalScrollbarHeight): (WebCore::RenderObject::clientWidth): (WebCore::RenderObject::clientHeight): (WebCore::RenderObject::setStyle):
  • rendering/RenderObject.h: (WebCore::RenderObject::hasControlClip): (WebCore::RenderObject::controlClipRect): (WebCore::RenderObject::contentWidth): (WebCore::RenderObject::contentHeight):
  • rendering/RenderStyle.cpp: (WebCore::StyleVisualData::StyleVisualData): (WebCore::cursorDataEqvuialent): (WebCore::StyleInheritedData::operator==): (WebCore::CursorList::operator==): (WebCore::RenderStyle::diff):
  • rendering/RenderStyle.h: (WebCore::LengthBox::operator!=): (WebCore::StyleVisualData::operator==): (WebCore::CursorData::operator==): (WebCore::CursorData::operator!=): (WebCore::CursorList::operator!=): (WebCore::RenderStyle::setTableLayout):
  • rendering/bidi.cpp: (WebCore::RenderBlock::layoutInlineChildren):
Location:
trunk/WebCore
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r18816 r18819  
     12007-01-12  David Hyatt  <hyatt@apple.com>
     2
     3        Fix for bug 11598, implement lightweight control clipping mechanism for
     4        buttons, list boxes, and dropdown lists.  Make sure list box respects
     5        scrollLeft/Top/Width/Height as well as clientWidth/Height.
     6
     7        Fix bugs in RenderStyle::diff.  CursorData was not being compared properly.
     8        vertical-align had a non-inline display check that was wrong (preventing
     9        dynamic changes to keyword-based vertical-align from working).
     10
     11        Reviewed by mitz
     12
     13        * page/EventHandler.cpp:
     14        (WebCore::EventHandler::selectClosestWordFromMouseEvent):
     15        * rendering/RenderBlock.cpp:
     16        (WebCore::RenderBlock::layout):
     17        (WebCore::RenderBlock::layoutBlock):
     18        (WebCore::RenderBlock::determineHorizontalPosition):
     19        (WebCore::RenderBlock::layoutBlockChildren):
     20        (WebCore::RenderBlock::paint):
     21        (WebCore::RenderBlock::fillHorizontalSelectionGap):
     22        (WebCore::RenderBlock::nodeAtPoint):
     23        (WebCore::RenderBlock::layoutColumns):
     24        * rendering/RenderBox.cpp:
     25        (WebCore::RenderBox::computeAbsoluteRepaintRect):
     26        * rendering/RenderBox.h:
     27        * rendering/RenderButton.cpp:
     28        (WebCore::RenderButton::setStyle):
     29        (WebCore::RenderButton::controlClipRect):
     30        * rendering/RenderButton.h:
     31        (WebCore::RenderButton::hasControlClip):
     32        * rendering/RenderFlexibleBox.cpp:
     33        (WebCore::RenderFlexibleBox::layoutBlock):
     34        (WebCore::RenderFlexibleBox::layoutHorizontalBox):
     35        (WebCore::RenderFlexibleBox::layoutVerticalBox):
     36        * rendering/RenderFlow.cpp:
     37        (WebCore::RenderFlow::addFocusRingRects):
     38        * rendering/RenderListBox.cpp:
     39        (WebCore::RenderListBox::itemBoundingBoxRect):
     40        (WebCore::RenderListBox::paintObject):
     41        (WebCore::RenderListBox::itemHeight):
     42        (WebCore::RenderListBox::verticalScrollbarWidth):
     43        (WebCore::RenderListBox::scrollWidth):
     44        (WebCore::RenderListBox::scrollHeight):
     45        (WebCore::RenderListBox::scrollLeft):
     46        (WebCore::RenderListBox::setScrollLeft):
     47        (WebCore::RenderListBox::scrollTop):
     48        (WebCore::RenderListBox::setScrollTop):
     49        (WebCore::RenderListBox::controlClipRect):
     50        * rendering/RenderListBox.h:
     51        (WebCore::RenderListBox::hasControlClip):
     52        * rendering/RenderMenuList.cpp:
     53        (WebCore::RenderMenuList::setStyle):
     54        (WebCore::RenderMenuList::controlClipRect):
     55        * rendering/RenderMenuList.h:
     56        (WebCore::RenderMenuList::hasControlClip):
     57        * rendering/RenderObject.cpp:
     58        (WebCore::RenderObject::verticalScrollbarWidth):
     59        (WebCore::RenderObject::horizontalScrollbarHeight):
     60        (WebCore::RenderObject::clientWidth):
     61        (WebCore::RenderObject::clientHeight):
     62        (WebCore::RenderObject::setStyle):
     63        * rendering/RenderObject.h:
     64        (WebCore::RenderObject::hasControlClip):
     65        (WebCore::RenderObject::controlClipRect):
     66        (WebCore::RenderObject::contentWidth):
     67        (WebCore::RenderObject::contentHeight):
     68        * rendering/RenderStyle.cpp:
     69        (WebCore::StyleVisualData::StyleVisualData):
     70        (WebCore::cursorDataEqvuialent):
     71        (WebCore::StyleInheritedData::operator==):
     72        (WebCore::CursorList::operator==):
     73        (WebCore::RenderStyle::diff):
     74        * rendering/RenderStyle.h:
     75        (WebCore::LengthBox::operator!=):
     76        (WebCore::StyleVisualData::operator==):
     77        (WebCore::CursorData::operator==):
     78        (WebCore::CursorData::operator!=):
     79        (WebCore::CursorList::operator!=):
     80        (WebCore::RenderStyle::setTableLayout):
     81        * rendering/bidi.cpp:
     82        (WebCore::RenderBlock::layoutInlineChildren):
     83
    1842007-01-12  David Hyatt  <hyatt@apple.com>
    285
  • trunk/WebCore/page/EventHandler.cpp

    r18769 r18819  
    137137            newSelection.expandUsingGranularity(WordGranularity);
    138138        }
    139     }
    140    
    141     if (newSelection.isRange()) {
    142         m_frame->setSelectionGranularity(WordGranularity);
    143         m_beganSelectingText = true;
    144     }
    145    
    146     if (m_frame->shouldChangeSelection(newSelection))
    147         m_frame->selectionController()->setSelection(newSelection);
     139   
     140        if (newSelection.isRange()) {
     141            m_frame->setSelectionGranularity(WordGranularity);
     142            m_beganSelectingText = true;
     143        }
     144       
     145        if (m_frame->shouldChangeSelection(newSelection))
     146            m_frame->selectionController()->setSelection(newSelection);
     147    }
    148148}
    149149
  • trunk/WebCore/rendering/RenderBlock.cpp

    r18799 r18819  
    437437    // layoutBlock().
    438438    layoutBlock(false);
     439   
     440    // It's safe to check for control clip here, since controls can never be table cells.
     441    if (hasControlClip()) {
     442        // Because of the lightweight clip, there can never be any overflow from children.
     443        m_overflowWidth = m_width;
     444        m_overflowHeight = m_height;
     445        m_overflowLeft = 0;
     446        m_overflowTop = 0;
     447    }
    439448}
    440449
     
    517526
    518527    // Expand our intrinsic height to encompass floats.
    519     int toAdd = borderBottom() + paddingBottom();
    520     if (includeHorizontalScrollbarSize())
    521         toAdd += m_layer->horizontalScrollbarHeight();
     528    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    522529    if (floatBottom() > (m_height - toAdd) && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() ||
    523530                                    (parent() && parent()->isFlexibleBox())))
     
    980987        child->setPos(chPos, child->yPos());
    981988    } else {
    982         int xPos = m_width - borderRight() - paddingRight() - (includeVerticalScrollbarSize() ? m_layer->verticalScrollbarWidth() : 0);
     989        int xPos = m_width - borderRight() - paddingRight() - verticalScrollbarWidth();
    983990        int chPos = xPos - (child->width() + child->marginRight());
    984991        if (child->avoidsFloats()) {
     
    10571064{
    10581065    int top = borderTop() + paddingTop();
    1059     int bottom = borderBottom() + paddingBottom() + (includeHorizontalScrollbarSize() ? m_layer->horizontalScrollbarHeight() : 0);
     1066    int bottom = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    10601067
    10611068    m_height = m_overflowHeight = top;
     
    13031310    }
    13041311
    1305     return paintObject(paintInfo, tx, ty);
     1312    // Push a clip.
     1313    bool useControlClip = paintInfo.phase == PaintPhaseForeground && hasControlClip();
     1314    if (useControlClip) {
     1315        IntRect clipRect(controlClipRect(tx, ty));
     1316        if (clipRect.isEmpty())
     1317            return;
     1318        paintInfo.context->save();
     1319        paintInfo.context->clip(clipRect);
     1320    }
     1321
     1322    paintObject(paintInfo, tx, ty);
     1323   
     1324    // Pop the clip.
     1325    if (useControlClip)
     1326        paintInfo.context->restore();
    13061327}
    13071328
     
    17341755        return IntRect();
    17351756    IntRect gapRect(xPos, yPos, width, height);
    1736     if (paintInfo)
     1757    if (paintInfo && selObj->style()->visibility() == VISIBLE)
    17371758        paintInfo->context->fillRect(gapRect, selObj->selectionBackgroundColor());
    17381759    return gapRect;
     
    26352656    int tx = _tx + m_x;
    26362657    int ty = _ty + m_y + borderTopExtra();
    2637    
     2658
    26382659    if (!inlineFlow && !isRenderView()) {
    26392660        // Check if we need to do anything at all.
     
    26602681    }
    26612682
    2662     // Hit test descendants first.
    2663     int scrolledX = tx;
    2664     int scrolledY = ty;
    2665     if (hasOverflowClip())
    2666         m_layer->subtractScrollOffset(scrolledX, scrolledY);
    2667 
    2668     // Hit test contents if we don't have columns.
    2669     if (!hasColumns() && hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction))
    2670         return true;
    2671        
    2672     // Hit test our columns if we do have them.
    2673     if (hasColumns() && hitTestColumns(request, result, _x, _y, scrolledX, scrolledY, hitTestAction))
    2674         return true;
    2675 
    2676     // Hit test floats.
    2677     if (hitTestAction == HitTestFloat && m_floatingObjects) {
    2678         if (isRenderView()) {
    2679             scrolledX += static_cast<RenderView*>(this)->frameView()->contentsX();
    2680             scrolledY += static_cast<RenderView*>(this)->frameView()->contentsY();
    2681         }
    2682        
    2683         FloatingObject* o;
    2684         DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
    2685         for (it.toLast(); (o = it.current()); --it) {
    2686             if (!o->noPaint && !o->node->layer()) {
    2687                 int xoffset = scrolledX + o->left + o->node->marginLeft() - o->node->xPos();
    2688                 int yoffset =  scrolledY + o->startY + o->node->marginTop() - o->node->yPos();
    2689                 if (o->node->hitTest(request, result, _x, _y, xoffset, yoffset)) {
    2690                     updateHitTestResult(result, IntPoint(_x - xoffset, _y - yoffset));
    2691                     return true;
     2683     // If we have lightweight control clipping, then we can't have any spillout.
     2684    if (!hasControlClip() || controlClipRect(tx, ty).contains(_x, _y)) {
     2685        // Hit test descendants first.
     2686        int scrolledX = tx;
     2687        int scrolledY = ty;
     2688        if (hasOverflowClip())
     2689            m_layer->subtractScrollOffset(scrolledX, scrolledY);
     2690
     2691        // Hit test contents if we don't have columns.
     2692        if (!hasColumns() && hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction))
     2693            return true;
     2694           
     2695        // Hit test our columns if we do have them.
     2696        if (hasColumns() && hitTestColumns(request, result, _x, _y, scrolledX, scrolledY, hitTestAction))
     2697            return true;
     2698
     2699        // Hit test floats.
     2700        if (hitTestAction == HitTestFloat && m_floatingObjects) {
     2701            if (isRenderView()) {
     2702                scrolledX += static_cast<RenderView*>(this)->frameView()->contentsX();
     2703                scrolledY += static_cast<RenderView*>(this)->frameView()->contentsY();
     2704            }
     2705           
     2706            FloatingObject* o;
     2707            DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
     2708            for (it.toLast(); (o = it.current()); --it) {
     2709                if (!o->noPaint && !o->node->layer()) {
     2710                    int xoffset = scrolledX + o->left + o->node->marginLeft() - o->node->xPos();
     2711                    int yoffset =  scrolledY + o->startY + o->node->marginTop() - o->node->yPos();
     2712                    if (o->node->hitTest(request, result, _x, _y, xoffset, yoffset)) {
     2713                        updateHitTestResult(result, IntPoint(_x - xoffset, _y - yoffset));
     2714                        return true;
     2715                    }
    26922716                }
    26932717            }
     
    30713095
    30723096    m_overflowHeight = maxColBottom;
    3073     int toAdd = borderBottom() + paddingBottom();
    3074     if (includeHorizontalScrollbarSize())
    3075         toAdd += m_layer->horizontalScrollbarHeight();
     3097    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    30763098       
    30773099    if (computeIntrinsicHeight)
  • trunk/WebCore/rendering/RenderBox.cpp

    r18788 r18819  
    179179    if (layer)
    180180        layer->destroy(arena);
    181 }
    182 
    183 int RenderBox::contentWidth() const
    184 {
    185     int w = m_width - (borderLeft() + borderRight() + paddingLeft() + paddingRight());
    186 
    187     if (includeVerticalScrollbarSize())
    188         w -= m_layer->verticalScrollbarWidth();
    189    
    190     return w;
    191 }
    192 
    193 int RenderBox::contentHeight() const
    194 {
    195     int h = m_height - (borderTop() + borderBottom() + paddingTop() + paddingBottom());
    196 
    197     if (includeHorizontalScrollbarSize())
    198         h -= m_layer->horizontalScrollbarHeight();
    199 
    200     return h;
    201181}
    202182
     
    975955            IntRect boxRect(0, 0, o->layer()->width(), o->layer()->height());
    976956            o->layer()->subtractScrollOffset(x,y); // For overflow:auto/scroll/hidden.
     957            IntRect repaintRect(x, y, r.width(), r.height());
     958            r = intersection(repaintRect, boxRect);
     959            if (r.isEmpty())
     960                return;
     961        } else if (o->hasControlClip()) {
     962            // Some form controls use a lightweight clipping scheme to avoid the overhead of a layer.
     963            IntRect boxRect(borderLeft(), borderTop(), m_width - borderLeft() - borderRight(), m_height - borderTop() - borderBottom());
    977964            IntRect repaintRect(x, y, r.width(), r.height());
    978965            r = intersection(repaintRect, boxRect);
  • trunk/WebCore/rendering/RenderBox.h

    r18788 r18819  
    4545    virtual int minWidth() const { return m_minWidth; }
    4646    virtual int maxWidth() const { return m_maxWidth; }
    47 
    48     virtual int contentWidth() const;
    49     virtual int contentHeight() const;
    5047
    5148    virtual int overrideSize() const { return m_overrideSize; }
  • trunk/WebCore/rendering/RenderButton.cpp

    r18637 r18819  
    6868    if (m_buttonText)
    6969        m_buttonText->setStyle(style);
    70     if (m_inner)
     70    if (m_inner) // RenderBlock handled updating the anonymous block's style.
    7171        m_inner->style()->setBoxFlex(1.0f);
    7272    setReplaced(isInline());
     
    109109}
    110110
    111 void RenderButton::paintObject(PaintInfo& paintInfo, int tx, int ty)
     111IntRect RenderButton::controlClipRect(int tx, int ty) const
    112112{
    113     // Push a clip.
    114     if (m_inner && paintInfo.phase == PaintPhaseForeground) {
    115         IntRect clipRect(tx + borderLeft(), ty + borderTop(),
    116             width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
    117         if (clipRect.width() == 0 || clipRect.height() == 0)
    118             return;
    119         paintInfo.context->save();
    120         paintInfo.context->clip(clipRect);
    121     }
    122 
    123     // Paint the children.
    124     RenderBlock::paintObject(paintInfo, tx, ty);
    125 
    126     // Pop the clip.
    127     if (m_inner && paintInfo.phase == PaintPhaseForeground)
    128         paintInfo.context->restore();
     113    // Clip to the padding box to at least give content the extra padding space.
     114    return IntRect(tx + borderLeft(), ty + borderTop(), m_width - borderLeft() - borderRight(), m_height - borderTop() - borderBottom());
    129115}
    130116
     117
    131118} // namespace WebCore
  • trunk/WebCore/rendering/RenderButton.h

    r17448 r18819  
    4747    virtual void updatePseudoChild(RenderStyle::PseudoId);
    4848
    49     virtual void paintObject(PaintInfo&, int tx, int ty);
     49    virtual bool hasControlClip() const { return true; }
     50    virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const;
    5051
    5152    void setText(const String&);
  • trunk/WebCore/rendering/RenderFlexibleBox.cpp

    r18764 r18819  
    293293        // If the block got expanded in size, then increase our overflowheight to match.
    294294        if (m_overflowHeight > m_height)
    295             m_overflowHeight -= (borderBottom() + paddingBottom() + (includeHorizontalScrollbarSize() ? m_layer->horizontalScrollbarHeight() : 0));
     295            m_overflowHeight -= (borderBottom() + paddingBottom() + horizontalScrollbarHeight());
    296296        if (m_overflowHeight < m_height)
    297297            m_overflowHeight = m_height;
     
    336336void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
    337337{
    338     int toAdd = borderBottom() + paddingBottom() + (includeHorizontalScrollbarSize() ? m_layer->horizontalScrollbarHeight() : 0);
     338    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    339339    int yPos = borderTop() + paddingTop();
    340340    int xPos = borderLeft() + paddingLeft();
     
    662662    if( style()->direction() == RTL )
    663663        xPos = m_width - paddingRight() - borderRight();
    664     int toAdd = borderBottom() + paddingBottom() + (includeHorizontalScrollbarSize() ? m_layer->horizontalScrollbarHeight() : 0);;
     664    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    665665    bool heightSpecified = false;
    666666    int oldHeight = 0;
  • trunk/WebCore/rendering/RenderFlow.cpp

    r18758 r18819  
    664664       graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));
    665665
    666     if (!hasOverflowClip()) {
     666    if (!hasOverflowClip() && !hasControlClip()) {
    667667        for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
    668668            graphicsContext->addFocusRingRect(IntRect(tx + curr->xPos(), ty + curr->yPos(), curr->width(), curr->height()));
  • trunk/WebCore/rendering/RenderListBox.cpp

    r18648 r18819  
    205205IntRect RenderListBox::itemBoundingBoxRect(int tx, int ty, int index)
    206206{
    207     return IntRect (tx + borderLeft() + paddingLeft(),
     207    return IntRect(tx + borderLeft() + paddingLeft(),
    208208                   ty + borderTop() + paddingTop() + ((style()->font().height() + optionsSpacingMiddle) * (index - m_indexOffset)),
    209                    absoluteBoundingBoxRect().width() - borderLeft() - borderRight() - paddingLeft() - paddingRight(),
     209                   contentWidth(),
    210210                   style()->font().height() + optionsSpacingMiddle);
    211211}
     
    213213void RenderListBox::paintObject(PaintInfo& paintInfo, int tx, int ty)
    214214{
    215     // Push a clip.
    216     IntRect clipRect(tx + borderLeft(), ty + borderTop(),
    217          width() - borderLeft() - borderRight() - (m_vBar ? m_vBar->width() : 0), height() - borderBottom() - borderTop());
    218     if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
    219         if (clipRect.width() == 0 || clipRect.height() == 0)
    220             return;
    221         paintInfo.context->save();
    222         paintInfo.context->clip(clipRect);
    223     }
    224    
    225215    HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
    226216    int listItemsSize = select->listItems().size();
     
    245235        paintScrollbar(paintInfo);
    246236    }
    247     // Pop the clip.
    248     if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds)
    249         paintInfo.context->restore();
    250237}
    251238
     
    452439}
    453440
     441int RenderListBox::itemHeight() const
     442{
     443    return style()->font().height() + optionsSpacingMiddle;
     444}
     445
     446int RenderListBox::verticalScrollbarWidth() const
     447{
     448    return m_vBar ? m_vBar->width() : 0;
     449}
     450
     451// FIXME: We ignore padding in the vertical direction as far as these values are concerned, since that's
     452// how the control currently paints.
     453int RenderListBox::scrollWidth() const
     454{
     455    // There is no horizontal scrolling allowed.
     456    return clientWidth();
     457}
     458
     459int RenderListBox::scrollHeight() const
     460{
     461    HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
     462    const Vector<HTMLElement*>& listItems = select->listItems();
     463    return max(clientHeight(), (int)listItems.size() * itemHeight());
     464}
     465
     466int RenderListBox::scrollLeft() const
     467{
     468    return 0;
     469}
     470
     471void RenderListBox::setScrollLeft(int)
     472{
     473}
     474
     475int RenderListBox::scrollTop() const
     476{
     477    return m_indexOffset * itemHeight();
     478}
     479
     480void RenderListBox::setScrollTop(int newTop)
     481{
     482    // Determine an index and scroll to it.
     483    HTMLSelectElement* select = static_cast<HTMLSelectElement*>(node());
     484    const Vector<HTMLElement*>& listItems = select->listItems();
     485   
     486    int index = newTop / itemHeight();
     487    if (index < 0 || index > (int)listItems.size() - 1 || listIndexIsVisible(index))
     488        return;
     489
     490    int newOffset = index;
     491 
     492    if (m_vBar) {
     493        IntRect rect = absoluteBoundingBoxRect();
     494        m_vBar->setValue(itemBoundingBoxRect(rect.x(), rect.y(), newOffset + m_indexOffset).y() - rect.y());
     495    }
     496    m_indexOffset = newOffset;
     497}
     498
     499IntRect RenderListBox::controlClipRect(int tx, int ty) const
     500{
     501    // Clip to the padding box, since we have a scrollbar inside the padding box.
     502    return IntRect(tx + borderLeft(),
     503                   ty + borderTop(),
     504                   clientWidth(), clientHeight());
     505}
     506
    454507IntRect RenderListBox::windowClipRect() const
    455508{
  • trunk/WebCore/rendering/RenderListBox.h

    r18637 r18819  
    4646    virtual bool canHaveChildren() const { return false; }
    4747
     48    virtual bool hasControlClip() const { return true; }
    4849    virtual void paintObject(PaintInfo&, int tx, int ty);
     50    virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const;
     51
    4952    virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
    5053
     
    6366    int listIndexAtOffset(int x, int y);
    6467
     68    int itemHeight() const;
     69
    6570    bool scrollToRevealElementAtListIndex(int index);
    6671
     
    6873    virtual void autoscroll();
    6974    virtual void stopAutoscroll();
     75
     76    virtual int verticalScrollbarWidth() const;
     77    virtual int scrollLeft() const;
     78    virtual int scrollTop() const;
     79    virtual int scrollWidth() const;
     80    virtual int scrollHeight() const;
     81    virtual void setScrollLeft(int);
     82    virtual void setScrollTop(int);
    7083
    7184private:
     
    8093    bool m_optionsChanged;
    8194    int m_optionsWidth;
    82     int m_optionsMaxHeight;
    83     int m_optionsTotalHeight;
    8495    int m_indexOffset;
    8596    bool m_selectionChanged;
  • trunk/WebCore/rendering/RenderMenuList.cpp

    r18248 r18819  
    9696    if (m_buttonText)
    9797        m_buttonText->setStyle(style);
    98     if (m_innerBlock)
     98    if (m_innerBlock) // RenderBlock handled updating the anonymous block's style.
    9999        m_innerBlock->style()->setBoxFlex(1.0f);
    100100    setReplaced(isInline());
     
    169169}
    170170
    171 void RenderMenuList::paintObject(PaintInfo& paintInfo, int x, int y)
    172 {
    173     // Push a clip.
    174     if (paintInfo.phase == PaintPhaseForeground) {
    175         IntRect clipRect(x + borderLeft() + paddingLeft(), y + borderTop() + paddingTop(),
    176             width() - borderLeft() - borderRight() - paddingLeft() - paddingRight(),
    177             height() - borderBottom() - borderTop() - paddingTop() - paddingBottom());
    178         if (clipRect.isEmpty())
    179             return;
    180         paintInfo.context->save();
    181         paintInfo.context->clip(clipRect);
    182     }
    183 
    184     // Paint the children.
    185     RenderBlock::paintObject(paintInfo, x, y);
    186 
    187     // Pop the clip.
    188     if (paintInfo.phase == PaintPhaseForeground)
    189         paintInfo.context->restore();
     171IntRect RenderMenuList::controlClipRect(int tx, int ty) const
     172{
     173    // Clip to the content box, since the arrow sits in the padding space, and we don't want to draw over it.
     174    return IntRect(tx + borderLeft() + paddingLeft(),
     175                   ty + borderTop() + paddingTop(),
     176                   contentWidth(), contentHeight());
    190177}
    191178
  • trunk/WebCore/rendering/RenderMenuList.h

    r18248 r18819  
    5454    virtual void updateFromElement();
    5555
    56     virtual void paintObject(PaintInfo&, int tx, int ty);
     56    virtual bool hasControlClip() const { return true; }
     57    virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const;
    5758
    5859    virtual const char* renderName() const { return "RenderMenuList"; }
  • trunk/WebCore/rendering/RenderObject.cpp

    r18758 r18819  
    654654}
    655655
     656int RenderObject::verticalScrollbarWidth() const
     657{
     658    return includeVerticalScrollbarSize() ? layer()->verticalScrollbarWidth() : 0;
     659}
     660
     661int RenderObject::horizontalScrollbarHeight() const
     662{
     663    return includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0;
     664}
     665
    656666// More IE extensions.  clientWidth and clientHeight represent the interior of an object
    657667// excluding border and scrollbar.
    658668int RenderObject::clientWidth() const
    659669{
    660     return width() - borderLeft() - borderRight() -
    661         (includeVerticalScrollbarSize() ? layer()->verticalScrollbarWidth() : 0);
     670    return width() - borderLeft() - borderRight() - verticalScrollbarWidth();
     671       
    662672}
    663673
    664674int RenderObject::clientHeight() const
    665675{
    666     return height() - borderTop() - borderBottom() -
    667       (includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0);
     676    return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();
    668677}
    669678
     
    23112320    // No need to ever schedule repaints from a style change of a text run, since
    23122321    // we already did this for the parent of the text run.
    2313     if (d == RenderStyle::Layout && m_parent)
     2322    if (d == RenderStyle::Layout && m_parent && !isText())
    23142323        setNeedsLayoutAndMinMaxRecalc();
    23152324    else if (m_parent && !isText() && (d == RenderStyle::RepaintLayer || d == RenderStyle::Repaint))
  • trunk/WebCore/rendering/RenderObject.h

    r18810 r18819  
    326326
    327327    bool hasOverflowClip() const { return m_hasOverflowClip; }
     328    virtual bool hasControlClip() const { return false; }
     329    virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const { return IntRect(); }
    328330
    329331    bool hasAutoVerticalScrollbar() const { return hasOverflowClip() && (style()->overflowY() == OAUTO || style()->overflowY() == OOVERLAY); }
     
    334336    bool scrollsOverflowY() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || hasAutoVerticalScrollbar()); }
    335337
     338    virtual int verticalScrollbarWidth() const;
     339    virtual int horizontalScrollbarHeight() const;
     340private:
    336341    bool includeVerticalScrollbarSize() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || style()->overflowY() == OAUTO); }
    337342    bool includeHorizontalScrollbarSize() const { return hasOverflowClip() && (style()->overflowX() == OSCROLL || style()->overflowX() == OAUTO); }
    338343
     344public:
    339345    RenderStyle* getPseudoStyle(RenderStyle::PseudoId, RenderStyle* parentStyle = 0) const;
    340346
     
    549555
    550556    // size of the content area (box size minus padding/border)
    551     virtual int contentWidth() const { return 0; }
    552     virtual int contentHeight() const { return 0; }
     557    int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
     558    int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
    553559
    554560    // intrinsic extend of replaced elements. undefined otherwise
  • trunk/WebCore/rendering/RenderStyle.cpp

    r18810 r18819  
    8787    : hasClip(false)
    8888    , textDecoration(RenderStyle::initialTextDecoration())
    89     , colspan(1)
    9089    , counterIncrement(0)
    9190    , counterReset(0)
     
    102101    , hasClip(o.hasClip)
    103102    , textDecoration(o.textDecoration)
    104     , colspan(o.colspan)
    105103    , counterIncrement(o.counterIncrement)
    106104    , counterReset(o.counterReset)
     
    604602}
    605603
     604static bool cursorDataEqvuialent(const CursorList* c1, const CursorList* c2)
     605{
     606    if (c1 == c2)
     607        return true;
     608    if (!c1 && c2 || c1 && !c2)
     609        return false;
     610    return (*c1 == *c2);
     611}
     612
    606613bool StyleInheritedData::operator==(const StyleInheritedData& o) const
    607614{
     
    610617        line_height == o.line_height &&
    611618        style_image == o.style_image &&
    612         cursorData  == o.cursorData &&
     619        cursorDataEqvuialent(cursorData.get(), o.cursorData.get()) &&
    613620        font == o.font &&
    614621        color == o.color &&
     
    619626        page_break_inside == o.page_break_inside;
    620627}
     628
     629bool CursorList::operator==(const CursorList& other) const
     630{
     631    // If the lists aren't the same size, then they can't be equivalent.
     632    if (size() != other.size())
     633        return false;
     634       
     635    for (unsigned i = 0; i < size(); i++) {
     636        if (m_vector[i] != other.m_vector[i])
     637            return false;
     638    }
     639   
     640    return true;
     641}
     642
    621643
    622644static inline bool operator!=(const CounterContent& a, const CounterContent& b)
     
    872894#endif
    873895
    874     // we anyway assume they are the same
    875 //      EDisplay _effectiveDisplay : 5;
    876 
    877     // NonVisible:
    878 //      ECursor _cursor_style : 4;
    879 
    880 // ### this needs work to know more exactly if we need a relayout
    881 //     or just a repaint
    882 
    883 // non-inherited attributes
    884 //     DataRef<StyleBoxData> box;
    885 //     DataRef<StyleVisualData> visual;
    886 //     DataRef<StyleSurroundData> surround;
    887 
    888 // inherited attributes
    889 //     DataRef<StyleInheritedData> inherited;
    890 
    891     if ( box->width != other->box->width ||
    892          box->min_width != other->box->min_width ||
    893          box->max_width != other->box->max_width ||
    894          box->height != other->box->height ||
    895          box->min_height != other->box->min_height ||
    896          box->max_height != other->box->max_height ||
    897          box->vertical_align != other->box->vertical_align ||
    898          box->boxSizing != other->box->boxSizing ||
    899          !(surround->margin == other->surround->margin) ||
    900          !(surround->padding == other->surround->padding) ||
    901          rareNonInheritedData->m_appearance != other->rareNonInheritedData->m_appearance ||
    902          rareNonInheritedData->marginTopCollapse != other->rareNonInheritedData->marginTopCollapse ||
    903          rareNonInheritedData->marginBottomCollapse != other->rareNonInheritedData->marginBottomCollapse ||
    904          *rareNonInheritedData->flexibleBox.get() != *other->rareNonInheritedData->flexibleBox.get() ||
    905          *rareNonInheritedData->m_multiCol.get() != *other->rareNonInheritedData->m_multiCol.get() ||
    906          (rareNonInheritedData->lineClamp != other->rareNonInheritedData->lineClamp) ||
    907          (rareInheritedData->highlight != other->rareInheritedData->highlight) ||
    908          (rareInheritedData->textSizeAdjust != other->rareInheritedData->textSizeAdjust) ||
    909          (rareInheritedData->wordWrap != other->rareInheritedData->wordWrap) ||
    910          (rareInheritedData->nbspMode != other->rareInheritedData->nbspMode) ||
    911          (rareInheritedData->khtmlLineBreak != other->rareInheritedData->khtmlLineBreak) ||
    912         !(inherited->indent == other->inherited->indent) ||
    913         !(inherited->line_height == other->inherited->line_height) ||
    914         !(inherited->style_image == other->inherited->style_image) ||
    915         !(inherited->cursorData  == other->inherited->cursorData) ||
    916         !(inherited->font == other->inherited->font) ||
    917         !(inherited->horizontal_border_spacing == other->inherited->horizontal_border_spacing) ||
    918         !(inherited->vertical_border_spacing == other->inherited->vertical_border_spacing) ||
    919         !(inherited_flags._box_direction == other->inherited_flags._box_direction) ||
    920         !(inherited_flags._visuallyOrdered == other->inherited_flags._visuallyOrdered) ||
    921         !(inherited_flags._htmlHacks == other->inherited_flags._htmlHacks) ||
    922         !(noninherited_flags._position == other->noninherited_flags._position) ||
    923         !(noninherited_flags._floating == other->noninherited_flags._floating) ||
    924         !(noninherited_flags._originalDisplay == other->noninherited_flags._originalDisplay) ||
    925          visual->colspan != other->visual->colspan ||
    926          visual->counterIncrement != other->visual->counterIncrement ||
    927          visual->counterReset != other->visual->counterReset ||
    928          rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow ||
    929          (rareInheritedData->textSecurity != other->rareInheritedData->textSecurity))
     896    if (box->width != other->box->width ||
     897        box->min_width != other->box->min_width ||
     898        box->max_width != other->box->max_width ||
     899        box->height != other->box->height ||
     900        box->min_height != other->box->min_height ||
     901        box->max_height != other->box->max_height)
    930902        return Layout;
     903   
     904    if (box->vertical_align != other->box->vertical_align || noninherited_flags._vertical_align != other->noninherited_flags._vertical_align)
     905        return Layout;
     906   
     907    if (box->boxSizing != other->box->boxSizing)
     908        return Layout;
     909   
     910    if (surround->margin != other->surround->margin)
     911        return Layout;
     912       
     913    if (surround->padding != other->surround->padding)
     914        return Layout;
     915   
     916    if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) {
     917        if (rareNonInheritedData->m_appearance != other->rareNonInheritedData->m_appearance ||
     918            rareNonInheritedData->marginTopCollapse != other->rareNonInheritedData->marginTopCollapse ||
     919            rareNonInheritedData->marginBottomCollapse != other->rareNonInheritedData->marginBottomCollapse ||
     920            rareNonInheritedData->lineClamp != other->rareNonInheritedData->lineClamp ||
     921            rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow)
     922            return Layout;
     923       
     924        if (rareNonInheritedData->flexibleBox.get() != other->rareNonInheritedData->flexibleBox.get() &&
     925            *rareNonInheritedData->flexibleBox.get() != *other->rareNonInheritedData->flexibleBox.get())
     926            return Layout;
     927       
     928        if (!rareNonInheritedData->shadowDataEquivalent(*other->rareNonInheritedData.get()))
     929            return Layout;
     930
     931        if (rareNonInheritedData->m_multiCol.get() != other->rareNonInheritedData->m_multiCol.get() &&
     932            *rareNonInheritedData->m_multiCol.get() != *other->rareNonInheritedData->m_multiCol.get())
     933            return Layout;
     934           
     935        // If regions change trigger a relayout to re-calc regions.
     936        if (rareNonInheritedData->m_dashboardRegions != other->rareNonInheritedData->m_dashboardRegions)
     937            return Layout;
     938    }
     939
     940    if (rareInheritedData.get() != other->rareInheritedData.get()) {
     941        if (rareInheritedData->highlight != other->rareInheritedData->highlight ||
     942            rareInheritedData->textSizeAdjust != other->rareInheritedData->textSizeAdjust ||
     943            rareInheritedData->wordWrap != other->rareInheritedData->wordWrap ||
     944            rareInheritedData->nbspMode != other->rareInheritedData->nbspMode ||
     945            rareInheritedData->khtmlLineBreak != other->rareInheritedData->khtmlLineBreak ||
     946            rareInheritedData->textSecurity != other->rareInheritedData->textSecurity)
     947            return Layout;
     948       
     949        if (!rareInheritedData->shadowDataEquivalent(*other->rareInheritedData.get()))
     950            return Layout;
     951           
     952        if (textStrokeWidth() != other->textStrokeWidth())
     953            return Layout;
     954    }
     955
     956    if (inherited->indent != other->inherited->indent ||
     957        inherited->line_height != other->inherited->line_height ||
     958        inherited->style_image != other->inherited->style_image ||
     959        inherited->font != other->inherited->font ||
     960        inherited->horizontal_border_spacing != other->inherited->horizontal_border_spacing ||
     961        inherited->vertical_border_spacing != other->inherited->vertical_border_spacing ||
     962        inherited_flags._box_direction != other->inherited_flags._box_direction ||
     963        inherited_flags._visuallyOrdered != other->inherited_flags._visuallyOrdered ||
     964        inherited_flags._htmlHacks != other->inherited_flags._htmlHacks ||
     965        noninherited_flags._position != other->noninherited_flags._position ||
     966        noninherited_flags._floating != other->noninherited_flags._floating ||
     967        noninherited_flags._originalDisplay != other->noninherited_flags._originalDisplay)
     968        return Layout;
     969
    931970   
    932     // changes causing Layout changes:
    933 
    934 // only for tables:
    935 //     _border_collapse
    936 //     EEmptyCell _empty_cells : 2 ;
    937 //     ECaptionSide _caption_side : 2;
    938 //     ETableLayout _table_layout : 1;
    939 //     EPosition _position : 2;
    940 //     EFloat _floating : 2;
    941     if ( ((int)noninherited_flags._effectiveDisplay) >= TABLE ) {
    942         // Stupid gcc gives a compile error on
    943         // a != other->b if a and b are bitflags. Using
    944         // !(a== other->b) instead.
    945         if ( !(inherited_flags._border_collapse == other->inherited_flags._border_collapse) ||
    946              !(inherited_flags._empty_cells == other->inherited_flags._empty_cells) ||
    947              !(inherited_flags._caption_side == other->inherited_flags._caption_side) ||
    948              !(noninherited_flags._table_layout == other->noninherited_flags._table_layout))
     971    if (((int)noninherited_flags._effectiveDisplay) >= TABLE) {
     972        if (inherited_flags._border_collapse != other->inherited_flags._border_collapse ||
     973            inherited_flags._empty_cells != other->inherited_flags._empty_cells ||
     974            inherited_flags._caption_side != other->inherited_flags._caption_side ||
     975            noninherited_flags._table_layout != other->noninherited_flags._table_layout)
    949976            return Layout;
    950977       
     
    963990    }
    964991
    965 // only for lists:
    966 //      EListStyleType _list_style_type : 5 ;
    967 //      EListStylePosition _list_style_position :1;
    968     if (noninherited_flags._effectiveDisplay == LIST_ITEM ) {
    969         if ( !(inherited_flags._list_style_type == other->inherited_flags._list_style_type) ||
    970              !(inherited_flags._list_style_position == other->inherited_flags._list_style_position) )
     992    if (noninherited_flags._effectiveDisplay == LIST_ITEM) {
     993        if (inherited_flags._list_style_type != other->inherited_flags._list_style_type ||
     994            inherited_flags._list_style_position != other->inherited_flags._list_style_position)
    971995            return Layout;
    972996    }
    973997
    974 // ### These could be better optimised
    975 //      ETextAlign _text_align : 3;
    976 //      ETextTransform _text_transform : 4;
    977 //      EDirection _direction : 1;
    978 //      EWhiteSpace _white_space : 2;
    979 //      EFontVariant _font_variant : 1;
    980 //     EClear _clear : 2;
    981     if ( !(inherited_flags._text_align == other->inherited_flags._text_align) ||
    982          !(inherited_flags._text_transform == other->inherited_flags._text_transform) ||
    983          !(inherited_flags._direction == other->inherited_flags._direction) ||
    984          !(inherited_flags._white_space == other->inherited_flags._white_space) ||
    985          !(noninherited_flags._clear == other->noninherited_flags._clear) ||
    986          !rareInheritedData->shadowDataEquivalent(*other->rareInheritedData.get()) ||
    987          !rareNonInheritedData->shadowDataEquivalent(*other->rareNonInheritedData.get()) ||
    988          textStrokeWidth() != other->textStrokeWidth()
    989         )
     998    if (inherited_flags._text_align != other->inherited_flags._text_align ||
     999        inherited_flags._text_transform != other->inherited_flags._text_transform ||
     1000        inherited_flags._direction != other->inherited_flags._direction ||
     1001        inherited_flags._white_space != other->inherited_flags._white_space ||
     1002        noninherited_flags._clear != other->noninherited_flags._clear)
    9901003        return Layout;
    9911004
     
    9941007        noninherited_flags._overflowY != other->noninherited_flags._overflowY)
    9951008        return Layout;
    996        
    997 // only for inline:
    998 //     EVerticalAlign _vertical_align : 4;
    999 
    1000     if ( !(noninherited_flags._effectiveDisplay == INLINE) &&
    1001          !(noninherited_flags._vertical_align == other->noninherited_flags._vertical_align))
    1002         return Layout;
    1003 
     1009 
    10041010    // If our border widths change, then we need to layout.  Other changes to borders
    10051011    // only necessitate a repaint.
     
    10101016        return Layout;
    10111017
    1012     // If regions change trigger a relayout to re-calc regions.
    1013     if (!(rareNonInheritedData->m_dashboardRegions == other->rareNonInheritedData->m_dashboardRegions))
    1014         return Layout;
    1015    
    10161018    // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree.
    10171019    const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirectives;
     
    10191021    if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB)))
    10201022        return Layout;
     1023    if (visual->counterIncrement != other->visual->counterIncrement ||
     1024        visual->counterReset != other->visual->counterReset)
     1025        return Layout;
    10211026
    10221027    // Make sure these left/top/right/bottom checks stay below all layout checks and above
    10231028    // all visible checks.
    10241029    if (other->position() != StaticPosition) {
    1025         if (!(surround->offset == other->surround->offset)) {
     1030        if (surround->offset != other->surround->offset) {
    10261031            // FIXME: We will need to do a bit of work in RenderObject/Box::setStyle before we
    10271032            // can stop doing a layout when relative positioned objects move.  In particular, we'll need
     
    10331038        }
    10341039        else if (box->z_index != other->box->z_index || box->z_auto != other->box->z_auto ||
    1035                  !(visual->clip == other->visual->clip) || visual->hasClip != other->visual->hasClip)
     1040                 visual->clip != other->visual->clip || visual->hasClip != other->visual->hasClip)
    10361041            return RepaintLayer;
    10371042    }
     
    10401045        return RepaintLayer;
    10411046
    1042     // Repaint:
    1043 //      EVisibility _visibility : 2;
    1044 //      int _text_decoration : 4;
    1045 //     DataRef<StyleBackgroundData> background;
    10461047    if (inherited->color != other->inherited->color ||
    10471048        inherited_flags._visibility != other->inherited_flags._visibility ||
    1048         !(inherited_flags._text_decorations == other->inherited_flags._text_decorations) ||
    1049         !(inherited_flags._force_backgrounds_to_white == other->inherited_flags._force_backgrounds_to_white) ||
    1050         !(surround->border == other->surround->border) ||
     1049        inherited_flags._text_decorations != other->inherited_flags._text_decorations ||
     1050        inherited_flags._force_backgrounds_to_white != other->inherited_flags._force_backgrounds_to_white ||
     1051        surround->border != other->surround->border ||
    10511052        *background.get() != *other->background.get() ||
    10521053        visual->textDecoration != other->visual->textDecoration ||
     
    10551056        rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag ||
    10561057        rareInheritedData->textFillColor != other->rareInheritedData->textFillColor ||
    1057         rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor
    1058         )
     1058        rareInheritedData->textStrokeColor != other->rareInheritedData->textStrokeColor)
    10591059        return Repaint;
     1060
     1061    // Cursors are not checked, since they will be set appropriately in response to mouse events,
     1062    // so they don't need to cause any repaint or layout.
    10601063
    10611064    return Equal;
  • trunk/WebCore/rendering/RenderStyle.h

    r18724 r18819  
    109109    }
    110110
     111    bool operator!=(const LengthBox& o) const
     112    {
     113        return !(*this == o);
     114    }
    111115
    112116    bool nonZero() const { return !(left.isZero() && right.isZero() && top.isZero() && bottom.isZero()); }
     
    413417        return ( clip == o.clip &&
    414418                 hasClip == o.hasClip &&
    415                  colspan == o.colspan &&
    416419                 counterIncrement == o.counterIncrement &&
    417420                 counterReset == o.counterReset &&
     
    423426    bool hasClip : 1;
    424427    unsigned textDecoration : 4; // Text decorations defined *only* by this element.
    425    
    426     short colspan; // for html, not a css2 attribute
    427428
    428429    short counterIncrement; // ok, so these are not visual mode specific
     
    962963    {}
    963964   
     965    bool operator==(const CursorData& o) const {
     966        return hotSpot == o.hotSpot && cursorImage == o.cursorImage && cursorFragmentId == o.cursorFragmentId;
     967    }
     968    bool operator!=(const CursorData& o) const { return !(*this == o); }
     969
    964970    IntPoint hotSpot; // for CSS3 support
    965971    CachedImage* cursorImage; // weak pointer, the CSSValueImage takes care of deleting cursorImage
     
    972978        return m_vector[i];
    973979    }
     980
     981    bool operator==(const CursorList&) const;
     982    bool operator!=(const CursorList& o) const { return !(*this == o); }
    974983
    975984    size_t size() const { return m_vector.size(); }
     
    13051314    EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
    13061315    ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
    1307 
    1308     short colSpan() const { return visual->colspan; }
    13091316
    13101317    const Font& font() { return inherited->font; }
     
    15661573    void setClear(EClear v) {  noninherited_flags._clear = v; }
    15671574    void setTableLayout(ETableLayout v) {  noninherited_flags._table_layout = v; }
    1568     void ssetColSpan(short v) { SET_VAR(visual,colspan,v) }
    15691575
    15701576    bool setFontDescription(const FontDescription& v) {
  • trunk/WebCore/rendering/bidi.cpp

    r18764 r18819  
    14931493   
    14941494    m_height = borderTop() + paddingTop();
    1495     int toAdd = borderBottom() + paddingBottom();
    1496     if (includeHorizontalScrollbarSize())
    1497         toAdd += m_layer->horizontalScrollbarHeight();
     1495    int toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
    14981496   
    14991497    // Figure out if we should clear out our line boxes.
Note: See TracChangeset for help on using the changeset viewer.