Changeset 17448 in webkit


Ignore:
Timestamp:
Oct 30, 2006 2:41:29 PM (17 years ago)
Author:
weinig
Message:

Reviewed by Mitz.

Fix for http://bugs.webkit.org/show_bug.cgi?id=11441
More rendering code cleaning

  • WebCore.xcodeproj/project.pbxproj:
  • rendering/RenderApplet.cpp: (WebCore::RenderApplet::RenderApplet): (WebCore::RenderApplet::createWidgetIfNecessary):
  • rendering/RenderApplet.h:
  • rendering/RenderArena.cpp: (WebCore::): (WebCore::RenderArena::RenderArena): (WebCore::RenderArena::allocate): (WebCore::RenderArena::free):
  • rendering/RenderArena.h:
  • rendering/RenderBR.cpp: (WebCore::RenderBR::RenderBR): (WebCore::RenderBR::baselinePosition): (WebCore::RenderBR::lineHeight): (WebCore::RenderBR::setStyle): (WebCore::RenderBR::caretMinOffset): (WebCore::RenderBR::positionForCoordinates): (WebCore::RenderBR::inlineBox):
  • rendering/RenderBR.h:
  • rendering/RenderBlock.cpp:
  • rendering/RenderBlock.h: (WebCore::RenderBlock::maxTopMargin): (WebCore::RenderBlock::maxBottomMargin): (WebCore::RenderBlock::initMaxMarginValues): (WebCore::RenderBlock::containsFloats): (WebCore::RenderBlock::setHasMarkupTruncation): (WebCore::RenderBlock::BlockSelectionInfo::BlockSelectionInfo): (WebCore::RenderBlock::BlockSelectionInfo::block): (WebCore::RenderBlock::BlockSelectionInfo::state): (WebCore::RenderBlock::FloatingObject::FloatingObject): (WebCore::RenderBlock::CompactInfo::clear):
  • rendering/RenderButton.cpp: (WebCore::RenderButton::removeChild): (WebCore::RenderButton::paintObject):
  • rendering/RenderButton.h: (WebCore::RenderButton::renderName): (WebCore::RenderButton::removeLeftoverAnonymousBoxes):
  • rendering/RenderContainer.cpp: (WebCore::RenderContainer::RenderContainer):
  • rendering/RenderContainer.h: (WebCore::RenderContainer::firstChild): (WebCore::RenderContainer::lastChild): (WebCore::RenderContainer::calcMinMaxWidth):
  • rendering/RenderCounter.cpp: (WebCore::RenderCounter::RenderCounter): (WebCore::toRoman): (WebCore::toHebrew): (WebCore::RenderCounter::calcMinMaxWidth):
  • rendering/RenderCounter.h:
  • rendering/RenderFieldset.cpp: (WebCore::RenderFieldset::paintBoxDecorations): (WebCore::RenderFieldset::paintBorderMinusLegend): (WebCore::RenderFieldset::setStyle):
  • rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::~RenderFileUploadControl): (WebCore::RenderFileUploadControl::setStyle): (WebCore::RenderFileUploadControl::paintObject): (WebCore::RenderFileUploadControl::calcMinMaxWidth):
  • rendering/RenderFileUploadControl.h: (WebCore::RenderFileUploadControl::renderName):
  • rendering/RenderFlexibleBox.h:
  • rendering/RenderFlow.cpp:
  • rendering/RenderFlow.h:
  • rendering/RenderForeignObject.cpp: (WebCore::RenderForeignObject::RenderForeignObject): (WebCore::RenderForeignObject::paint): (WebCore::RenderForeignObject::computeAbsoluteRepaintRect): (WebCore::RenderForeignObject::layout): (WebCore::RenderForeignObject::nodeAtPoint):
  • rendering/RenderForeignObject.h: (WebCore::RenderForeignObject::renderName):
  • rendering/RenderFormElement.cpp: (WebCore::RenderFormElement::setStyle): (WebCore::RenderFormElement::layout): (WebCore::RenderFormElement::textAlignment):
  • rendering/RenderFormElement.h:
  • rendering/RenderFrame.cpp:
  • rendering/RenderFrame.h: (WebCore::RenderFrame::element):
  • rendering/RenderFrameSet.cpp:
  • rendering/RenderFrameSet.h: (WebCore::RenderFrameSet::element):
  • rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::RenderHTMLCanvas): (WebCore::RenderHTMLCanvas::paint):
  • rendering/RenderHTMLCanvas.h: (WebCore::RenderHTMLCanvas::renderName):
  • rendering/RenderImage.cpp: (WebCore::RenderImage::RenderImage): (WebCore::RenderImage::setStyle): (WebCore::RenderImage::setContentObject): (WebCore::RenderImage::setCachedImage): (WebCore::RenderImage::imageChanged): (WebCore::RenderImage::paint): (WebCore::RenderImage::layout): (WebCore::RenderImage::updateAltText):
  • rendering/RenderImage.h: (WebCore::RenderImage::element):
  • rendering/RenderInline.cpp: (WebCore::RenderInline::RenderInline): (WebCore::RenderInline::~RenderInline): (WebCore::RenderInline::setStyle): (WebCore::RenderInline::addChildToFlow): (WebCore::RenderInline::cloneInline): (WebCore::RenderInline::splitInlines): (WebCore::RenderInline::splitFlow): (WebCore::RenderInline::paint): (WebCore::RenderInline::absoluteRects): (WebCore::RenderInline::calcMinMaxWidth): (WebCore::RenderInline::requiresLayer): (WebCore::RenderInline::width): (WebCore::RenderInline::height): (WebCore::RenderInline::renderName): (WebCore::RenderInline::nodeAtPoint): (WebCore::RenderInline::positionForCoordinates):
  • rendering/RenderInline.h: (WebCore::RenderInline::layout):
  • rendering/RenderLayer.cpp:
  • rendering/RenderLayer.h: (WebCore::ClipRects::ClipRects): (WebCore::RenderLayer::nextSibling): (WebCore::RenderLayer::root): (WebCore::RenderLayer::setPos): (WebCore::RenderLayer::height): (WebCore::RenderLayer::relativePositionOffset):
  • rendering/RenderLineEdit.cpp: (WebCore::RenderLineEdit::setStyle): (WebCore::RenderLineEdit::updateFromElement): (WebCore::RenderLineEdit::selectionStart): (WebCore::RenderLineEdit::selectionEnd): (WebCore::RenderLineEdit::setSelectionStart): (WebCore::RenderLineEdit::setSelectionEnd): (WebCore::RenderLineEdit::setSelectionRange):
  • rendering/RenderLineEdit.h:
  • rendering/RenderListBox.cpp:
  • rendering/RenderListBox.h: (WebCore::RenderListBox::renderName):
  • rendering/RenderListItem.cpp: (WebCore::RenderListItem::setStyle): (WebCore::getParentOfFirstLineBox): (WebCore::RenderListItem::updateMarkerLocation): (WebCore::RenderListItem::positionListMarker): (WebCore::RenderListItem::paint):
  • rendering/RenderListItem.h:
  • rendering/RenderListMarker.cpp:
  • rendering/RenderListMarker.h: (WebCore::RenderListMarker::renderName): (WebCore::RenderListMarker::isListMarker):
