short -> int in RenderObjects

David Hyatt hyatt at apple.com
Fri Feb 27 00:12:11 CET 2004


This patch fixes all widths to be ints instead of shorts.  We actually 
have some real-world Web pages overflowing and so had to take care of 
this.

dave

-------------- next part --------------
Index: khtml/rendering/render_applet.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_applet.cpp,v
retrieving revision 1.27
diff -u -p -r1.27 khtml/rendering/render_applet.cpp
--- khtml/rendering/render_applet.cpp	2004/01/16 00:53:08	1.27
+++ khtml/rendering/render_applet.cpp	2004/02/26 01:18:07
@@ -70,7 +70,7 @@ RenderApplet::~RenderApplet()
 {
 }
 
-short RenderApplet::intrinsicWidth() const
+int RenderApplet::intrinsicWidth() const
 {
     int rval = 150;
 
@@ -192,7 +192,7 @@ RenderEmptyApplet::RenderEmptyApplet(DOM
 #endif
 }
 
-short RenderEmptyApplet::intrinsicWidth() const
+int RenderEmptyApplet::intrinsicWidth() const
 {
     return (m_widget ? m_widget->sizeHint().width() : 150);
 }
Index: khtml/rendering/render_applet.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_applet.h,v
retrieving revision 1.6
diff -u -p -r1.6 khtml/rendering/render_applet.h
--- khtml/rendering/render_applet.h	2003/12/01 22:44:53	1.6
+++ khtml/rendering/render_applet.h	2004/02/26 01:18:07
@@ -49,7 +49,7 @@ public:
 #endif
 
     virtual void layout();
-    virtual short intrinsicWidth() const;
+    virtual int intrinsicWidth() const;
     virtual int intrinsicHeight() const;
     virtual bool isApplet() const { return true; }
 
@@ -72,7 +72,7 @@ public:
 
     virtual const char *renderName() const { return "RenderEmptyApplet"; }
 
-    virtual short intrinsicWidth() const;
+    virtual int intrinsicWidth() const;
     virtual int intrinsicHeight() const;
     virtual void layout();
 };
Index: khtml/rendering/render_block.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_block.cpp,v
retrieving revision 1.101
diff -u -p -r1.101 khtml/rendering/render_block.cpp
--- khtml/rendering/render_block.cpp	2004/02/23 21:26:25	1.101
+++ khtml/rendering/render_block.cpp	2004/02/26 01:18:11
@@ -1614,7 +1614,7 @@ RenderBlock::rightRelOffset(int y, int f
     return right;
 }
 
