Reviewed by Mitz.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Oct 2006 22:41:29 +0000 (22:41 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Oct 2006 22:41:29 +0000 (22:41 +0000)
        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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17448 268f45cc-cd09-0410-ab3c-d52691b4dbfc

46 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/rendering/RenderApplet.cpp
WebCore/rendering/RenderApplet.h
WebCore/rendering/RenderArena.cpp
WebCore/rendering/RenderArena.h
WebCore/rendering/RenderBR.cpp
WebCore/rendering/RenderBR.h
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBlock.h
WebCore/rendering/RenderButton.cpp
WebCore/rendering/RenderButton.h
WebCore/rendering/RenderContainer.cpp
WebCore/rendering/RenderContainer.h
WebCore/rendering/RenderCounter.cpp
WebCore/rendering/RenderCounter.h
WebCore/rendering/RenderFieldset.cpp
WebCore/rendering/RenderFileUploadControl.cpp
WebCore/rendering/RenderFileUploadControl.h
WebCore/rendering/RenderFlexibleBox.h
WebCore/rendering/RenderFlow.cpp
WebCore/rendering/RenderFlow.h
WebCore/rendering/RenderForeignObject.cpp
WebCore/rendering/RenderForeignObject.h
WebCore/rendering/RenderFormElement.cpp
WebCore/rendering/RenderFormElement.h
WebCore/rendering/RenderFrame.cpp
WebCore/rendering/RenderFrame.h
WebCore/rendering/RenderFrameSet.cpp
WebCore/rendering/RenderFrameSet.h
WebCore/rendering/RenderHTMLCanvas.cpp
WebCore/rendering/RenderHTMLCanvas.h
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderImage.h
WebCore/rendering/RenderInline.cpp
WebCore/rendering/RenderInline.h
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderLayer.h
WebCore/rendering/RenderLineEdit.cpp
WebCore/rendering/RenderLineEdit.h
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderListBox.h
WebCore/rendering/RenderListItem.cpp
WebCore/rendering/RenderListItem.h
WebCore/rendering/RenderListMarker.cpp
WebCore/rendering/RenderListMarker.h

index 37f7fbd312acb43c9abb890419a395a30a50faaa..f726e697bf426dc3fb99649bba6278669eaee1e0 100644 (file)
@@ -1,3 +1,160 @@
+2006-10-30  Sam Weinig  <sam.weinig@gmail.com>
+
+        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):
+
 2006-10-30  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Hyatt.
index d0630e8da675c5b84e35c8ea26596486b46c3b53..53356ea2bda0702e752f46c25e8c585e2c5e85bb 100644 (file)
                F523D2F302DE443B018635CA /* rendering */ = {
                        isa = PBXGroup;
                        children = (
-                               ABB5419C0ACDDFE4002820EB /* RenderListBox.cpp */,
-                               ABB5419D0ACDDFE4002820EB /* RenderListBox.h */,
                                A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */,
                                A8CFF0490A154F09000A4234 /* AutoTableLayout.h */,
                                BCEA4813097D93020094C9E4 /* bidi.cpp */,
                                A8EA73BD0A1900E300A8EF5F /* RenderLegend.h */,
                                A8EA73BE0A1900E300A8EF5F /* RenderLineEdit.cpp */,
                                A8EA73B10A1900E300A8EF5F /* RenderLineEdit.h */,
+                               ABB5419C0ACDDFE4002820EB /* RenderListBox.cpp */,
+                               ABB5419D0ACDDFE4002820EB /* RenderListBox.h */,
                                A8EA7A480A191A5200A8EF5F /* RenderListItem.cpp */,
                                A8EA7A4C0A191A5200A8EF5F /* RenderListItem.h */,
                                A8EA7A4B0A191A5200A8EF5F /* RenderListMarker.cpp */,
index a35422f0b86b53b30e968f05a7c6c35a5e2a98c8..57e20d3f6efbc47015aba6eaa6c14f77cffb1eab 100644 (file)
@@ -35,7 +35,8 @@ namespace WebCore {
 using namespace HTMLNames;
 
 RenderApplet::RenderApplet(HTMLAppletElement* applet, const HashMap<String, String>& args)
-    : RenderWidget(applet), m_args(args)
+    : RenderWidget(applet)
+    , m_args(args)
 {
     setInline(true);
 }
@@ -74,13 +75,14 @@ void RenderApplet::createWidgetIfNecessary()
         m_width - borderLeft() - borderRight() - paddingLeft() - paddingRight();
     int height = style()->height().isFixed() ? style()->height().value() :
         m_height - borderTop() - borderBottom() - paddingTop() - paddingBottom();
-    for (Node* child = node()->firstChild(); child; child = child->nextSibling())
+    for (Node* child = node()->firstChild(); child; child = child->nextSibling()) {
         if (child->hasTagName(paramTag)) {
             HTMLParamElement* p = static_cast<HTMLParamElement*>(child);
             if (!p->name().isEmpty())
                 m_args.set(p->name(), p->value());
         }
-    
+    }
+
     Frame* frame = document()->frame();
     ASSERT(frame);
     setWidget(frame->createJavaAppletWidget(IntSize(width, height), static_cast<Element*>(node()), m_args));
@@ -99,4 +101,4 @@ void RenderApplet::layout()
     setNeedsLayout(false);
 }
 
-}
+} // namespace WebCore
index cd4d2c2b1c3bce3a6c12cb3fb74e1ae6dc19752f..c10bc73658cc1425bb9a4bc102c0e968292ed296 100644 (file)
@@ -35,8 +35,11 @@ namespace WebCore {
     public:
         RenderApplet(HTMLAppletElement*, const HashMap<String, String>& args);
         virtual ~RenderApplet();
+
         virtual const char* renderName() const { return "RenderApplet"; }
+
         virtual bool isApplet() const { return true; }
+
         virtual void layout();
         virtual int intrinsicWidth() const;
         virtual int intrinsicHeight() const;
@@ -47,6 +50,6 @@ namespace WebCore {
         HashMap<String, String> m_args;
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // RenderApplet_h
index e6cb9921ab319b53588dc2d666e9795c3fc33644..083fa8adb13eb2fe1ee17d02a29b9d308bbad6f4 100644 (file)
@@ -36,8 +36,8 @@
 #include "RenderArena.h"
 
 #include <assert.h>
-#include <string.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
 
@@ -49,14 +49,14 @@ const int signature = 0xDBA00AEA;
 const int signatureDead = 0xDBA00AED;
 
 typedef struct {
-    RenderArena *arena;
+    RenderArenaarena;
     size_t size;
     int signature;
 } RenderArenaDebugHeader;
 
 #endif
 
-RenderArena::RenderArena(unsigned int arenaSize)
+RenderArena::RenderArena(unsigned arenaSize)
 {
     // Initialize the arena pool
     INIT_ARENA_POOL(&m_pool, "RenderArena", arenaSize);
@@ -76,8 +76,8 @@ void* RenderArena::allocate(size_t size)
 #ifndef NDEBUG
     // Use standard malloc so that memory debugging tools work.
     assert(this);
-    void *block = ::malloc(sizeof(RenderArenaDebugHeader) + size);
-    RenderArenaDebugHeader *header = (RenderArenaDebugHeader *)block;
+    voidblock = ::malloc(sizeof(RenderArenaDebugHeader) + size);
+    RenderArenaDebugHeader* header = (RenderArenaDebugHeader*)block;
     header->arena = this;
     header->size = size;
     header->signature = signature;
@@ -90,8 +90,8 @@ void* RenderArena::allocate(size_t size)
 
     // Check recyclers first
     if (size < gMaxRecycledSize) {
-        const int   index = size >> 2;
-    
+        const int index = size >> 2;
+
         result = m_recyclers[index];
         if (result) {
             // Need to move to the next object
@@ -99,7 +99,7 @@ void* RenderArena::allocate(size_t size)
             m_recyclers[index] = next;
         }
     }
-    
+
     if (!result) {
         // Allocate a new chunk from the arena
         ARENA_ALLOCATE(result, &m_pool, size);
@@ -113,7 +113,7 @@ void RenderArena::free(size_t size, void* ptr)
 {
 #ifndef NDEBUG
     // Use standard free so that memory debugging tools work.
-    RenderArenaDebugHeader *header = (RenderArenaDebugHeader *)ptr - 1;
+    RenderArenaDebugHeader* header = (RenderArenaDebugHeader*)ptr - 1;
     assert(header->signature == signature);
     assert(header->size == size);
     assert(header->arena == this);
@@ -125,12 +125,12 @@ void RenderArena::free(size_t size, void* ptr)
 
     // See if it's a size that we recycle
     if (size < gMaxRecycledSize) {
-        const int   index = size >> 2;
-        void*       currentTop = m_recyclers[index];
+        const int index = size >> 2;
+        void* currentTop = m_recyclers[index];
         m_recyclers[index] = ptr;
         *((void**)ptr) = currentTop;
     }
 #endif
 }
 
-}
+} // namespace WebCore
index 7afaa95ed1a71a70cd3c89dbd648d769737d818f..974d38f114cbc73e24e3a03e134721017a77eb61 100644 (file)
@@ -32,8 +32,8 @@
  * version of this file under any of the LGPL, the MPL or the GPL.
  */
 
-#ifndef RENDERARENA_H
-#define RENDERARENA_H
+#ifndef RenderArena_h
+#define RenderArena_h
 
 #include "Arena.h"
 
@@ -43,22 +43,22 @@ static const size_t gMaxRecycledSize = 400;
 
 class RenderArena {
 public:
-   RenderArena(unsigned int arenaSize = 4096);
+    RenderArena(unsigned arenaSize = 4096);
     ~RenderArena();
 
-  // Memory management functions
-  void* allocate(size_t size);
-  void  free(size_t size, void* ptr);
+    // Memory management functions
+    void* allocate(size_t);
+    void free(size_t, void*);
 
 private:
-  // Underlying arena pool
-  ArenaPool m_pool;
+    // Underlying arena pool
+    ArenaPool m_pool;
 
-  // The recycler array is sparse with the indices being multiples of 4,
-  // i.e., 0, 4, 8, 12, 16, 20, ...
-  void*       m_recyclers[gMaxRecycledSize >> 2];
+    // The recycler array is sparse with the indices being multiples of 4,
+    // i.e., 0, 4, 8, 12, 16, 20, ...
+    void* m_recyclers[gMaxRecycledSize >> 2];
 };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // RenderArena_h
index 165479be0162b5a12457b17db230996a7d7a4fbb..b7648e7b92c6302ea3f492e5e4b87b29c5ed326c 100644 (file)
@@ -31,7 +31,8 @@
 namespace WebCore {
 
 RenderBR::RenderBR(Node* node)
-    : RenderText(node, new StringImpl("\n")), m_lineHeight(-1)
+    : RenderText(node, new StringImpl("\n"))
+    , m_lineHeight(-1)
 {
 }
 
@@ -48,7 +49,7 @@ InlineBox* RenderBR::createInlineBox(bool makePlaceholder, bool isRootLineBox, b
     return box;
 }
 
-short RenderBR::baselinePosition( bool firstLine, bool isRootLineBox) const
+short RenderBR::baselinePosition(bool firstLine, bool isRootLineBox) const
 {
     if (firstTextBox() && !firstTextBox()->isText())
         return 0;
@@ -75,21 +76,21 @@ short RenderBR::lineHeight(bool firstLine, bool isRootLineBox) const
             return lh.calcMinValue(s->fontSize());
         return lh.value();
     }
-    
+
     if (m_lineHeight == -1)
         m_lineHeight = RenderObject::lineHeight(false);
     return m_lineHeight;
 }
 
-void RenderBR::setStyle(RenderStyle* _style)
+void RenderBR::setStyle(RenderStyle* newStyle)
 {
-    RenderText::setStyle(_style);
+    RenderText::setStyle(newStyle);
     m_lineHeight = -1;
 }
 
 int RenderBR::caretMinOffset() const 
 { 
-    return 0; 
+    return 0;
 }
 
 int RenderBR::caretMaxOffset() const 
@@ -102,14 +103,14 @@ unsigned RenderBR::caretMaxRenderedOffset() const
     return 1;
 }
 
-VisiblePosition RenderBR::positionForCoordinates(int _x, int _y)
+VisiblePosition RenderBR::positionForCoordinates(int /*x*/, int /*y*/)
 {
     return VisiblePosition(element(), 0, DOWNSTREAM);
 }
 
-InlineBox *RenderBR::inlineBox(int offset, EAffinity affinity)
+InlineBox* RenderBR::inlineBox(int /*offset*/, EAffinity /*affinity*/)
 {
     return firstTextBox();
 }
 
-}
+} // namespace WebCore
index f3873cfdd0c97720b49a901c2031639955a0fbb5..a667f99a44225b08f3a56e769358e0bbd66f7c4c 100644 (file)
@@ -19,8 +19,9 @@
  * Boston, MA 02111-1307, USA.
  *
  */
-#ifndef RENDER_BR_H
-#define RENDER_BR_H
+
+#ifndef RenderBR_h
+#define RenderBR_h
 
 #include "RenderText.h"
 
@@ -56,16 +57,15 @@ public:
     virtual int caretMinOffset() const;
     virtual int caretMaxOffset() const;
     virtual unsigned caretMaxRenderedOffset() const;
-    
+
     virtual VisiblePosition positionForCoordinates(int x, int y);
 
-    virtual InlineBox* inlineBox(int offset, EAffinity affinity = UPSTREAM);
-    
+    virtual InlineBox* inlineBox(int offset, EAffinity = UPSTREAM);
+
 private:
     mutable short m_lineHeight;
-
 };
 
 } // namespace WebCore
 
-#endif // RENDER_BR_H
+#endif // RenderBR_h
index 5b9d347a628d2cbc5b415813bfa83970a83f67af..65ef840ebd900bd1ab9ddc542f6101123fea4933 100644 (file)
 #include "Element.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
-#include "InlineTextBox.h"
+#include "HTMLNames.h"
 #include "HitTestResult.h"
+#include "InlineTextBox.h"
 #include "RenderTableCell.h"
 #include "RenderTextFragment.h"
-#include "SelectionController.h"
-#include "HTMLNames.h"
-#include "RenderView.h"
 #include "RenderTheme.h"
+#include "RenderView.h"
+#include "SelectionController.h"
 #include "TextStream.h"
 
 using namespace std;
@@ -3680,4 +3680,3 @@ void RenderBlock::dump(TextStream *stream, DeprecatedString ind) const
 #endif
 
 } // namespace WebCore
-
index 214797aa32ac9dd9a5b535e4db0b2b3e6fc13ac6..18ae57a780418fb724a3f53888bdcb8c443ce3b2 100644 (file)
@@ -21,8 +21,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef RenderBlock_H
-#define RenderBlock_H
+#ifndef RenderBlock_h
+#define RenderBlock_h
 
 #include "GapRects.h"
 #include "RenderFlow.h"
@@ -46,14 +46,14 @@ public:
     virtual const char* renderName() const;
 
     // These two functions are overridden for inline-block.
-    virtual short lineHeight(bool b, bool isRootLineBox=false) const;
-    virtual short baselinePosition(bool b, bool isRootLineBox=false) const;
-    
+    virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
+    virtual short baselinePosition(bool firstLine, bool isRootLineBox = false) const;
+
     virtual bool isRenderBlock() const { return true; }
     virtual bool isBlockFlow() const { return (!isInline() || isReplaced()) && !isTable(); }
     virtual bool isInlineFlow() const { return isInline() && !isReplaced(); }
     virtual bool isInlineBlockOrInlineTable() const { return isInline() && isReplaced(); }