Location:
trunk/WebCore
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r17445 r17448  
     12006-10-30  Sam Weinig  <sam.weinig@gmail.com>
     2
     3        Reviewed by Mitz.
     4
     5        Fix for http://bugs.webkit.org/show_bug.cgi?id=11441
     6        More rendering code cleaning
     7
     8        * WebCore.xcodeproj/project.pbxproj:
     9        * rendering/RenderApplet.cpp:
     10        (WebCore::RenderApplet::RenderApplet):
     11        (WebCore::RenderApplet::createWidgetIfNecessary):
     12        * rendering/RenderApplet.h:
     13        * rendering/RenderArena.cpp:
     14        (WebCore::):
     15        (WebCore::RenderArena::RenderArena):
     16        (WebCore::RenderArena::allocate):
     17        (WebCore::RenderArena::free):
     18        * rendering/RenderArena.h:
     19        * rendering/RenderBR.cpp:
     20        (WebCore::RenderBR::RenderBR):
     21        (WebCore::RenderBR::baselinePosition):
     22        (WebCore::RenderBR::lineHeight):
     23        (WebCore::RenderBR::setStyle):
     24        (WebCore::RenderBR::caretMinOffset):
     25        (WebCore::RenderBR::positionForCoordinates):
     26        (WebCore::RenderBR::inlineBox):
     27        * rendering/RenderBR.h:
     28        * rendering/RenderBlock.cpp:
     29        * rendering/RenderBlock.h:
     30        (WebCore::RenderBlock::maxTopMargin):
     31        (WebCore::RenderBlock::maxBottomMargin):
     32        (WebCore::RenderBlock::initMaxMarginValues):
     33        (WebCore::RenderBlock::containsFloats):
     34        (WebCore::RenderBlock::setHasMarkupTruncation):
     35        (WebCore::RenderBlock::BlockSelectionInfo::BlockSelectionInfo):
     36        (WebCore::RenderBlock::BlockSelectionInfo::block):
     37        (WebCore::RenderBlock::BlockSelectionInfo::state):
     38        (WebCore::RenderBlock::FloatingObject::FloatingObject):
     39        (WebCore::RenderBlock::CompactInfo::clear):
     40        * rendering/RenderButton.cpp:
     41        (WebCore::RenderButton::removeChild):
     42        (WebCore::RenderButton::paintObject):
     43        * rendering/RenderButton.h:
     44        (WebCore::RenderButton::renderName):
     45        (WebCore::RenderButton::removeLeftoverAnonymousBoxes):
     46        * rendering/RenderContainer.cpp:
     47        (WebCore::RenderContainer::RenderContainer):
     48        * rendering/RenderContainer.h:
     49        (WebCore::RenderContainer::firstChild):
     50        (WebCore::RenderContainer::lastChild):
     51        (WebCore::RenderContainer::calcMinMaxWidth):
     52        * rendering/RenderCounter.cpp:
     53        (WebCore::RenderCounter::RenderCounter):
     54        (WebCore::toRoman):
     55        (WebCore::toHebrew):
     56        (WebCore::RenderCounter::calcMinMaxWidth):
     57        * rendering/RenderCounter.h:
     58        * rendering/RenderFieldset.cpp:
     59        (WebCore::RenderFieldset::paintBoxDecorations):
     60        (WebCore::RenderFieldset::paintBorderMinusLegend):
     61        (WebCore::RenderFieldset::setStyle):
     62        * rendering/RenderFileUploadControl.cpp:
     63        (WebCore::RenderFileUploadControl::~RenderFileUploadControl):
     64        (WebCore::RenderFileUploadControl::setStyle):
     65        (WebCore::RenderFileUploadControl::paintObject):
     66        (WebCore::RenderFileUploadControl::calcMinMaxWidth):
     67        * rendering/RenderFileUploadControl.h:
     68        (WebCore::RenderFileUploadControl::renderName):
     69        * rendering/RenderFlexibleBox.h:
     70        * rendering/RenderFlow.cpp:
     71        * rendering/RenderFlow.h:
     72        * rendering/RenderForeignObject.cpp:
     73        (WebCore::RenderForeignObject::RenderForeignObject):
     74        (WebCore::RenderForeignObject::paint):
     75        (WebCore::RenderForeignObject::computeAbsoluteRepaintRect):
     76        (WebCore::RenderForeignObject::layout):
     77        (WebCore::RenderForeignObject::nodeAtPoint):
     78        * rendering/RenderForeignObject.h:
     79        (WebCore::RenderForeignObject::renderName):
     80        * rendering/RenderFormElement.cpp:
     81        (WebCore::RenderFormElement::setStyle):
     82        (WebCore::RenderFormElement::layout):
     83        (WebCore::RenderFormElement::textAlignment):
     84        * rendering/RenderFormElement.h:
     85        * rendering/RenderFrame.cpp:
     86        * rendering/RenderFrame.h:
     87        (WebCore::RenderFrame::element):
     88        * rendering/RenderFrameSet.cpp:
     89        * rendering/RenderFrameSet.h:
     90        (WebCore::RenderFrameSet::element):
     91        * rendering/RenderHTMLCanvas.cpp:
     92        (WebCore::RenderHTMLCanvas::RenderHTMLCanvas):
     93        (WebCore::RenderHTMLCanvas::paint):
     94        * rendering/RenderHTMLCanvas.h:
     95        (WebCore::RenderHTMLCanvas::renderName):
     96        * rendering/RenderImage.cpp:
     97        (WebCore::RenderImage::RenderImage):
     98        (WebCore::RenderImage::setStyle):
     99        (WebCore::RenderImage::setContentObject):
     100        (WebCore::RenderImage::setCachedImage):
     101        (WebCore::RenderImage::imageChanged):
     102        (WebCore::RenderImage::paint):
     103        (WebCore::RenderImage::layout):
     104        (WebCore::RenderImage::updateAltText):
     105        * rendering/RenderImage.h:
     106        (WebCore::RenderImage::element):
     107        * rendering/RenderInline.cpp:
     108        (WebCore::RenderInline::RenderInline):
     109        (WebCore::RenderInline::~RenderInline):
     110        (WebCore::RenderInline::setStyle):
     111        (WebCore::RenderInline::addChildToFlow):
     112        (WebCore::RenderInline::cloneInline):
     113        (WebCore::RenderInline::splitInlines):
     114        (WebCore::RenderInline::splitFlow):
     115        (WebCore::RenderInline::paint):
     116        (WebCore::RenderInline::absoluteRects):
     117        (WebCore::RenderInline::calcMinMaxWidth):
     118        (WebCore::RenderInline::requiresLayer):
     119        (WebCore::RenderInline::width):
     120        (WebCore::RenderInline::height):
     121        (WebCore::RenderInline::renderName):
     122        (WebCore::RenderInline::nodeAtPoint):
     123        (WebCore::RenderInline::positionForCoordinates):
     124        * rendering/RenderInline.h:
     125        (WebCore::RenderInline::layout):
     126        * rendering/RenderLayer.cpp:
     127        * rendering/RenderLayer.h:
     128        (WebCore::ClipRects::ClipRects):
     129        (WebCore::RenderLayer::nextSibling):
     130        (WebCore::RenderLayer::root):
     131        (WebCore::RenderLayer::setPos):
     132        (WebCore::RenderLayer::height):
     133        (WebCore::RenderLayer::relativePositionOffset):
     134        * rendering/RenderLineEdit.cpp:
     135        (WebCore::RenderLineEdit::setStyle):
     136        (WebCore::RenderLineEdit::updateFromElement):
     137        (WebCore::RenderLineEdit::selectionStart):
     138        (WebCore::RenderLineEdit::selectionEnd):
     139        (WebCore::RenderLineEdit::setSelectionStart):
     140        (WebCore::RenderLineEdit::setSelectionEnd):
     141        (WebCore::RenderLineEdit::setSelectionRange):
     142        * rendering/RenderLineEdit.h:
     143        * rendering/RenderListBox.cpp:
     144        * rendering/RenderListBox.h:
     145        (WebCore::RenderListBox::renderName):
     146        * rendering/RenderListItem.cpp:
     147        (WebCore::RenderListItem::setStyle):
     148        (WebCore::getParentOfFirstLineBox):
     149        (WebCore::RenderListItem::updateMarkerLocation):
     150        (WebCore::RenderListItem::positionListMarker):
     151        (WebCore::RenderListItem::paint):
     152        * rendering/RenderListItem.h:
     153        * rendering/RenderListMarker.cpp:
     154        * rendering/RenderListMarker.h:
     155        (WebCore::RenderListMarker::renderName):
     156        (WebCore::RenderListMarker::isListMarker):
     157
    11582006-10-30  Timothy Hatcher  <timothy@apple.com>
    2159
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r17438 r17448  
    87848784                        isa = PBXGroup;
    87858785                        children = (
    8786                                 ABB5419C0ACDDFE4002820EB /* RenderListBox.cpp */,
    8787                                 ABB5419D0ACDDFE4002820EB /* RenderListBox.h */,
    87888786                                A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */,
    87898787                                A8CFF0490A154F09000A4234 /* AutoTableLayout.h */,
     
    88658863                                A8EA73BE0A1900E300A8EF5F /* RenderLineEdit.cpp */,
    88668864                                A8EA73B10A1900E300A8EF5F /* RenderLineEdit.h */,
     8865                                ABB5419C0ACDDFE4002820EB /* RenderListBox.cpp */,
     8866                                ABB5419D0ACDDFE4002820EB /* RenderListBox.h */,
    88678867                                A8EA7A480A191A5200A8EF5F /* RenderListItem.cpp */,
    88688868                                A8EA7A4C0A191A5200A8EF5F /* RenderListItem.h */,
  • trunk/WebCore/rendering/RenderApplet.cpp

    r16927 r17448  
    3636
    3737RenderApplet::RenderApplet(HTMLAppletElement* applet, const HashMap<String, String>& args)
    38     : RenderWidget(applet), m_args(args)
     38    : RenderWidget(applet)
     39    , m_args(args)
    3940{
    4041    setInline(true);
     
    7576    int height = style()->height().isFixed() ? style()->height().value() :
    7677        m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
    77     for (Node* child = node()->firstChild(); child; child = child->nextSibling())
     78    for (Node* child = node()->firstChild(); child; child = child->nextSibling()) {
    7879        if (child->hasTagName(paramTag)) {
    7980            HTMLParamElement* p = static_cast<HTMLParamElement*>(child);
     
    8182                m_args.set(p->name(), p->value());
    8283        }
    83    
     84    }
     85
    8486    Frame* frame = document()->frame();
    8587    ASSERT(frame);
     
    100102}
    101103
    102 }
     104} // namespace WebCore
  • trunk/WebCore/rendering/RenderApplet.h

    r14336 r17448  
    3636        RenderApplet(HTMLAppletElement*, const HashMap<String, String>& args);
    3737        virtual ~RenderApplet();
     38
    3839        virtual const char* renderName() const { return "RenderApplet"; }
     40
    3941        virtual bool isApplet() const { return true; }
     42
    4043        virtual void layout();
    4144        virtual int intrinsicWidth() const;
     
    4851    };
    4952
    50 }
     53} // namespace WebCore
    5154
    52 #endif
     55#endif // RenderApplet_h
  • trunk/WebCore/rendering/RenderArena.cpp

    r15286 r17448  
    3737
    3838#include <assert.h>
     39#include <stdlib.h>
    3940#include <string.h>
    40 #include <stdlib.h>
    4141
    4242#define ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
     
    5050
    5151typedef struct {
    52     RenderArena *arena;
     52    RenderArena* arena;
    5353    size_t size;
    5454    int signature;
     
    5757#endif
    5858
    59 RenderArena::RenderArena(unsigned int arenaSize)
     59RenderArena::RenderArena(unsigned arenaSize)
    6060{
    6161    // Initialize the arena pool
     
    7777    // Use standard malloc so that memory debugging tools work.
    7878    assert(this);
    79     void *block = ::malloc(sizeof(RenderArenaDebugHeader) + size);
    80     RenderArenaDebugHeader *header = (RenderArenaDebugHeader *)block;
     79    void* block = ::malloc(sizeof(RenderArenaDebugHeader) + size);
     80    RenderArenaDebugHeader* header = (RenderArenaDebugHeader*)block;
    8181    header->arena = this;
    8282    header->size = size;
     
    9191    // Check recyclers first
    9292    if (size < gMaxRecycledSize) {
    93         const int   index = size >> 2;
    94    
     93        const int index = size >> 2;
     94
    9595        result = m_recyclers[index];
    9696        if (result) {
     
    100100        }
    101101    }
    102    
     102
    103103    if (!result) {
    104104        // Allocate a new chunk from the arena
     
    114114#ifndef NDEBUG
    115115    // Use standard free so that memory debugging tools work.
    116     RenderArenaDebugHeader *header = (RenderArenaDebugHeader *)ptr - 1;
     116    RenderArenaDebugHeader* header = (RenderArenaDebugHeader*)ptr - 1;
    117117    assert(header->signature == signature);
    118118    assert(header->size == size);
     
    126126    // See if it's a size that we recycle
    127127    if (size < gMaxRecycledSize) {
    128         const int   index = size >> 2;
    129         void*       currentTop = m_recyclers[index];
     128        const int index = size >> 2;
     129        void* currentTop = m_recyclers[index];
    130130        m_recyclers[index] = ptr;
    131131        *((void**)ptr) = currentTop;
     
    134134}
    135135
    136 }
     136} // namespace WebCore
  • trunk/WebCore/rendering/RenderArena.h

    r15286 r17448  
    3333 */
    3434
    35 #ifndef RENDERARENA_H
    36 #define RENDERARENA_H
     35#ifndef RenderArena_h
     36#define RenderArena_h
    3737
    3838#include "Arena.h"
     
    4444class RenderArena {
    4545public:
    46    RenderArena(unsigned int arenaSize = 4096);
     46    RenderArena(unsigned arenaSize = 4096);
    4747    ~RenderArena();
    4848
    49   // Memory management functions
    50   void* allocate(size_t size);
    51   void  free(size_t size, void* ptr);
     49    // Memory management functions
     50    void* allocate(size_t);
     51    void free(size_t, void*);
    5252
    5353private:
    54   // Underlying arena pool
    55   ArenaPool m_pool;
     54    // Underlying arena pool
     55    ArenaPool m_pool;
    5656
    57   // The recycler array is sparse with the indices being multiples of 4,
    58   // i.e., 0, 4, 8, 12, 16, 20, ...
    59   void*      m_recyclers[gMaxRecycledSize >> 2];
     57    // The recycler array is sparse with the indices being multiples of 4,
     58    // i.e., 0, 4, 8, 12, 16, 20, ...
     59    void* m_recyclers[gMaxRecycledSize >> 2];
    6060};
    6161
    62 }
     62} // namespace WebCore
    6363
    64 #endif
     64#endif // RenderArena_h
  • trunk/WebCore/rendering/RenderBR.cpp

    r13868 r17448  
    3232
    3333RenderBR::RenderBR(Node* node)
    34     : RenderText(node, new StringImpl("\n")), m_lineHeight(-1)
     34    : RenderText(node, new StringImpl("\n"))
     35    , m_lineHeight(-1)
    3536{
    3637}
     
    4950}
    5051
    51 short RenderBR::baselinePosition( bool firstLine, bool isRootLineBox) const
     52short RenderBR::baselinePosition(bool firstLine, bool isRootLineBox) const
    5253{
    5354    if (firstTextBox() && !firstTextBox()->isText())
     
    7677        return lh.value();
    7778    }
    78    
     79
    7980    if (m_lineHeight == -1)
    8081        m_lineHeight = RenderObject::lineHeight(false);
     
    8283}
    8384
    84 void RenderBR::setStyle(RenderStyle* _style)
     85void RenderBR::setStyle(RenderStyle* newStyle)
    8586{
    86     RenderText::setStyle(_style);
     87    RenderText::setStyle(newStyle);
    8788    m_lineHeight = -1;
    8889}
     
    9091int RenderBR::caretMinOffset() const
    9192{
    92     return 0; 
     93    return 0;
    9394}
    9495
     
    103104}
    104105
    105 VisiblePosition RenderBR::positionForCoordinates(int _x, int _y)
     106VisiblePosition RenderBR::positionForCoordinates(int /*x*/, int /*y*/)
    106107{
    107108    return VisiblePosition(element(), 0, DOWNSTREAM);
    108109}
    109110
    110 InlineBox *RenderBR::inlineBox(int offset, EAffinity affinity)
     111InlineBox* RenderBR::inlineBox(int /*offset*/, EAffinity /*affinity*/)
    111112{
    112113    return firstTextBox();
    113114}
    114115
    115 }
     116} // namespace WebCore
  • trunk/WebCore/rendering/RenderBR.h

    r15696 r17448  
    2020 *
    2121 */
    22 #ifndef RENDER_BR_H
    23 #define RENDER_BR_H
     22
     23#ifndef RenderBR_h
     24#define RenderBR_h
    2425
    2526#include "RenderText.h"
     
    5758    virtual int caretMaxOffset() const;
    5859    virtual unsigned caretMaxRenderedOffset() const;
    59    
     60
    6061    virtual VisiblePosition positionForCoordinates(int x, int y);
    6162
    62     virtual InlineBox* inlineBox(int offset, EAffinity affinity = UPSTREAM);
    63    
     63    virtual InlineBox* inlineBox(int offset, EAffinity = UPSTREAM);
     64
    6465private:
    6566    mutable short m_lineHeight;
    66 
    6767};
    6868
    6969} // namespace WebCore
    7070
    71 #endif // RENDER_BR_H
     71#endif // RenderBR_h
  • trunk/WebCore/rendering/RenderBlock.cpp

    r17426 r17448  
    2929#include "Frame.h"
    3030#include "GraphicsContext.h"
     31#include "HTMLNames.h"
     32#include "HitTestResult.h"
    3133#include "InlineTextBox.h"
    32 #include "HitTestResult.h"
    3334#include "RenderTableCell.h"
    3435#include "RenderTextFragment.h"
     36#include "RenderTheme.h"
     37#include "RenderView.h"
    3538#include "SelectionController.h"
    36 #include "HTMLNames.h"
    37 #include "RenderView.h"
    38 #include "RenderTheme.h"
    3939#include "TextStream.h"
    4040
     
    36813681
    36823682} // namespace WebCore
    3683 
  • trunk/WebCore/rendering/RenderBlock.h

    r17426 r17448  
    2222 */
    2323
    24 #ifndef RenderBlock_H
    25 #define RenderBlock_H
     24#ifndef RenderBlock_h
     25#define RenderBlock_h
    2626
    2727#include "GapRects.h"
     
    4747
    4848    // These two functions are overridden for inline-block.
    49     virtual short lineHeight(bool b, bool isRootLineBox=false) const;
    50     virtual short baselinePosition(bool b, bool isRootLineBox=false) const;
    51    
     49    virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
     50    virtual short baselinePosition(bool firstLine, bool isRootLineBox = false) const;
     51
    5252    virtual bool isRenderBlock() const { return true; }
    5353    virtual bool isBlockFlow() const { return (!isInline() || isReplaced()) && !isTable(); }
    5454    virtual bool isInlineFlow() const { return isInline() && !isReplaced(); }
    5555    virtual bool isInlineBlockOrInlineTable() const { return isInline() && isReplaced(); }
    56    
     56
    5757    virtual bool childrenInline() const { return m_childrenInline; }
    5858    virtual void setChildrenInline(bool b) { m_childrenInline = b; }
     
    6262    // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside
    6363    // it would have an overflow height of borderTop() + paddingTop() + 100px.
    64     virtual int overflowHeight(bool includeInterior=true) const;
    65     virtual int overflowWidth(bool includeInterior=true) const;
    66     virtual int overflowLeft(bool includeInterior=true) const;
    67     virtual int overflowTop(bool includeInterior=true) const;
    68     virtual IntRect overflowRect(bool includeInterior=true) const;
     64    virtual int overflowHeight(bool includeInterior = true) const;
     65    virtual int overflowWidth(bool includeInterior = true) const;
     66    virtual int overflowLeft(bool includeInterior = true) const;
     67    virtual int overflowTop(bool includeInterior = true) const;
     68    virtual IntRect overflowRect(bool includeInterior = true) const;
    6969    virtual void setOverflowHeight(int h) { m_overflowHeight = h; }
    7070    virtual void setOverflowWidth(int w) { m_overflowWidth = w; }
    71    
     71
    7272    virtual bool isSelfCollapsingBlock() const;
    7373    virtual bool isTopMarginQuirk() const { return m_topMarginQuirk; }
    7474    virtual bool isBottomMarginQuirk() const { return m_bottomMarginQuirk; }
    7575
    76     virtual int maxTopMargin(bool positive) const {
    77         if (positive)
    78             return m_maxTopPosMargin;
    79         else
    80             return m_maxTopNegMargin;
    81     }
    82     virtual int maxBottomMargin(bool positive) const {
    83         if (positive)
    84             return m_maxBottomPosMargin;
    85         else
    86             return m_maxBottomNegMargin;
    87     }
    88 
    89     void initMaxMarginValues() {
     76    virtual int maxTopMargin(bool positive) const { return positive ? m_maxTopPosMargin : m_maxTopNegMargin; }
     77    virtual int maxBottomMargin(bool positive) const { return positive ? m_maxBottomPosMargin : m_maxBottomNegMargin; }
     78
     79    void initMaxMarginValues()
     80    {
    9081        if (m_marginTop >= 0) {
    9182            m_maxTopPosMargin = m_marginTop;
     
    127118    // Called to lay out the legend for a fieldset.
    128119    virtual RenderObject* layoutLegend(bool relayoutChildren) { return 0; };
    129    
     120
    130121    // the implementation of the following functions is in bidi.cpp
    131122    void bidiReorderLine(const BidiIterator& start, const BidiIterator& end, BidiState& bidi);
     
    137128                        const BidiIterator& endLineStart, const BidiStatus& endLineStatus, BidiContext* endLineContext,
    138129                        RootInlineBox*& endLine, int& endYPos, int& repaintBottom, int& repaintTop);
    139     int skipWhitespace(BidiIterator& , BidiState &);
    140     BidiIterator findNextLineBreak(BidiIterator& start, BidiState &info );
     130    int skipWhitespace(BidiIterator&, BidiState&);
     131    BidiIterator findNextLineBreak(BidiIterator& start, BidiState& info);
    141132    RootInlineBox* constructLine(const BidiIterator& start, const BidiIterator& end);
    142133    InlineFlowBox* createLineBoxes(RenderObject*);
     
    148139    void checkLinesForTextOverflow();
    149140    // end bidi.cpp functions
     141
     142    virtual void paint(PaintInfo&, int tx, int ty);
     143    virtual void paintObject(PaintInfo&, int tx, int ty);
     144    void paintFloats(PaintInfo&, int tx, int ty, bool paintSelection = false);
     145    void paintChildren(PaintInfo&, int tx, int ty);
     146    void paintEllipsisBoxes(PaintInfo&, int tx, int ty);
     147    void paintSelection(PaintInfo&, int tx, int ty);
     148    void paintCaret(PaintInfo&, CaretType);
    150149   
    151     virtual void paint(PaintInfo& i, int tx, int ty);
    152     virtual void paintObject(PaintInfo& i, int tx, int ty);
    153     void paintFloats(PaintInfo& i, int _tx, int _ty, bool paintSelection = false);
    154     void paintChildren(PaintInfo& i, int _tx, int _ty);
    155     void paintEllipsisBoxes(PaintInfo& i, int _tx, int _ty);
    156     void paintSelection(PaintInfo& i, int _tx, int _ty);
    157     void paintCaret(PaintInfo& i, CaretType);
    158    
    159     void insertFloatingObject(RenderObject *o);
    160     void removeFloatingObject(RenderObject *o);
     150    void insertFloatingObject(RenderObject*);
     151    void removeFloatingObject(RenderObject*);
    161152    void setPaintsFloatingObject(RenderObject*, bool);
    162153
     
    164155    void positionNewFloats();
    165156    void clearFloats();
    166     int getClearDelta(RenderObject *child);
     157    int getClearDelta(RenderObject* child);
    167158    virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
    168159    void markPositionedObjectsForLayout();
     
    171162    // is empty. However, layoutInlineChildren() relies on the current behavior.
    172163    // http://bugzilla.opendarwin.org/show_bug.cgi?id=7395#c3
    173     virtual bool containsFloats() { return m_floatingObjects!=0; }
    174     virtual bool containsFloat(RenderObject* o);
     164    virtual bool containsFloats() { return m_floatingObjects; }
     165    virtual bool containsFloat(RenderObject*);
    175166
    176167    virtual bool hasOverhangingFloats() { return floatBottom() > m_height; }
     
    185176
    186177    virtual int lineWidth(int y) const;
    187     virtual int lowestPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
    188     virtual int rightmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
    189     virtual int leftmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
     178    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     179    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     180    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
    190181
    191182    int rightOffset() const;
    192     int rightRelOffset(int y, int fixedOffset, bool applyTextIndent = true,
    193                        int *heightRemaining = 0) const;
     183    int rightRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
    194184    int rightOffset(int y) const { return rightRelOffset(y, rightOffset(), true); }
    195185
    196186    int leftOffset() const;
    197     int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true,
    198                       int *heightRemaining = 0) const;
     187    int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
    199188    int leftOffset(int y) const { return leftRelOffset(y, leftOffset(), true); }
    200189
    201     virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction hitTestAction);
     190    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
    202191
    203192    virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
     
    219208    virtual RenderBlock* firstLineBlock() const;
    220209    virtual void updateFirstLetter();
    221    
     210
    222211    bool inRootBlockContext() const;
    223212
    224     void setHasMarkupTruncation(bool b=true) { m_hasMarkupTruncation = b; }
     213    void setHasMarkupTruncation(bool b = true) { m_hasMarkupTruncation = b; }
    225214    bool hasMarkupTruncation() const { return m_hasMarkupTruncation; }
    226215
     
    234223        SelectionState m_state;
    235224
    236         BlockSelectionInfo() { m_block = 0; m_state = SelectionNone; }
    237         BlockSelectionInfo(RenderBlock* b) {
    238             m_block = b;
    239             m_state = m_block->selectionState();
    240             m_rects = m_block->selectionGapRects();
     225        BlockSelectionInfo()
     226            : m_block(0)
     227            , m_state(SelectionNone)
     228        {
    241229        }
    242        
     230
     231        BlockSelectionInfo(RenderBlock* b)
     232            : m_block(b)
     233            , m_rects(b->selectionGapRects())
     234            , m_state(b->selectionState())
     235        {
     236        }
     237
     238        RenderBlock* block() const { return m_block; }
    243239        GapRects rects() const { return m_rects; }
    244240        SelectionState state() const { return m_state; }
    245         RenderBlock* block() const { return m_block; }
    246241    };
    247    
     242
    248243    virtual IntRect selectionRect() { return selectionGapRects(); }
    249244    GapRects selectionGapRects();
    250245    virtual bool shouldPaintSelectionGaps() const;
    251246    bool isSelectionRoot() const;
    252     GapRects fillSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, 
    253                                int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* i = 0);
     247    GapRects fillSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,
     248                               int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* = 0);
    254249    GapRects fillInlineSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,
    255                                      int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* i);
     250                                     int& lastTop, int& lastLeft, int& lastRight, const PaintInfo*);
    256251    GapRects fillBlockSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,
    257                                     int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* i);
    258     IntRect fillVerticalSelectionGap(int lastTop, int lastLeft, int lastRight,
    259                                    int bottomY, RenderBlock* rootBlock, int blockX, int blockY, const PaintInfo* i);
    260     IntRect fillLeftSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, const PaintInfo* i);
    261     IntRect fillRightSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, const PaintInfo* i);
    262     IntRect fillHorizontalSelectionGap(RenderObject* selObj, int xPos, int yPos, int width, int height, const PaintInfo* i);
    263 
    264     void getHorizontalSelectionGapInfo(SelectionState state, bool& leftGap, bool& rightGap);
     252                                    int& lastTop, int& lastLeft, int& lastRight, const PaintInfo*);
     253    IntRect fillVerticalSelectionGap(int lastTop, int lastLeft, int lastRight, int bottomY, RenderBlock* rootBlock,
     254                                     int blockX, int blockY, const PaintInfo*);
     255    IntRect fillLeftSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock,
     256                                 int blockX, int blockY, int tx, int ty, const PaintInfo*);
     257    IntRect fillRightSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock,
     258                                  int blockX, int blockY, int tx, int ty, const PaintInfo*);
     259    IntRect fillHorizontalSelectionGap(RenderObject* selObj, int xPos, int yPos, int width, int height, const PaintInfo*);
     260
     261    void getHorizontalSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap);
    265262    int leftSelectionOffset(RenderBlock* rootBlock, int y);
    266263    int rightSelectionOffset(RenderBlock* rootBlock, int y);
    267264
    268265#ifndef NDEBUG
    269     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
     266    virtual void dump(TextStream*, DeprecatedString ind = "") const;
    270267#endif
    271268
    272269    // Helper methods for computing line counts and heights for line counts.
    273     RootInlineBox* lineAtIndex(int i);
     270    RootInlineBox* lineAtIndex(int);
    274271    int lineCount();
    275     int heightForLineCount(int l);
     272    int heightForLineCount(int);
    276273    void clearTruncation();
    277274
     
    281278
    282279private:
    283     Position positionForBox(InlineBox *box, bool start=true) const;
    284     Position positionForRenderer(RenderObject *renderer, bool start=true) const;
     280    Position positionForBox(InlineBox*, bool start = true) const;
     281    Position positionForRenderer(RenderObject*, bool start = true) const;
    285282       
    286283protected:
     
    291288        };
    292289
    293         FloatingObject(Type type) {
    294             node = 0;
    295             startY = 0;
    296             endY = 0;
    297             m_type = type;
    298             left = 0;
    299             width = 0;
    300             noPaint = false;
     290        FloatingObject(Type type)
     291            : node(0)
     292            , startY(0)
     293            , endY(0)
     294            , left(0)
     295            , width(0)
     296            , m_type(type)
     297            , noPaint(false)
     298        {
    301299        }
    302        
     300
    303301        Type type() { return static_cast<Type>(m_type); }
    304302
     
    311309        bool noPaint : 1;
    312310    };
    313    
     311
    314312    // The following helper functions and structs are used by layoutBlockChildren.
    315313    class CompactInfo {
    316314        // A compact child that needs to be collapsed into the margin of the following block.
    317315        RenderObject* m_compact;
    318        
     316
    319317        // The block with the open margin that the compact child is going to place itself within.
    320318        RenderObject* m_block;
     
    324322        RenderObject* block() const { return m_block; }
    325323        bool matches(RenderObject* child) const { return m_compact && m_block == child; }
    326        
    327         void clear() { set(0, 0);  }
     324
     325        void clear() { set(0, 0); }
    328326        void set(RenderObject* c, RenderObject* b) { m_compact = c; m_block = b; }
    329        
     327
    330328        CompactInfo() { clear(); }
    331329    };
     
    336334        bool m_canCollapseTopWithChildren : 1;
    337335        bool m_canCollapseBottomWithChildren : 1;
    338        
     336
    339337        // Whether or not we are a quirky container, i.e., do we collapse away top and bottom
    340338        // margins in our container.  Table cells and the body are the common examples. We
     
    354352        // we track it in this variable.
    355353        bool m_selfCollapsingBlockClearedFloat : 1;
    356    
     354
    357355        // These variables are used to detect quirky margins that we need to collapse away (in table cells
    358356        // and in the body element).
     
    367365    public:
    368366        MarginInfo(RenderBlock* b, int top, int bottom);
    369        
     367
    370368        void setAtTopOfBlock(bool b) { m_atTopOfBlock = b; }
    371369        void setAtBottomOfBlock(bool b) { m_atBottomOfBlock = b; }
     
    396394        int margin() const { return m_posMargin - m_negMargin; }
    397395    };
    398    
    399     void adjustPositionedBlock(RenderObject* child, const MarginInfo& marginInfo);
    400     void adjustFloatingBlock(const MarginInfo& marginInfo);
    401     RenderObject* handleSpecialChild(RenderObject* child, const MarginInfo& marginInfo, CompactInfo& compactInfo, bool& handled);
    402     RenderObject* handleFloatingChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled);
    403     RenderObject* handlePositionedChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled);
    404     RenderObject* handleCompactChild(RenderObject* child, CompactInfo& compactInfo, bool& handled);
     396
     397    void adjustPositionedBlock(RenderObject* child, const MarginInfo&);
     398    void adjustFloatingBlock(const MarginInfo&);
     399    RenderObject* handleSpecialChild(RenderObject* child, const MarginInfo&, CompactInfo&, bool& handled);
     400    RenderObject* handleFloatingChild(RenderObject* child, const MarginInfo&, bool& handled);
     401    RenderObject* handlePositionedChild(RenderObject* child, const MarginInfo&, bool& handled);
     402    RenderObject* handleCompactChild(RenderObject* child, CompactInfo&, bool& handled);
    405403    RenderObject* handleRunInChild(RenderObject* child, bool& handled);
    406     void collapseMargins(RenderObject* child, MarginInfo& marginInfo, int yPosEstimate);
    407     void clearFloatsIfNeeded(RenderObject* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin);
    408     void insertCompactIfNeeded(RenderObject* child, CompactInfo& compactInfo);
    409     int estimateVerticalPosition(RenderObject* child, const MarginInfo& info);
     404    void collapseMargins(RenderObject* child, MarginInfo&, int yPosEstimate);
     405    void clearFloatsIfNeeded(RenderObject* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin);
     406    void insertCompactIfNeeded(RenderObject* child, CompactInfo&);
     407    int estimateVerticalPosition(RenderObject* child, const MarginInfo&);
    410408    void determineHorizontalPosition(RenderObject* child);
    411     void handleBottomOfBlock(int top, int bottom, MarginInfo& marginInfo);
    412     void setCollapsedBottomMargin(const MarginInfo& marginInfo);
     409    void handleBottomOfBlock(int top, int bottom, MarginInfo&);
     410    void setCollapsedBottomMargin(const MarginInfo&);
    413411    // End helper functions and structs used by layoutBlockChildren.
    414412
     
    416414    DeprecatedPtrList<FloatingObject>* m_floatingObjects;
    417415    DeprecatedPtrList<RenderObject>* m_positionedObjects;
    418    
     416
    419417    bool m_childrenInline : 1;
    420418    bool m_firstLine : 1;
     
    432430    // How much content overflows out of our block vertically or horizontally (all we support
    433431    // for now is spillage out of the bottom and the right, which are the common cases).
    434     // XXX Generalize to work with top and left as well.
     432    // FIXME: Generalize to work with top and left as well.
    435433    int m_overflowHeight;
    436434    int m_overflowWidth;
    437    
     435
    438436    // Left and top overflow.  Does not affect scrolling dimensions, but we do at least use it
    439437    // when dirty rect checking and hit testing.
    440438    int m_overflowLeft;
    441439    int m_overflowTop;
    442    
     440
    443441    // full width of a tab character
    444442    int m_tabWidth;
     
    447445} // namespace WebCore
    448446
    449 #endif // RenderBlock_H
     447#endif // RenderBlock_h
  • trunk/WebCore/rendering/RenderButton.cpp

    r16826 r17448  
    2727#include "GraphicsContext.h"
    2828#include "HTMLInputElement.h"
     29#include "HTMLNames.h"
    2930#include "RenderText.h"
    30 #include "HTMLNames.h"
    3131
    3232namespace WebCore {
     
    5959        RenderFlexibleBox::removeChild(oldChild);
    6060        m_inner = 0;
    61     }
    62     else
     61    } else
    6362        m_inner->removeChild(oldChild);
    6463}
     
    110109}
    111110
    112 void RenderButton::paintObject(PaintInfo& i, int _tx, int _ty)
     111void RenderButton::paintObject(PaintInfo& paintInfo, int tx, int ty)
    113112{
    114113    // Push a clip.
    115     if (m_inner && i.phase == PaintPhaseForeground) {
    116         IntRect clipRect(_tx + borderLeft(), _ty + borderTop(),
     114    if (m_inner && paintInfo.phase == PaintPhaseForeground) {
     115        IntRect clipRect(tx + borderLeft(), ty + borderTop(),
    117116            width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
    118117        if (clipRect.width() == 0 || clipRect.height() == 0)
    119118            return;
    120         i.p->save();
    121         i.p->clip(clipRect);
     119        paintInfo.p->save();
     120        paintInfo.p->clip(clipRect);
    122121    }
    123    
     122
    124123    // Paint the children.
    125     RenderBlock::paintObject(i, _tx, _ty);
    126    
     124    RenderBlock::paintObject(paintInfo, tx, ty);
     125
    127126    // Pop the clip.
    128     if (m_inner && i.phase == PaintPhaseForeground)
    129         i.p->restore();
     127    if (m_inner && paintInfo.phase == PaintPhaseForeground)
     128        paintInfo.p->restore();
    130129}
    131130
    132 }
     131} // namespace WebCore
  • trunk/WebCore/rendering/RenderButton.h

    r16323 r17448  
    2121 */
    2222
    23 #ifndef RenderButton_H
    24 #define RenderButton_H
     23#ifndef RenderButton_h
     24#define RenderButton_h
    2525
    2626#include "RenderFlexibleBox.h"
     
    3131// For inputs, they will also generate an anonymous RenderText and keep its style and content up
    3232// to date as the button changes.
    33 class RenderButton : public RenderFlexibleBox
    34 {
     33class RenderButton : public RenderFlexibleBox {
    3534public:
    3635    RenderButton(Node*);
    3736
     37    virtual const char* renderName() const { return "RenderButton"; }
     38
    3839    virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0);
    39     virtual void removeChild(RenderObject* oldChild);
    40     virtual void removeLeftoverAnonymousBoxes() {}
     40    virtual void removeChild(RenderObject*);
     41    virtual void removeLeftoverAnonymousBoxes() { }
    4142    virtual bool createsAnonymousWrapper() const { return true; }
    4243
     
    5051    void setText(const String&);
    5152
    52     virtual const char* renderName() const { return "RenderButton"; }
    53 
    5453protected:
    5554    virtual bool hasLineIfEmpty() const { return true; }
     
    5958};
    6059
    61 }
     60} // namespace WebCore
    6261
    63 #endif
     62#endif // RenderButton_h
  • trunk/WebCore/rendering/RenderContainer.cpp

    r16988 r17448  
    2929#include "RenderContainer.h"
    3030
    31 #include "htmlediting.h"
     31#include "AXObjectCache.h"
     32#include "Document.h"
    3233#include "RenderCounter.h"
     34#include "RenderImage.h"
    3335#include "RenderListItem.h"
    3436#include "RenderTable.h"
    3537#include "RenderTextFragment.h"
    36 #include "RenderImage.h"
    3738#include "RenderView.h"
    38 #include "Document.h"
    39 
    40 // For accessibility
    41 #include "AXObjectCache.h"
     39#include "htmlediting.h"
    4240
    4341namespace WebCore {
     
    4543RenderContainer::RenderContainer(Node* node)
    4644    : RenderBox(node)
    47 {
    48     m_first = 0;
    49     m_last = 0;
    50 }
    51 
     45    , m_first(0)
     46    , m_last(0)
     47{
     48}
    5249
    5350RenderContainer::~RenderContainer()
     
    640637#undef DEBUG_LAYOUT
    641638
    642 }
     639} // namespace WebCore
  • trunk/WebCore/rendering/RenderContainer.h

    r16250 r17448  
    2121 */
    2222
    23 #ifndef RenderContainer_H
    24 #define RenderContainer_H
     23#ifndef RenderContainer_h
     24#define RenderContainer_h
    2525
    2626#include "RenderBox.h"
     
    3333 * Base class for rendering objects that can have children
    3434 */
    35 class RenderContainer : public RenderBox
    36 {
     35class RenderContainer : public RenderBox {
    3736public:
    3837    RenderContainer(Node*);
    3938    virtual ~RenderContainer();
    4039
    41     RenderObject *firstChild() const { return m_first; }
    42     RenderObject *lastChild() const { return m_last; }
     40    RenderObject* firstChild() const { return m_first; }
     41    RenderObject* lastChild() const { return m_last; }
    4342
    4443    virtual bool canHaveChildren() const;
    45     virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
    46     virtual void removeChild(RenderObject *oldChild);
     44    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
     45    virtual void removeChild(RenderObject*);
    4746
    4847    virtual void destroy();
    4948    void destroyLeftoverChildren();
    50    
    51     virtual RenderObject* removeChildNode(RenderObject* child);
    52     virtual void appendChildNode(RenderObject* child);
     49
     50    virtual RenderObject* removeChildNode(RenderObject*);
     51    virtual void appendChildNode(RenderObject*);
    5352    virtual void insertChildNode(RenderObject* child, RenderObject* before);
    5453
    5554    virtual void layout();
    56     virtual void calcMinMaxWidth() { setMinMaxKnown( true ); }
     55    virtual void calcMinMaxWidth() { setMinMaxKnown(true); }
    5756
    5857    virtual void removeLeftoverAnonymousBoxes();
     
    6362
    6463    virtual VisiblePosition positionForCoordinates(int x, int y);
    65    
     64
    6665    virtual void lineBoxRects(Vector<IntRect>&);
    6766
     
    7069    void setLastChild(RenderObject* last) { m_last = last; }
    7170
    72 protected:
    73     RenderObject *m_first;
    74     RenderObject *m_last;
     71    RenderObject* m_first;
     72    RenderObject* m_last;
    7573};
    7674
    77 }
    78 #endif
     75} // namespace WebCore
     76
     77#endif // RenderContainer_h
  • trunk/WebCore/rendering/RenderCounter.cpp

    r16721 r17448  
    3535
    3636RenderCounter::RenderCounter(Node* node, CounterData* counter)
    37     : RenderText(node, 0), m_counter(counter), m_counterNode(0)
     37    : RenderText(node, 0)
     38    , m_counter(counter)
     39    , m_counterNode(0)
    3840{
    3941}
     
    5860    do {
    5961        int num = number % 10;
    60         if (num % 5 < 4)
     62        if (num % 5 < 4) {
    6163            for (int i = num % 5; i > 0; i--)
    6264                roman.insert(&digits[d], 1, 0);
     65        }
    6366        if (num >= 4 && num <= 8)
    6467            roman.insert(&digits[d + 1], 1, 0);
     
    9598    if (number < 1)
    9699        return String::number(number);
    97    
     100
    98101    static const UChar tenDigit[] = {1497, 1499, 1500, 1502, 1504, 1505, 1506, 1508, 1510};
    99102
     
    218221    if (m_counterNode->isReset())
    219222        value = m_counterNode->value();
    220    
     223
    221224    int total = value;
    222225    if (m_counterNode->parent())
    223226        total = m_counterNode->parent()->total();
    224    
     227
    225228    m_item = convertValueToType(value, total, m_counter->listStyle());
    226229
     
    231234            value = counter->count() ? counter->count() : 1;
    232235            total = counter->parent()->total();
    233             m_item = convertValueToType(value, total, m_counter->listStyle())
    234                 + m_counter->separator() + m_item;
     236            m_item = convertValueToType(value, total, m_counter->listStyle()) + m_counter->separator() + m_item;
    235237            counter = counter->parent();
    236238            first = false;
     
    239241
    240242    str = new StringImpl(m_item.characters(), m_item.length());
    241    
     243
    242244    RenderText::calcMinMaxWidth();
    243245}
  • trunk/WebCore/rendering/RenderCounter.h

    r16721 r17448  
    2121 *
    2222 */
    23 #ifndef RENDER_COUNTER_H_
    24 #define RENDER_COUNTER_H_
     23#ifndef RenderCounter_h
     24#define RenderCounter_h
    2525
    2626#include "RenderText.h"
    2727
    2828namespace WebCore {
    29     class CounterNode;
    3029
    31 // -----------------------------------------------------------------------------
     30class CounterNode;
    3231
    3332class RenderCounter : public RenderText {
    34 
    3533public:
    3634    RenderCounter(Node*, CounterData*);
    37    
     35
    3836    virtual const char* renderName() const { return "RenderCounter"; }
    3937
    4038    virtual bool isCounter() const { return true; }
     39
    4140    virtual void layout();
    4241    virtual void calcMinMaxWidth();
     
    5049};
    5150
    52 } //namespace
     51} // namespace WebCore
    5352
    54 #endif
     53#endif // RenderCounter_h
  • trunk/WebCore/rendering/RenderFieldset.cpp

    r14382 r17448  
    7171}
    7272
    73 void RenderFieldset::paintBoxDecorations(PaintInfo& i, int _tx, int _ty)
     73void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
    7474{
    7575    int w = width();
     
    7777    RenderObject* legend = findLegend();
    7878    if (!legend)
    79         return RenderBlock::paintBoxDecorations(i, _tx, _ty);
     79        return RenderBlock::paintBoxDecorations(paintInfo, tx, ty);
    8080
    81     int yOff = (legend->yPos() > 0) ? 0 : (legend->height()-borderTop())/2;
     81    int yOff = (legend->yPos() > 0) ? 0 : (legend->height() - borderTop()) / 2;
    8282    h -= yOff;
    83     _ty += yOff - borderTopExtra();
     83    ty += yOff - borderTopExtra();
    8484
    85     int my = max(_ty, i.r.y());
    86     int end = min(i.r.bottom(),  _ty + h);
     85    int my = max(ty, paintInfo.r.y());
     86    int end = min(paintInfo.r.bottom(), ty + h);
    8787    int mh = end - my;
    8888
    89     paintBackground(i.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, _tx, _ty, w, h);
     89    paintBackground(paintInfo.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, tx, ty, w, h);
    9090
    9191    if (style()->hasBorder())
    92         paintBorderMinusLegend(i.p, _tx, _ty, w, h, style(), legend->xPos(), legend->width());
     92        paintBorderMinusLegend(paintInfo.p, tx, ty, w, h, style(), legend->xPos(), legend->width());
    9393}
    9494
    95 void RenderFieldset::paintBorderMinusLegend(GraphicsContext* p, int _tx, int _ty, int w, int h,
     95void RenderFieldset::paintBorderMinusLegend(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
    9696                                            const RenderStyle* style, int lx, int lw)
    9797{
     
    111111
    112112    if (render_t) {
    113         drawBorder(p, _tx, _ty, _tx + lx, _ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
    114                    (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE)?style->borderLeftWidth():0), 0);
    115         drawBorder(p, _tx+lx+lw, _ty, _tx + w, _ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
    116                    0, (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE)?style->borderRightWidth():0));
     113        drawBorder(graphicsContext, tx, ty, tx + lx, ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
     114                   (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? style->borderLeftWidth() : 0), 0);
     115        drawBorder(graphicsContext, tx + lx + lw, ty, tx + w, ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
     116                   0, (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? style->borderRightWidth() : 0));
    117117    }
    118118
    119119    if (render_b)
    120         drawBorder(p, _tx, _ty + h - style->borderBottomWidth(), _tx + w, _ty + h, BSBottom, bc, style->color(), bs,
    121                    (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE)?style->borderLeftWidth():0),
    122                    (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE)?style->borderRightWidth():0));
     120        drawBorder(graphicsContext, tx, ty + h - style->borderBottomWidth(), tx + w, ty + h, BSBottom, bc, style->color(), bs,
     121                   (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? style->borderLeftWidth() : 0),
     122                   (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? style->borderRightWidth() : 0));
    123123
    124124    if (render_l) {
     
    135135            (bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET);
    136136
    137         drawBorder(p, _tx, _ty, _tx + style->borderLeftWidth(), _ty + h, BSLeft, lc, style->color(), ls,
    138                    ignore_top?0:style->borderTopWidth(),
    139                    ignore_bottom?0:style->borderBottomWidth());
     137        drawBorder(graphicsContext, tx, ty, tx + style->borderLeftWidth(), ty + h, BSLeft, lc, style->color(), ls,
     138                   ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
    140139    }
    141140
     
    153152            (bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET);
    154153
    155         drawBorder(p, _tx + w - style->borderRightWidth(), _ty, _tx + w, _ty + h, BSRight, rc, style->color(), rs,
    156                    ignore_top?0:style->borderTopWidth(),
    157                    ignore_bottom?0:style->borderBottomWidth());
     154        drawBorder(graphicsContext, tx + w - style->borderRightWidth(), ty, tx + w, ty + h, BSRight, rc, style->color(), rs,
     155                   ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
    158156    }
    159157}
    160158
    161 void RenderFieldset::setStyle(RenderStyle* _style)
     159void RenderFieldset::setStyle(RenderStyle* newStyle)
    162160{
    163     RenderBlock::setStyle(_style);
     161    RenderBlock::setStyle(newStyle);
    164162
    165163    // WinIE renders fieldsets with display:inline like they're inline-blocks.  For us,
  • trunk/WebCore/rendering/RenderFileUploadControl.cpp

    r17024 r17448  
    5959   
    6060private:
    61         Node* m_shadowParent;   
     61    Node* m_shadowParent;   
    6262};
    6363
     
    7373    if (m_button)
    7474        m_button->detach();
    75     if (m_fileChooser) {
     75    if (m_fileChooser)
    7676        m_fileChooser->disconnectUploadControl();
    77     }
    78 }
    79 
    80 void RenderFileUploadControl::setStyle(RenderStyle* s)
     77}
     78
     79void RenderFileUploadControl::setStyle(RenderStyle* newStyle)
    8180{
    8281    // Force text-align to match the direction
    83     if (s->direction() == LTR)
    84         s->setTextAlign(LEFT);
     82    if (newStyle->direction() == LTR)
     83        newStyle->setTextAlign(LEFT);
    8584    else
    86         s->setTextAlign(RIGHT);
    87    
    88     RenderBlock::setStyle(s);
     85        newStyle->setTextAlign(RIGHT);
     86
     87    RenderBlock::setStyle(newStyle);
    8988    if (m_button)
    90         m_button->renderer()->setStyle(createButtonStyle(s));
     89        m_button->renderer()->setStyle(createButtonStyle(newStyle));
    9190
    9291    setReplaced(isInline());
     
    141140}
    142141
    143 void RenderFileUploadControl::paintObject(PaintInfo& i, int tx, int ty)
     142void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, int tx, int ty)
    144143{
    145144    // Push a clip.
    146     if (i.phase == PaintPhaseForeground || i.phase == PaintPhaseChildBlockBackgrounds) {
     145    if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
    147146        IntRect clipRect(tx + borderLeft(), ty + borderTop(),
    148147                         width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
    149148        if (clipRect.width() == 0 || clipRect.height() == 0)
    150149            return;
    151         i.p->save();
    152         i.p->clip(clipRect);
    153     }
    154    
    155     if (i.phase == PaintPhaseForeground) {
     150        paintInfo.p->save();
     151        paintInfo.p->clip(clipRect);
     152    }
     153
     154    if (paintInfo.phase == PaintPhaseForeground) {
    156155        const String& displayedFilename = m_fileChooser->basenameForWidth(maxFilenameWidth());
    157156        TextRun textRun(displayedFilename.characters(), displayedFilename.length());
    158        
     157
    159158        // Determine where the filename should be placed
    160159        int contentLeft = tx + borderLeft() + paddingLeft();
     
    168167        RenderButton* buttonRenderer = static_cast<RenderButton*>(m_button->renderer());
    169168        int textY = buttonRenderer->absoluteBoundingBoxRect().y() + buttonRenderer->marginTop() + buttonRenderer->borderTop() + buttonRenderer->paddingTop() + buttonRenderer->baselinePosition(true, false);
    170        
    171         i.p->setFont(style()->font());
    172         i.p->setPen(style()->color());
    173        
     169
     170        paintInfo.p->setFont(style()->font());
     171        paintInfo.p->setPen(style()->color());
     172
    174173        // Draw the filename
    175         i.p->drawText(textRun, IntPoint(textX, textY));
    176        
     174        paintInfo.p->drawText(textRun, IntPoint(textX, textY));
     175
    177176        if (m_fileChooser->icon()) {
    178177            // Determine where the icon should be placed
     
    183182            else
    184183                iconX = contentLeft + contentWidth() - m_button->renderer()->width() - afterButtonSpacing - iconWidth;
    185            
     184
    186185            // Draw the file icon
    187             m_fileChooser->icon()->paint(i.p, IntRect(iconX, iconY, iconWidth, iconHeight));
     186            m_fileChooser->icon()->paint(paintInfo.p, IntRect(iconX, iconY, iconWidth, iconHeight));
    188187        }
    189188    }
    190    
     189
    191190    // Paint the children.
    192     RenderBlock::paintObject(i, tx, ty);
    193    
     191    RenderBlock::paintObject(paintInfo, tx, ty);
     192
    194193    // Pop the clip.
    195     if (i.phase == PaintPhaseForeground || i.phase == PaintPhaseChildBlockBackgrounds)
    196         i.p->restore();
     194    if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds)
     195        paintInfo.p->restore();
    197196}
    198197
     
    201200    m_minWidth = 0;
    202201    m_maxWidth = 0;
    203    
     202
    204203    if (style()->width().isFixed() && style()->width().value() > 0)
    205204        m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value());
     
    211210        m_maxWidth = (int)ceilf(charWidth * defaultWidthNumChars);
    212211    }
    213    
     212
    214213    if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
    215214        m_maxWidth = max(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
     
    219218    else
    220219        m_minWidth = m_maxWidth;
    221    
     220
    222221    if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
    223222        m_maxWidth = min(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
    224223        m_minWidth = min(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
    225224    }
    226    
     225
    227226    int toAdd = paddingLeft() + paddingRight() + borderLeft() + borderRight();
    228227    m_minWidth += toAdd;
    229228    m_maxWidth += toAdd;
    230    
     229
    231230    setMinMaxKnown();
    232231}
     
    244243}
    245244
    246 }
     245} // namespace WebCore
  • trunk/WebCore/rendering/RenderFileUploadControl.h

    r16983 r17448  
    1919 */
    2020
    21 #ifndef RenderFileUploadControl_H
    22 #define RenderFileUploadControl_H
    23 
    24 #include "RenderBlock.h"
     21#ifndef RenderFileUploadControl_h
     22#define RenderFileUploadControl_h
    2523
    2624#include "FileChooser.h"
    2725#include "HTMLInputElement.h"
     26#include "RenderBlock.h"
    2827#include "Shared.h"
    2928
     
    4241    ~RenderFileUploadControl();
    4342
     43    virtual const char* renderName() const { return "RenderFileUploadControl"; }
     44
    4445    virtual void setStyle(RenderStyle*);
    4546    virtual void updateFromElement();
     
    5152    void valueChanged();
    5253
    53     virtual const char* renderName() const { return "RenderFileUploadControl"; }
    54 
    5554protected:
    5655    int maxFilenameWidth();
    5756    RenderStyle* createButtonStyle(RenderStyle* parentStyle = 0);
    58    
     57
    5958    RefPtr<HTMLFileUploadInnerButtonElement> m_button;
    6059    RefPtr<FileChooser> m_fileChooser;
    6160};
    6261
    63 }
     62} // namespace WebCore
    6463
    65 #endif
     64#endif // RenderFileUploadControl_h
  • trunk/WebCore/rendering/RenderFlexibleBox.h

    r16403 r17448  
    2121 */
    2222
    23 #ifndef RenderFlexibleBox_H
    24 #define RenderFlexibleBox_H
     23#ifndef RenderFlexibleBox_h
     24#define RenderFlexibleBox_h
    2525
    2626#include "RenderBlock.h"
     
    3232    RenderFlexibleBox(Node*);
    3333    virtual ~RenderFlexibleBox();
     34
     35    virtual const char* renderName() const;
    3436
    3537    virtual void calcMinMaxWidth();
     
    4648    virtual bool isFlexingChildren() const { return m_flexingChildren; }
    4749    virtual bool isStretchingChildren() const { return m_stretchingChildren; }
    48 
    49     virtual const char* renderName() const;
    5050
    5151    void placeChild(RenderObject* child, int x, int y);
     
    6464} // namespace WebCore
    6565
    66 #endif // RenderFlexibleBox_H
     66#endif // RenderFlexibleBox_h
  • trunk/WebCore/rendering/RenderFlow.cpp

    r17426 r17448  
    2121 * Boston, MA 02111-1307, USA.
    2222 */
    23 // -------------------------------------------------------------------------
    2423
    2524#include "config.h"
     
    2827#include "Document.h"
    2928#include "GraphicsContext.h"
     29#include "HTMLNames.h"
    3030#include "InlineTextBox.h"
    31 #include "HTMLNames.h"
    3231#include "RenderArena.h"
     32#include "RenderInline.h"
    3333#include "RenderView.h"
    34 #include "RenderInline.h"
    3534
    3635using namespace std;
     
    800799}
    801800
    802 }
     801} // namespace WebCore
  • trunk/WebCore/rendering/RenderFlow.h

    r17426 r17448  
    2323 */
    2424
    25 #ifndef RenderFlow_H
    26 #define RenderFlow_H
     25#ifndef RenderFlow_h
     26#define RenderFlow_h
    2727
    2828#include "RenderContainer.h"
     
    5353    void setContinuation(RenderFlow* c) { m_continuation = c; }
    5454    RenderFlow* continuationBefore(RenderObject* beforeChild);
    55    
     55
    5656    void addChildWithContinuation(RenderObject* newChild, RenderObject* beforeChild);
    5757    virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild) = 0;
    58     virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
     58    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
    5959
    60     static RenderFlow* createAnonymousFlow(Document* doc, RenderStyle* style);
     60    static RenderFlow* createAnonymousFlow(Document*, RenderStyle*);
    6161
    62     void extractLineBox(InlineFlowBox* lineBox);
    63     void attachLineBox(InlineFlowBox* lineBox);
    64     void removeLineBox(InlineFlowBox* lineBox);
     62    void extractLineBox(InlineFlowBox*);
     63    void attachLineBox(InlineFlowBox*);
     64    void removeLineBox(InlineFlowBox*);
    6565    void deleteLineBoxes();
    6666    virtual void destroy();
    6767
    6868    virtual void dirtyLinesFromChangedChild(RenderObject* child);
    69    
    70     virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
    71    
     69
     70    virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
     71
    7272    InlineFlowBox* firstLineBox() const { return m_firstLineBox; }
    7373    InlineFlowBox* lastLineBox() const { return m_lastLineBox; }
     
    7575    virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun=false);
    7676    virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false);
    77    
    78     void paintLines(PaintInfo&, int _tx, int _ty);
     77
     78    void paintLines(PaintInfo&, int tx, int ty);
    7979    bool hitTestLines(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
    8080
    8181    virtual IntRect getAbsoluteRepaintRect();
    82    
    83     virtual int lowestPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
    84     virtual int rightmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
    85     virtual int leftmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
    86    
    87     virtual IntRect caretRect(int offset, EAffinity affinity = UPSTREAM, int *extraWidthToEndOfLine = 0);
    8882
    89     virtual void addFocusRingRects(GraphicsContext*, int _tx, int _ty);
    90     void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect &prevLine, const IntRect &thisLine, const IntRect &nextLine);
     83    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     84    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     85    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     86
     87    virtual IntRect caretRect(int offset, EAffinity = UPSTREAM, int* extraWidthToEndOfLine = 0);
     88
     89    virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
     90    void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine, const IntRect& nextLine);
    9191    void paintOutline(GraphicsContext*, int tx, int ty);
    9292
     
    103103    InlineFlowBox* m_firstLineBox;
    104104    InlineFlowBox* m_lastLineBox;
    105    
     105
    106106    mutable short m_lineHeight;
    107107};
     
    109109} // namespace WebCore
    110110
    111 #endif // RenderFlow_H
     111#endif // RenderFlow_h
  • trunk/WebCore/rendering/RenderForeignObject.cpp

    r17426 r17448  
    2222
    2323#include "config.h"
     24
    2425#ifdef SVG_SUPPORT
     26
    2527#include "RenderForeignObject.h"
    2628
    2729#include "GraphicsContext.h"
    2830#include "KRenderingDevice.h"
     31#include "SVGForeignObjectElement.h"
    2932#include "SVGLength.h"
    30 #include "SVGForeignObjectElement.h"
    3133
    3234namespace WebCore {
    3335
    34 RenderForeignObject::RenderForeignObject(SVGForeignObjectElement *node)
     36RenderForeignObject::RenderForeignObject(SVGForeignObjectElement* node)
    3537    : RenderBlock(node)
    3638{
     
    4850        return;
    4951
    50     KRenderingDevice *device = renderingDevice();
     52    KRenderingDevice* device = renderingDevice();
    5153    KRenderingDeviceContext* context = device->currentContext();
    5254    bool shouldPopContext = false;
     
    7779    if (opacity < 1.0f)
    7880        paintInfo.p->endTransparencyLayer();
    79    
     81
    8082    if (shouldPopContext) {
    8183        device->popContext();
     
    9092    AffineTransform transform = translationForAttributes() * localTransform();
    9193    r = transform.mapRect(r);
    92    
     94
    9395    RenderBlock::computeAbsoluteRepaintRect(r, f);
    9496}
     
    115117    if (checkForRepaint)
    116118        repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
    117    
     119
    118120    setNeedsLayout(false);
    119121}
     
    125127    double localX, localY;
    126128    totalTransform.invert().map(x, y, &localX, &localY);
    127     return RenderBlock::nodeAtPoint(result, (int)localX, (int)localY, tx, ty, hitTestAction);
     129    return RenderBlock::nodeAtPoint(result, static_cast<int>(localX), static_cast<int>(localY), tx, ty, hitTestAction);
    128130}
    129131
    130 }
     132} // namespace WebCore
    131133
    132134#endif // SVG_SUPPORT
  • trunk/WebCore/rendering/RenderForeignObject.h

    r17399 r17448  
    2121 */
    2222
    23 #ifndef RenderForeignObject_H
    24 #define RenderForeignObject_H
     23#ifndef RenderForeignObject_h
     24#define RenderForeignObject_h
    2525#ifdef SVG_SUPPORT
    2626
     27#include "AffineTransform.h"
    2728#include "RenderBlock.h"
    28 #include "AffineTransform.h"
    2929
    3030namespace WebCore {
     
    3232class SVGForeignObjectElement;
    3333
    34 class RenderForeignObject : public RenderBlock
    35 {
     34class RenderForeignObject : public RenderBlock {
    3635public:
    37     RenderForeignObject(SVGForeignObjectElement *node);
    38    
    39     virtual const char *renderName() const { return "RenderForeignObject"; }
    40     virtual void paint(PaintInfo& paintInfo, int parentX, int parentY);
    41    
     36    RenderForeignObject(SVGForeignObjectElement*);
     37
     38    virtual const char* renderName() const { return "RenderForeignObject"; }
     39
     40    virtual void paint(PaintInfo&, int parentX, int parentY);
     41
    4242    virtual AffineTransform localTransform() const { return m_transform; }
    4343    virtual void setLocalTransform(const AffineTransform& transform) { m_transform = transform; }
    44    
    45     virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
     44
     45    virtual void computeAbsoluteRepaintRect(IntRect&, bool fixed);
    4646    virtual bool requiresLayer();
    4747    virtual void layout();
     
    5151 private:
    5252    AffineTransform translationForAttributes();
     53
    5354    AffineTransform m_transform;
    5455    IntRect m_absoluteBounds;
    5556};
    5657
    57 }
     58} // namespace WebCore
    5859
    5960#endif // SVG_SUPPORT
    60 #endif
     61#endif // RenderForeignObject_h
  • trunk/WebCore/rendering/RenderFormElement.cpp

    r16289 r17448  
    5151}
    5252
    53 void RenderFormElement::setStyle(RenderStyle* s)
     53void RenderFormElement::setStyle(RenderStyle* newStyle)
    5454{
    55     RenderWidget::setStyle(s);
     55    RenderWidget::setStyle(newStyle);
    5656
    5757    // Do not paint a background or border for Aqua form elements
     
    7676    calcWidth();
    7777    calcHeight();
    78    
     78
    7979    setNeedsLayout(false);
    8080}
     
    106106            return style()->direction() == RTL ? AlignRight : AlignLeft;
    107107    }
    108     ASSERT(false); // Should never be reached.
     108    ASSERT_NOT_REACHED();
    109109    return AlignLeft;
    110110}
  • trunk/WebCore/rendering/RenderFormElement.h

    r16289 r17448  
    2727#define RenderFormElement_h
    2828
     29#include "GraphicsTypes.h"
    2930#include "RenderWidget.h"
    30 #include "GraphicsTypes.h"
    3131
    3232namespace WebCore {
  • trunk/WebCore/rendering/RenderFrame.cpp

    r15696 r17448  
    2323 *
    2424 */
     25
    2526#include "config.h"
    2627#include "RenderFrame.h"
  • trunk/WebCore/rendering/RenderFrame.h

    r14334 r17448  
    2323 */
    2424
    25 #ifndef RenderFrame_H
    26 #define RenderFrame_H
     25#ifndef RenderFrame_h
     26#define RenderFrame_h
    2727
     28#include "HTMLFrameElement.h"
    2829#include "RenderPart.h"
    29 #include "HTMLFrameElement.h"
    3030
    3131namespace WebCore {
    3232
    33 class RenderFrame : public RenderPart
    34 {
     33class RenderFrame : public RenderPart {
    3534public:
    3635    RenderFrame(HTMLFrameElement*);
     
    3837    virtual const char* renderName() const { return "RenderFrame"; }
    3938
    40     HTMLFrameElement* element() const
    41         { return static_cast<HTMLFrameElement*>(RenderPart::element()); }
     39    HTMLFrameElement* element() const { return static_cast<HTMLFrameElement*>(RenderPart::element()); }
    4240
    4341    virtual void viewCleared();
    4442};
    4543
    46 }
     44} // namespace WebCore
    4745
    48 #endif
     46#endif // RenderFrame_h
  • trunk/WebCore/rendering/RenderFrameSet.cpp

    r17426 r17448  
    2323 *
    2424 */
     25
    2526#include "config.h"
    2627#include "RenderFrameSet.h"
     
    3233#include "HTMLFrameSetElement.h"
    3334#include "HTMLNames.h"
    34 #include "TextStream.h"
     35#include "HitTestResult.h"
    3536#include "MouseEvent.h"
    36 #include "HitTestResult.h"
    3737#include "RenderFrame.h"
    3838#include "RenderView.h"
     39#include "TextStream.h"
    3940
    4041namespace WebCore {
     
    558559#endif
    559560
    560 }
     561} // namespace WebCore
  • trunk/WebCore/rendering/RenderFrameSet.h

    r17399 r17448  
    2323 */
    2424
    25 #ifndef RenderFrameSet_H
    26 #define RenderFrameSet_H
     25#ifndef RenderFrameSet_h
     26#define RenderFrameSet_h
    2727
     28#include "HTMLFrameSetElement.h"
    2829#include "RenderContainer.h"
    29 #include "HTMLFrameSetElement.h"
    30 
    3130
    3231namespace WebCore {
     
    3534class MouseEvent;
    3635
    37 class RenderFrameSet : public RenderContainer
    38 {
     36class RenderFrameSet : public RenderContainer {
    3937    friend class HTMLFrameSetElement;
    4038public:
     
    5755    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
    5856
    59     HTMLFrameSetElement* element() const
    60         { return static_cast<HTMLFrameSetElement*>(RenderContainer::element()); }
     57    HTMLFrameSetElement* element() const { return static_cast<HTMLFrameSetElement*>(RenderContainer::element()); }
    6158
    6259#ifndef NDEBUG
     
    8279};
    8380
    84 }
     81} // namespace WebCore
    8582
    86 #endif
     83#endif // RenderFrameSet_h
  • trunk/WebCore/rendering/RenderHTMLCanvas.cpp

    r14827 r17448  
    3636using namespace HTMLNames;
    3737
    38 RenderHTMLCanvas::RenderHTMLCanvas(Node* n)
    39     : RenderReplaced(n)
     38RenderHTMLCanvas::RenderHTMLCanvas(Node* node)
     39    : RenderReplaced(node)
    4040{
    4141}
    4242
    43 const char* RenderHTMLCanvas::renderName() const
     43void RenderHTMLCanvas::paint(PaintInfo& paintInfo, int tx, int ty)
    4444{
    45     return "RenderHTMLCanvas";
    46 }
    47 
    48 void RenderHTMLCanvas::paint(PaintInfo& i, int tx, int ty)
    49 {
    50     if (!shouldPaint(i, tx, ty))
     45    if (!shouldPaint(paintInfo, tx, ty))
    5146        return;
    5247
     
    5449    int y = ty + m_y;
    5550
    56     if (shouldPaintBackgroundOrBorder() && (i.phase == PaintPhaseForeground || i.phase == PaintPhaseSelection))
    57         paintBoxDecorations(i, x, y);
     51    if (shouldPaintBackgroundOrBorder() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
     52        paintBoxDecorations(paintInfo, x, y);
    5853
    59     if ((i.phase == PaintPhaseOutline || i.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
    60         paintOutline(i.p, x, y, width(), height(), style());
    61    
    62     if (i.phase != PaintPhaseForeground && i.phase != PaintPhaseSelection)
     54    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
     55        paintOutline(paintInfo.p, x, y, width(), height(), style());
     56
     57    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
    6358        return;
    6459
    65     if (!shouldPaintWithinRoot(i))
     60    if (!shouldPaintWithinRoot(paintInfo))
    6661        return;
    6762
    6863    bool drawSelectionTint = selectionState() != SelectionNone && !document()->printing();
    69     if (i.phase == PaintPhaseSelection) {
     64    if (paintInfo.phase == PaintPhaseSelection) {
    7065        if (selectionState() == SelectionNone)
    7166            return;
     
    7469
    7570    if (element() && element()->hasTagName(canvasTag))
    76         static_cast<HTMLCanvasElement*>(element())->paint(i.p,
     71        static_cast<HTMLCanvasElement*>(element())->paint(paintInfo.p,
    7772            IntRect(x + borderLeft() + paddingLeft(), y + borderTop() + paddingTop(), contentWidth(), contentHeight()));
    7873
    7974    if (drawSelectionTint)
    80         i.p->fillRect(selectionRect(), selectionBackgroundColor());
     75        paintInfo.p->fillRect(selectionRect(), selectionBackgroundColor());
    8176}
    8277
     
    9893}
    9994
    100 }
     95} // namespace WebCore
  • trunk/WebCore/rendering/RenderHTMLCanvas.h

    r14336 r17448  
    2424 */
    2525
    26 #ifndef RenderHTMLCanvas_H
    27 #define RenderHTMLCanvas_H
     26#ifndef RenderHTMLCanvas_h
     27#define RenderHTMLCanvas_h
    2828
    2929#include "RenderReplaced.h"
     
    3434    public:
    3535        RenderHTMLCanvas(Node*);
    36         virtual const char* renderName() const;
     36
     37        virtual const char* renderName() const { return "RenderHTMLCanvas"; }
     38
    3739        virtual void paint(PaintInfo&, int tx, int ty);
    3840        virtual void layout();
    3941    };
    4042
    41 } //namespace
     43} // namespace WebCore
    4244
    43 #endif
     45#endif // RenderHTMLCanvas_h
  • trunk/WebCore/rendering/RenderImage.cpp

    r17426 r17448  
    4545using namespace HTMLNames;
    4646
    47 RenderImage::RenderImage(Node* n)
    48     : RenderReplaced(n)
     47RenderImage::RenderImage(Node* node)
     48    : RenderReplaced(node)
    4949    , m_cachedImage(0)
     50    , m_isAnonymousImage(0)
    5051{
    5152    m_selectionState = SelectionNone;
    5253    setIntrinsicWidth(0);
    5354    setIntrinsicHeight(0);
    54     m_isAnonymousImage = 0;
    5555    updateAltText();
    5656}
     
    6262}
    6363
    64 void RenderImage::setStyle(RenderStyle* _style)
    65 {
    66     RenderReplaced::setStyle(_style);
    67    
     64void RenderImage::setStyle(RenderStyle* newStyle)
     65{
     66    RenderReplaced::setStyle(newStyle);
    6867    setShouldPaintBackgroundOrBorder(true);
    6968}
    7069
    71 void RenderImage::setContentObject(CachedResource* co)
    72 {
    73     if (co && m_cachedImage != co) {
     70void RenderImage::setContentObject(CachedResource* cachedResource)
     71{
     72    if (cachedResource && m_cachedImage != cachedResource) {
    7473        if (m_cachedImage)
    7574            m_cachedImage->deref(this);
    76         m_cachedImage = static_cast<CachedImage*>(co);
     75        m_cachedImage = static_cast<CachedImage*>(cachedResource);
    7776        if (m_cachedImage)
    7877            m_cachedImage->ref(this);
     
    8483    if (isAnonymousImage())
    8584        return;
    86    
     85
    8786    if (m_cachedImage != newImage) {
    8887        if (m_cachedImage)
     
    9695}
    9796
    98 void RenderImage::imageChanged(CachedImage* o)
     97void RenderImage::imageChanged(CachedImage* newImage)
    9998{
    10099    if (documentBeingDestroyed())
    101100        return;
    102101
    103     if (o != m_cachedImage) {
    104         RenderReplaced::imageChanged(o);
    105         return;
    106     }
    107 
    108     bool iwchanged = false;
    109 
    110     if (o->isErrorImage()) {
    111         int iw = o->image()->width() + 4;
    112         int ih = o->image()->height() + 4;
     102    if (newImage != m_cachedImage) {
     103        RenderReplaced::imageChanged(newImage);
     104        return;
     105    }
     106
     107    bool imageSizeChanged = false;
     108
     109    if (newImage->isErrorImage()) {
     110        int imageWidth = newImage->image()->width() + 4;
     111        int imageHeight = newImage->image()->height() + 4;
    113112
    114113        // we have an alt and the user meant it (its not a text we invented)
    115114        if (!m_altText.isEmpty()) {
    116115            const Font& font = style()->font();
    117             iw = max(iw, min(font.width(TextRun(m_altText.characters(), m_altText.length())), 1024));
    118             ih = max(ih, min(font.height(), 256));
    119         }
    120 
    121         if (iw != intrinsicWidth()) {
    122             setIntrinsicWidth(iw);
    123             iwchanged = true;
    124         }
    125         if (ih != intrinsicHeight()) {
    126             setIntrinsicHeight(ih);
    127             iwchanged = true;
    128         }
    129     }
    130 
    131     bool needlayout = false;
     116            imageWidth = max(imageWidth, min(font.width(TextRun(m_altText.characters(), m_altText.length())), 1024));
     117            imageHeight = max(imageHeight, min(font.height(), 256));
     118        }
     119
     120        if (imageWidth != intrinsicWidth()) {
     121            setIntrinsicWidth(imageWidth);
     122            imageSizeChanged = true;
     123        }
     124        if (imageHeight != intrinsicHeight()) {
     125            setIntrinsicHeight(imageHeight);
     126            imageSizeChanged = true;
     127        }
     128    }
     129
     130    bool ensureLayout = false;
    132131
    133132    // Image dimensions have been changed, see what needs to be done
    134     if ((o->imageSize().width() != intrinsicWidth() || o->imageSize().height() != intrinsicHeight() || iwchanged)) {
    135         if(!o->isErrorImage()) {
    136             setIntrinsicWidth(o->imageSize().width());
    137             setIntrinsicHeight(o->imageSize().height());
     133    if (newImage->imageSize().width() != intrinsicWidth() || newImage->imageSize().height() != intrinsicHeight() || imageSizeChanged) {
     134        if (!newImage->isErrorImage()) {
     135            setIntrinsicWidth(newImage->imageSize().width());
     136            setIntrinsicHeight(newImage->imageSize().height());
    138137        }
    139138
     
    148147            calcHeight();
    149148   
    150             if(iwchanged || m_width != oldwidth || m_height != oldheight)
    151                 needlayout = true;
    152    
     149            if (imageSizeChanged || m_width != oldwidth || m_height != oldheight)
     150                ensureLayout = true;
     151
    153152            m_width = oldwidth;
    154153            m_height = oldheight;
     
    156155    }
    157156
    158     if (needlayout) {
     157    if (ensureLayout) {
    159158        if (!selfNeedsLayout())
    160159            setNeedsLayout(true);
    161160        if (minMaxKnown())
    162161            setMinMaxKnown(false);
    163     }
    164     else
     162    } else
    165163        // FIXME: We always just do a complete repaint, since we always pass in the full image
    166164        // rect at the moment anyway.
    167         repaintRectangle(IntRect(borderLeft()+paddingLeft(), borderTop()+paddingTop(), contentWidth(), contentHeight()));
     165        repaintRectangle(IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()));
    168166}
    169167
     
    177175}
    178176
    179 void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
    180 {
    181     if (!shouldPaint(i, _tx, _ty)) return;
    182 
    183     _tx += m_x;
    184     _ty += m_y;
     177void RenderImage::paint(PaintInfo& paintInfo, int tx, int ty)
     178{
     179    if (!shouldPaint(paintInfo, tx, ty))
     180        return;
     181
     182    tx += m_x;
     183    ty += m_y;
    185184       
    186     if (shouldPaintBackgroundOrBorder() && i.phase != PaintPhaseOutline && i.phase != PaintPhaseSelfOutline)
    187         paintBoxDecorations(i, _tx, _ty);
    188 
    189     GraphicsContext* p = i.p;
    190    
    191     if ((i.phase == PaintPhaseOutline || i.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
    192         paintOutline(p, _tx, _ty, width(), height(), style());
    193    
    194     if (i.phase != PaintPhaseForeground && i.phase != PaintPhaseSelection)
    195         return;
    196 
    197     if (!shouldPaintWithinRoot(i))
     185    if (shouldPaintBackgroundOrBorder() && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline)
     186        paintBoxDecorations(paintInfo, tx, ty);
     187
     188    GraphicsContext* p = paintInfo.p;
     189
     190    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
     191        paintOutline(p, tx, ty, width(), height(), style());
     192
     193    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
     194        return;
     195
     196    if (!shouldPaintWithinRoot(paintInfo))
    198197        return;
    199198       
    200199    bool isPrinting = document()->printing();
    201200    bool drawSelectionTint = isSelected() && !isPrinting;
    202     if (i.phase == PaintPhaseSelection) {
     201    if (paintInfo.phase == PaintPhaseSelection) {
    203202        if (selectionState() == SelectionNone)
    204203            return;
     
    217216
    218217    if (!m_cachedImage || image()->isNull() || errorOccurred()) {
    219         if (i.phase == PaintPhaseSelection)
     218        if (paintInfo.phase == PaintPhaseSelection)
    220219            return;
    221220
     
    224223                p->setPen(Color::lightGray);
    225224                p->setFillColor(Color::transparent);
    226                 p->drawRect(IntRect(_tx + leftBorder + leftPad, _ty + topBorder + topPad, cWidth, cHeight));
     225                p->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight));
    227226            }
    228            
     227
    229228            bool errorPictureDrawn = false;
    230             int imageX = 0, imageY = 0;
     229            int imageX = 0;
     230            int imageY = 0;
    231231            int usableWidth = cWidth;
    232232            int usableHeight = cHeight;
    233            
     233
    234234            if (errorOccurred() && !image()->isNull() && (usableWidth >= image()->width()) && (usableHeight >= image()->height())) {
    235235                // Center the error image, accounting for border and padding.
    236                 int centerX = (usableWidth - image()->width())/2;
     236                int centerX = (usableWidth - image()->width()) / 2;
    237237                if (centerX < 0)
    238238                    centerX = 0;
    239                 int centerY = (usableHeight - image()->height())/2;
     239                int centerY = (usableHeight - image()->height()) / 2;
    240240                if (centerY < 0)
    241241                    centerY = 0;
    242242                imageX = leftBorder + leftPad + centerX;
    243243                imageY = topBorder + topPad + centerY;
    244                 p->drawImage(image(), IntPoint(_tx + imageX, _ty + imageY));
     244                p->drawImage(image(), IntPoint(tx + imageX, ty + imageY));
    245245                errorPictureDrawn = true;
    246246            }
    247            
     247
    248248            if (!m_altText.isEmpty()) {
    249249                DeprecatedString text = m_altText.deprecatedString();
     
    251251                p->setFont(style()->font());
    252252                p->setPen(style()->color());
    253                 int ax = _tx + leftBorder + leftPad;
    254                 int ay = _ty + topBorder + topPad;
     253                int ax = tx + leftBorder + leftPad;
     254                int ay = ty + topBorder + topPad;
    255255                const Font& font = style()->font();
    256256                int ascent = font.ascent();
     
    269269    } else if (m_cachedImage) {
    270270#if PLATFORM(MAC)
    271         if (style()->highlight() != nullAtom && !i.p->paintingDisabled())
    272             paintCustomHighlight(_tx - m_x, _ty - m_y, style()->highlight(), true);
     271        if (style()->highlight() != nullAtom && !paintInfo.p->paintingDisabled())
     272            paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), true);
    273273#endif
    274274
    275         IntRect rect(IntPoint(_tx + leftBorder + leftPad, _ty + topBorder + topPad), IntSize(cWidth, cHeight));
    276        
     275        IntRect rect(IntPoint(tx + leftBorder + leftPad, ty + topBorder + topPad), IntSize(cWidth, cHeight));
     276
    277277        HTMLImageElement* imageElt = (element() && element()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(element()) : 0;
    278278        CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
     
    287287{
    288288    ASSERT(needsLayout());
    289     ASSERT( minMaxKnown() );
     289    ASSERT(minMaxKnown());
    290290
    291291    IntRect oldBounds;
     
    335335    if (!element())
    336336        return;
    337        
     337
    338338    if (element()->hasTagName(inputTag))
    339339        m_altText = static_cast<HTMLInputElement*>(element())->altText();
     
    436436}
    437437
    438 }
     438} // namespace WebCore
  • trunk/WebCore/rendering/RenderImage.h

    r17399 r17448  
    2525 */
    2626
    27 #ifndef RENDER_IMAGE_H
    28 #define RENDER_IMAGE_H
     27#ifndef RenderImage_h
     28#define RenderImage_h
    2929
    3030#include "CachedImage.h"
     
    3737class HTMLMapElement;
    3838
    39 class RenderImage : public RenderReplaced
    40 {
     39class RenderImage : public RenderReplaced {
    4140public:
    4241    RenderImage(Node*);
     
    5251
    5352    virtual void imageChanged(CachedImage*);
    54    
     53
    5554    // don't even think about making this method virtual!
    56     HTMLElement* element() const
    57         { return static_cast<HTMLElement*>(RenderReplaced::element()); }
     55    HTMLElement* element() const { return static_cast<HTMLElement*>(RenderReplaced::element()); }
    5856
    5957    // hook to keep RendeObject::m_inline() up to date
    60     virtual void setStyle(RenderStyle *style);
     58    virtual void setStyle(RenderStyle*);
    6159    void updateAltText();
    62    
     60
    6361    void setIsAnonymousImage(bool anon) { m_isAnonymousImage = anon; }
    6462    bool isAnonymousImage() { return m_isAnonymousImage; }
    65    
     63
    6664    void setCachedImage(CachedImage*);
    6765    CachedImage* cachedImage() const { return m_cachedImage; }
    68    
     66
    6967    Image* image() { return m_cachedImage ? m_cachedImage->image() : nullImage(); }
    7068
    7169    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
    72    
     70
    7371    virtual int calcReplacedWidth() const;
    7472    virtual int calcReplacedHeight() const;
     
    8179    // Called to set generated content images (e.g., :before/:after generated images).
    8280    void setContentObject(CachedResource*);
    83    
     81
    8482    bool errorOccurred() const { return m_cachedImage && m_cachedImage->isErrorImage(); }
    85    
     83
    8684    HTMLMapElement* imageMap();
    8785
     
    104102};
    105103
    106 } //namespace
     104} // namespace WebCore
    107105
    108 #endif
     106#endif // RenderImage_h
  • trunk/WebCore/rendering/RenderInline.cpp

    r17426 r17448  
    3434
    3535RenderInline::RenderInline(Node* node)
    36 :RenderFlow(node), m_isContinuation(false)
    37 {}
     36    : RenderFlow(node)
     37    , m_isContinuation(false)
     38{
     39}
    3840
    3941RenderInline::~RenderInline()
    40 {}
    41 
    42 void RenderInline::setStyle(RenderStyle* _style)
    43 {
    44     RenderFlow::setStyle(_style);
     42{
     43}
     44
     45void RenderInline::setStyle(RenderStyle* newStyle)
     46{
     47    RenderFlow::setStyle(newStyle);
    4548    setInline(true);
    4649
     
    6366
    6467    m_lineHeight = -1;
    65    
     68
    6669    // Update pseudos for :before and :after now.
    6770    updatePseudoChild(RenderStyle::BEFORE);
     
    8588        // |newChild|.  We then make that block box a continuation of this inline.  We take all of
    8689        // the children after |beforeChild| and put them in a clone of this object.
    87         RenderStyle *newStyle = new (renderArena()) RenderStyle();
     90        RenderStyle* newStyle = new (renderArena()) RenderStyle();
    8891        newStyle->inheritFrom(style());
    8992        newStyle->setDisplay(BLOCK);
    9093
    91         RenderBlock *newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
     94        RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
    9295        newBox->setStyle(newStyle);
    9396        RenderFlow* oldContinuation = continuation();
     
    102105            beforeChild = 0; // We destroyed the last child, so now we need to update our insertion
    103106                             // point to be 0.  It's just a straight append now.
    104        
     107
    105108        splitFlow(beforeChild, newBox, newChild, oldContinuation);
    106109        return;
     
    114117RenderInline* RenderInline::cloneInline(RenderFlow* src)
    115118{
    116     RenderInline *o = new (src->renderArena()) RenderInline(src->element());
     119    RenderInline* o = new (src->renderArena()) RenderInline(src->element());
    117120    o->m_isContinuation = true;
    118121    o->setStyle(src->style());
     
    127130    RenderInline* clone = cloneInline(this);
    128131    clone->setContinuation(oldCont);
    129    
     132
    130133    // Now take all of the children from beforeChild to the end and remove
    131134    // them from |this| and place them in the clone.
     
    163166        // content gets properly destroyed.
    164167        curr->updatePseudoChild(RenderStyle::AFTER);
    165        
     168
    166169        // Now we need to take all of the children starting from the first child
    167170        // *after* currChild and append them all to the clone.
     
    209212
    210213    RenderBlock* post = block->createAnonymousBlock();
    211    
     214
    212215    RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
    213216    if (madeNewBeforeBlock)
     
    219222    if (madeNewBeforeBlock) {
    220223        RenderObject* o = boxFirst;
    221         while (o)
    222         {
     224        while (o) {
    223225            RenderObject* no = o;
    224226            o = no->nextSibling();
     
    240242    // to wrap itself in additional boxes (e.g., table construction).
    241243    newBlockBox->addChildToFlow(newChild, 0);
    242    
     244
    243245    // Always just do a full layout in order to ensure that line boxes (especially wrappers for images)
    244246    // get deleted properly.  Because objects moves from the pre block into the post block, we want to
     
    249251}
    250252
    251 void RenderInline::paint(PaintInfo& i, int _tx, int _ty)
    252 {
    253     paintLines(i, _tx, _ty);
     253void RenderInline::paint(PaintInfo& paintInfo, int tx, int ty)
     254{
     255    paintLines(paintInfo, tx, ty);
    254256}
    255257
     
    258260    for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
    259261        rects.append(IntRect(tx + curr->xPos(), ty + curr->yPos(), curr->width(), curr->height()));
    260    
    261     for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
     262
     263    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
    262264        if (!curr->isText())
    263265            curr->absoluteRects(rects, tx + curr->xPos(), ty + curr->yPos());
    264    
     266    }
     267
    265268    if (continuation())
    266269        continuation()->absoluteRects(rects,
     
    271274void RenderInline::calcMinMaxWidth()
    272275{
    273     ASSERT( !minMaxKnown() );
    274 
    275 #ifdef DEBUG_LAYOUT
    276     kdDebug( 6040 ) << renderName() << "(RenderInline)::calcMinMaxWidth() this=" << this << endl;
    277 #endif
     276    ASSERT(!minMaxKnown());
    278277
    279278    // Irrelevant, since some enclosing block will actually measure us and our children.
     
    284283}
    285284
    286 bool RenderInline::requiresLayer() {
     285bool RenderInline::requiresLayer()
     286{
    287287    return isRoot() || isRelPositioned() || style()->opacity() < 1.0f;
    288288}
     
    299299            rightSide = curr->xPos() + curr->width();
    300300    }
    301    
     301
    302302    return rightSide - leftSide;
    303303}
     
    305305int RenderInline::height() const
    306306{
    307     int h = 0;
    308307    if (firstLineBox())
    309         h = lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos();
    310     return h;
     308        return lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos();
     309    return 0;
    311310}
    312311
     
    327326}
    328327
    329 const char *RenderInline::renderName() const
     328const char* RenderInline::renderName() const
    330329{
    331330    if (isRelPositioned())
     
    336335}
    337336
    338 bool RenderInline::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty,
    339                                HitTestAction hitTestAction)
    340 {
    341     return hitTestLines(result, _x, _y, _tx, _ty, hitTestAction);
     337bool RenderInline::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
     338{
     339    return hitTestLines(result, x, y, tx, ty, hitTestAction);
    342340}
    343341
    344342VisiblePosition RenderInline::positionForCoordinates(int x, int y)
    345343{
    346     for (RenderObject *c = continuation(); c; c = c->continuation()) {
     344    for (RenderObject* c = continuation(); c; c = c->continuation()) {
    347345        if (c->isInline() || c->firstChild())
    348346            return c->positionForCoordinates(x, y);
     
    352350}
    353351
    354 }
     352} // namespace WebCore
  • trunk/WebCore/rendering/RenderInline.h

    r17426 r17448  
    2323 */
    2424
    25 #ifndef RENDER_INLINE_H
    26 #define RENDER_INLINE_H
     25#ifndef RenderInline_h
     26#define RenderInline_h
    2727
    2828#include "RenderFlow.h"
    2929
    3030namespace WebCore {
    31     class Position;
    32 }
    3331
    34 namespace WebCore {
     32class Position;
    3533
    36 class RenderInline : public RenderFlow
    37 {
     34class RenderInline : public RenderFlow {
    3835public:
    3936    RenderInline(Node*);
    4037    virtual ~RenderInline();
    4138
    42     virtual const char *renderName() const;
     39    virtual const char* renderName() const;
    4340
    4441    virtual bool isRenderInline() const { return true; }
     
    4744
    4845    virtual bool isInlineContinuation() const;
    49    
     46
    5047    virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild);
    5148    void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock,
     
    5350    void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
    5451                   RenderObject* newChild, RenderFlow* oldCont);
    55    
     52
    5653    virtual void setStyle(RenderStyle*);
    5754
    58     virtual void layout() {} // Do nothing for layout()
    59    
     55    virtual void layout() { } // Do nothing for layout()
     56
    6057    virtual void paint(PaintInfo&, int tx, int ty);
    6158
    62     virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
    63    
     59    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     60
    6461    virtual void calcMinMaxWidth();
    6562
     
    6966    virtual int width() const;
    7067    virtual int height() const;
    71    
     68
    7269    // used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow) to return
    7370    // the remaining width on a given line (and the height of a single line).
     
    7875
    7976    virtual VisiblePosition positionForCoordinates(int x, int y);
    80    
     77
    8178protected:
    8279    static RenderInline* cloneInline(RenderFlow* src);
     
    8683};
    8784
    88 } // namespace
     85} // namespace WebCore
    8986
    90 #endif
    91 
     87#endif // RenderInline_h
  • trunk/WebCore/rendering/RenderLayer.cpp

    r17426 r17448  
    5757#include "OverflowEvent.h"
    5858#include "PlatformMouseEvent.h"
     59#include "PlatformScrollBar.h"
    5960#include "RenderArena.h"
    6061#include "RenderInline.h"
     
    6263#include "RenderView.h"
    6364#include "SelectionController.h"
    64 #include "PlatformScrollBar.h"
    6565
    6666#ifdef SVG_SUPPORT
     
    23132313}
    23142314
    2315 }
     2315} // namespace WebCore
  • trunk/WebCore/rendering/RenderLayer.h

    r17402 r17448  
    4242 */
    4343
    44 #ifndef render_layer_h
    45 #define render_layer_h
     44#ifndef RenderLayer_h
     45#define RenderLayer_h
    4646
    4747#include "RenderObject.h"
     48#include "ScrollBar.h"
    4849#include "Timer.h"
    49 #include "ScrollBar.h"
    5050
    5151namespace WebCore {
     
    5353class CachedResource;
    5454class HitTestResult;
    55 class RenderView;
     55class PlatformScrollbar;
    5656class RenderFrameSet;
    5757class RenderObject;
     
    5959class RenderTable;
    6060class RenderText;
    61 class PlatformScrollbar;
     61class RenderView;
    6262
    6363class ClipRects {
    6464public:
    65     ClipRects(const IntRect& r) :m_overflowClipRect(r), m_fixedClipRect(r), m_posClipRect(r), m_refCnt(0) {}
     65    ClipRects(const IntRect& r)
     66        : m_overflowClipRect(r)
     67        , m_fixedClipRect(r)
     68        , m_posClipRect(r)
     69        , m_refCnt(0)
     70    {
     71    }
     72
    6673    ClipRects(const IntRect& o, const IntRect& f, const IntRect& p)
    67       :m_overflowClipRect(o), m_fixedClipRect(f), m_posClipRect(p), m_refCnt(0) {}
     74        : m_overflowClipRect(o)
     75        , m_fixedClipRect(f)
     76        , m_posClipRect(p)
     77        , m_refCnt(0)
     78    {
     79    }
    6880
    6981    const IntRect& overflowClipRect() { return m_overflowClipRect; }
     
    7385    void ref() { m_refCnt++; }
    7486    void deref(RenderArena* renderArena) { if (--m_refCnt == 0) destroy(renderArena); }
    75    
    76     void destroy(RenderArena* renderArena);
     87
     88    void destroy(RenderArena*);
    7789
    7890    // Overloaded new operator.
    79     void* operator new(size_t sz, RenderArena* renderArena) throw();   
     91    void* operator new(size_t, RenderArena*) throw();
    8092
    8193    // Overridden to prevent the normal delete from being called.
    82     void operator delete(void* ptr, size_t sz);
     94    void operator delete(void*, size_t);
    8395       
    8496private:
    8597    // The normal operator new is disallowed on all render objects.
    86     void* operator new(size_t sz) throw();
     98    void* operator new(size_t) throw();
    8799
    88100private:
     
    93105};
    94106
     107
     108// FIXME: move this to its own file
    95109// This class handles the auto-scrolling of layers with overflow: marquee.
    96 class Marquee
    97 {
     110class Marquee {
    98111public:
    99112    Marquee(RenderLayer*);
     
    101114    int speed() const { return m_speed; }
    102115    int marqueeSpeed() const;
     116
    103117    EMarqueeDirection reverseDirection() const { return static_cast<EMarqueeDirection>(-direction()); }
    104118    EMarqueeDirection direction() const;
     
    109123
    110124    EWhiteSpace whiteSpace() { return static_cast<EWhiteSpace>(m_whiteSpace); }
    111    
    112     int computePosition(EMarqueeDirection dir, bool stopAtClientEdge);
     125
     126    int computePosition(EMarqueeDirection, bool stopAtClientEdge);
    113127
    114128    void setEnd(int end) { m_end = end; }
     
    163177    static const ScrollAlignment gAlignTopAlways;
    164178    static const ScrollAlignment gAlignBottomAlways;
    165    
     179
    166180    static ScrollBehavior getVisibleBehavior(const ScrollAlignment& s) { return s.m_rectVisible; }
    167181    static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return s.m_rectPartial; }
    168182    static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s.m_rectHidden; }
    169    
     183
    170184    RenderLayer(RenderObject*);
    171185    ~RenderLayer();
    172    
     186
    173187    RenderObject* renderer() const { return m_object; }
    174188    RenderLayer* parent() const { return m_parent; }
    175189    RenderLayer* previousSibling() const { return m_previous; }
    176190    RenderLayer* nextSibling() const { return m_next; }
    177 
    178191    RenderLayer* firstChild() const { return m_first; }
    179192    RenderLayer* lastChild() const { return m_last; }
     
    186199
    187200    void repaintIncludingDescendants();
    188    
     201
    189202    void styleChanged();
    190    
     203
    191204    Marquee* marquee() const { return m_marquee; }
    192205    void suspendMarquees();
    193206
    194207    bool isOverflowOnly() const { return m_isOverflowOnly; }
    195    
     208
    196209    bool isTransparent() const;
    197210    RenderLayer* transparentAncestor();
    198211    void beginTransparencyLayers(GraphicsContext*, const IntRect&);
    199    
    200     const RenderLayer* root() const {
     212
     213    const RenderLayer* root() const
     214    {
    201215        const RenderLayer* curr = this;
    202         while (curr->parent()) curr = curr->parent();
     216        while (curr->parent())
     217            curr = curr->parent();
    203218        return curr;
    204219    }
     
    206221    int xPos() const { return m_x; }
    207222    int yPos() const { return m_y; }
    208     int width() const { return m_width; }
    209     int height() const { return m_height; }
    210 
    211     void setWidth(int w) { m_width = w; }
    212     void setHeight(int h) { m_height = h; }
    213 
    214     int scrollWidth();
    215     int scrollHeight();
    216    
    217     void setPos( int xPos, int yPos ) {
     223    void setPos(int xPos, int yPos)
     224    {
    218225        m_x = xPos;
    219226        m_y = yPos;
    220227    }
     228
     229    int width() const { return m_width; }
     230    int height() const { return m_height; }
     231    void setWidth(int w) { m_width = w; }
     232    void setHeight(int h) { m_height = h; }
     233
     234    int scrollWidth();
     235    int scrollHeight();
    221236
    222237    // Scrolling methods for layers that can scroll their overflow.
     
    228243    void scrollToXOffset(int x) { scrollToOffset(x, m_scrollY); }
    229244    void scrollToYOffset(int y) { scrollToOffset(m_scrollX + m_scrollOriginX, y); }
    230     void scrollRectToVisible(const IntRect &r, const ScrollAlignment& alignX = gAlignCenterIfNeeded, const ScrollAlignment& alignY = gAlignCenterIfNeeded);
    231     IntRect getRectToExpose(const IntRect &visibleRect,  const IntRect &exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);   
     245    void scrollRectToVisible(const IntRect&, const ScrollAlignment& alignX = gAlignCenterIfNeeded, const ScrollAlignment& alignY = gAlignCenterIfNeeded);
     246
     247    IntRect getRectToExpose(const IntRect& visibleRect, const IntRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);   
     248
    232249    void setHasHorizontalScrollbar(bool);
    233250    void setHasVerticalScrollbar(bool);
     251
    234252    PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
    235253    void destroyScrollbar(ScrollbarOrientation);
     254
    236255    Scrollbar* horizontalScrollbar() { return m_hBar.get(); }
    237256    Scrollbar* verticalScrollbar() { return m_vBar.get(); }
     257
    238258    PlatformScrollbar* horizontaScrollbarWidget() const;
    239259    PlatformScrollbar* verticalScrollbarWidget() const;
     260
    240261    int verticalScrollbarWidth() const;
    241262    int horizontalScrollbarHeight() const;
     263
    242264    void positionOverflowControls();
    243265    bool isPointInResizeControl(const IntPoint&);
    244266    IntSize offsetFromResizeCorner(const IntPoint&) const;
     267
    245268    void paintOverflowControls(GraphicsContext*, int tx, int ty, const IntRect& damageRect);
     269
    246270    void updateScrollInfoAfterLayout();
    247     bool scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier=1.0);
     271
     272    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
    248273    void autoscroll();
     274
    249275    void resize(const PlatformMouseEvent&, const IntSize&);
    250276    bool inResizeMode() const { return m_inResizeMode; }
     
    252278   
    253279    void updateLayerPosition();
    254     void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint=true);
     280    void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint = true);
    255281    void checkForRepaintOnResize();
    256     void relativePositionOffset(int& relX, int& relY) {
    257         relX += m_relX; relY += m_relY;
    258     }
    259      
     282
     283    void relativePositionOffset(int& relX, int& relY) { relX += m_relX; relY += m_relY; }
     284
    260285    void clearClipRects();
    261286    void clearClipRect();
     
    270295    Vector<RenderLayer*>* posZOrderList() const { return m_posZOrderList; }
    271296    Vector<RenderLayer*>* negZOrderList() const { return m_negZOrderList; }
    272    
     297
    273298    void dirtyOverflowList();
    274299    void updateOverflowList();
    275300    Vector<RenderLayer*>* overflowList() const { return m_overflowList; }
    276    
     301
    277302    bool hasVisibleContent() const { return m_hasVisibleContent; }
    278     void setHasVisibleContent(bool b);
     303    void setHasVisibleContent(bool);
    279304    void dirtyVisibleContentStatus();
    280305
     
    282307    // the <html> layer and the root layer).
    283308    RenderLayer* enclosingPositionedAncestor() const;
    284    
     309
    285310    void convertToLayerCoords(const RenderLayer* ancestorLayer, int& x, int& y) const;
    286    
     311
    287312    bool hasAutoZIndex() const { return renderer()->style()->hasAutoZIndex(); }
    288313    int zIndex() const { return renderer()->style()->zIndex(); }
     
    311336
    312337    void updateHoverActiveState(HitTestResult&);
    313    
     338
    314339    IntRect repaintRect() const { return m_repaintRect; }
    315340
    316     void destroy(RenderArena* renderArena);
     341    void destroy(RenderArena*);
    317342
    318343     // Overloaded new operator.  Derived classes must override operator new
    319344    // in order to allocate out of the RenderArena.
    320     void* operator new(size_t sz, RenderArena* renderArena) throw();   
     345    void* operator new(size_t, RenderArena*) throw();
    321346
    322347    // Overridden to prevent the normal delete from being called.
    323     void operator delete(void* ptr, size_t sz);
     348    void operator delete(void*, size_t);
    324349
    325350private:
    326351    // The normal operator new is disallowed on all render objects.
    327     void* operator new(size_t sz) throw();
     352    void* operator new(size_t) throw();
    328353
    329354private:
     
    337362
    338363    void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect,
    339         bool haveTransparency, PaintRestriction, RenderObject* paintingRoot);
     364                    bool haveTransparency, PaintRestriction, RenderObject* paintingRoot);
    340365    RenderLayer* hitTestLayer(RenderLayer* rootLayer, HitTestResult&, const IntRect& hitTestRect);
    341366    void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0);
     
    347372
    348373    void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
    349    
     374
    350375    void childVisibilityChanged(bool newVisibility);
    351376    void dirtyVisibleDescendantStatus();
    352377    void updateVisibilityStatus();
    353        
     378
    354379protected:   
    355380    RenderObject* m_object;
    356    
     381
    357382    RenderLayer* m_parent;
    358383    RenderLayer* m_previous;
    359384    RenderLayer* m_next;
    360 
    361385    RenderLayer* m_first;
    362386    RenderLayer* m_last;
     
    378402    int m_width;
    379403    int m_height;
    380    
     404
    381405    // Our scroll offsets if the view is scrolled.
    382406    int m_scrollX;
     
    384408    int m_scrollOriginX;
    385409    int m_scrollLeftOverflow;
    386    
     410
    387411    // The width/height of our scrolled area.
    388412    int m_scrollWidth;
    389413    int m_scrollHeight;
    390    
     414
    391415    // For layers with overflow, we have a pair of scrollbars.
    392416    RefPtr<Scrollbar> m_hBar;
    393417    RefPtr<Scrollbar> m_vBar;
    394    
     418
    395419    // Keeps track of whether the layer is currently resizing, so events can cause resizing to start and stop.
    396420    bool m_inResizeMode;
     
    402426    Vector<RenderLayer*>* m_posZOrderList;
    403427    Vector<RenderLayer*>* m_negZOrderList;
    404    
     428
    405429    // This list contains our overflow child layers.
    406430    Vector<RenderLayer*>* m_overflowList;
     
    426450    bool m_visibleDescendantStatusDirty : 1;
    427451    bool m_hasVisibleDescendant : 1;
    428    
     452
    429453    Marquee* m_marquee; // Used by layers with overflow:marquee
    430454};
    431455
    432 } // namespace
    433 
    434 #endif
     456} // namespace WebCore
     457
     458#endif // RenderLayer_h
  • trunk/WebCore/rendering/RenderLineEdit.cpp

    r16171 r17448  
    111111}
    112112
    113 void RenderLineEdit::setStyle(RenderStyle *s)
    114 {
    115     RenderFormElement::setStyle(s);
     113void RenderLineEdit::setStyle(RenderStyle* newStyle)
     114{
     115    RenderFormElement::setStyle(newStyle);
    116116
    117117    TextField* w = static_cast<TextField*>(widget());
     
    150150
    151151    w->setReadOnly(e->isReadOnlyControl());
    152    
     152
    153153    // Handle updating the search attributes.
    154154    w->setPlaceholderString(e->getAttribute(placeholderAttr).deprecatedString());
     
    183183int RenderLineEdit::selectionStart()
    184184{
    185     TextField *lineEdit = static_cast<TextField *>(m_widget);
     185    TextField* lineEdit = static_cast<TextField*>(m_widget);
    186186    int start = lineEdit->selectionStart();
    187187    if (start == -1)
     
    192192int RenderLineEdit::selectionEnd()
    193193{
    194     TextField *lineEdit = static_cast<TextField *>(m_widget);
     194    TextField* lineEdit = static_cast<TextField*>(m_widget);
    195195    int start = lineEdit->selectionStart();
    196196    if (start == -1)
    197197        return lineEdit->cursorPosition();
    198     return start + (int)lineEdit->selectedText().length();
     198    return start + static_cast<int>(lineEdit->selectedText().length());
    199199}
    200200
     
    203203    int realStart = max(start, 0);
    204204    int length = max(selectionEnd() - realStart, 0);
    205     static_cast<TextField *>(m_widget)->setSelection(realStart, length);
     205    static_cast<TextField*>(m_widget)->setSelection(realStart, length);
    206206}
    207207
     
    215215        length = 0;
    216216    }
    217     static_cast<TextField *>(m_widget)->setSelection(start, length);
     217    static_cast<TextField*>(m_widget)->setSelection(start, length);
    218218}
    219219
     
    236236    int realStart = max(start, 0);
    237237    int length = max(end - realStart, 0);
    238     static_cast<TextField *>(m_widget)->setSelection(realStart, length);
     238    static_cast<TextField*>(m_widget)->setSelection(realStart, length);
    239239}
    240240
  • trunk/WebCore/rendering/RenderLineEdit.h

    r14382 r17448  
    5050        void setSelectionStart(int);
    5151        void setSelectionEnd(int);
    52        
     52
    5353        bool isEdited() const;
    5454        void setEdited(bool);
  • trunk/WebCore/rendering/RenderListBox.cpp

    r17426 r17448  
    3030#include "GraphicsContext.h"
    3131#include "HTMLNames.h"
     32#include "HTMLOptGroupElement.h"
    3233#include "HTMLOptionElement.h"
    33 #include "HTMLOptGroupElement.h"
    3434#include "HTMLSelectElement.h"
    3535#include "HitTestResult.h"
     
    434434}
    435435
    436 }
     436} // namespace WebCore
  • trunk/WebCore/rendering/RenderListBox.h

    r17399 r17448  
    2121 */
    2222
    23 #ifndef RenderListBox_H
    24 #define RenderListBox_H
     23#ifndef RenderListBox_h
     24#define RenderListBox_h
    2525
    2626#include "RenderBlock.h"
     
    3636    ~RenderListBox();
    3737
     38    virtual const char* renderName() const { return "RenderListBox"; }
     39
    3840    virtual bool isListBox() const { return true; }
    3941
     
    4345
    4446    virtual bool canHaveChildren() const { return false; }
    45     virtual const char* renderName() const { return "RenderListBox"; }
     47
    4648    virtual void paintObject(PaintInfo&, int tx, int ty);
    4749    virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
    4850
    49     virtual bool scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier=1.0);
     51    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
    5052
    5153    virtual void calcMinMaxWidth();
    52     virtual short baselinePosition(bool, bool isRootLineBox) const;
     54    virtual short baselinePosition(bool firstLine, bool isRootLineBox) const;
    5355    virtual void calcHeight();
    5456    void setOptionsChanged(bool c) { m_optionsChanged = c; }
    5557    void valueChanged(unsigned listIndex);
    56    
     58
    5759    // ScrollbarClient interface.
    5860    virtual void valueChanged(Scrollbar*);
     
    6062
    6163    HTMLOptionElement* optionAtPoint(int x, int y);
    62    
     64
    6365    bool scrollToRevealElementAtListIndex(int index);
    64    
     66
    6567    virtual bool shouldAutoscroll() const { return numItems() > size(); }
    6668    virtual void autoscroll();
    6769
    6870private:
     71    int size() const;
     72    int numItems() const;
     73    IntRect itemBoundingBoxRect(int tx, int ty, int index);
     74    void paintScrollbar(PaintInfo&);
     75    void paintItemForeground(PaintInfo&, int tx, int ty, int listIndex);
     76    void paintItemBackground(PaintInfo&, int tx, int ty, int listIndex);
     77
    6978    bool m_optionsChanged;
    7079    int m_optionsWidth;
     
    7382    int m_indexOffset;
    7483    bool m_selectionChanged;
    75    
    76     int size() const;
    77     int numItems() const;
    78     IntRect itemBoundingBoxRect(int tx, int ty, int index);
    79     void paintScrollbar(PaintInfo&);
    80     void paintItemForeground(PaintInfo&, int tx, int ty, int listIndex);
    81     void paintItemBackground(PaintInfo&, int tx, int ty, int listIndex);
    82    
     84
    8385    Scrollbar* m_vBar;
    8486};
    8587
    86 }
     88} // namepace WebCore
    8789
    88 #endif
     90#endif // RenderListBox_h
  • trunk/WebCore/rendering/RenderListItem.cpp

    r15801 r17448  
    4848}
    4949
    50 void RenderListItem::setStyle(RenderStyle* _style)
    51 {
    52     RenderBlock::setStyle(_style);
     50void RenderListItem::setStyle(RenderStyle* newStyle)
     51{
     52    RenderBlock::setStyle(newStyle);
    5353
    5454    if (style()->listStyleType() != LNONE ||
     
    143143    if (!firstChild)
    144144        return 0;
    145        
     145
    146146    for (RenderObject* currChild = firstChild; currChild; currChild = currChild->nextSibling()) {
    147147        if (currChild == marker)
    148148            continue;
    149            
     149
    150150        if (currChild->isInline())
    151151            return curr;
    152        
     152
    153153        if (currChild->isFloating() || currChild->isPositioned())
    154154            continue;
    155            
     155
    156156        if (currChild->isTable() || !currChild->isRenderBlock())
    157157            break;
    158        
     158
    159159        if (currChild->style()->htmlHacks() && currChild->element() &&
    160160            (currChild->element()->hasTagName(ulTag)|| currChild->element()->hasTagName(olTag)))
    161161            break;
    162            
     162
    163163        RenderObject* lineBox = getParentOfFirstLineBox(currChild, marker);
    164164        if (lineBox)
    165165            return lineBox;
    166166    }
    167    
     167
    168168    return 0;
    169169}
     
    192192                lineBoxParent = this;
    193193        }
    194        
     194
    195195        if (markerPar != lineBoxParent || !m_marker->minMaxKnown()) {
    196196            m_marker->remove();
     
    232232            xOffset += o->xPos();
    233233        }
    234        
     234
    235235        RootInlineBox* root = m_marker->inlineBoxWrapper()->root();
    236236        if (style()->direction() == LTR) {
     
    254254}
    255255
    256 void RenderListItem::paint(PaintInfo& i, int _tx, int _ty)
     256void RenderListItem::paint(PaintInfo& paintInfo, int tx, int ty)
    257257{
    258258    if (!m_height)
    259259        return;
    260260
    261     RenderBlock::paint(i, _tx, _ty);
     261    RenderBlock::paint(paintInfo, tx, ty);
    262262}
    263263
     
    267267}
    268268
    269 }
     269} // namespace WebCore
  • trunk/WebCore/rendering/RenderListItem.h

    r14389 r17448  
    2323 */
    2424
    25 #ifndef RenderListItem_H
    26 #define RenderListItem_H
     25#ifndef RenderListItem_h
     26#define RenderListItem_h
    2727
    2828#include "RenderBlock.h"
     
    3232class RenderListMarker;
    3333
    34 class RenderListItem : public RenderBlock
    35 {
     34class RenderListItem : public RenderBlock {
    3635public:
    3736    RenderListItem(Node*);
     37
     38    virtual const char* renderName() const { return "RenderListItem"; }
     39
     40    virtual bool isListItem() const { return true; }
    3841   
    3942    virtual void destroy();
    4043
    41     virtual const char* renderName() const { return "RenderListItem"; }
    42 
    4344    virtual void setStyle(RenderStyle*);
    4445
    45     virtual bool isListItem() const { return true; }
    46    
    4746    int value() const { return m_value; }
    4847    void setValue(int v) { m_predefVal = v; }
     
    5857    virtual void positionListMarker();
    5958    void updateMarkerLocation();
    60    
     59
    6160    void setNotInList(bool notInList) { m_notInList = notInList; }
    6261    bool notInList() const { return m_notInList; }
     
    7170};
    7271
     72} // namespace WebCore
    7373
    74 } //namespace
    75 
    76 #endif
     74#endif // RenderListItem_h
  • trunk/WebCore/rendering/RenderListMarker.cpp

    r16296 r17448  
    522522}
    523523
    524 }
     524} // namespace WebCore
  • trunk/WebCore/rendering/RenderListMarker.h

    r14784 r17448  
    2323 */
    2424
    25 #ifndef RenderListMarker_H
    26 #define RenderListMarker_H
     25#ifndef RenderListMarker_h
     26#define RenderListMarker_h
    2727
    2828#include "DeprecatedString.h"
     
    3636     This class always has to be a direct child of a RenderListItem!
    3737*/
    38 class RenderListMarker : public RenderBox
    39 {
     38class RenderListMarker : public RenderBox {
    4039public:
    4140    RenderListMarker(Document*);
    4241    ~RenderListMarker();
    4342
     43    virtual const char* renderName() const { return "RenderListMarker"; }
     44
     45    virtual bool isListMarker() const { return true; }
     46
    4447    virtual void setStyle(RenderStyle*);
    4548
    46     virtual const char* renderName() const { return "RenderListMarker"; }
     49    virtual void paint(PaintInfo&, int xoff, int yoff);
     50
    4751    // so the marker gets to layout itself. Only needed for
    4852    // list-style-position: inside
    49 
    50     virtual void paint(PaintInfo&, int xoff, int yoff);
    5153    virtual void layout();
    5254    virtual void calcMinMaxWidth();
     
    5860    virtual InlineBox* createInlineBox(bool, bool, bool);
    5961
    60     virtual short lineHeight(bool b, bool isRootLineBox=false) const;
    61     virtual short baselinePosition(bool b, bool isRootLineBox=false) const;
     62    virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
     63    virtual short baselinePosition(bool firstLine, bool isRootLineBox = false) const;
    6264
    63     virtual bool isListMarker() const { return true; }
    64    
    6565    CachedImage* listImage() const { return m_listImage; }
    66    
     66
    6767    RenderListItem* listItem() { return m_listItem; }
    6868    void setListItem(RenderListItem* listItem) { m_listItem = listItem; }
    69    
     69
    7070    const DeprecatedString& text() const { return m_item; }
    7171
    7272    bool isInside() const;
    73    
     73
    7474    IntRect getRelativeMarkerRect();
    75    
     75
    7676    virtual SelectionState selectionState() const { return m_selectionState; }
    7777    virtual void setSelectionState(SelectionState);
     
    8686};
    8787
    88 } //namespace
     88} // namespace WebCore
    8989
    90 #endif
     90#endif // RenderListMarker_h
Note: See TracChangeset for help on using the changeset viewer.