-unsigned short
+int
 RenderBlock::lineWidth(int y) const
 {
     //kdDebug( 6040 ) << "lineWidth(" << y << ")=" << rightOffset(y) - leftOffset(y) << endl;
@@ -2038,19 +2038,19 @@ void RenderBlock::calcMinMaxWidth()
 
     if (style()->width().isFixed() && style()->width().value > 0) {
         if (isTableCell())
-            m_maxWidth = KMAX(m_minWidth,short(style()->width().value));
+            m_maxWidth = KMAX(m_minWidth, style()->width().value);
         else
-            m_minWidth = m_maxWidth = short(style()->width().value);
+            m_minWidth = m_maxWidth = style()->width().value;
     }
     
     if (style()->minWidth().isFixed() && style()->minWidth().value > 0) {
-        m_maxWidth = KMAX(m_maxWidth, short(style()->minWidth().value));
-        m_minWidth = KMAX(m_minWidth, short(style()->minWidth().value));
+        m_maxWidth = KMAX(m_maxWidth, style()->minWidth().value);
+        m_minWidth = KMAX(m_minWidth, style()->minWidth().value);
     }
     
     if (style()->maxWidth().isFixed() && style()->maxWidth().value != UNDEFINED) {
-        m_maxWidth = KMIN(m_maxWidth, short(style()->maxWidth().value));
-        m_minWidth = KMIN(m_minWidth, short(style()->maxWidth().value));
+        m_maxWidth = KMIN(m_maxWidth, style()->maxWidth().value);
+        m_minWidth = KMIN(m_minWidth, style()->maxWidth().value);
     }
 
     int toAdd = 0;
@@ -2229,8 +2229,8 @@ void RenderBlock::calcInlineMinMaxWidth(
             // the width of the last non-breakable run and use that to start a new line
             // (unless we end in whitespace).
             RenderStyle* cstyle = child->style();
-            short childMin = 0;
-            short childMax = 0;
+            int childMin = 0;
+            int childMax = 0;
 
             if (!child->isText()) {
                 // Case (1) and (2).  Inline replaced and inline flow elements.
@@ -2311,9 +2311,9 @@ void RenderBlock::calcInlineMinMaxWidth(
                 // then they shouldn't be considered in the breakable char
                 // check.
                 bool hasBreakableChar, hasBreak;
-                short beginMin, endMin;
+                int beginMin, endMin;
                 bool beginWS, endWS;
-                short beginMax, endMax;
+                int beginMax, endMax;
                 t->trimmedMinMaxWidth(beginMin, beginWS, endMin, endWS, hasBreakableChar,
                                       hasBreak, beginMax, endMax,
                                       childMin, childMax, stripFrontSpaces);
Index: khtml/rendering/render_block.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_block.h,v
retrieving revision 1.32
diff -u -p -r1.32 khtml/rendering/render_block.h
--- khtml/rendering/render_block.h	2004/02/23 21:26:26	1.32
+++ khtml/rendering/render_block.h	2004/02/26 01:18:12
@@ -148,7 +148,7 @@ public:
     inline int leftBottom();
     inline int rightBottom();
 
-    virtual unsigned short lineWidth(int y) 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;
@@ -219,8 +219,8 @@ protected:
         RenderObject* node;
         int startY;
         int endY;
-        short left;
-        short width;
+        int left;
+        int width;
         Type type : 1; // left or right aligned
         bool noPaint : 1;
     };
Index: khtml/rendering/render_box.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_box.cpp,v
retrieving revision 1.111
diff -u -p -r1.111 khtml/rendering/render_box.cpp
--- khtml/rendering/render_box.cpp	2004/02/23 21:26:26	1.111
+++ khtml/rendering/render_box.cpp	2004/02/26 01:18:13
@@ -136,9 +136,9 @@ void RenderBox::detach()
         layer->detach(arena);
 }
 
-short RenderBox::contentWidth() const
+int RenderBox::contentWidth() const
 {
-    short w = m_width - borderLeft() - borderRight();
+    int w = m_width - borderLeft() - borderRight();
     w -= paddingLeft() + paddingRight();
 
     if (style()->scrollsOverflow() && m_layer)
@@ -167,7 +167,7 @@ void RenderBox::setPos( int xPos, int yP
     m_x = xPos; m_y = yPos;
 }
 
-short RenderBox::width() const
+int RenderBox::width() const
 {
     return m_width;
 }
@@ -506,7 +506,7 @@ QRect RenderBox::getClipRect(int tx, int
     return cr;
 }
 
-short RenderBox::containingBlockWidth() const
+int RenderBox::containingBlockWidth() const
 {
     RenderBlock* cb = containingBlock();
     if (!cb)
@@ -958,7 +958,7 @@ void RenderBox::calcHeight()
     }
 }
 
-short RenderBox::calcReplacedWidth() const
+int RenderBox::calcReplacedWidth() const
 {
     int width = calcReplacedWidthUsing(Width);
     int minW = calcReplacedWidthUsing(MinWidth);
@@ -1081,7 +1081,7 @@ void RenderBox::calcVerticalMargins()
     m_marginBottom = bm.minWidth(cw);
 }
 
-void RenderBox::setStaticX(short staticX)
+void RenderBox::setStaticX(int staticX)
 {
     m_staticX = staticX;
 }
Index: khtml/rendering/render_box.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_box.h,v
retrieving revision 1.38
diff -u -p -r1.38 khtml/rendering/render_box.h
--- khtml/rendering/render_box.h	2004/02/23 21:26:26	1.38
+++ khtml/rendering/render_box.h	2004/02/26 01:18:13
@@ -52,10 +52,10 @@ public:
 
     virtual void detach();
     
-    virtual short minWidth() const { return m_minWidth; }
-    virtual short maxWidth() const { return m_maxWidth; }
+    virtual int minWidth() const { return m_minWidth; }
+    virtual int maxWidth() const { return m_maxWidth; }
 
-    virtual short contentWidth() const;
+    virtual int contentWidth() const;
     virtual int contentHeight() const;
 
     virtual bool absolutePosition(int &xPos, int &yPos, bool f = false);
@@ -64,7 +64,7 @@ public:
 
     virtual int xPos() const { return m_x; }
     virtual int yPos() const { return m_y; }
-    virtual short width() const;
+    virtual int width() const;
     virtual int height() const;
 
     virtual short marginTop() const { return m_marginTop; }
@@ -101,7 +101,7 @@ public:
 
     virtual void repaintDuringLayoutIfMoved(int oldX, int oldY);
     
-    virtual short containingBlockWidth() const;
+    virtual int containingBlockWidth() const;
 
     virtual void calcWidth();
     virtual void calcHeight();
@@ -110,7 +110,7 @@ public:
     int calcReplacedWidthUsing(WidthType widthType) const;
     int calcReplacedHeightUsing(HeightType heightType) const;
     
-    virtual short calcReplacedWidth() const;
+    virtual int calcReplacedWidth() const;
     virtual int   calcReplacedHeight() const;
 
     virtual int availableHeight() const;
@@ -128,7 +128,7 @@ public:
                                          int _tx, int _ty, int w, int height,
                                          int bleft, int bright);
 
-    virtual void setStaticX(short staticX);
+    virtual void setStaticX(int staticX);
     virtual void setStaticY(int staticY);
 
 protected:
@@ -152,8 +152,8 @@ protected:
 
     int m_y;
 
-    short m_x;
-    short m_width;
+    int m_x;
+    int m_width;
 
     short m_marginTop;
     short m_marginBottom;
@@ -165,14 +165,14 @@ protected:
      * the minimum width the element needs, to be able to render
      * it's content without clipping
      */
-    short m_minWidth;
+    int m_minWidth;
     /* The maximum width the element can fill horizontally
      * ( = the width of the element with line breaking disabled)
      */
-    short m_maxWidth;
+    int m_maxWidth;
 
     // Cached normal flow values for absolute positioned elements with static left/top values.
-    short m_staticX;
+    int m_staticX;
     int m_staticY;
     
     // A pointer to our layer if we have one.  Currently only positioned elements
Index: khtml/rendering/render_br.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_br.h,v
retrieving revision 1.10
diff -u -p -r1.10 khtml/rendering/render_br.h
--- khtml/rendering/render_br.h	2004/02/23 21:26:26	1.10
+++ khtml/rendering/render_br.h	2004/02/26 01:18:14
@@ -50,8 +50,8 @@ public:
     // overrides
     virtual InlineBox* createInlineBox(bool, bool, bool isOnlyRun = false);
     virtual void calcMinMaxWidth() {}
-    virtual short minWidth() const { return 0; }
-    virtual short maxWidth() const { return 0; }
+    virtual int minWidth() const { return 0; }
+    virtual int maxWidth() const { return 0; }
 
     virtual int xPos() const { return m_x; }
     virtual int yPos() const { return m_y; }
Index: khtml/rendering/render_canvas.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_canvas.cpp,v
retrieving revision 1.17
diff -u -p -r1.17 khtml/rendering/render_canvas.cpp
--- khtml/rendering/render_canvas.cpp	2004/02/11 19:52:37	1.17
+++ khtml/rendering/render_canvas.cpp	2004/02/26 01:18:14
@@ -179,7 +179,7 @@ void RenderCanvas::layout()
 #endif
 
     layer()->setHeight(kMax(doch, m_height));
-    layer()->setWidth(kMax((short)docw, m_width));
+    layer()->setWidth(kMax(docw, m_width));
     
     setNeedsLayout(false);
 }