-    
+
     virtual bool childrenInline() const { return m_childrenInline; }
     virtual void setChildrenInline(bool b) { m_childrenInline = b; }
     void makeChildrenNonInline(RenderObject* insertionPoint = 0);
@@ -61,32 +61,23 @@ public:
     // The height (and width) of a block when you include overflow spillage out of the bottom
     // of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside
     // it would have an overflow height of borderTop() + paddingTop() + 100px.
-    virtual int overflowHeight(bool includeInterior=true) const;
-    virtual int overflowWidth(bool includeInterior=true) const;
-    virtual int overflowLeft(bool includeInterior=true) const;
-    virtual int overflowTop(bool includeInterior=true) const;
-    virtual IntRect overflowRect(bool includeInterior=true) const;
+    virtual int overflowHeight(bool includeInterior = true) const;
+    virtual int overflowWidth(bool includeInterior = true) const;
+    virtual int overflowLeft(bool includeInterior = true) const;
+    virtual int overflowTop(bool includeInterior = true) const;
+    virtual IntRect overflowRect(bool includeInterior = true) const;
     virtual void setOverflowHeight(int h) { m_overflowHeight = h; }
     virtual void setOverflowWidth(int w) { m_overflowWidth = w; }
-    
+
     virtual bool isSelfCollapsingBlock() const;
     virtual bool isTopMarginQuirk() const { return m_topMarginQuirk; }
     virtual bool isBottomMarginQuirk() const { return m_bottomMarginQuirk; }
 
-    virtual int maxTopMargin(bool positive) const {
-        if (positive)
-            return m_maxTopPosMargin;
-        else
-            return m_maxTopNegMargin;
-    }
-    virtual int maxBottomMargin(bool positive) const {
-        if (positive)
-            return m_maxBottomPosMargin;
-        else
-            return m_maxBottomNegMargin;
-    }
+    virtual int maxTopMargin(bool positive) const { return positive ? m_maxTopPosMargin : m_maxTopNegMargin; }
+    virtual int maxBottomMargin(bool positive) const { return positive ? m_maxBottomPosMargin : m_maxBottomNegMargin; }
 
-    void initMaxMarginValues() {
+    void initMaxMarginValues()
+    {
         if (m_marginTop >= 0) {
             m_maxTopPosMargin = m_marginTop;
             m_maxTopNegMargin = 0;
@@ -126,7 +117,7 @@ public:
 
     // Called to lay out the legend for a fieldset.
     virtual RenderObject* layoutLegend(bool relayoutChildren) { return 0; };
-    
+
     // the implementation of the following functions is in bidi.cpp
     void bidiReorderLine(const BidiIterator& start, const BidiIterator& end, BidiState& bidi);
     RootInlineBox* determineStartPosition(bool fullLayout, BidiIterator& start, BidiState& bidi);
@@ -136,8 +127,8 @@ public:
     bool matchedEndLine(const BidiIterator& start, const BidiStatus& status, BidiContext* context,
                         const BidiIterator& endLineStart, const BidiStatus& endLineStatus, BidiContext* endLineContext,
                         RootInlineBox*& endLine, int& endYPos, int& repaintBottom, int& repaintTop);
-    int skipWhitespace(BidiIterator& , BidiState &);
-    BidiIterator findNextLineBreak(BidiIterator& start, BidiState &info );
+    int skipWhitespace(BidiIterator&, BidiState&);
+    BidiIterator findNextLineBreak(BidiIterator& start, BidiState& info);
     RootInlineBox* constructLine(const BidiIterator& start, const BidiIterator& end);
     InlineFlowBox* createLineBoxes(RenderObject*);
     int tabWidth(bool isWhitespacePre);
@@ -147,31 +138,31 @@ public:
     void deleteEllipsisLineBoxes();
     void checkLinesForTextOverflow();
     // end bidi.cpp functions
+
+    virtual void paint(PaintInfo&, int tx, int ty);
+    virtual void paintObject(PaintInfo&, int tx, int ty);
+    void paintFloats(PaintInfo&, int tx, int ty, bool paintSelection = false);
+    void paintChildren(PaintInfo&, int tx, int ty);
+    void paintEllipsisBoxes(PaintInfo&, int tx, int ty);
+    void paintSelection(PaintInfo&, int tx, int ty);
+    void paintCaret(PaintInfo&, CaretType);
     
-    virtual void paint(PaintInfo& i, int tx, int ty);
-    virtual void paintObject(PaintInfo& i, int tx, int ty);
-    void paintFloats(PaintInfo& i, int _tx, int _ty, bool paintSelection = false);
-    void paintChildren(PaintInfo& i, int _tx, int _ty);
-    void paintEllipsisBoxes(PaintInfo& i, int _tx, int _ty);
-    void paintSelection(PaintInfo& i, int _tx, int _ty);
-    void paintCaret(PaintInfo& i, CaretType);
-    
-    void insertFloatingObject(RenderObject *o);
-    void removeFloatingObject(RenderObject *o);
+    void insertFloatingObject(RenderObject*);
+    void removeFloatingObject(RenderObject*);
     void setPaintsFloatingObject(RenderObject*, bool);
 
     // called from lineWidth, to position the floats added in the last line.
     void positionNewFloats();
     void clearFloats();
-    int getClearDelta(RenderObject *child);
+    int getClearDelta(RenderObjectchild);
     virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
     void markPositionedObjectsForLayout();
 
     // FIXME: containsFloats() should not return true if the floating objects list
     // is empty. However, layoutInlineChildren() relies on the current behavior.
     // http://bugzilla.opendarwin.org/show_bug.cgi?id=7395#c3
-    virtual bool containsFloats() { return m_floatingObjects!=0; }
-    virtual bool containsFloat(RenderObject* o);
+    virtual bool containsFloats() { return m_floatingObjects; }
+    virtual bool containsFloat(RenderObject*);
 
     virtual bool hasOverhangingFloats() { return floatBottom() > m_height; }
     void addIntrudingFloats(RenderBlock* prev, int xoffset, int yoffset);
@@ -184,21 +175,19 @@ public:
     virtual IntRect floatRect() const;
 
     virtual int lineWidth(int y) const;
-    virtual int lowestPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
-    virtual int rightmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
-    virtual int leftmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
+    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
 
     int rightOffset() const;
-    int rightRelOffset(int y, int fixedOffset, bool applyTextIndent = true,
-                       int *heightRemaining = 0) const;
+    int rightRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
     int rightOffset(int y) const { return rightRelOffset(y, rightOffset(), true); }
 
     int leftOffset() const;
-    int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true,
-                      int *heightRemaining = 0) const;
+    int leftRelOffset(int y, int fixedOffset, bool applyTextIndent = true, int* heightRemaining = 0) const;
     int leftOffset(int y) const { return leftRelOffset(y, leftOffset(), true); }
 
-    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction hitTestAction);
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
     virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
 
@@ -218,10 +207,10 @@ public:
     // children.
     virtual RenderBlock* firstLineBlock() const;
     virtual void updateFirstLetter();
-    
+
     bool inRootBlockContext() const;
 
-    void setHasMarkupTruncation(bool b=true) { m_hasMarkupTruncation = b; }
+    void setHasMarkupTruncation(bool b = true) { m_hasMarkupTruncation = b; }
     bool hasMarkupTruncation() const { return m_hasMarkupTruncation; }
 
     virtual bool hasSelectedChildren() const { return m_selectionState != SelectionNone; }
@@ -233,46 +222,54 @@ public:
         GapRects m_rects;
         SelectionState m_state;
 
-        BlockSelectionInfo() { m_block = 0; m_state = SelectionNone; }
-        BlockSelectionInfo(RenderBlock* b) { 
-            m_block = b;
-            m_state = m_block->selectionState();
-            m_rects = m_block->selectionGapRects();
+        BlockSelectionInfo()
+            : m_block(0)
+            , m_state(SelectionNone)
+        {
         }
-        
+
+        BlockSelectionInfo(RenderBlock* b)
+            : m_block(b)
+            , m_rects(b->selectionGapRects())
+            , m_state(b->selectionState())
+        { 
+        }
+
+        RenderBlock* block() const { return m_block; }
         GapRects rects() const { return m_rects; }
         SelectionState state() const { return m_state; }
-        RenderBlock* block() const { return m_block; }
     };
-    
+
     virtual IntRect selectionRect() { return selectionGapRects(); }
     GapRects selectionGapRects();
     virtual bool shouldPaintSelectionGaps() const;
     bool isSelectionRoot() const;
-    GapRects fillSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, 
-                               int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* = 0);
+    GapRects fillSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,
+                               int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* = 0);
     GapRects fillInlineSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,
-                                     int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* i);
+                                     int& lastTop, int& lastLeft, int& lastRight, const PaintInfo*);
     GapRects fillBlockSelectionGaps(RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty,
-                                    int& lastTop, int& lastLeft, int& lastRight, const PaintInfo* i);
-    IntRect fillVerticalSelectionGap(int lastTop, int lastLeft, int lastRight,
-                                   int bottomY, RenderBlock* rootBlock, int blockX, int blockY, const PaintInfo* i);
-    IntRect fillLeftSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, const PaintInfo* i);
-    IntRect fillRightSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, const PaintInfo* i);
-    IntRect fillHorizontalSelectionGap(RenderObject* selObj, int xPos, int yPos, int width, int height, const PaintInfo* i);
-
-    void getHorizontalSelectionGapInfo(SelectionState state, bool& leftGap, bool& rightGap);
+                                    int& lastTop, int& lastLeft, int& lastRight, const PaintInfo*);
+    IntRect fillVerticalSelectionGap(int lastTop, int lastLeft, int lastRight, int bottomY, RenderBlock* rootBlock,
+                                     int blockX, int blockY, const PaintInfo*);
+    IntRect fillLeftSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock, 
+                                 int blockX, int blockY, int tx, int ty, const PaintInfo*);
+    IntRect fillRightSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock,
+                                  int blockX, int blockY, int tx, int ty, const PaintInfo*);
+    IntRect fillHorizontalSelectionGap(RenderObject* selObj, int xPos, int yPos, int width, int height, const PaintInfo*);
+
+    void getHorizontalSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap);
     int leftSelectionOffset(RenderBlock* rootBlock, int y);
     int rightSelectionOffset(RenderBlock* rootBlock, int y);
 
 #ifndef NDEBUG
-    virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
+    virtual void dump(TextStream*, DeprecatedString ind = "") const;
 #endif
 
     // Helper methods for computing line counts and heights for line counts.
-    RootInlineBox* lineAtIndex(int i);
+    RootInlineBox* lineAtIndex(int);
     int lineCount();
-    int heightForLineCount(int l);
+    int heightForLineCount(int);
     void clearTruncation();
 
 protected:
@@ -280,8 +277,8 @@ protected:
     virtual bool hasLineIfEmpty() const;
 
 private:
-    Position positionForBox(InlineBox *box, bool start=true) const;
-    Position positionForRenderer(RenderObject *renderer, bool start=true) const;
+    Position positionForBox(InlineBox*, bool start = true) const;
+    Position positionForRenderer(RenderObject*, bool start = true) const;
         
 protected:
     struct FloatingObject {
@@ -290,16 +287,17 @@ protected:
             FloatRight
         };
 
-        FloatingObject(Type type) {
-            node = 0;
-            startY = 0;
-            endY = 0;
-            m_type = type;
-            left = 0;
-            width = 0;
-            noPaint = false;
+        FloatingObject(Type type)
+            : node(0)
+            , startY(0)
+            , endY(0)
+            , left(0)
+            , width(0)
+            , m_type(type)
+            , noPaint(false)
+        {
         }
-        
+
         Type type() { return static_cast<Type>(m_type); }
 
         RenderObject* node;
@@ -310,12 +308,12 @@ protected:
         unsigned m_type : 1; // Type (left or right aligned)
         bool noPaint : 1;
     };
-    
+
     // The following helper functions and structs are used by layoutBlockChildren.
     class CompactInfo {
         // A compact child that needs to be collapsed into the margin of the following block.
         RenderObject* m_compact;
-        
+
         // The block with the open margin that the compact child is going to place itself within.
         RenderObject* m_block;
 
@@ -323,10 +321,10 @@ protected:
         RenderObject* compact() const { return m_compact; }
         RenderObject* block() const { return m_block; }
         bool matches(RenderObject* child) const { return m_compact && m_block == child; }
-        
-        void clear() { set(0, 0);  }
+
+        void clear() { set(0, 0); }
         void set(RenderObject* c, RenderObject* b) { m_compact = c; m_block = b; }
-        
+
         CompactInfo() { clear(); }
     };
 
@@ -335,7 +333,7 @@ protected:
         bool m_canCollapseWithChildren : 1;
         bool m_canCollapseTopWithChildren : 1;
         bool m_canCollapseBottomWithChildren : 1;
-        
+
         // Whether or not we are a quirky container, i.e., do we collapse away top and bottom
         // margins in our container.  Table cells and the body are the common examples. We
         // also have a custom style property for Safari RSS to deal with TypePad blog articles.
@@ -353,7 +351,7 @@ protected:
         // If our last normal flow child was a self-collapsing block that cleared a float,
         // we track it in this variable.
         bool m_selfCollapsingBlockClearedFloat : 1;
-    
+
         // These variables are used to detect quirky margins that we need to collapse away (in table cells
         // and in the body element).
         bool m_topQuirk : 1;
@@ -366,7 +364,7 @@ protected:
 
     public:
         MarginInfo(RenderBlock* b, int top, int bottom);
-        
+
         void setAtTopOfBlock(bool b) { m_atTopOfBlock = b; }
         void setAtBottomOfBlock(bool b) { m_atBottomOfBlock = b; }
         void clearMargin() { m_posMargin = m_negMargin = 0; }
@@ -395,27 +393,27 @@ protected:
         int negMargin() const { return m_negMargin; }
         int margin() const { return m_posMargin - m_negMargin; }
     };
-    
-    void adjustPositionedBlock(RenderObject* child, const MarginInfo& marginInfo);
-    void adjustFloatingBlock(const MarginInfo& marginInfo);
-    RenderObject* handleSpecialChild(RenderObject* child, const MarginInfo& marginInfo, CompactInfo& compactInfo, bool& handled);
-    RenderObject* handleFloatingChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled);
-    RenderObject* handlePositionedChild(RenderObject* child, const MarginInfo& marginInfo, bool& handled);
-    RenderObject* handleCompactChild(RenderObject* child, CompactInfo& compactInfo, bool& handled);
+
+    void adjustPositionedBlock(RenderObject* child, const MarginInfo&);
+    void adjustFloatingBlock(const MarginInfo&);
+    RenderObject* handleSpecialChild(RenderObject* child, const MarginInfo&, CompactInfo&, bool& handled);
+    RenderObject* handleFloatingChild(RenderObject* child, const MarginInfo&, bool& handled);
+    RenderObject* handlePositionedChild(RenderObject* child, const MarginInfo&, bool& handled);
+    RenderObject* handleCompactChild(RenderObject* child, CompactInfo&, bool& handled);
     RenderObject* handleRunInChild(RenderObject* child, bool& handled);
-    void collapseMargins(RenderObject* child, MarginInfo& marginInfo, int yPosEstimate);
-    void clearFloatsIfNeeded(RenderObject* child, MarginInfo& marginInfo, int oldTopPosMargin, int oldTopNegMargin);
-    void insertCompactIfNeeded(RenderObject* child, CompactInfo& compactInfo);
-    int estimateVerticalPosition(RenderObject* child, const MarginInfo& info);
+    void collapseMargins(RenderObject* child, MarginInfo&, int yPosEstimate);
+    void clearFloatsIfNeeded(RenderObject* child, MarginInfo&, int oldTopPosMargin, int oldTopNegMargin);
+    void insertCompactIfNeeded(RenderObject* child, CompactInfo&);
+    int estimateVerticalPosition(RenderObject* child, const MarginInfo&);
     void determineHorizontalPosition(RenderObject* child);
-    void handleBottomOfBlock(int top, int bottom, MarginInfo& marginInfo);
-    void setCollapsedBottomMargin(const MarginInfo& marginInfo);
+    void handleBottomOfBlock(int top, int bottom, MarginInfo&);
+    void setCollapsedBottomMargin(const MarginInfo&);
     // End helper functions and structs used by layoutBlockChildren.
 
 protected:
     DeprecatedPtrList<FloatingObject>* m_floatingObjects;
     DeprecatedPtrList<RenderObject>* m_positionedObjects;
-    
+
     bool m_childrenInline : 1;
     bool m_firstLine : 1;
     unsigned m_clearStatus  : 2; // EClear
@@ -431,19 +429,19 @@ protected:
 
     // How much content overflows out of our block vertically or horizontally (all we support
     // for now is spillage out of the bottom and the right, which are the common cases).
-    // XXX Generalize to work with top and left as well.
+    // FIXME: Generalize to work with top and left as well.
     int m_overflowHeight;
     int m_overflowWidth;
-    
+
     // Left and top overflow.  Does not affect scrolling dimensions, but we do at least use it
     // when dirty rect checking and hit testing.
     int m_overflowLeft;
     int m_overflowTop;
-    
+
     // full width of a tab character
     int m_tabWidth;
 };
 
 } // namespace WebCore
 
-#endif // RenderBlock_H
+#endif // RenderBlock_h
index 80da83ee89d031c0a86c18467e9a77bfc4dfab3f..1728783795c69b02e6e0af777d2317b7c04fc1c5 100644 (file)
@@ -26,8 +26,8 @@
 #include "Document.h"
 #include "GraphicsContext.h"
 #include "HTMLInputElement.h"
-#include "RenderText.h"
 #include "HTMLNames.h"
+#include "RenderText.h"
 
 namespace WebCore {
 
@@ -58,8 +58,7 @@ void RenderButton::removeChild(RenderObject* oldChild)
     if (oldChild == m_inner || !m_inner) {
         RenderFlexibleBox::removeChild(oldChild);
         m_inner = 0;
-    }
-    else
+    } else
         m_inner->removeChild(oldChild);
 }
 
@@ -109,24 +108,24 @@ void RenderButton::updatePseudoChild(RenderStyle::PseudoId type)
         updatePseudoChildForObject(type, this);
 }
 
-void RenderButton::paintObject(PaintInfo& i, int _tx, int _ty)
+void RenderButton::paintObject(PaintInfo& paintInfo, int tx, int ty)
 {
     // Push a clip.
-    if (m_inner && i.phase == PaintPhaseForeground) {
-        IntRect clipRect(_tx + borderLeft(), _ty + borderTop(),
+    if (m_inner && paintInfo.phase == PaintPhaseForeground) {
+        IntRect clipRect(tx + borderLeft(), ty + borderTop(),
             width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
         if (clipRect.width() == 0 || clipRect.height() == 0)
             return;
-        i.p->save();
-        i.p->clip(clipRect);
+        paintInfo.p->save();
+        paintInfo.p->clip(clipRect);
     }
-    
+
     // Paint the children.
-    RenderBlock::paintObject(i, _tx, _ty);
-    
+    RenderBlock::paintObject(paintInfo, tx, ty);
+
     // Pop the clip.
-    if (m_inner && i.phase == PaintPhaseForeground)
-        i.p->restore();
+    if (m_inner && paintInfo.phase == PaintPhaseForeground)
+        paintInfo.p->restore();
 }
 
-}
+} // namespace WebCore
index ab56c9d88cc1253cb2414381cb5023eca30a0f5f..c215d9a7e4fd42adb16c3bd62326e36f2737215f 100644 (file)
@@ -20,8 +20,8 @@
  *
  */
 
-#ifndef RenderButton_H
-#define RenderButton_H
+#ifndef RenderButton_h
+#define RenderButton_h
 
 #include "RenderFlexibleBox.h"
 
@@ -30,14 +30,15 @@ namespace WebCore {
 // RenderButtons are just like normal flexboxes except that they will generate an anonymous block child.
 // For inputs, they will also generate an anonymous RenderText and keep its style and content up
 // to date as the button changes.
-class RenderButton : public RenderFlexibleBox
-{
+class RenderButton : public RenderFlexibleBox {
 public:
     RenderButton(Node*);
 
+    virtual const char* renderName() const { return "RenderButton"; }
+
     virtual void addChild(RenderObject* newChild, RenderObject *beforeChild = 0);
-    virtual void removeChild(RenderObject* oldChild);
-    virtual void removeLeftoverAnonymousBoxes() {}
+    virtual void removeChild(RenderObject*);
+    virtual void removeLeftoverAnonymousBoxes() { }
     virtual bool createsAnonymousWrapper() const { return true; }
 
     virtual void setStyle(RenderStyle*);
@@ -49,8 +50,6 @@ public:
 
     void setText(const String&);
 
-    virtual const char* renderName() const { return "RenderButton"; }
-
 protected:
     virtual bool hasLineIfEmpty() const { return true; }
 
@@ -58,6 +57,6 @@ protected:
     RenderBlock* m_inner;
 };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // RenderButton_h
index ad22fdc34a4fc38a4f1e28c7dcf5372a803141b3..4c5f94ec49a2ca6322f1377c84383579663479f3 100644 (file)
 #include "config.h"
 #include "RenderContainer.h"
 
-#include "htmlediting.h"
+#include "AXObjectCache.h"
+#include "Document.h"
 #include "RenderCounter.h"
+#include "RenderImage.h"
 #include "RenderListItem.h"
 #include "RenderTable.h"
 #include "RenderTextFragment.h"
-#include "RenderImage.h"
 #include "RenderView.h"
-#include "Document.h"
-
-// For accessibility
-#include "AXObjectCache.h" 
+#include "htmlediting.h"
 
 namespace WebCore {
 
 RenderContainer::RenderContainer(Node* node)
     : RenderBox(node)
+    , m_first(0)
+    , m_last(0)
 {
-    m_first = 0;
-    m_last = 0;
 }
 
-
 RenderContainer::~RenderContainer()
 {
 }
@@ -639,4 +636,4 @@ void RenderContainer::lineBoxRects(Vector<IntRect>& rects)
 
 #undef DEBUG_LAYOUT
 
-}
+} // namespace WebCore
index c2e01cdd9ea24e2d9920f104a36104bd5bb324bd..f63bf157b46c5dc59c0be60a67c3514a47210e74 100644 (file)
@@ -20,8 +20,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifndef RenderContainer_H
-#define RenderContainer_H
+#ifndef RenderContainer_h
+#define RenderContainer_h
 
 #include "RenderBox.h"
 
@@ -32,28 +32,27 @@ class Position;
 /**
  * Base class for rendering objects that can have children
  */
-class RenderContainer : public RenderBox
-{
+class RenderContainer : public RenderBox {
 public:
     RenderContainer(Node*);
     virtual ~RenderContainer();
 
-    RenderObject *firstChild() const { return m_first; }
-    RenderObject *lastChild() const { return m_last; }
+    RenderObjectfirstChild() const { return m_first; }
+    RenderObjectlastChild() const { return m_last; }
 
     virtual bool canHaveChildren() const;
-    virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
-    virtual void removeChild(RenderObject *oldChild);
+    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
+    virtual void removeChild(RenderObject*);
 
     virtual void destroy();
     void destroyLeftoverChildren();
-    
-    virtual RenderObject* removeChildNode(RenderObject* child);
-    virtual void appendChildNode(RenderObject* child);
+
+    virtual RenderObject* removeChildNode(RenderObject*);
+    virtual void appendChildNode(RenderObject*);
     virtual void insertChildNode(RenderObject* child, RenderObject* before);
 
     virtual void layout();
-    virtual void calcMinMaxWidth() { setMinMaxKnown( true ); }
+    virtual void calcMinMaxWidth() { setMinMaxKnown(true); }
 
     virtual void removeLeftoverAnonymousBoxes();
 
@@ -62,17 +61,17 @@ public:
     void updatePseudoChildForObject(RenderStyle::PseudoId, RenderObject*);
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
-    
+
     virtual void lineBoxRects(Vector<IntRect>&);
 
 protected:
     void setFirstChild(RenderObject* first) { m_first = first; }
     void setLastChild(RenderObject* last) { m_last = last; }
 
-protected:
-    RenderObject *m_first;
-    RenderObject *m_last;
+    RenderObject* m_first;
+    RenderObject* m_last;
 };
 
-}
-#endif
+} // namespace WebCore
+
+#endif // RenderContainer_h
index 088d9edfe1f271658e6bbbefe76655de6e62c6fa..d56a05a0a4f5f23e2d1564b4df437063a54e57bf 100644 (file)
@@ -34,7 +34,9 @@ namespace WebCore {
 const int cMarkerPadding = 7;
 
 RenderCounter::RenderCounter(Node* node, CounterData* counter)
-    : RenderText(node, 0), m_counter(counter), m_counterNode(0)
+    : RenderText(node, 0)
+    , m_counter(counter)
+    , m_counterNode(0)
 {
 }
 
@@ -57,9 +59,10 @@ static String toRoman(int number, bool upper)
     int d = 0;
     do {
         int num = number % 10;
-        if (num % 5 < 4)
+        if (num % 5 < 4) {
             for (int i = num % 5; i > 0; i--)
                 roman.insert(&digits[d], 1, 0);
+        }
         if (num >= 4 && num <= 8)
             roman.insert(&digits[d + 1], 1, 0);
         if (num == 9)
@@ -94,7 +97,7 @@ static String toHebrew(int number)
 {
     if (number < 1)
         return String::number(number);
-    
+
     static const UChar tenDigit[] = {1497, 1499, 1500, 1502, 1504, 1505, 1506, 1508, 1510};
 
     String letter;
@@ -217,11 +220,11 @@ void RenderCounter::calcMinMaxWidth()
     int value = m_counterNode->count();
     if (m_counterNode->isReset())
         value = m_counterNode->value();
-    
+
     int total = value;
     if (m_counterNode->parent())
         total = m_counterNode->parent()->total();
-    
+
     m_item = convertValueToType(value, total, m_counter->listStyle());
 
     if (hasSeparator) {
@@ -230,15 +233,14 @@ void RenderCounter::calcMinMaxWidth()
         while  (counter->parent() && (first || !(counter->isReset() && counter->parent()->isRoot()))) {
             value = counter->count() ? counter->count() : 1;
             total = counter->parent()->total();
-            m_item = convertValueToType(value, total, m_counter->listStyle()) 
-                + m_counter->separator() + m_item;
+            m_item = convertValueToType(value, total, m_counter->listStyle()) + m_counter->separator() + m_item;
             counter = counter->parent();
             first = false;
         }
     }
 
     str = new StringImpl(m_item.characters(), m_item.length());
-    
+
     RenderText::calcMinMaxWidth();
 }
 
index 97ae72b82fe8ccd7d0aeedb049df6fa95efa6303..f1c73745eaa4118077401d79032c8b685c942c21 100644 (file)
  * Boston, MA 02111-1307, USA.
  *
  */
-#ifndef RENDER_COUNTER_H_
-#define RENDER_COUNTER_H_
+#ifndef RenderCounter_h
+#define RenderCounter_h
 
 #include "RenderText.h"
 
 namespace WebCore {
-    class CounterNode;
 
-// -----------------------------------------------------------------------------
+class CounterNode;
 
 class RenderCounter : public RenderText {
-
 public:
     RenderCounter(Node*, CounterData*);
-    
+
     virtual const char* renderName() const { return "RenderCounter"; }
 
     virtual bool isCounter() const { return true; }
+
     virtual void layout();
     virtual void calcMinMaxWidth();
 
@@ -49,6 +48,6 @@ private:
     CounterNode* m_counterNode;
 };
 
-} //namespace
+} // namespace WebCore
 
-#endif
+#endif // RenderCounter_h
index 0d76bdc24522f19db36a2ebabb40964e58fa6de7..dd2781c771a316aacd95740f3d660c89c06bd90e 100644 (file)
@@ -70,29 +70,29 @@ RenderObject* RenderFieldset::findLegend()
     return 0;
 }
 
-void RenderFieldset::paintBoxDecorations(PaintInfo& i, int _tx, int _ty)
+void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
 {
     int w = width();
     int h = height() + borderTopExtra() + borderBottomExtra();
     RenderObject* legend = findLegend();
     if (!legend)
-        return RenderBlock::paintBoxDecorations(i, _tx, _ty);
+        return RenderBlock::paintBoxDecorations(paintInfo, tx, ty);
 
-    int yOff = (legend->yPos() > 0) ? 0 : (legend->height()-borderTop())/2;
+    int yOff = (legend->yPos() > 0) ? 0 : (legend->height() - borderTop()) / 2;
     h -= yOff;
-    _ty += yOff - borderTopExtra();
+    ty += yOff - borderTopExtra();
 
-    int my = max(_ty, i.r.y());
-    int end = min(i.r.bottom(),  _ty + h);
+    int my = max(ty, paintInfo.r.y());
+    int end = min(paintInfo.r.bottom(), ty + h);
     int mh = end - my;
 
-    paintBackground(i.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, _tx, _ty, w, h);
+    paintBackground(paintInfo.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, tx, ty, w, h);
 
     if (style()->hasBorder())
-        paintBorderMinusLegend(i.p, _tx, _ty, w, h, style(), legend->xPos(), legend->width());
+        paintBorderMinusLegend(paintInfo.p, tx, ty, w, h, style(), legend->xPos(), legend->width());
 }
 
-void RenderFieldset::paintBorderMinusLegend(GraphicsContext* p, int _tx, int _ty, int w, int h,
+void RenderFieldset::paintBorderMinusLegend(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
                                             const RenderStyle* style, int lx, int lw)
 {
 
@@ -110,16 +110,16 @@ void RenderFieldset::paintBorderMinusLegend(GraphicsContext* p, int _tx, int _ty
     bool render_b = bs > BHIDDEN;
 
     if (render_t) {
-        drawBorder(p, _tx, _ty, _tx + lx, _ty +  style->borderTopWidth(), BSTop, tc, style->color(), ts,
-                   (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE)?style->borderLeftWidth():0), 0);
-        drawBorder(p, _tx+lx+lw, _ty, _tx + w, _ty +  style->borderTopWidth(), BSTop, tc, style->color(), ts,
-                   0, (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE)?style->borderRightWidth():0));
+        drawBorder(graphicsContext, tx, ty, tx + lx, ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
+                   (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? style->borderLeftWidth() : 0), 0);
+        drawBorder(graphicsContext, tx + lx + lw, ty, tx + w, ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
+                   0, (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? style->borderRightWidth() : 0));
     }
 
     if (render_b)
-        drawBorder(p, _tx, _ty + h - style->borderBottomWidth(), _tx + w, _ty + h, BSBottom, bc, style->color(), bs,
-                   (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE)?style->borderLeftWidth():0),
-                   (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE)?style->borderRightWidth():0));
+        drawBorder(graphicsContext, tx, ty + h - style->borderBottomWidth(), tx + w, ty + h, BSBottom, bc, style->color(), bs,
+                   (render_l && (ls == DOTTED || ls == DASHED || ls == DOUBLE) ? style->borderLeftWidth() : 0),
+                   (render_r && (rs == DOTTED || rs == DASHED || rs == DOUBLE) ? style->borderRightWidth() : 0));
 
     if (render_l) {
         const Color& lc = style->borderLeftColor();
@@ -134,9 +134,8 @@ void RenderFieldset::paintBorderMinusLegend(GraphicsContext* p, int _tx, int _ty
             (ls >= OUTSET) &&
             (bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET);
 
-        drawBorder(p, _tx, _ty, _tx + style->borderLeftWidth(), _ty + h, BSLeft, lc, style->color(), ls,
-                   ignore_top?0:style->borderTopWidth(),
-                   ignore_bottom?0:style->borderBottomWidth());
+        drawBorder(graphicsContext, tx, ty, tx + style->borderLeftWidth(), ty + h, BSLeft, lc, style->color(), ls,
+                   ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
     }
 
     if (render_r) {
@@ -152,15 +151,14 @@ void RenderFieldset::paintBorderMinusLegend(GraphicsContext* p, int _tx, int _ty
             (rs >= DOTTED || rs == INSET) &&
             (bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET);
 
-        drawBorder(p, _tx + w - style->borderRightWidth(), _ty, _tx + w, _ty + h, BSRight, rc, style->color(), rs,
-                   ignore_top?0:style->borderTopWidth(),
-                   ignore_bottom?0:style->borderBottomWidth());
+        drawBorder(graphicsContext, tx + w - style->borderRightWidth(), ty, tx + w, ty + h, BSRight, rc, style->color(), rs,
+                   ignore_top ? 0 : style->borderTopWidth(), ignore_bottom ? 0 : style->borderBottomWidth());
     }
 }
 
-void RenderFieldset::setStyle(RenderStyle* _style)
+void RenderFieldset::setStyle(RenderStyle* newStyle)
 {
-    RenderBlock::setStyle(_style);
+    RenderBlock::setStyle(newStyle);
 
     // WinIE renders fieldsets with display:inline like they're inline-blocks.  For us,
     // an inline-block is just a block element with replaced set to true and inline set
index 6419147a767f10398ca66916c3145dd60f143529..87615a5afda0997d67c84fd8c922ef0a83ce555e 100644 (file)
@@ -58,7 +58,7 @@ public:
     virtual Node* shadowParentNode() { return m_shadowParent; }
     
 private:
-        Node* m_shadowParent;    
+    Node* m_shadowParent;    
 };
 
 RenderFileUploadControl::RenderFileUploadControl(Node* node)
@@ -72,22 +72,21 @@ RenderFileUploadControl::~RenderFileUploadControl()
 {
     if (m_button)
         m_button->detach();
-    if (m_fileChooser) {
+    if (m_fileChooser)
         m_fileChooser->disconnectUploadControl();
-    }
 }
 
-void RenderFileUploadControl::setStyle(RenderStyle* s)
+void RenderFileUploadControl::setStyle(RenderStyle* newStyle)
 {
     // Force text-align to match the direction
-    if (s->direction() == LTR)
-        s->setTextAlign(LEFT);
+    if (newStyle->direction() == LTR)
+        newStyle->setTextAlign(LEFT);
     else
-        s->setTextAlign(RIGHT);
-    
-    RenderBlock::setStyle(s);
+        newStyle->setTextAlign(RIGHT);
+
+    RenderBlock::setStyle(newStyle);
     if (m_button)
-        m_button->renderer()->setStyle(createButtonStyle(s));
+        m_button->renderer()->setStyle(createButtonStyle(newStyle));
 
     setReplaced(isInline());
 }
@@ -140,22 +139,22 @@ RenderStyle* RenderFileUploadControl::createButtonStyle(RenderStyle* parentStyle
     return style;
 }
 
-void RenderFileUploadControl::paintObject(PaintInfo& i, int tx, int ty)
+void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, int tx, int ty)
 {
     // Push a clip.
-    if (i.phase == PaintPhaseForeground || i.phase == PaintPhaseChildBlockBackgrounds) {
+    if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
         IntRect clipRect(tx + borderLeft(), ty + borderTop(),
                          width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop());
         if (clipRect.width() == 0 || clipRect.height() == 0)
             return;
-        i.p->save();
-        i.p->clip(clipRect);
+        paintInfo.p->save();
+        paintInfo.p->clip(clipRect);
     }
-    
-    if (i.phase == PaintPhaseForeground) {
+
+    if (paintInfo.phase == PaintPhaseForeground) {
         const String& displayedFilename = m_fileChooser->basenameForWidth(maxFilenameWidth());
         TextRun textRun(displayedFilename.characters(), displayedFilename.length());
-        
+
         // Determine where the filename should be placed
         int contentLeft = tx + borderLeft() + paddingLeft();
         int buttonAndIconWidth = m_button->renderer()->width() + afterButtonSpacing + (m_fileChooser->icon() ? iconWidth + iconFilenameSpacing : 0);
@@ -167,13 +166,13 @@ void RenderFileUploadControl::paintObject(PaintInfo& i, int tx, int ty)
         // We want to match the button's baseline
         RenderButton* buttonRenderer = static_cast<RenderButton*>(m_button->renderer());
         int textY = buttonRenderer->absoluteBoundingBoxRect().y() + buttonRenderer->marginTop() + buttonRenderer->borderTop() + buttonRenderer->paddingTop() + buttonRenderer->baselinePosition(true, false);
-        
-        i.p->setFont(style()->font());
-        i.p->setPen(style()->color());
-        
+
+        paintInfo.p->setFont(style()->font());
+        paintInfo.p->setPen(style()->color());
+
         // Draw the filename
-        i.p->drawText(textRun, IntPoint(textX, textY));
-        
+        paintInfo.p->drawText(textRun, IntPoint(textX, textY));
+
         if (m_fileChooser->icon()) {
             // Determine where the icon should be placed
             int iconY = ty + borderTop() + paddingTop() + (contentHeight() - iconHeight) / 2;
@@ -182,25 +181,25 @@ void RenderFileUploadControl::paintObject(PaintInfo& i, int tx, int ty)
                 iconX = contentLeft + m_button->renderer()->width() + afterButtonSpacing;
             else
                 iconX = contentLeft + contentWidth() - m_button->renderer()->width() - afterButtonSpacing - iconWidth;
-            
+
             // Draw the file icon
-            m_fileChooser->icon()->paint(i.p, IntRect(iconX, iconY, iconWidth, iconHeight));
+            m_fileChooser->icon()->paint(paintInfo.p, IntRect(iconX, iconY, iconWidth, iconHeight));
         }
     }
-    
+
     // Paint the children.
-    RenderBlock::paintObject(i, tx, ty);
-    
+    RenderBlock::paintObject(paintInfo, tx, ty);
+
     // Pop the clip.
-    if (i.phase == PaintPhaseForeground || i.phase == PaintPhaseChildBlockBackgrounds)
-        i.p->restore();
+    if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds)
+        paintInfo.p->restore();
 }
 
 void RenderFileUploadControl::calcMinMaxWidth()
 {
     m_minWidth = 0;
     m_maxWidth = 0;
-    
+
     if (style()->width().isFixed() && style()->width().value() > 0)
         m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value());
     else {
@@ -210,7 +209,7 @@ void RenderFileUploadControl::calcMinMaxWidth()
         float charWidth = style()->font().floatWidth(TextRun(&ch, 1), TextStyle(0, 0, 0, false, false, false));
         m_maxWidth = (int)ceilf(charWidth * defaultWidthNumChars);
     }
-    
+
     if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
         m_maxWidth = max(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
         m_minWidth = max(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
@@ -218,16 +217,16 @@ void RenderFileUploadControl::calcMinMaxWidth()
         m_minWidth = 0;
     else
         m_minWidth = m_maxWidth;
-    
+
     if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
         m_maxWidth = min(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
         m_minWidth = min(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
     }
-    
+
     int toAdd = paddingLeft() + paddingRight() + borderLeft() + borderRight();
     m_minWidth += toAdd;
     m_maxWidth += toAdd;
-    
+
     setMinMaxKnown();
 }
 
@@ -243,4 +242,4 @@ RenderObject* HTMLFileUploadInnerButtonElement::createRenderer(RenderArena* aren
     return HTMLInputElement::createRenderer(arena, style);
 }
 
-}
+} // namespace WebCore
index 3fd31af2eef075f4b1c42eecb541c314fe4851cf..9b910a9ff8e89f48893a56704e2b38a7a1e9ff11 100644 (file)
  *
  */
 
-#ifndef RenderFileUploadControl_H
-#define RenderFileUploadControl_H
-
-#include "RenderBlock.h"
+#ifndef RenderFileUploadControl_h
+#define RenderFileUploadControl_h
 
 #include "FileChooser.h"
 #include "HTMLInputElement.h"
+#include "RenderBlock.h"
 #include "Shared.h"
 
 namespace WebCore {
@@ -41,6 +40,8 @@ public:
     RenderFileUploadControl(Node*);
     ~RenderFileUploadControl();
 
+    virtual const char* renderName() const { return "RenderFileUploadControl"; }
+
     virtual void setStyle(RenderStyle*);
     virtual void updateFromElement();
     virtual void calcMinMaxWidth();
@@ -50,16 +51,14 @@ public:
 
     void valueChanged();
 
-    virtual const char* renderName() const { return "RenderFileUploadControl"; }
-
 protected:
     int maxFilenameWidth();
     RenderStyle* createButtonStyle(RenderStyle* parentStyle = 0);
-    
+
     RefPtr<HTMLFileUploadInnerButtonElement> m_button;
     RefPtr<FileChooser> m_fileChooser;
 };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // RenderFileUploadControl_h
index 16671ea7e445c66d0a4ca702916ba4c0289b55c8..6298055f5f084b9e1af4984f02ae69b8f3fb348a 100644 (file)
@@ -20,8 +20,8 @@
  *
  */
 
-#ifndef RenderFlexibleBox_H
-#define RenderFlexibleBox_H
+#ifndef RenderFlexibleBox_h
+#define RenderFlexibleBox_h
 
 #include "RenderBlock.h"
 
@@ -32,6 +32,8 @@ public:
     RenderFlexibleBox(Node*);
     virtual ~RenderFlexibleBox();
 
+    virtual const char* renderName() const;
+
     virtual void calcMinMaxWidth();
     void calcHorizontalMinMaxWidth();
     void calcVerticalMinMaxWidth();
@@ -46,8 +48,6 @@ public:
     virtual bool isFlexingChildren() const { return m_flexingChildren; }
     virtual bool isStretchingChildren() const { return m_stretchingChildren; }
 
-    virtual const char* renderName() const;
-
     void placeChild(RenderObject* child, int x, int y);
 
 protected:
@@ -63,4 +63,4 @@ protected:
 
 } // namespace WebCore
 