Index: khtml/rendering/render_flexbox.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_flexbox.cpp,v
retrieving revision 1.12
diff -u -p -r1.12 khtml/rendering/render_flexbox.cpp
--- khtml/rendering/render_flexbox.cpp	2004/02/23 21:26:26	1.12
+++ khtml/rendering/render_flexbox.cpp	2004/02/26 01:18:16
@@ -219,16 +219,16 @@ void RenderFlexibleBox::calcMinMaxWidth(
     if(m_maxWidth < m_minWidth) m_maxWidth = m_minWidth;
 
     if (style()->width().isFixed() && style()->width().value > 0)
-        m_minWidth = m_maxWidth = short(style()->width().value);
+        m_minWidth = m_maxWidth = style()->width().value;
    
     if (style()->minWidth().isFixed() && style()->minWidth().value > 0) {
-        m_maxWidth = KMAX(m_maxWidth, short(style()->minWidth().value));
-        m_minWidth = KMAX(m_minWidth, short(style()->minWidth().value));
+        m_maxWidth = KMAX(m_maxWidth, style()->minWidth().value);
+        m_minWidth = KMAX(m_minWidth, style()->minWidth().value);
     }
     
     if (style()->maxWidth().isFixed() && style()->maxWidth().value != UNDEFINED) {
-        m_maxWidth = KMIN(m_maxWidth, short(style()->maxWidth().value));
-        m_minWidth = KMIN(m_minWidth, short(style()->maxWidth().value));
+        m_maxWidth = KMIN(m_maxWidth, style()->maxWidth().value);
+        m_minWidth = KMIN(m_minWidth, style()->maxWidth().value);
     }
 
     int toAdd = borderLeft() + borderRight() + paddingLeft() + paddingRight();
Index: khtml/rendering/render_frames.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_frames.cpp,v
retrieving revision 1.47
diff -u -p -r1.47 khtml/rendering/render_frames.cpp
--- khtml/rendering/render_frames.cpp	2004/02/10 20:52:12	1.47
+++ khtml/rendering/render_frames.cpp	2004/02/26 01:18:17
@@ -603,7 +603,7 @@ bool RenderPart::partLoadingErrorNotify(
     return false;
 }
 
-short RenderPart::intrinsicWidth() const
+int RenderPart::intrinsicWidth() const
 {
   // KDE may need a non-zero width here, although this will mess up pages (e.g., thinker.org).
 #if APPLE_CHANGES
@@ -923,7 +923,7 @@ void RenderPartObject::layout( )
     KHTMLAssert( minMaxKnown() );
 
 #if !APPLE_CHANGES
-    short m_oldwidth = m_width;
+    int m_oldwidth = m_width;
     int m_oldheight = m_height;
 #endif
 
Index: khtml/rendering/render_frames.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_frames.h,v
retrieving revision 1.11
diff -u -p -r1.11 khtml/rendering/render_frames.h
--- khtml/rendering/render_frames.h	2004/01/11 19:06:35	1.11
+++ khtml/rendering/render_frames.h	2004/02/26 01:18:17
@@ -118,7 +118,7 @@ public:
      */
     virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType );
 
-    virtual short intrinsicWidth() const;
+    virtual int intrinsicWidth() const;
     virtual int intrinsicHeight() const;
 
 public slots:
Index: khtml/rendering/render_image.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_image.cpp,v
retrieving revision 1.51
diff -u -p -r1.51 khtml/rendering/render_image.cpp
--- khtml/rendering/render_image.cpp	2004/02/11 19:52:38	1.51
+++ khtml/rendering/render_image.cpp	2004/02/26 01:18:18
@@ -417,7 +417,7 @@ void RenderImage::layout()
     if (checkForRepaint)
         oldBounds = getAbsoluteRepaintRect();
     
-    short oldwidth = m_width;
+    int oldwidth = m_width;
     int oldheight = m_height;
 
     // minimum height
@@ -590,7 +590,7 @@ bool RenderImage::isHeightSpecified() co
     return false;
 }
 