-#endif // RenderFlexibleBox_H
+#endif // RenderFlexibleBox_h
index d45ea1f0afafc9694dd6d7031bdd752c9fb0d6ee..b4e55fd07bb681ceaf264feab866881e650af6d8 100644 (file)
  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-// -------------------------------------------------------------------------
 
 #include "config.h"
 #include "RenderFlow.h"
 
 #include "Document.h"
 #include "GraphicsContext.h"
-#include "InlineTextBox.h"
 #include "HTMLNames.h"
+#include "InlineTextBox.h"
 #include "RenderArena.h"
-#include "RenderView.h"
 #include "RenderInline.h"
+#include "RenderView.h"
 
 using namespace std;
 
@@ -799,4 +798,4 @@ void RenderFlow::paintOutlineForLine(GraphicsContext* p, int tx, int ty, const I
                    ow);
 }
 
-}
+} // namespace WebCore
index b368c1c49a557df79a3c4ce0c28236705b83cc4c..914638aa92a9adc90756181b8794256e75be6a68 100644 (file)
@@ -22,8 +22,8 @@
  *
  */
 
-#ifndef RenderFlow_H
-#define RenderFlow_H
+#ifndef RenderFlow_h
+#define RenderFlow_h
 
 #include "RenderContainer.h"
 
@@ -52,42 +52,42 @@ public:
     virtual RenderFlow* continuation() const { return m_continuation; }
     void setContinuation(RenderFlow* c) { m_continuation = c; }
     RenderFlow* continuationBefore(RenderObject* beforeChild);
-    
+
     void addChildWithContinuation(RenderObject* newChild, RenderObject* beforeChild);
     virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild) = 0;
-    virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
+    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
 
-    static RenderFlow* createAnonymousFlow(Document* doc, RenderStyle* style);
+    static RenderFlow* createAnonymousFlow(Document*, RenderStyle*);
 
-    void extractLineBox(InlineFlowBox* lineBox);
-    void attachLineBox(InlineFlowBox* lineBox);
-    void removeLineBox(InlineFlowBox* lineBox);
+    void extractLineBox(InlineFlowBox*);
+    void attachLineBox(InlineFlowBox*);
+    void removeLineBox(InlineFlowBox*);
     void deleteLineBoxes();
     virtual void destroy();
 
     virtual void dirtyLinesFromChangedChild(RenderObject* child);
-    
-    virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
-    
+
+    virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
+
     InlineFlowBox* firstLineBox() const { return m_firstLineBox; }
     InlineFlowBox* lastLineBox() const { return m_lastLineBox; }
 
     virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun=false);
     virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false);
-    
-    void paintLines(PaintInfo&, int _tx, int _ty);
+
+    void paintLines(PaintInfo&, int tx, int ty);
     bool hitTestLines(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
     virtual IntRect getAbsoluteRepaintRect();
-    
-    virtual int lowestPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
-    virtual int rightmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
-    virtual int leftmostPosition(bool includeOverflowInterior=true, bool includeSelf=true) const;
-    
-    virtual IntRect caretRect(int offset, EAffinity affinity = UPSTREAM, int *extraWidthToEndOfLine = 0);
-
-    virtual void addFocusRingRects(GraphicsContext*, int _tx, int _ty);
-    void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect &prevLine, const IntRect &thisLine, const IntRect &nextLine);
+
+    virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+    virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
+
+    virtual IntRect caretRect(int offset, EAffinity = UPSTREAM, int* extraWidthToEndOfLine = 0);
+
+    virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+    void paintOutlineForLine(GraphicsContext*, int tx, int ty, const IntRect& prevLine, const IntRect& thisLine, const IntRect& nextLine);
     void paintOutline(GraphicsContext*, int tx, int ty);
 
 protected:
@@ -102,10 +102,10 @@ protected:
     // For inline flows, each box represents a portion of that inline.
     InlineFlowBox* m_firstLineBox;
     InlineFlowBox* m_lastLineBox;
-    
+
     mutable short m_lineHeight;
 };
 
 } // namespace WebCore
 
-#endif // RenderFlow_H
+#endif // RenderFlow_h
index 12cc2282c79251514ba0e2adf7e1a6a1857596a6..3605277c8fb98ed1e835911291ae37fec6b0b9ba 100644 (file)
  */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
+
 #include "RenderForeignObject.h"
 
 #include "GraphicsContext.h"
 #include "KRenderingDevice.h"
-#include "SVGLength.h"
 #include "SVGForeignObjectElement.h"
+#include "SVGLength.h"
 
 namespace WebCore {
 
-RenderForeignObject::RenderForeignObject(SVGForeignObjectElement *node) 
+RenderForeignObject::RenderForeignObject(SVGForeignObjectElementnode) 
     : RenderBlock(node)
 {
 }
@@ -47,7 +49,7 @@ void RenderForeignObject::paint(PaintInfo& paintInfo, int parentX, int parentY)
     if (paintInfo.p->paintingDisabled())
         return;
 
-    KRenderingDevice *device = renderingDevice();
+    KRenderingDevicedevice = renderingDevice();
     KRenderingDeviceContext* context = device->currentContext();
     bool shouldPopContext = false;
     if (!context) {
@@ -76,7 +78,7 @@ void RenderForeignObject::paint(PaintInfo& paintInfo, int parentX, int parentY)
 
     if (opacity < 1.0f)
         paintInfo.p->endTransparencyLayer();
-    
+
     if (shouldPopContext) {
         device->popContext();
         delete context;
@@ -89,7 +91,7 @@ void RenderForeignObject::computeAbsoluteRepaintRect(IntRect& r, bool f)
 {
     AffineTransform transform = translationForAttributes() * localTransform();
     r = transform.mapRect(r);
-    
+
     RenderBlock::computeAbsoluteRepaintRect(r, f);
 }
 
@@ -114,7 +116,7 @@ void RenderForeignObject::layout()
 
     if (checkForRepaint)
         repaintAfterLayoutIfNeeded(oldBounds, oldBounds);
-    
+
     setNeedsLayout(false);
 }
 
@@ -124,9 +126,9 @@ bool RenderForeignObject::nodeAtPoint(HitTestResult& result, int x, int y, int t
     totalTransform *= translationForAttributes();
     double localX, localY;
     totalTransform.invert().map(x, y, &localX, &localY);
-    return RenderBlock::nodeAtPoint(result, (int)localX, (int)localY, tx, ty, hitTestAction);
+    return RenderBlock::nodeAtPoint(result, static_cast<int>(localX), static_cast<int>(localY), tx, ty, hitTestAction);
 }
 
-}
+} // namespace WebCore
 
 #endif // SVG_SUPPORT
index 70310f8052dd6c9eef28825d1680dbe691c78aaf..c570efa91aaa9525a97c2e7235b7a308a4b9a7fd 100644 (file)
  *
  */
 
-#ifndef RenderForeignObject_H
-#define RenderForeignObject_H
+#ifndef RenderForeignObject_h
+#define RenderForeignObject_h
 #ifdef SVG_SUPPORT
 
-#include "RenderBlock.h"
 #include "AffineTransform.h"
+#include "RenderBlock.h"
 
 namespace WebCore {
 
 class SVGForeignObjectElement;
 
-class RenderForeignObject : public RenderBlock
-{
+class RenderForeignObject : public RenderBlock {
 public:
-    RenderForeignObject(SVGForeignObjectElement *node);
-    
-    virtual const char *renderName() const { return "RenderForeignObject"; }
-    virtual void paint(PaintInfo& paintInfo, int parentX, int parentY);
-    
+    RenderForeignObject(SVGForeignObjectElement*);
+
+    virtual const char* renderName() const { return "RenderForeignObject"; }
+
+    virtual void paint(PaintInfo&, int parentX, int parentY);
+
     virtual AffineTransform localTransform() const { return m_transform; }
     virtual void setLocalTransform(const AffineTransform& transform) { m_transform = transform; }
-    
-    virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
+
+    virtual void computeAbsoluteRepaintRect(IntRect&, bool fixed);
     virtual bool requiresLayer();
     virtual void layout();
 
@@ -50,11 +50,12 @@ public:
 
  private:
     AffineTransform translationForAttributes();
+
     AffineTransform m_transform;
     IntRect m_absoluteBounds;
 };
 
-}
+} // namespace WebCore
 
 #endif // SVG_SUPPORT
-#endif
+#endif // RenderForeignObject_h
index 47efe7f74ddc47957de503816bba02fd3d320383..b5ab0202b08ed64455b87b144ef931e5b898e9d8 100644 (file)
@@ -50,9 +50,9 @@ short RenderFormElement::baselinePosition(bool f, bool isRootLineBox) const
     return marginTop() + widget()->baselinePosition(m_height);
 }
 
-void RenderFormElement::setStyle(RenderStyle* s)
+void RenderFormElement::setStyle(RenderStyle* newStyle)
 {
-    RenderWidget::setStyle(s);
+    RenderWidget::setStyle(newStyle);
 
     // Do not paint a background or border for Aqua form elements
     setShouldPaintBackgroundOrBorder(false);
@@ -75,7 +75,7 @@ void RenderFormElement::layout()
 
     calcWidth();
     calcHeight();
-    
+
     setNeedsLayout(false);
 }
 
@@ -105,7 +105,7 @@ HorizontalAlignment RenderFormElement::textAlignment() const
         case TAAUTO:
             return style()->direction() == RTL ? AlignRight : AlignLeft;
     }
-    ASSERT(false); // Should never be reached.
+    ASSERT_NOT_REACHED();
     return AlignLeft;
 }
 
index 281d275851f25b6ca0b745741ec2f8b4311337b5..40c7c0032075d4e303b3f5c42b79ff8c69989d9e 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef RenderFormElement_h
 #define RenderFormElement_h
 
-#include "RenderWidget.h"
 #include "GraphicsTypes.h"