-short RenderImage::calcReplacedWidth() const
+int RenderImage::calcReplacedWidth() const
 {
     // If height is specified and not width, preserve aspect ratio.
     if (isHeightSpecified() && !isWidthSpecified()) {
Index: khtml/rendering/render_image.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_image.h,v
retrieving revision 1.18
diff -u -p -r1.18 khtml/rendering/render_image.h
--- khtml/rendering/render_image.h	2004/02/11 19:52:38	1.18
+++ khtml/rendering/render_image.h	2004/02/26 01:18:18
@@ -70,7 +70,7 @@ public:
     virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty,
                              HitTestAction hitTestAction = HitTestAll, bool inside=false);
     
-    virtual short calcReplacedWidth() const;
+    virtual int calcReplacedWidth() const;
     virtual int calcReplacedHeight() const;
 
     virtual void detach();
Index: khtml/rendering/render_inline.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_inline.cpp,v
retrieving revision 1.33
diff -u -p -r1.33 khtml/rendering/render_inline.cpp
--- khtml/rendering/render_inline.cpp	2004/02/11 21:37:00	1.33
+++ khtml/rendering/render_inline.cpp	2004/02/26 01:18:19
@@ -467,11 +467,11 @@ bool RenderInline::requiresLayer() {
     return isRoot() || isRelPositioned() || style()->opacity() < 1.0f;
 }
 
-short RenderInline::width() const
+int RenderInline::width() const
 {
     // Return the width of the minimal left side and the maximal right side.
-    short leftSide = 0;
-    short rightSide = 0;
+    int leftSide = 0;
+    int rightSide = 0;
     for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
         if (curr == firstLineBox() || curr->xPos() < leftSide)
             leftSide = curr->xPos();
Index: khtml/rendering/render_inline.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_inline.h,v
retrieving revision 1.17
diff -u -p -r1.17 khtml/rendering/render_inline.h
--- khtml/rendering/render_inline.h	2004/02/11 19:52:38	1.17
+++ khtml/rendering/render_inline.h	2004/02/26 01:18:19
@@ -63,7 +63,7 @@ public:
     // overrides RenderObject
     virtual bool requiresLayer();
 
-    virtual short width() const;
+    virtual int width() const;
     virtual int height() const;
     
     // used to calculate offsetWidth/Height.  Overridden by inlines (render_flow) to return
Index: khtml/rendering/render_layer.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_layer.cpp,v
retrieving revision 1.67
diff -u -p -r1.67 khtml/rendering/render_layer.cpp
--- khtml/rendering/render_layer.cpp	2004/02/21 01:06:29	1.67
+++ khtml/rendering/render_layer.cpp	2004/02/26 01:18:21
@@ -585,7 +585,7 @@ RenderLayer::positionScrollbars(const QR
 #define LINE_STEP   10
 #define PAGE_KEEP   40
 
-short RenderLayer::scrollWidth()
+int RenderLayer::scrollWidth()
 {
     if (m_scrollDimensionsDirty)
         computeScrollDimensions();
Index: khtml/rendering/render_layer.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_layer.h,v
retrieving revision 1.37
diff -u -p -r1.37 khtml/rendering/render_layer.h
--- khtml/rendering/render_layer.h	2004/01/26 21:56:41	1.37
+++ khtml/rendering/render_layer.h	2004/02/26 01:18:21
@@ -163,13 +163,13 @@ public:
     
     int xPos() const { return m_x; }
     int yPos() const { return m_y; }
-    short width() const { return m_width; }
+    int width() const { return m_width; }
     int height() const { return m_height; }
 
-    void setWidth(short w) { m_width = w; }
+    void setWidth(int w) { m_width = w; }
     void setHeight(int h) { m_height = h; }
 
-    short scrollWidth();
+    int scrollWidth();
     int scrollHeight();
     
     void setPos( int xPos, int yPos ) {
@@ -180,7 +180,7 @@ public:
     // Scrolling methods for layers that can scroll their overflow.
     void scrollOffset(int& x, int& y);
     void subtractScrollOffset(int& x, int& y);
-    short scrollXOffset() { return m_scrollX; }
+    int scrollXOffset() { return m_scrollX; }
     int scrollYOffset() { return m_scrollY; }
     void scrollToOffset(int x, int y, bool updateScrollbars = true, bool repaint = true);
     void scrollToXOffset(int x) { scrollToOffset(x, m_scrollY); }
@@ -293,19 +293,19 @@ protected:   
     int m_relY;
 
     // Our (x,y) coordinates are in our parent layer's coordinate space.
-    short m_x;
+    int m_x;
     int m_y;
 
     // The layer's width/height
-    short m_width;
+    int m_width;
     int m_height;
     
     // Our scroll offsets if the view is scrolled.
-    short m_scrollX;
+    int m_scrollX;
     int m_scrollY;
     
     // The width/height of our scrolled area.
-    short m_scrollWidth;
+    int m_scrollWidth;
     int m_scrollHeight;
     
     // For layers with overflow, we have a pair of scrollbars.
Index: khtml/rendering/render_line.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_line.h,v
retrieving revision 1.9
diff -u -p -r1.9 khtml/rendering/render_line.h
--- khtml/rendering/render_line.h	2004/02/23 21:26:26	1.9
+++ khtml/rendering/render_line.h	2004/02/26 01:18:21
@@ -97,11 +97,11 @@ public:
 
     RootInlineBox* root();
     
-    void setWidth(short w) { m_width = w; }
-    short width() { return m_width; }
+    void setWidth(int w) { m_width = w; }
+    int width() { return m_width; }
 
-    void setXPos(short x) { m_x = x; }
-    short xPos() { return m_x; }
+    void setXPos(int x) { m_x = x; }
+    int xPos() { return m_x; }
 
     void setYPos(int y) { m_y = y; }
     int yPos() { return m_y; }
@@ -129,9 +129,9 @@ public: // FIXME: Would like to make thi
         // members over in the part.
     RenderObject* m_object;
 
-    short m_x;
+    int m_x;
     int m_y;
-    short m_width;
+    int m_width;
     int m_height;
     int m_baseline;
     
Index: khtml/rendering/render_object.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_object.cpp,v
retrieving revision 1.134
diff -u -p -r1.134 khtml/rendering/render_object.cpp
--- khtml/rendering/render_object.cpp	2004/02/23 23:33:52	1.134
+++ khtml/rendering/render_object.cpp	2004/02/26 01:18:24
@@ -558,7 +558,7 @@ RenderObject* RenderObject::offsetParent
 
 // More IE extensions.  clientWidth and clientHeight represent the interior of an object
 // excluding border and scrollbar.
-short
+int
 RenderObject::clientWidth() const
 {
     return width() - borderLeft() - borderRight() -
@@ -574,7 +574,7 @@ RenderObject::clientHeight() const
 
 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
 // object has overflow:hidden/scroll/auto specified and also has overflow.
-short
+int
 RenderObject::scrollWidth() const
 {
     return (style()->hidesOverflow() && layer()) ? layer()->scrollWidth() : overflowWidth();
@@ -693,7 +693,7 @@ RenderBlock* RenderObject::containingBlo
     return static_cast<RenderBlock*>(o);
 }
 
-short RenderObject::containingBlockWidth() const
+int RenderObject::containingBlockWidth() const
 {
     // ###
     return containingBlock()->contentWidth();
Index: khtml/rendering/render_object.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_object.h,v
retrieving revision 1.106
diff -u -p -r1.106 khtml/rendering/render_object.h
--- khtml/rendering/render_object.h	2004/02/23 23:33:52	1.106
+++ khtml/rendering/render_object.h	2004/02/26 01:18:25
@@ -162,7 +162,7 @@ public:
     // to determine its position.
     bool hasStaticX() const;
     bool hasStaticY() const;
-    virtual void setStaticX(short staticX) {};
+    virtual void setStaticX(int staticX) {};
     virtual void setStaticY(int staticY) {};
     
     // RenderObject tree manipulation
@@ -479,16 +479,16 @@ public:
     RenderBlock *containingBlock() const;
 
     // return just the width of the containing block
-    virtual short containingBlockWidth() const;
+    virtual int containingBlockWidth() const;
     // return just the height of the containing block
     virtual int containingBlockHeight() const;
 
     // size of the content area (box size minus padding/border)
-    virtual short contentWidth() const { return 0; }
+    virtual int contentWidth() const { return 0; }
     virtual int contentHeight() const { return 0; }
 
     // intrinsic extend of replaced elements. undefined otherwise
-    virtual short intrinsicWidth() const { return 0; }
+    virtual int intrinsicWidth() const { return 0; }
     virtual int intrinsicHeight() const { return 0; }
 
     // relative to parent node
@@ -503,7 +503,7 @@ public:
     virtual bool absolutePosition(int &/*xPos*/, int &/*yPos*/, bool fixed = false);
 
     // width and height are without margins but include paddings and borders
-    virtual short width() const { return 0; }
+    virtual int width() const { return 0; }
     virtual int height() const { return 0; }
 
     // The height of a block when you include normal flow overflow spillage out of the bottom
@@ -516,7 +516,7 @@ public:
 
     // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (render_flow) 
     // to return the remaining width on a given line (and the height of a single line). -dwh
-    virtual short offsetWidth() const { return width(); }
+    virtual int offsetWidth() const { return width(); }
     virtual int offsetHeight() const { return height(); }
     
     // IE exxtensions.  Also supported by Gecko.  We override in render flow to get the
@@ -527,12 +527,12 @@ public:
 
     // More IE extensions.  clientWidth and clientHeight represent the interior of an object
     // excluding border and scrollbar.
-    short clientWidth() const;
+    int clientWidth() const;
     int clientHeight() const;
 
     // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
     // object has overflow:hidden/scroll/auto specified and also has overflow.
-    short scrollWidth() const;
+    int scrollWidth() const;
     int scrollHeight() const;
 
     // The following seven functions are used to implement collapsing margins.
@@ -595,8 +595,8 @@ public:
     virtual void addFocusRingRects(QPainter *painter, int _tx, int _ty);
 #endif
 
-    virtual short minWidth() const { return 0; }
-    virtual short maxWidth() const { return 0; }
+    virtual int minWidth() const { return 0; }
+    virtual int maxWidth() const { return 0; }
 
     RenderStyle* style() const { return m_style; }
     RenderStyle* style( bool firstLine ) const;
Index: khtml/rendering/render_replaced.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_replaced.h,v
retrieving revision 1.20
diff -u -p -r1.20 khtml/rendering/render_replaced.h
--- khtml/rendering/render_replaced.h	2004/02/11 19:52:38	1.20
+++ khtml/rendering/render_replaced.h	2004/02/26 01:18:25
@@ -44,7 +44,7 @@ public:
     bool shouldPaint(PaintInfo& i, int& _tx, int& _ty);
     virtual void paint(PaintInfo& i, int _tx, int _ty) = 0;
 
-    virtual short intrinsicWidth() const { return m_intrinsicWidth; }
+    virtual int intrinsicWidth() const { return m_intrinsicWidth; }
     virtual int intrinsicHeight() const { return m_intrinsicHeight; }
 
     void setIntrinsicWidth(int w) {  m_intrinsicWidth = w; }
@@ -56,8 +56,8 @@ public:
     virtual long caretMaxOffset() const;
 
 private:
-    short m_intrinsicWidth;
-    short m_intrinsicHeight;
+    int m_intrinsicWidth;
+    int m_intrinsicHeight;
 };
 
 
Index: khtml/rendering/render_table.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_table.cpp,v
retrieving revision 1.96
diff -u -p -r1.96 khtml/rendering/render_table.cpp
--- khtml/rendering/render_table.cpp	2004/02/23 23:33:52	1.96
+++ khtml/rendering/render_table.cpp	2004/02/26 01:18:28
@@ -209,13 +209,13 @@ void RenderTable::calcWidth()
             marginTotal += style()->marginRight().width(availableWidth);
             
         // Subtract out our margins to get the available content width.
-        int availContentWidth = KMAX(0, availableWidth - marginTotal);
+        int availContentWidth = kMax(0, availableWidth - marginTotal);
         
         // Ensure we aren't bigger than our max width or smaller than our min width.
-        m_width = KMIN(short(availContentWidth),m_maxWidth);
+        m_width = kMin(availContentWidth, m_maxWidth);
     }
     
-    m_width = KMAX(m_width, m_minWidth);
+    m_width = kMax(m_width, m_minWidth);
 
     // Finally, with our true width determined, compute our margins for real.
     m_marginRight = 0;
Index: khtml/rendering/render_table.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_table.h,v
retrieving revision 1.35
diff -u -p -r1.35 khtml/rendering/render_table.h
--- khtml/rendering/render_table.h	2004/02/23 23:33:52	1.35
+++ khtml/rendering/render_table.h	2004/02/26 01:18:28
@@ -131,7 +131,7 @@ public:
 	    width = WidthUndefined;
 	}
 	ushort span;
-	ushort width; // the calculated position of the column
+	uint width; // the calculated position of the column
     };
 
     QMemArray<int> columnPos;
Index: khtml/rendering/render_text.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_text.cpp,v
retrieving revision 1.110
diff -u -p -r1.110 khtml/rendering/render_text.cpp
--- khtml/rendering/render_text.cpp	2004/02/23 21:26:26	1.110
+++ khtml/rendering/render_text.cpp	2004/02/26 01:18:30
@@ -927,11 +927,11 @@ inline int RenderText::widthFromCache(co
 
 #endif
 
-void RenderText::trimmedMinMaxWidth(short& beginMinW, bool& beginWS, 
-                                    short& endMinW, bool& endWS,
+void RenderText::trimmedMinMaxWidth(int& beginMinW, bool& beginWS, 
+                                    int& endMinW, bool& endWS,
                                     bool& hasBreakableChar, bool& hasBreak,
-                                    short& beginMaxW, short& endMaxW,
-                                    short& minW, short& maxW, bool& stripFrontSpaces)
+                                    int& beginMaxW, int& endMaxW,
+                                    int& minW, int& maxW, bool& stripFrontSpaces)
 {
     bool isPre = style()->whiteSpace() == PRE;
     if (isPre)
@@ -1373,7 +1373,7 @@ unsigned int RenderText::width(unsigned 
     return w;
 }
 
-short RenderText::width() const
+int RenderText::width() const
 {
     int w;
     int minx = 100000000;
Index: khtml/rendering/render_text.h
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/render_text.h,v
retrieving revision 1.49
diff -u -p -r1.49 khtml/rendering/render_text.h
--- khtml/rendering/render_text.h	2004/02/23 21:26:26	1.49
+++ khtml/rendering/render_text.h	2004/02/26 01:18:30
@@ -157,7 +157,7 @@ public:
 
     virtual unsigned int width(unsigned int from, unsigned int len, const Font *f) const;
     virtual unsigned int width(unsigned int from, unsigned int len, bool firstLine = false) const;
-    virtual short width() const;
+    virtual int width() const;
     virtual int height() const;
 
     // height of the contents (without paddings, margins and borders)
@@ -166,13 +166,13 @@ public:
 
     // overrides
     virtual void calcMinMaxWidth();
-    virtual short minWidth() const { return m_minWidth; }
-    virtual short maxWidth() const { return m_maxWidth; }
-    virtual void trimmedMinMaxWidth(short& beginMinW, bool& beginWS, 
-                                    short& endMinW, bool& endWS,
+    virtual int minWidth() const { return m_minWidth; }
+    virtual int maxWidth() const { return m_maxWidth; }
+    virtual void trimmedMinMaxWidth(int& beginMinW, bool& beginWS, 
+                                    int& endMinW, bool& endWS,
                                     bool& hasBreakableChar, bool& hasBreak,
-                                    short& beginMaxW, short& endMaxW,
-                                    short& minW, short& maxW, bool& stripFrontSpaces);
+                                    int& beginMaxW, int& endMaxW,
+                                    int& minW, int& maxW, bool& stripFrontSpaces);
     
     bool containsOnlyWhitespace(unsigned int from, unsigned int len) const;
     
@@ -233,10 +233,10 @@ protected: // members
     InlineTextBox* m_firstTextBox;
     InlineTextBox* m_lastTextBox;
     
-    short m_minWidth;
-    short m_maxWidth;
-    short m_beginMinWidth;
-    short m_endMinWidth;
+    int m_minWidth;
+    int m_maxWidth;
+    int m_beginMinWidth;
+    int m_endMinWidth;
     
     SelectionState m_selectionState : 3 ;
     bool m_hasBreakableChar : 1; // Whether or not we can be broken into multiple lines.
Index: khtml/rendering/table_layout.cpp
===================================================================
RCS file: /local/home/cvs/Labyrinth/WebCore/khtml/rendering/table_layout.cpp,v
retrieving revision 1.17
diff -u -p -r1.17 khtml/rendering/table_layout.cpp
--- khtml/rendering/table_layout.cpp	2003/10/17 22:32:14	1.17
+++ khtml/rendering/table_layout.cpp	2004/02/26 01:18:32
@@ -52,7 +52,7 @@ using namespace khtml;
     1. A column element with a value other than 'auto' for the 'width'
     property sets the width for that column.
 
-    2.Otherwise, a cell in the first row with a value other than
+    2. Otherwise, a cell in the first row with a value other than
     'auto' for the 'width' property sets the width for that column. If
     the cell spans more than one column, the width is divided over the
     columns.
-------------- next part --------------





More information about the Khtml-devel mailing list