+#include "RenderWidget.h"
 
 namespace WebCore {
 
index 0eac442faa93d1c6b068b4b0bcf1d957bfcbc8b0..10eaba4273e8ab6d3cc83671cb4423762815d46c 100644 (file)
@@ -22,6 +22,7 @@
  * Boston, MA 02111-1307, USA.
  *
  */
+
 #include "config.h"
 #include "RenderFrame.h"
 
index 34af2b9d2e51e8cbb0e6b49b20a0afe7e699260b..0f6a3c116ccedd7e3248cc48093400fd40500eab 100644 (file)
  *
  */
 
-#ifndef RenderFrame_H
-#define RenderFrame_H
+#ifndef RenderFrame_h
+#define RenderFrame_h
 
-#include "RenderPart.h"
 #include "HTMLFrameElement.h"
+#include "RenderPart.h"
 
 namespace WebCore {
 
-class RenderFrame : public RenderPart
-{
+class RenderFrame : public RenderPart {
 public:
     RenderFrame(HTMLFrameElement*);
 
     virtual const char* renderName() const { return "RenderFrame"; }
 
-    HTMLFrameElement* element() const
-        { return static_cast<HTMLFrameElement*>(RenderPart::element()); }
+    HTMLFrameElement* element() const { return static_cast<HTMLFrameElement*>(RenderPart::element()); }
 
     virtual void viewCleared();
 };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // RenderFrame_h
index ebd559aaade93b080771d4f894e31198f51a5730..fa8d291088e756e4096845b3aa2d4e416d69fc95 100644 (file)
@@ -22,6 +22,7 @@
  * Boston, MA 02111-1307, USA.
  *
  */
+
 #include "config.h"
 #include "RenderFrameSet.h"
 
 #include "GraphicsContext.h"
 #include "HTMLFrameSetElement.h"
 #include "HTMLNames.h"
-#include "TextStream.h"
-#include "MouseEvent.h"
 #include "HitTestResult.h"
+#include "MouseEvent.h"
 #include "RenderFrame.h"
 #include "RenderView.h"
+#include "TextStream.h"
 
 namespace WebCore {
 
@@ -557,4 +558,4 @@ void RenderFrameSet::dump(TextStream* stream, DeprecatedString ind) const
 }
 #endif
 
-}
+} // namespace WebCore
index e1daf17755ff4b493bf48c65e4a144794b5d730f..048db9e33e12dbd14b4f3e1f4c6d8f330d2d569f 100644 (file)
  *
  */
 
-#ifndef RenderFrameSet_H
-#define RenderFrameSet_H
+#ifndef RenderFrameSet_h
+#define RenderFrameSet_h
 
-#include "RenderContainer.h"
 #include "HTMLFrameSetElement.h"
-
+#include "RenderContainer.h"
 
 namespace WebCore {
 
 class HTMLFrameSetElement;
 class MouseEvent;
 
-class RenderFrameSet : public RenderContainer
-{
+class RenderFrameSet : public RenderContainer {
     friend class HTMLFrameSetElement;
 public:
     RenderFrameSet(HTMLFrameSetElement*);
@@ -56,8 +54,7 @@ public:
 
     virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
-    HTMLFrameSetElement* element() const
-        { return static_cast<HTMLFrameSetElement*>(RenderContainer::element()); }
+    HTMLFrameSetElement* element() const { return static_cast<HTMLFrameSetElement*>(RenderContainer::element()); }
 
 #ifndef NDEBUG
     virtual void dump(TextStream* stream, DeprecatedString ind = "") const;
@@ -81,6 +78,6 @@ private:
     bool m_clientResizing;
 };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // RenderFrameSet_h
index 3727b23282bb228a0bd7fcef37c7b00e3f751db0..433eb52fe89dfdfc7f9679caf968cf169cccbd06 100644 (file)
@@ -35,49 +35,44 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-RenderHTMLCanvas::RenderHTMLCanvas(Node* n)
-    : RenderReplaced(n)
+RenderHTMLCanvas::RenderHTMLCanvas(Node* node)
+    : RenderReplaced(node)
 {
 }
 
-const char* RenderHTMLCanvas::renderName() const
+void RenderHTMLCanvas::paint(PaintInfo& paintInfo, int tx, int ty)
 {
-    return "RenderHTMLCanvas";
-}
-
-void RenderHTMLCanvas::paint(PaintInfo& i, int tx, int ty)
-{
-    if (!shouldPaint(i, tx, ty))
+    if (!shouldPaint(paintInfo, tx, ty))
         return;
 
     int x = tx + m_x;
     int y = ty + m_y;
 
-    if (shouldPaintBackgroundOrBorder() && (i.phase == PaintPhaseForeground || i.phase == PaintPhaseSelection)) 
-        paintBoxDecorations(i, x, y);
+    if (shouldPaintBackgroundOrBorder() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 
+        paintBoxDecorations(paintInfo, x, y);
 
-    if ((i.phase == PaintPhaseOutline || i.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
-        paintOutline(i.p, x, y, width(), height(), style());
-    
-    if (i.phase != PaintPhaseForeground && i.phase != PaintPhaseSelection)
+    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
+        paintOutline(paintInfo.p, x, y, width(), height(), style());
+
+    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
         return;
 
-    if (!shouldPaintWithinRoot(i))
+    if (!shouldPaintWithinRoot(paintInfo))
         return;
 
     bool drawSelectionTint = selectionState() != SelectionNone && !document()->printing();
-    if (i.phase == PaintPhaseSelection) {
+    if (paintInfo.phase == PaintPhaseSelection) {
         if (selectionState() == SelectionNone)
             return;
         drawSelectionTint = false;
     }
 
     if (element() && element()->hasTagName(canvasTag))
-        static_cast<HTMLCanvasElement*>(element())->paint(i.p,
+        static_cast<HTMLCanvasElement*>(element())->paint(paintInfo.p,
             IntRect(x + borderLeft() + paddingLeft(), y + borderTop() + paddingTop(), contentWidth(), contentHeight()));
 
     if (drawSelectionTint)
-        i.p->fillRect(selectionRect(), selectionBackgroundColor());
+        paintInfo.p->fillRect(selectionRect(), selectionBackgroundColor());
 }
 
 void RenderHTMLCanvas::layout()
@@ -97,4 +92,4 @@ void RenderHTMLCanvas::layout()
     setNeedsLayout(false);
 }
 
-}
+} // namespace WebCore
index abf43c5871295baddcc0aa31c40997fc92359148..b7e01aa89ad2a31779d817421dff51885e349df9 100644 (file)
@@ -23,8 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef RenderHTMLCanvas_H
-#define RenderHTMLCanvas_H
+#ifndef RenderHTMLCanvas_h
+#define RenderHTMLCanvas_h
 
 #include "RenderReplaced.h"
 
@@ -33,11 +33,13 @@ namespace WebCore {
     class RenderHTMLCanvas : public RenderReplaced {
     public:
         RenderHTMLCanvas(Node*);
-        virtual const char* renderName() const;
+
+        virtual const char* renderName() const { return "RenderHTMLCanvas"; }
+
         virtual void paint(PaintInfo&, int tx, int ty);
         virtual void layout();
     };
 
-} //namespace
+} // namespace WebCore
 
-#endif
+#endif // RenderHTMLCanvas_h
index a7c93903c3f5f2b7b78c7ecee5b6f99d684dabec..0edaf5f52a992e5106fb3641100a505cb458190a 100644 (file)
@@ -44,14 +44,14 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-RenderImage::RenderImage(Node* n)
-    : RenderReplaced(n)
+RenderImage::RenderImage(Node* node)
+    : RenderReplaced(node)
     , m_cachedImage(0)
+    , m_isAnonymousImage(0)
 {
     m_selectionState = SelectionNone;
     setIntrinsicWidth(0);
     setIntrinsicHeight(0);
-    m_isAnonymousImage = 0;
     updateAltText();
 }
 
@@ -61,19 +61,18 @@ RenderImage::~RenderImage()
         m_cachedImage->deref(this);
 }
 
-void RenderImage::setStyle(RenderStyle* _style)
+void RenderImage::setStyle(RenderStyle* newStyle)
 {
-    RenderReplaced::setStyle(_style);
-    
+    RenderReplaced::setStyle(newStyle);
     setShouldPaintBackgroundOrBorder(true);
 }
 
-void RenderImage::setContentObject(CachedResource* co)
+void RenderImage::setContentObject(CachedResource* cachedResource)
 {
-    if (co && m_cachedImage != co) {
+    if (cachedResource && m_cachedImage != cachedResource) {
         if (m_cachedImage)
             m_cachedImage->deref(this);
-        m_cachedImage = static_cast<CachedImage*>(co);
+        m_cachedImage = static_cast<CachedImage*>(cachedResource);
         if (m_cachedImage)
             m_cachedImage->ref(this);
     }
@@ -83,7 +82,7 @@ void RenderImage::setCachedImage(CachedImage* newImage)
 {
     if (isAnonymousImage())
         return;
-    
+
     if (m_cachedImage != newImage) {
         if (m_cachedImage)
             m_cachedImage->deref(this);
@@ -95,46 +94,46 @@ void RenderImage::setCachedImage(CachedImage* newImage)
     }
 }
 
-void RenderImage::imageChanged(CachedImage* o)
+void RenderImage::imageChanged(CachedImage* newImage)
 {
     if (documentBeingDestroyed())
         return;
 
-    if (o != m_cachedImage) {
-        RenderReplaced::imageChanged(o);
+    if (newImage != m_cachedImage) {
+        RenderReplaced::imageChanged(newImage);
         return;
     }
 
-    bool iwchanged = false;
+    bool imageSizeChanged = false;
 
-    if (o->isErrorImage()) {
-        int iw = o->image()->width() + 4;
-        int ih = o->image()->height() + 4;
+    if (newImage->isErrorImage()) {
+        int imageWidth = newImage->image()->width() + 4;
+        int imageHeight = newImage->image()->height() + 4;
 
         // we have an alt and the user meant it (its not a text we invented)
         if (!m_altText.isEmpty()) {
             const Font& font = style()->font();
-            iw = max(iw, min(font.width(TextRun(m_altText.characters(), m_altText.length())), 1024));
-            ih = max(ih, min(font.height(), 256));
+            imageWidth = max(imageWidth, min(font.width(TextRun(m_altText.characters(), m_altText.length())), 1024));
+            imageHeight = max(imageHeight, min(font.height(), 256));
         }
 
-        if (iw != intrinsicWidth()) {
-            setIntrinsicWidth(iw);
-            iwchanged = true;
+        if (imageWidth != intrinsicWidth()) {
+            setIntrinsicWidth(imageWidth);
+            imageSizeChanged = true;
         }
-        if (ih != intrinsicHeight()) {
-            setIntrinsicHeight(ih);
-            iwchanged = true;
+        if (imageHeight != intrinsicHeight()) {
+            setIntrinsicHeight(imageHeight);
+            imageSizeChanged = true;
         }
     }
 
-    bool needlayout = false;
+    bool ensureLayout = false;
 
     // Image dimensions have been changed, see what needs to be done
-    if ((o->imageSize().width() != intrinsicWidth() || o->imageSize().height() != intrinsicHeight() || iwchanged)) {
-        if(!o->isErrorImage()) {
-            setIntrinsicWidth(o->imageSize().width());
-            setIntrinsicHeight(o->imageSize().height());
+    if (newImage->imageSize().width() != intrinsicWidth() || newImage->imageSize().height() != intrinsicHeight() || imageSizeChanged) {
+        if (!newImage->isErrorImage()) {
+            setIntrinsicWidth(newImage->imageSize().width());
+            setIntrinsicHeight(newImage->imageSize().height());
         }
 
         // In the case of generated image content using :before/:after, we might not be in the
@@ -147,24 +146,23 @@ void RenderImage::imageChanged(CachedImage* o)
             calcWidth();
             calcHeight();
     
-            if(iwchanged || m_width != oldwidth || m_height != oldheight)
-                needlayout = true;
-    
+            if (imageSizeChanged || m_width != oldwidth || m_height != oldheight)
+                ensureLayout = true;
+
             m_width = oldwidth;
             m_height = oldheight;
         }
     }
 
-    if (needlayout) {
+    if (ensureLayout) {
         if (!selfNeedsLayout())
             setNeedsLayout(true);
         if (minMaxKnown())
             setMinMaxKnown(false);
-    }
-    else
+    } else
         // FIXME: We always just do a complete repaint, since we always pass in the full image
         // rect at the moment anyway.
-        repaintRectangle(IntRect(borderLeft()+paddingLeft(), borderTop()+paddingTop(), contentWidth(), contentHeight()));
+        repaintRectangle(IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()));
 }
 
 void RenderImage::resetAnimation()
@@ -176,30 +174,31 @@ void RenderImage::resetAnimation()
     }
 }
 
-void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
+void RenderImage::paint(PaintInfo& paintInfo, int tx, int ty)
 {
-    if (!shouldPaint(i, _tx, _ty)) return;
+    if (!shouldPaint(paintInfo, tx, ty))
+        return;
 
-    _tx += m_x;
-    _ty += m_y;
+    tx += m_x;
+    ty += m_y;
         
-    if (shouldPaintBackgroundOrBorder() && i.phase != PaintPhaseOutline && i.phase != PaintPhaseSelfOutline) 
-        paintBoxDecorations(i, _tx, _ty);
+    if (shouldPaintBackgroundOrBorder() && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline) 
+        paintBoxDecorations(paintInfo, tx, ty);
 
-    GraphicsContext* p = i.p;
-    
-    if ((i.phase == PaintPhaseOutline || i.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
-        paintOutline(p, _tx, _ty, width(), height(), style());
-    
-    if (i.phase != PaintPhaseForeground && i.phase != PaintPhaseSelection)
+    GraphicsContext* p = paintInfo.p;
+
+    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
+        paintOutline(p, tx, ty, width(), height(), style());
+
+    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
         return;
 
-    if (!shouldPaintWithinRoot(i))
+    if (!shouldPaintWithinRoot(paintInfo))
         return;
         
     bool isPrinting = document()->printing();
     bool drawSelectionTint = isSelected() && !isPrinting;
-    if (i.phase == PaintPhaseSelection) {
+    if (paintInfo.phase == PaintPhaseSelection) {
         if (selectionState() == SelectionNone)
             return;
         drawSelectionTint = false;
@@ -216,42 +215,43 @@ void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
         return;
 
     if (!m_cachedImage || image()->isNull() || errorOccurred()) {
-        if (i.phase == PaintPhaseSelection)
+        if (paintInfo.phase == PaintPhaseSelection)
             return;
 
         if (cWidth > 2 && cHeight > 2) {
             if (!errorOccurred()) {
                 p->setPen(Color::lightGray);
                 p->setFillColor(Color::transparent);
-                p->drawRect(IntRect(_tx + leftBorder + leftPad, _ty + topBorder + topPad, cWidth, cHeight));
+                p->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight));
             }
-            
+
             bool errorPictureDrawn = false;
-            int imageX = 0, imageY = 0;
+            int imageX = 0;
+            int imageY = 0;
             int usableWidth = cWidth;
             int usableHeight = cHeight;
-            
+
             if (errorOccurred() && !image()->isNull() && (usableWidth >= image()->width()) && (usableHeight >= image()->height())) {
                 // Center the error image, accounting for border and padding.
-                int centerX = (usableWidth - image()->width())/2;
+                int centerX = (usableWidth - image()->width()) / 2;
                 if (centerX < 0)
                     centerX = 0;
-                int centerY = (usableHeight - image()->height())/2;
+                int centerY = (usableHeight - image()->height()) / 2;
                 if (centerY < 0)
                     centerY = 0;
                 imageX = leftBorder + leftPad + centerX;
                 imageY = topBorder + topPad + centerY;
-                p->drawImage(image(), IntPoint(_tx + imageX, _ty + imageY));
+                p->drawImage(image(), IntPoint(tx + imageX, ty + imageY));
                 errorPictureDrawn = true;
             }
-            
+
             if (!m_altText.isEmpty()) {
                 DeprecatedString text = m_altText.deprecatedString();
                 text.replace('\\', backslashAsCurrencySymbol());
                 p->setFont(style()->font());
                 p->setPen(style()->color());
-                int ax = _tx + leftBorder + leftPad;
-                int ay = _ty + topBorder + topPad;
+                int ax = tx + leftBorder + leftPad;
+                int ay = ty + topBorder + topPad;
                 const Font& font = style()->font();
                 int ascent = font.ascent();
                 
@@ -268,12 +268,12 @@ void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
         }
     } else if (m_cachedImage) {
 #if PLATFORM(MAC)
-        if (style()->highlight() != nullAtom && !i.p->paintingDisabled())
-            paintCustomHighlight(_tx - m_x, _ty - m_y, style()->highlight(), true);
+        if (style()->highlight() != nullAtom && !paintInfo.p->paintingDisabled())
+            paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), true);
 #endif
 
-        IntRect rect(IntPoint(_tx + leftBorder + leftPad, _ty + topBorder + topPad), IntSize(cWidth, cHeight));
-        
+        IntRect rect(IntPoint(tx + leftBorder + leftPad, ty + topBorder + topPad), IntSize(cWidth, cHeight));
+
         HTMLImageElement* imageElt = (element() && element()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(element()) : 0;
         CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
         p->drawImage(image(), rect, compositeOperator);
@@ -286,7 +286,7 @@ void RenderImage::paint(PaintInfo& i, int _tx, int _ty)
 void RenderImage::layout()
 {
     ASSERT(needsLayout());
-    ASSERT( minMaxKnown() );
+    ASSERT(minMaxKnown());
 
     IntRect oldBounds;
     bool checkForRepaint = checkForRepaintDuringLayout();
@@ -334,7 +334,7 @@ void RenderImage::updateAltText()
 {
     if (!element())
         return;
-        
+
     if (element()->hasTagName(inputTag))
         m_altText = static_cast<HTMLInputElement*>(element())->altText();
     else if (element()->hasTagName(imgTag))
@@ -435,4 +435,4 @@ Image* RenderImage::nullImage()
     return &sharedNullImage;
 }
 
-}
+} // namespace WebCore
index 119251edb5b1a5e654a854e18099cac664b29530..66a967681624ed29e1fac6192a493742346a6610 100644 (file)
@@ -24,8 +24,8 @@
  *
  */
 
-#ifndef RENDER_IMAGE_H
-#define RENDER_IMAGE_H
+#ifndef RenderImage_h
+#define RenderImage_h
 
 #include "CachedImage.h"
 #include "HTMLElement.h"
@@ -36,8 +36,7 @@ namespace WebCore {
 class DocLoader;
 class HTMLMapElement;
 
-class RenderImage : public RenderReplaced
-{
+class RenderImage : public RenderReplaced {
 public:
     RenderImage(Node*);
     virtual ~RenderImage();
@@ -51,25 +50,24 @@ public:
     virtual void layout();
 
     virtual void imageChanged(CachedImage*);
-    
+
     // don't even think about making this method virtual!
-    HTMLElement* element() const
-        { return static_cast<HTMLElement*>(RenderReplaced::element()); }
+    HTMLElement* element() const { return static_cast<HTMLElement*>(RenderReplaced::element()); }
 
     // hook to keep RendeObject::m_inline() up to date
-    virtual void setStyle(RenderStyle *style);
+    virtual void setStyle(RenderStyle*);
     void updateAltText();
-    
+
     void setIsAnonymousImage(bool anon) { m_isAnonymousImage = anon; }
     bool isAnonymousImage() { return m_isAnonymousImage; }
-    
+
     void setCachedImage(CachedImage*);
     CachedImage* cachedImage() const { return m_cachedImage; }
-    
+
     Image* image() { return m_cachedImage ? m_cachedImage->image() : nullImage(); }
 
     virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
-    
+
     virtual int calcReplacedWidth() const;
     virtual int calcReplacedHeight() const;
 
@@ -80,9 +78,9 @@ public:
 
     // Called to set generated content images (e.g., :before/:after generated images).
     void setContentObject(CachedResource*);
-    
+
     bool errorOccurred() const { return m_cachedImage && m_cachedImage->isErrorImage(); }
-    
+
     HTMLMapElement* imageMap();
 
     void resetAnimation();
@@ -103,6 +101,6 @@ private:
     static Image* nullImage();
 };
 
-} //namespace
+} // namespace WebCore
 
-#endif
+#endif // RenderImage_h
index a5a5f371675b214e0a97bb6fa958ab44d78681dc..119f857a009a76f613ebfd33270c3c56bfe57895 100644 (file)
 namespace WebCore {
 
 RenderInline::RenderInline(Node* node)
-:RenderFlow(node), m_isContinuation(false)
-{}
+    : RenderFlow(node)
+    , m_isContinuation(false)
+{
+}
 
 RenderInline::~RenderInline()
-{}
+{
+}
 
-void RenderInline::setStyle(RenderStyle* _style)
+void RenderInline::setStyle(RenderStyle* newStyle)
 {
-    RenderFlow::setStyle(_style);
+    RenderFlow::setStyle(newStyle);
     setInline(true);
 
     // Ensure that all of the split inlines pick up the new style. We
@@ -62,7 +65,7 @@ void RenderInline::setStyle(RenderStyle* _style)
     }
 
     m_lineHeight = -1;
-    
+
     // Update pseudos for :before and :after now.
     updatePseudoChild(RenderStyle::BEFORE);
     updatePseudoChild(RenderStyle::AFTER);
@@ -84,11 +87,11 @@ void RenderInline::addChildToFlow(RenderObject* newChild, RenderObject* beforeCh
         // inline into continuations.  This involves creating an anonymous block box to hold
         // |newChild|.  We then make that block box a continuation of this inline.  We take all of
         // the children after |beforeChild| and put them in a clone of this object.
-        RenderStyle *newStyle = new (renderArena()) RenderStyle();
+        RenderStylenewStyle = new (renderArena()) RenderStyle();
         newStyle->inheritFrom(style());
         newStyle->setDisplay(BLOCK);
 
-        RenderBlock *newBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
+        RenderBlocknewBox = new (renderArena()) RenderBlock(document() /* anonymous box */);
         newBox->setStyle(newStyle);
         RenderFlow* oldContinuation = continuation();
         setContinuation(newBox);
@@ -101,7 +104,7 @@ void RenderInline::addChildToFlow(RenderObject* newChild, RenderObject* beforeCh
         if (isLastChild && beforeChild != lastChild())
             beforeChild = 0; // We destroyed the last child, so now we need to update our insertion
                              // point to be 0.  It's just a straight append now.
-        
+
         splitFlow(beforeChild, newBox, newChild, oldContinuation);
         return;
     }
@@ -113,7 +116,7 @@ void RenderInline::addChildToFlow(RenderObject* newChild, RenderObject* beforeCh
 
 RenderInline* RenderInline::cloneInline(RenderFlow* src)
 {
-    RenderInline *o = new (src->renderArena()) RenderInline(src->element());
+    RenderInlineo = new (src->renderArena()) RenderInline(src->element());
     o->m_isContinuation = true;
     o->setStyle(src->style());
     return o;
@@ -126,7 +129,7 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
     // Create a clone of this inline.
     RenderInline* clone = cloneInline(this);
     clone->setContinuation(oldCont);
-    
+
     // Now take all of the children from beforeChild to the end and remove
     // them from |this| and place them in the clone.
     RenderObject* o = beforeChild;
@@ -162,7 +165,7 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
         // has to move into the inline continuation.  Call updatePseudoChild to ensure that the inline's :after
         // content gets properly destroyed.
         curr->updatePseudoChild(RenderStyle::AFTER);
-        
+
         // Now we need to take all of the children starting from the first child
         // *after* currChild and append them all to the clone.
         o = currChild->nextSibling();
@@ -208,7 +211,7 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
     }
 
     RenderBlock* post = block->createAnonymousBlock();
-    
+
     RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
     if (madeNewBeforeBlock)
         block->insertChildNode(pre, boxFirst);
@@ -218,8 +221,7 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
 
     if (madeNewBeforeBlock) {
         RenderObject* o = boxFirst;
-        while (o)
-        {
+        while (o) {
             RenderObject* no = o;
             o = no->nextSibling();
             pre->appendChildNode(block->removeChildNode(no));
@@ -239,7 +241,7 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
     // connected, thus allowing newChild access to a renderArena should it need
     // to wrap itself in additional boxes (e.g., table construction).
     newBlockBox->addChildToFlow(newChild, 0);
-    
+
     // Always just do a full layout in order to ensure that line boxes (especially wrappers for images)
     // get deleted properly.  Because objects moves from the pre block into the post block, we want to
     // make new line boxes instead of leaving the old line boxes around.
@@ -248,20 +250,21 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
     post->setNeedsLayoutAndMinMaxRecalc();
 }
 
-void RenderInline::paint(PaintInfo& i, int _tx, int _ty)
+void RenderInline::paint(PaintInfo& paintInfo, int tx, int ty)
 {
-    paintLines(i, _tx, _ty);
+    paintLines(paintInfo, tx, ty);
 }
 
 void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
     for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
         rects.append(IntRect(tx + curr->xPos(), ty + curr->yPos(), curr->width(), curr->height()));
-    
-    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
+
+    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
         if (!curr->isText())
             curr->absoluteRects(rects, tx + curr->xPos(), ty + curr->yPos());
-    
+    }
+
     if (continuation())
         continuation()->absoluteRects(rects, 
                                       tx - containingBlock()->xPos() + continuation()->xPos(),
@@ -270,11 +273,7 @@ void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 
 void RenderInline::calcMinMaxWidth()
 {
-    ASSERT( !minMaxKnown() );
-
-#ifdef DEBUG_LAYOUT
-    kdDebug( 6040 ) << renderName() << "(RenderInline)::calcMinMaxWidth() this=" << this << endl;
-#endif
+    ASSERT(!minMaxKnown());
 
     // Irrelevant, since some enclosing block will actually measure us and our children.
     m_minWidth = 0;
@@ -283,7 +282,8 @@ void RenderInline::calcMinMaxWidth()
     setMinMaxKnown();
 }
 
-bool RenderInline::requiresLayer() {
+bool RenderInline::requiresLayer()
+{
     return isRoot() || isRelPositioned() || style()->opacity() < 1.0f;
 }
 
@@ -298,16 +298,15 @@ int RenderInline::width() const
         if (curr == firstLineBox() || curr->xPos() + curr->width() > rightSide)
             rightSide = curr->xPos() + curr->width();
     }
-    
+
     return rightSide - leftSide;
 }
 
 int RenderInline::height() const
 {
-    int h = 0;
     if (firstLineBox())
-        h = lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos();
-    return h;
+        return lastLineBox()->yPos() + lastLineBox()->height() - firstLineBox()->yPos();
+    return 0;
 }
 
 int RenderInline::offsetLeft() const
@@ -326,7 +325,7 @@ int RenderInline::offsetTop() const
     return y;
 }
 
-const char *RenderInline::renderName() const
+const charRenderInline::renderName() const
 {
     if (isRelPositioned())
         return "RenderInline (relative positioned)";
@@ -335,15 +334,14 @@ const char *RenderInline::renderName() const
     return "RenderInline";
 }
 
-bool RenderInline::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty,
-                               HitTestAction hitTestAction)
+bool RenderInline::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
 {
-    return hitTestLines(result, _x, _y, _tx, _ty, hitTestAction);
+    return hitTestLines(result, x, y, tx, ty, hitTestAction);
 }
 
 VisiblePosition RenderInline::positionForCoordinates(int x, int y)
 {
-    for (RenderObject *c = continuation(); c; c = c->continuation()) {
+    for (RenderObjectc = continuation(); c; c = c->continuation()) {
         if (c->isInline() || c->firstChild())
             return c->positionForCoordinates(x, y);
     }
@@ -351,4 +349,4 @@ VisiblePosition RenderInline::positionForCoordinates(int x, int y)
     return RenderFlow::positionForCoordinates(x, y);
 }
 
-}
+} // namespace WebCore
index 7402aad84b293bb3a5690996dfae2f696114b6ed..d844d868204ab600197f020aeaba844600a16553 100644 (file)
  *
  */
 
-#ifndef RENDER_INLINE_H
-#define RENDER_INLINE_H
+#ifndef RenderInline_h
+#define RenderInline_h
 
 #include "RenderFlow.h"
 
 namespace WebCore {
-    class Position;
-}
 
-namespace WebCore {
+class Position;
 
-class RenderInline : public RenderFlow
-{
+class RenderInline : public RenderFlow {
 public:
     RenderInline(Node*);
     virtual ~RenderInline();
 
-    virtual const char *renderName() const;
+    virtual const charrenderName() const;
 
     virtual bool isRenderInline() const { return true; }
     virtual bool isInlineFlow() const { return true; }
     virtual bool childrenInline() const { return true; }
 
     virtual bool isInlineContinuation() const;
-    
+
     virtual void addChildToFlow(RenderObject* newChild, RenderObject* beforeChild);
     void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock,
                       RenderObject* beforeChild, RenderFlow* oldCont);
     void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
                    RenderObject* newChild, RenderFlow* oldCont);
-    
+
     virtual void setStyle(RenderStyle*);
 
-    virtual void layout() {} // Do nothing for layout()
-    
+    virtual void layout() { } // Do nothing for layout()
+
     virtual void paint(PaintInfo&, int tx, int ty);
 
-    virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
-    
+    virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+
     virtual void calcMinMaxWidth();
 
     // overrides RenderObject
@@ -68,7 +65,7 @@ public:
 
     virtual int width() const;
     virtual int height() const;
-    
+
     // used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow) to return
     // the remaining width on a given line (and the height of a single line).
     virtual int offsetLeft() const;
@@ -77,7 +74,7 @@ public:
     void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
-    
+
 protected:
     static RenderInline* cloneInline(RenderFlow* src);
 
@@ -85,7 +82,6 @@ private:
     bool m_isContinuation : 1; // Whether or not we're a continuation of an inline.
 };
 
-} // namespace
-
-#endif
+} // namespace WebCore
 
+#endif // RenderInline_h
index ef2a23f2ebae8dac18775b722aee406b0dbd4876..23fb3b298590c19c35f96733288de8aeee7a0afe 100644 (file)
 #include "HitTestResult.h"
 #include "OverflowEvent.h"
 #include "PlatformMouseEvent.h"
+#include "PlatformScrollBar.h" 
 #include "RenderArena.h"
 #include "RenderInline.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
 #include "SelectionController.h"
-#include "PlatformScrollBar.h" 
 
 #ifdef SVG_SUPPORT
 #include "SVGNames.h"
@@ -2312,4 +2312,4 @@ void Marquee::timerFired(Timer<Marquee>*)
     }
 }
 
-}
+} // namespace WebCore
index 5d26bdb5f67676ebd2be5b2d1121d9486b862144..93e80d91a2e0a12136ad8d8eda8a525a98bbbd25 100644 (file)
  * version of this file under any of the LGPL, the MPL or the GPL.
  */
 
-#ifndef render_layer_h
-#define render_layer_h
+#ifndef RenderLayer_h
+#define RenderLayer_h
 
 #include "RenderObject.h"
-#include "Timer.h"
 #include "ScrollBar.h"
+#include "Timer.h"
 
 namespace WebCore {
 
 class CachedResource;
 class HitTestResult;
-class RenderView;
+class PlatformScrollbar;
 class RenderFrameSet;
 class RenderObject;
 class RenderStyle;
 class RenderTable;
 class RenderText;
-class PlatformScrollbar;
+class RenderView;
 
 class ClipRects {
 public:
-    ClipRects(const IntRect& r) :m_overflowClipRect(r), m_fixedClipRect(r), m_posClipRect(r), m_refCnt(0) {}
+    ClipRects(const IntRect& r)
+        : m_overflowClipRect(r)
+        , m_fixedClipRect(r)
+        , m_posClipRect(r)
+        , m_refCnt(0)
+    {
+    }
+
     ClipRects(const IntRect& o, const IntRect& f, const IntRect& p)
-      :m_overflowClipRect(o), m_fixedClipRect(f), m_posClipRect(p), m_refCnt(0) {}
+        : m_overflowClipRect(o)
+        , m_fixedClipRect(f)
+        , m_posClipRect(p)
+        , m_refCnt(0)
+    {
+    }
 
     const IntRect& overflowClipRect() { return m_overflowClipRect; }
     const IntRect& fixedClipRect() { return m_fixedClipRect; }
@@ -72,18 +84,18 @@ public:
 
     void ref() { m_refCnt++; }
     void deref(RenderArena* renderArena) { if (--m_refCnt == 0) destroy(renderArena); }
-    
-    void destroy(RenderArena* renderArena);
+
+    void destroy(RenderArena*);
 
     // Overloaded new operator.
-    void* operator new(size_t sz, RenderArena* renderArena) throw();    
+    void* operator new(size_t, RenderArena*) throw();
 
     // Overridden to prevent the normal delete from being called.
-    void operator delete(void* ptr, size_t sz);
+    void operator delete(void*, size_t);
         
 private:
     // The normal operator new is disallowed on all render objects.
-    void* operator new(size_t sz) throw();
+    void* operator new(size_t) throw();
 
 private:
     IntRect m_overflowClipRect;
@@ -92,14 +104,16 @@ private:
     unsigned m_refCnt;
 };
 
+
+// FIXME: move this to its own file
 // This class handles the auto-scrolling of layers with overflow: marquee.
-class Marquee
-{
+class Marquee {
 public:
     Marquee(RenderLayer*);
 
     int speed() const { return m_speed; }
     int marqueeSpeed() const;
+
     EMarqueeDirection reverseDirection() const { return static_cast<EMarqueeDirection>(-direction()); }
     EMarqueeDirection direction() const;
 
@@ -108,8 +122,8 @@ public:
     int unfurlPos() const { return m_unfurlPos; }
 
     EWhiteSpace whiteSpace() { return static_cast<EWhiteSpace>(m_whiteSpace); }
-    
-    int computePosition(EMarqueeDirection dir, bool stopAtClientEdge);
+
+    int computePosition(EMarqueeDirection, bool stopAtClientEdge);
 
     void setEnd(int end) { m_end = end; }
     
@@ -162,19 +176,18 @@ public:
     static const ScrollAlignment gAlignCenterAlways;
     static const ScrollAlignment gAlignTopAlways;
     static const ScrollAlignment gAlignBottomAlways;
-    
+
     static ScrollBehavior getVisibleBehavior(const ScrollAlignment& s) { return s.m_rectVisible; }
     static ScrollBehavior getPartialBehavior(const ScrollAlignment& s) { return s.m_rectPartial; }
     static ScrollBehavior getHiddenBehavior(const ScrollAlignment& s) { return s.m_rectHidden; }
-    
+
     RenderLayer(RenderObject*);
     ~RenderLayer();
-    
+
     RenderObject* renderer() const { return m_object; }
     RenderLayer* parent() const { return m_parent; }
     RenderLayer* previousSibling() const { return m_previous; }
     RenderLayer* nextSibling() const { return m_next; }
-
     RenderLayer* firstChild() const { return m_first; }
     RenderLayer* lastChild() const { return m_last; }
 
@@ -185,39 +198,41 @@ public:
     void insertOnlyThisLayer();
 
     void repaintIncludingDescendants();
-    
+
     void styleChanged();
-    
+
     Marquee* marquee() const { return m_marquee; }
     void suspendMarquees();
 
     bool isOverflowOnly() const { return m_isOverflowOnly; }
-    
+
     bool isTransparent() const;
     RenderLayer* transparentAncestor();
     void beginTransparencyLayers(GraphicsContext*, const IntRect&);
-    
-    const RenderLayer* root() const {
+
+    const RenderLayer* root() const
+    {
         const RenderLayer* curr = this;
-        while (curr->parent()) curr = curr->parent();
+        while (curr->parent())
+            curr = curr->parent();
         return curr;
     }
     
     int xPos() const { return m_x; }
     int yPos() const { return m_y; }
+    void setPos(int xPos, int yPos)
+    {
+        m_x = xPos;
+        m_y = yPos;
+    }
+
     int width() const { return m_width; }
     int height() const { return m_height; }
-
     void setWidth(int w) { m_width = w; }
     void setHeight(int h) { m_height = h; }
 
     int scrollWidth();
     int scrollHeight();
-    
-    void setPos( int xPos, int yPos ) {
-        m_x = xPos;
-        m_y = yPos;
-    }
 
     // Scrolling methods for layers that can scroll their overflow.
     void scrollOffset(int& x, int& y);
@@ -227,36 +242,46 @@ public:
     void scrollToOffset(int x, int y, bool updateScrollbars = true, bool repaint = true);
     void scrollToXOffset(int x) { scrollToOffset(x, m_scrollY); }
     void scrollToYOffset(int y) { scrollToOffset(m_scrollX + m_scrollOriginX, y); }
-    void scrollRectToVisible(const IntRect &r, const ScrollAlignment& alignX = gAlignCenterIfNeeded, const ScrollAlignment& alignY = gAlignCenterIfNeeded);
-    IntRect getRectToExpose(const IntRect &visibleRect,  const IntRect &exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);    
+    void scrollRectToVisible(const IntRect&, const ScrollAlignment& alignX = gAlignCenterIfNeeded, const ScrollAlignment& alignY = gAlignCenterIfNeeded);
+
+    IntRect getRectToExpose(const IntRect& visibleRect, const IntRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);    
+
     void setHasHorizontalScrollbar(bool);
     void setHasVerticalScrollbar(bool);
+
     PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
     void destroyScrollbar(ScrollbarOrientation);
+
     Scrollbar* horizontalScrollbar() { return m_hBar.get(); }
     Scrollbar* verticalScrollbar() { return m_vBar.get(); }
+
     PlatformScrollbar* horizontaScrollbarWidget() const;
     PlatformScrollbar* verticalScrollbarWidget() const;
+
     int verticalScrollbarWidth() const;
     int horizontalScrollbarHeight() const;
+
     void positionOverflowControls();
     bool isPointInResizeControl(const IntPoint&);
     IntSize offsetFromResizeCorner(const IntPoint&) const;
+
     void paintOverflowControls(GraphicsContext*, int tx, int ty, const IntRect& damageRect);
+
     void updateScrollInfoAfterLayout();
-    bool scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier=1.0);
+
+    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
     void autoscroll();
+
     void resize(const PlatformMouseEvent&, const IntSize&);
     bool inResizeMode() const { return m_inResizeMode; }
     void setInResizeMode(bool b) { m_inResizeMode = b; }
     
     void updateLayerPosition();
-    void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint=true);
+    void updateLayerPositions(bool doFullRepaint = false, bool checkForRepaint = true);
     void checkForRepaintOnResize();
-    void relativePositionOffset(int& relX, int& relY) {
-        relX += m_relX; relY += m_relY;
-    }
-     
+
+    void relativePositionOffset(int& relX, int& relY) { relX += m_relX; relY += m_relY; }
+
     void clearClipRects();
     void clearClipRect();
 
@@ -269,21 +294,21 @@ public:
     void updateZOrderLists();
     Vector<RenderLayer*>* posZOrderList() const { return m_posZOrderList; }
     Vector<RenderLayer*>* negZOrderList() const { return m_negZOrderList; }
-    
+
     void dirtyOverflowList();
     void updateOverflowList();
     Vector<RenderLayer*>* overflowList() const { return m_overflowList; }
-    
+
     bool hasVisibleContent() const { return m_hasVisibleContent; }
-    void setHasVisibleContent(bool b);
+    void setHasVisibleContent(bool);
     void dirtyVisibleContentStatus();
 
     // Gets the nearest enclosing positioned ancestor layer (also includes
     // the <html> layer and the root layer).
     RenderLayer* enclosingPositionedAncestor() const;
-    
+
     void convertToLayerCoords(const RenderLayer* ancestorLayer, int& x, int& y) const;
-    
+
     bool hasAutoZIndex() const { return renderer()->style()->hasAutoZIndex(); }
     int zIndex() const { return renderer()->style()->zIndex(); }
 
@@ -310,21 +335,21 @@ public:
     IntRect absoluteBoundingBox() const;
 
     void updateHoverActiveState(HitTestResult&);
-    
+
     IntRect repaintRect() const { return m_repaintRect; }
 
-    void destroy(RenderArena* renderArena);
+    void destroy(RenderArena*);
 
      // Overloaded new operator.  Derived classes must override operator new
     // in order to allocate out of the RenderArena.
-    void* operator new(size_t sz, RenderArena* renderArena) throw();    
+    void* operator new(size_t, RenderArena*) throw();
 
     // Overridden to prevent the normal delete from being called.
-    void operator delete(void* ptr, size_t sz);
+    void operator delete(void*, size_t);
 
 private:
     // The normal operator new is disallowed on all render objects.
-    void* operator new(size_t sz) throw();
+    void* operator new(size_t) throw();
 
 private:
     void setNextSibling(RenderLayer* next) { m_next = next; }
@@ -336,7 +361,7 @@ private:
     void collectLayers(Vector<RenderLayer*>*&, Vector<RenderLayer*>*&);
 
     void paintLayer(RenderLayer* rootLayer, GraphicsContext*, const IntRect& paintDirtyRect,
-        bool haveTransparency, PaintRestriction, RenderObject* paintingRoot);
+                    bool haveTransparency, PaintRestriction, RenderObject* paintingRoot);
     RenderLayer* hitTestLayer(RenderLayer* rootLayer, HitTestResult&, const IntRect& hitTestRect);
     void computeScrollDimensions(bool* needHBar = 0, bool* needVBar = 0);
 
@@ -346,18 +371,17 @@ private:
     virtual IntRect windowClipRect() const;
 
     void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
-    
+
     void childVisibilityChanged(bool newVisibility);
     void dirtyVisibleDescendantStatus();
     void updateVisibilityStatus();
-        
+
 protected:   
     RenderObject* m_object;
-    
+
     RenderLayer* m_parent;
     RenderLayer* m_previous;
     RenderLayer* m_next;
-
     RenderLayer* m_first;
     RenderLayer* m_last;
 
@@ -377,21 +401,21 @@ protected:
     // The layer's width/height
     int m_width;
     int m_height;
-    
+
     // Our scroll offsets if the view is scrolled.
     int m_scrollX;
     int m_scrollY;
     int m_scrollOriginX;
     int m_scrollLeftOverflow;
-    
+
     // The width/height of our scrolled area.
     int m_scrollWidth;
     int m_scrollHeight;
-    
+
     // For layers with overflow, we have a pair of scrollbars.
     RefPtr<Scrollbar> m_hBar;
     RefPtr<Scrollbar> m_vBar;
-    
+
     // Keeps track of whether the layer is currently resizing, so events can cause resizing to start and stop.
     bool m_inResizeMode;
 
@@ -401,7 +425,7 @@ protected:
     // z-indices.
     Vector<RenderLayer*>* m_posZOrderList;
     Vector<RenderLayer*>* m_negZOrderList;
-    
+
     // This list contains our overflow child layers.
     Vector<RenderLayer*>* m_overflowList;
 
@@ -425,10 +449,10 @@ protected:
     bool m_hasVisibleContent : 1;
     bool m_visibleDescendantStatusDirty : 1;
     bool m_hasVisibleDescendant : 1;
-    
+
     Marquee* m_marquee; // Used by layers with overflow:marquee
 };
 
-} // namespace
+} // namespace WebCore
 
-#endif
+#endif // RenderLayer_h
index 897048be17ce0a576dfc4836c5566ad5ae03e8ef..18ce22d6c6e60e482dbb544306cac6d73744d0dd 100644 (file)
@@ -110,9 +110,9 @@ void RenderLineEdit::calcMinMaxWidth()
     RenderFormElement::calcMinMaxWidth();
 }
 
-void RenderLineEdit::setStyle(RenderStyle *s)
+void RenderLineEdit::setStyle(RenderStyle* newStyle)
 {
-    RenderFormElement::setStyle(s);
+    RenderFormElement::setStyle(newStyle);
 
     TextField* w = static_cast<TextField*>(widget());
     w->setAlignment(textAlignment());
@@ -149,7 +149,7 @@ void RenderLineEdit::updateFromElement()
     }
 
     w->setReadOnly(e->isReadOnlyControl());
-    
+
     // Handle updating the search attributes.
     w->setPlaceholderString(e->getAttribute(placeholderAttr).deprecatedString());
     if (w->type() == TextField::Search) {
@@ -182,7 +182,7 @@ void RenderLineEdit::valueChanged(Widget*)
 
 int RenderLineEdit::selectionStart()
 {
-    TextField *lineEdit = static_cast<TextField *>(m_widget);
+    TextField* lineEdit = static_cast<TextField*>(m_widget);
     int start = lineEdit->selectionStart();
     if (start == -1)
         start = lineEdit->cursorPosition();
@@ -191,18 +191,18 @@ int RenderLineEdit::selectionStart()
 
 int RenderLineEdit::selectionEnd()
 {
-    TextField *lineEdit = static_cast<TextField *>(m_widget);
+    TextField* lineEdit = static_cast<TextField*>(m_widget);
     int start = lineEdit->selectionStart();
     if (start == -1)
         return lineEdit->cursorPosition();
-    return start + (int)lineEdit->selectedText().length();
+    return start + static_cast<int>(lineEdit->selectedText().length());
 }
 
 void RenderLineEdit::setSelectionStart(int start)
 {
     int realStart = max(start, 0);
     int length = max(selectionEnd() - realStart, 0);
-    static_cast<TextField *>(m_widget)->setSelection(realStart, length);
+    static_cast<TextField*>(m_widget)->setSelection(realStart, length);
 }
 
 void RenderLineEdit::setSelectionEnd(int end)
@@ -214,7 +214,7 @@ void RenderLineEdit::setSelectionEnd(int end)
         start = realEnd;
         length = 0;
     }
-    static_cast<TextField *>(m_widget)->setSelection(start, length);
+    static_cast<TextField*>(m_widget)->setSelection(start, length);
 }
 
 void RenderLineEdit::select()
@@ -235,7 +235,7 @@ void RenderLineEdit::setSelectionRange(int start, int end)
 {
     int realStart = max(start, 0);
     int length = max(end - realStart, 0);
-    static_cast<TextField *>(m_widget)->setSelection(realStart, length);
+    static_cast<TextField*>(m_widget)->setSelection(realStart, length);
 }
 
 } // namespace WebCore
index 60ae3cf01022a9286521ac4cb189f4545404001e..8c842fbcf55f6e3f77d1858e281346398b3a682c 100644 (file)
@@ -49,7 +49,7 @@ namespace WebCore {
         int selectionEnd();
         void setSelectionStart(int);
         void setSelectionEnd(int);
-        
+
         bool isEdited() const;
         void setEdited(bool);
         bool isTextField() const { return true; }
index 5c2a444eb89b7e1fb89fa477915abbde3f78d1c4..ddabc46f3b2a211bdd0f381f2056587122b229f0 100644 (file)
@@ -29,8 +29,8 @@
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "HTMLNames.h"
-#include "HTMLOptionElement.h"
 #include "HTMLOptGroupElement.h"
+#include "HTMLOptionElement.h"
 #include "HTMLSelectElement.h"
 #include "HitTestResult.h"
 #include "PlatformScrollBar.h" 
@@ -433,4 +433,4 @@ IntRect RenderListBox::windowClipRect() const
     return view()->frameView()->windowClipRectForLayer(enclosingLayer(), true);
 }
 
-}
+} // namespace WebCore
index cc59d8bd276c2c088c00609c06e7f76acebd0836..fbf7db5313c767ca986e56b2bc65ac7b59994010 100644 (file)
@@ -20,8 +20,8 @@
  *
  */
 
-#ifndef RenderListBox_H
-#define RenderListBox_H
+#ifndef RenderListBox_h
+#define RenderListBox_h
 
 #include "RenderBlock.h"
 
@@ -35,6 +35,8 @@ public:
     RenderListBox(HTMLSelectElement*);
     ~RenderListBox();
 
+    virtual const char* renderName() const { return "RenderListBox"; }
+
     virtual bool isListBox() const { return true; }
 
     virtual void setStyle(RenderStyle*);
@@ -42,47 +44,47 @@ public:
     void setSelectionChanged(bool selectionChanged) { m_selectionChanged = selectionChanged; }
 
     virtual bool canHaveChildren() const { return false; }
-    virtual const char* renderName() const { return "RenderListBox"; }
+
     virtual void paintObject(PaintInfo&, int tx, int ty);
     virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty);
 
-    virtual bool scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier=1.0);
+    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
 
     virtual void calcMinMaxWidth();
-    virtual short baselinePosition(bool, bool isRootLineBox) const;
+    virtual short baselinePosition(bool firstLine, bool isRootLineBox) const;
     virtual void calcHeight();
     void setOptionsChanged(bool c) { m_optionsChanged = c; }
     void valueChanged(unsigned listIndex);
-    
+
     // ScrollbarClient interface.
     virtual void valueChanged(Scrollbar*);
     virtual IntRect windowClipRect() const;
 
     HTMLOptionElement* optionAtPoint(int x, int y);
-    
+
     bool scrollToRevealElementAtListIndex(int index);
-    
+
     virtual bool shouldAutoscroll() const { return numItems() > size(); }
     virtual void autoscroll();
 
 private:
-    bool m_optionsChanged;
-    int m_optionsWidth;
-    int m_optionsMaxHeight;
-    int m_optionsTotalHeight;
-    int m_indexOffset;
-    bool m_selectionChanged;
-    
     int size() const;
     int numItems() const;
     IntRect itemBoundingBoxRect(int tx, int ty, int index);
     void paintScrollbar(PaintInfo&);
     void paintItemForeground(PaintInfo&, int tx, int ty, int listIndex);
     void paintItemBackground(PaintInfo&, int tx, int ty, int listIndex);
-    
+
+    bool m_optionsChanged;
+    int m_optionsWidth;
+    int m_optionsMaxHeight;
+    int m_optionsTotalHeight;
+    int m_indexOffset;
+    bool m_selectionChanged;
+
     Scrollbar* m_vBar;
 };
 
-}
+} // namepace WebCore
 
-#endif
+#endif // RenderListBox_h
index 89a992b475cef1aceab0396efae2d39d8b777be6..8a5e2371ab15a14c5c5579f56d4b30973421614b 100644 (file)
@@ -47,9 +47,9 @@ RenderListItem::RenderListItem(Node* node)
     setInline(false); // our object is not Inline
 }
 
-void RenderListItem::setStyle(RenderStyle* _style)
+void RenderListItem::setStyle(RenderStyle* newStyle)
 {
-    RenderBlock::setStyle(_style);
+    RenderBlock::setStyle(newStyle);
 
     if (style()->listStyleType() != LNONE ||
         (style()->listStyleImage() && !style()->listStyleImage()->isErrorImage())) {
@@ -142,29 +142,29 @@ static RenderObject* getParentOfFirstLineBox(RenderObject* curr, RenderObject* m
     RenderObject* firstChild = curr->firstChild();
     if (!firstChild)
         return 0;
-        
+
     for (RenderObject* currChild = firstChild; currChild; currChild = currChild->nextSibling()) {
         if (currChild == marker)
             continue;
-            
+
         if (currChild->isInline())
             return curr;
-        
+
         if (currChild->isFloating() || currChild->isPositioned())
             continue;
-            
+
         if (currChild->isTable() || !currChild->isRenderBlock())
             break;
-        
+
         if (currChild->style()->htmlHacks() && currChild->element() &&
             (currChild->element()->hasTagName(ulTag)|| currChild->element()->hasTagName(olTag)))
             break;
-            
+
         RenderObject* lineBox = getParentOfFirstLineBox(currChild, marker);
         if (lineBox)
             return lineBox;
     }
-    
+
     return 0;
 }
 
@@ -191,7 +191,7 @@ void RenderListItem::updateMarkerLocation()
             else
                 lineBoxParent = this;
         }
-        
+
         if (markerPar != lineBoxParent || !m_marker->minMaxKnown()) {
             m_marker->remove();
             if (!lineBoxParent)
@@ -231,7 +231,7 @@ void RenderListItem::positionListMarker()
             yOffset += o->yPos();
             xOffset += o->xPos();
         }
-        
+
         RootInlineBox* root = m_marker->inlineBoxWrapper()->root();
         if (style()->direction() == LTR) {
             int leftLineOffset = leftRelOffset(yOffset, leftOffset(yOffset));
@@ -253,12 +253,12 @@ void RenderListItem::positionListMarker()
     }
 }
 
-void RenderListItem::paint(PaintInfo& i, int _tx, int _ty)
+void RenderListItem::paint(PaintInfo& paintInfo, int tx, int ty)
 {
     if (!m_height)
         return;
 
-    RenderBlock::paint(i, _tx, _ty);
+    RenderBlock::paint(paintInfo, tx, ty);
 }
 
 DeprecatedString RenderListItem::markerStringValue()
@@ -266,4 +266,4 @@ DeprecatedString RenderListItem::markerStringValue()
     return m_marker ? m_marker->text() : "";
 }
 
-}
+} // namespace WebCore
index 00e9871134323cde111c60d42627e555c6e0b057..358eda085e97ff325f9ac1892c53dcf7bd369ae2 100644 (file)
@@ -22,8 +22,8 @@
  *
  */
 
-#ifndef RenderListItem_H
-#define RenderListItem_H
+#ifndef RenderListItem_h
+#define RenderListItem_h
 
 #include "RenderBlock.h"
 
@@ -31,19 +31,18 @@ namespace WebCore {
 
 class RenderListMarker;
 
-class RenderListItem : public RenderBlock
-{
+class RenderListItem : public RenderBlock {
 public:
     RenderListItem(Node*);
-    
-    virtual void destroy();
 
     virtual const char* renderName() const { return "RenderListItem"; }
 
-    virtual void setStyle(RenderStyle*);
-
     virtual bool isListItem() const { return true; }
     
+    virtual void destroy();
+
+    virtual void setStyle(RenderStyle*);
+
     int value() const { return m_value; }
     void setValue(int v) { m_predefVal = v; }
     void calcValue();
@@ -57,7 +56,7 @@ public:
 
     virtual void positionListMarker();
     void updateMarkerLocation();
-    
+
     void setNotInList(bool notInList) { m_notInList = notInList; }
     bool notInList() const { return m_notInList; }
 
@@ -70,7 +69,6 @@ private:
     int m_value;
 };
 
+} // namespace WebCore
 
-} //namespace
-
-#endif
+#endif // RenderListItem_h
index c40326d3bfa78c4df6aa0009a6884474859445e3..3d348def4568ebc7a91368c1c6f10f84bd2268aa 100644 (file)
@@ -521,4 +521,4 @@ IntRect RenderListMarker::selectionRect()
     return IntRect(absx + xPos(), absy + root->selectionTop(), width(), root->selectionHeight());
 }
 
-}
+} // namespace WebCore
index 64bd334c14473a92524800ffae8ddb6eb05bddfb..43dc13eee5254bff3689ff5a2a7a254661d7c772 100644 (file)
@@ -22,8 +22,8 @@
  *
  */
 
-#ifndef RenderListMarker_H
-#define RenderListMarker_H
+#ifndef RenderListMarker_h
+#define RenderListMarker_h
 
 #include "DeprecatedString.h"
 #include "RenderBox.h"
@@ -35,19 +35,21 @@ class RenderListItem;
 /* used to render the lists marker.
      This class always has to be a direct child of a RenderListItem!
 */
-class RenderListMarker : public RenderBox
-{
+class RenderListMarker : public RenderBox {
 public:
     RenderListMarker(Document*);
     ~RenderListMarker();
 
+    virtual const char* renderName() const { return "RenderListMarker"; }
+
+    virtual bool isListMarker() const { return true; }
+
     virtual void setStyle(RenderStyle*);
 
-    virtual const char* renderName() const { return "RenderListMarker"; }
+    virtual void paint(PaintInfo&, int xoff, int yoff);
+
     // so the marker gets to layout itself. Only needed for
     // list-style-position: inside
-
-    virtual void paint(PaintInfo&, int xoff, int yoff);
     virtual void layout();
     virtual void calcMinMaxWidth();
 
@@ -57,22 +59,20 @@ public:
 
     virtual InlineBox* createInlineBox(bool, bool, bool);
 
-    virtual short lineHeight(bool b, bool isRootLineBox=false) const;
-    virtual short baselinePosition(bool b, bool isRootLineBox=false) const;
+    virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
+    virtual short baselinePosition(bool firstLine, bool isRootLineBox = false) const;
 
-    virtual bool isListMarker() const { return true; }
-    
     CachedImage* listImage() const { return m_listImage; }
-    
+
     RenderListItem* listItem() { return m_listItem; }
     void setListItem(RenderListItem* listItem) { m_listItem = listItem; }
-    
+
     const DeprecatedString& text() const { return m_item; }
 
     bool isInside() const;
-    
+
     IntRect getRelativeMarkerRect();
-    
+
     virtual SelectionState selectionState() const { return m_selectionState; }
     virtual void setSelectionState(SelectionState);
     virtual IntRect selectionRect();
@@ -85,6 +85,6 @@ private:
     SelectionState m_selectionState;
 };
 
-} //namespace
+} // namespace WebCore
 
-#endif
+#endif // RenderListMarker_h