render_object.h 21.4 KB
Newer Older
1
/*
kocienda's avatar
kocienda committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * This file is part of the html renderer for KDE.
 *
 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
 *           (C) 2000 Antti Koivisto (koivisto@kde.org)
 *           (C) 2000 Dirk Mueller (mueller@kde.org)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 */
#ifndef render_object_h
#define render_object_h

#include <qcolor.h>
#include <qrect.h>
29
#include <assert.h>
kocienda's avatar
kocienda committed
30
31
32

#include "misc/khtmllayout.h"
#include "misc/loader_client.h"
33
34
#include "misc/helper.h"
#include "rendering/render_style.h"
rjw's avatar
rjw committed
35
#include "khtml_events.h"
kocienda's avatar
kocienda committed
36
37

class QPainter;
38
class QTextStream;
kocienda's avatar
kocienda committed
39
40
class CSSStyle;
class KHTMLView;
41
class RenderArena;
kocienda's avatar
kocienda committed
42

43
44
45
46
#ifndef NDEBUG
#define KHTMLAssert( x ) if( !(x) ) { \
    const RenderObject *o = this; while( o->parent() ) o = o->parent(); \
    o->printTree(); \
darin's avatar
darin committed
47
    qDebug(" this object = %p", this ); \
48
49
50
51
52
53
    assert( false ); \
}
#else
#define KHTMLAssert( x )
#endif

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// The painting of a layer occurs in three distinct phases.  Each phase involves
// a recursive descent into the layer's render objects.

// The first phase is the background phase.  The backgrounds and borders of all blocks
// are painted.  Inlines are not painted at all.
#define BACKGROUND_PHASE			0 

// Floats must paint above block backgrounds but entirely below inline content that can
// overlap them.  
#define FLOAT_PHASE					1

// In the foreground phase, all inlines are fully painted.  Inline replaced elements will
// get all three phases invoked on them during this phase.
#define FOREGROUND_PHASE			2

kocienda's avatar
kocienda committed
69
namespace DOM {
70
    class HTMLAreaElementImpl;
kocienda's avatar
kocienda committed
71
72
    class DOMString;
    class NodeImpl;
73
74
    class ElementImpl;
    class EventImpl;
kocienda's avatar
kocienda committed
75
76
77
};

namespace khtml {
78
    class RenderFlow;
kocienda's avatar
kocienda committed
79
80
81
82
    class RenderStyle;
    class RenderTable;
    class CachedObject;
    class RenderRoot;
83
84
    class RenderText;
    class RenderFrameSet;
85
    class RenderLayer;
kocienda's avatar
kocienda committed
86
87
88
89
90
91
92
93

/**
 * Base Class for all rendering tree objects.
 */
class RenderObject : public CachedObjectClient
{
public:

94
    RenderObject(DOM::NodeImpl* node);
kocienda's avatar
kocienda committed
95
96
97
98
99
100
101
102
103
104
    virtual ~RenderObject();

    RenderObject *parent() const { return m_parent; }

    RenderObject *previousSibling() const { return m_previous; }
    RenderObject *nextSibling() const { return m_next; }

    virtual RenderObject *firstChild() const { return 0; }
    virtual RenderObject *lastChild() const { return 0; }

105
    virtual RenderLayer* layer() const { return 0; }
106
107
108
    RenderLayer* enclosingLayer();
    void appendLayers(RenderLayer* parentLayer);
    void removeLayers(RenderLayer* parentLayer);
109
110
111
    virtual void setHasChildLayers(bool hasLayers) { }
    virtual void positionChildLayers() { }
    
112
    virtual QRect getOverflowClipRect(int tx, int ty) { return QRect(0,0,0,0); }
113
    virtual QRect getClipRect(int tx, int ty) { return QRect(0,0,0,0); }
114
115
    bool hasClip() { return isPositioned() &&  style()->hasClip(); }
    bool hasOverflowClip() { return style()->overflow() == OHIDDEN; }
116
    
kocienda's avatar
kocienda committed
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
    // RenderObject tree manipulation
    //////////////////////////////////////////
    virtual void addChild(RenderObject *newChild, RenderObject *beforeChild = 0);
    virtual void removeChild(RenderObject *oldChild);

    // raw tree manipulation
    virtual RenderObject* removeChildNode(RenderObject* child);
    virtual void appendChildNode(RenderObject* child);
    virtual void insertChildNode(RenderObject* child, RenderObject* before);
    //////////////////////////////////////////

private:
    //////////////////////////////////////////
    // Helper functions. Dangerous to use!
    void setPreviousSibling(RenderObject *previous) { m_previous = previous; }
    void setNextSibling(RenderObject *next) { m_next = next; }
    void setParent(RenderObject *parent) { m_parent = parent; }
    //////////////////////////////////////////

public:
    virtual const char *renderName() const { return "RenderObject"; }
138
139
#ifndef NDEBUG
    QString information() const;
kocienda's avatar
kocienda committed
140
    virtual void printTree(int indent=0) const;
141
142
    virtual void dump(QTextStream *stream, QString ind = "") const;
#endif
kocienda's avatar
kocienda committed
143

144
    static RenderObject *createObject(DOM::NodeImpl* node, RenderStyle* style);
kocienda's avatar
kocienda committed
145

146
147
148
149
150
151
152
153
154
    // 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();    

    // Overridden to prevent the normal delete from being called.
    void operator delete(void* ptr, size_t sz);
        
private:
    // The normal operator new is disallowed on all render objects.
155
    void* operator new(size_t sz) throw();
156
157
158
159
    
public:
    RenderArena* renderArena();
    
kocienda's avatar
kocienda committed
160
161
    // some helper functions...
    virtual bool childrenInline() const { return false; }
162
    virtual void setChildrenInline(bool b) { };
kocienda's avatar
kocienda committed
163
164
    virtual bool isRendered() const { return false; }
    virtual bool isFlow() const { return false; }
165
166
    virtual RenderFlow* continuation() const { return 0; }
    
kocienda's avatar
kocienda committed
167
    virtual bool isListItem() const { return false; }
168
    virtual bool isListMarker() const { return false; }
kocienda's avatar
kocienda committed
169
170
171
172
173
174
175
176
177
178
    virtual bool isRoot() const { return false; }
    virtual bool isBR() const { return false; }
    virtual bool isHtml() const { return false; }
    virtual bool isTableCell() const { return false; }
    virtual bool isTableRow() const { return false; }
    virtual bool isTableSection() const { return false; }
    virtual bool isTable() const { return false; }
    virtual bool isWidget() const { return false; }
    virtual bool isBody() const { return false; }
    virtual bool isFormElement() const { return false; }
179
    virtual bool isImage() const { return false; }
180
    virtual bool isTextArea() const { return false; }
181
    virtual bool isFrameSet() const { return false; }
darin's avatar
darin committed
182
    virtual bool isApplet() const { return false; }
kocienda's avatar
kocienda committed
183
184
185
186
187
188
189

    bool isAnonymousBox() const { return m_isAnonymous; }
    void setIsAnonymousBox(bool b) { m_isAnonymous = b; }

    bool isFloating() const { return m_floating; }
    bool isPositioned() const { return m_positioned; } // absolute or fixed positioning
    bool isRelPositioned() const { return m_relPositioned; } // relative positioning
190
    bool isText() const  { return m_isText; }
kocienda's avatar
kocienda committed
191
    bool isInline() const { return m_inline; }  // inline object
192
    bool mouseInside() const;
kocienda's avatar
kocienda committed
193
    bool isReplaced() const { return m_replaced; } // a "replaced" element (see CSS)
194
    bool shouldPaintBackgroundOrBorder() const { return m_paintBackground; }
kocienda's avatar
kocienda committed
195
196
    bool layouted() const   { return m_layouted; }
    bool minMaxKnown() const{ return m_minMaxKnown; }
197
    bool overhangingContents() const { return m_overhangingContents; }
kocienda's avatar
kocienda committed
198
    bool hasFirstLine() const { return m_hasFirstLine; }
199
200
201
    bool isSelectionBorder() const { return m_isSelectionBorder; }
    bool recalcMinMax() const { return m_recalcMinMax; }

kocienda's avatar
kocienda committed
202
    RenderRoot* root() const;
203
204
205
206
    // don't even think about making this method virtual!
    DOM::NodeImpl* element() const { return m_node; }

   /**
kocienda's avatar
kocienda committed
207
208
209
210
211
     * returns the object containing this one. can be different from parent for
     * positioned elements
     */
    RenderObject *container() const;

212
    void setOverhangingContents(bool p=true);
hyatt's avatar
hyatt committed
213
    
214
    void setLayouted(bool b=true);
215
216
217
218
219
220
221
222
223
224
225
226
227

    void setMinMaxKnown(bool b=true) {
	m_minMaxKnown = b;
	if ( !b ) {
	    RenderObject *o = this;
	    RenderObject *root = this;
	    while( o ) { // ### && !o->m_recalcMinMax ) {
		o->m_recalcMinMax = true;
		root = o;
		o = o->m_parent;
	    }
	}
    }
kocienda's avatar
kocienda committed
228
229
230
231
    void setPositioned(bool b=true)  { m_positioned = b;  }
    void setRelPositioned(bool b=true) { m_relPositioned = b; }
    void setFloating(bool b=true) { m_floating = b; }
    void setInline(bool b=true) { m_inline = b; }
232
    void setMouseInside(bool b=true) { m_mouseInside = b; }
233
    void setShouldPaintBackgroundOrBorder(bool b=true) { m_paintBackground = b; }
kocienda's avatar
kocienda committed
234
235
    void setRenderText() { m_isText = true; }
    void setReplaced(bool b=true) { m_replaced = b; }
236
237
238
    void setIsSelectionBorder(bool b=true) { m_isSelectionBorder = b; }

    void scheduleRelayout();
kocienda's avatar
kocienda committed
239
240

    // for discussion of lineHeight see CSS2 spec
241
    virtual short lineHeight( bool firstLine ) const;
kocienda's avatar
kocienda committed
242
243
244
245
246
    // for the vertical-align property of inline elements
    // the difference between this objects baseline position and the lines baseline position.
    virtual short verticalPositionHint( bool firstLine ) const;
    // the offset of baseline from the top of the object.
    virtual short baselinePosition( bool firstLine ) const;
247

kocienda's avatar
kocienda committed
248
    /*
249
     * Paint the object and its children, clipped by (x|y|w|h).
kocienda's avatar
kocienda committed
250
251
     * (tx|ty) is the calculated position of the parent
     */
252
253
    virtual void paint(QPainter *p, int x, int y, int w, int h, int tx, int ty, 
                       int paintPhase);
kocienda's avatar
kocienda committed
254

255
256
257
258
259
    virtual void paintObject( QPainter */*p*/, int /*x*/, int /*y*/,
                              int /*w*/, int /*h*/, int /*tx*/, int /*ty*/,
                              int paintPhase /*paintPhase*/) {}
    void paintBorder(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style, bool begin=true, bool end=true);
    void paintOutline(QPainter *p, int _tx, int _ty, int w, int h, const RenderStyle* style);
kocienda's avatar
kocienda committed
260

261
262
263
    // RenderBox implements this.
    virtual void paintBoxDecorations(QPainter *p,int _x, int _y,
                                     int _w, int _h, int _tx, int _ty) {};
kocienda's avatar
kocienda committed
264
265
266
267
268
269
270
271
272
273
274
275

    /*
     * This function calculates the minimum & maximum width that the object
     * can be set to.
     *
     * when the Element calls setMinMaxKnown(true), calcMinMaxWidth() will
     * be no longer called.
     *
     * when a element has a fixed size, m_minWidth and m_maxWidth should be
     * set to the same value. This has the special meaning that m_width,
     * contains the actual value.
     *
276
     * assumes calcMinMaxWidth has already been called for all children.
kocienda's avatar
kocienda committed
277
278
279
     */
    virtual void calcMinMaxWidth() { }

280
281
282
283
284
    /*
     * Does the min max width recalculations after changes.
     */
    void recalcMinMaxWidths();

kocienda's avatar
kocienda committed
285
286
287
288
289
290
291
292
    /*
     * Calculates the actual width of the object (only for non inline
     * objects)
     */
    virtual void calcWidth() {}

    /*
     * This function should cause the Element to calculate its
darin's avatar
darin committed
293
     * width and height and the layout of its content
kocienda's avatar
kocienda committed
294
295
296
297
298
299
300
301
302
     *
     * when the Element calls setLayouted(true), layout() is no
     * longer called during relayouts, as long as there is no
     * style sheet change. When that occurs, isLayouted will be
     * set to false and the Element receives layout() calls
     * again.
     */
    virtual void layout() = 0;

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
    // used for element state updates that can not be fixed with a
    // repaint and do not need a relayout
    virtual void updateFromElement() {};

    // The corresponding closing element has been parsed. ### remove me
    virtual void close() { }

    // does a query on the rendertree and finds the innernode
    // and overURL for the given position
    // if readonly == false, it will recalc hover styles accordingly
    class NodeInfo
    {
        friend class RenderImage;
        friend class RenderFlow;
        friend class RenderText;
        friend class RenderObject;
        friend class RenderFrameSet;
        friend class DOM::HTMLAreaElementImpl;
    public:
        NodeInfo(bool readonly, bool active)
cblu's avatar
cblu committed
323
            : m_innerNode(0), m_innerNonSharedNode(0), m_innerURLElement(0), m_readonly(readonly), m_active(active)
324
325
326
            { }

        DOM::NodeImpl* innerNode() const { return m_innerNode; }
cblu's avatar
cblu committed
327
        DOM::NodeImpl* innerNonSharedNode() const { return m_innerNonSharedNode; }
328
329
330
331
332
333
        DOM::NodeImpl* URLElement() const { return m_innerURLElement; }
        bool readonly() const { return m_readonly; }
        bool active() const { return m_active; }

    private:
        void setInnerNode(DOM::NodeImpl* n) { m_innerNode = n; }
cblu's avatar
cblu committed
334
        void setInnerNonSharedNode(DOM::NodeImpl* n) { m_innerNonSharedNode = n; }
335
336
337
        void setURLElement(DOM::NodeImpl* n) { m_innerURLElement = n; }

        DOM::NodeImpl* m_innerNode;
cblu's avatar
cblu committed
338
        DOM::NodeImpl* m_innerNonSharedNode;
339
340
341
342
343
        DOM::NodeImpl* m_innerURLElement;
        bool m_readonly;
        bool m_active;
    };

rjw's avatar
rjw committed
344
    virtual FindSelectionResult checkSelectionPoint( const khtml::MouseEvent *event, int _tx, int _ty,
345
                                                     DOM::NodeImpl*&, int & offset );
346
    virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, bool inside=false);
347
348
    void setHoverAndActive(NodeInfo& info, bool oldinside, bool inside);
    
kocienda's avatar
kocienda committed
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
    // set the style of the object.
    virtual void setStyle(RenderStyle *style);

    // returns the containing block level element for this element.
    RenderObject *containingBlock() const;

    // return just the width of the containing block
    virtual short 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 contentHeight() const { return 0; }

    // intrinsic extend of replaced elements. undefined otherwise
    virtual short intrinsicWidth() const { return 0; }
    virtual int intrinsicHeight() const { return 0; }

    // relative to parent node
    virtual void setPos( int /*xPos*/, int /*yPos*/ ) { }
    virtual void setWidth( int /*width*/ ) { }
    virtual void setHeight( int /*height*/ ) { }

    virtual int xPos() const { return 0; }
    virtual int yPos() const { return 0; }

    // calculate client position of box
    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 height() const { return 0; }

383
384
385
386
    // The height 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() const { return height(); }
387
    virtual int overflowWidth() const { return width(); }
388
    
389
390
    // 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
391
392
393
    virtual short offsetWidth() const { return width(); }
    virtual int offsetHeight() const { return height(); }
    
394
395
396
397
398
    // IE exxtensions.  Also supported by Gecko.  We override in render flow to get the
    // left and top correct. -dwh
    virtual int offsetLeft() const;
    virtual int offsetTop() const;
    virtual RenderObject* offsetParent() const;
399
    
400
    // The following seven functions are used to implement collapsing margins.
401
402
403
404
405
    // All objects know their maximal positive and negative margins.  The
    // formula for computing a collapsed margin is |maxPosMargin|-|maxNegmargin|.
    // For a non-collapsing, e.g., a leaf element, this formula will simply return
    // the margin of the element.  Blocks override the maxTopMargin and maxBottomMargin
    // methods.
406
    virtual bool isSelfCollapsingBlock() const { return false; }
407
408
409
410
    virtual short collapsedMarginTop() const 
        { return maxTopMargin(true)-maxTopMargin(false); }
    virtual short collapsedMarginBottom() const 
        { return maxBottomMargin(true)-maxBottomMargin(false); }
411
412
    virtual bool isTopMarginQuirk() const { return false; }
    virtual bool isBottomMarginQuirk() const { return false; }
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
    virtual short maxTopMargin(bool positive) const {
        if (positive)
            if (marginTop() > 0)
                return marginTop();
            else
                return 0;
        else
            if (marginTop() < 0)
                return 0 - marginTop();
            else
                return 0;
    }
    virtual short maxBottomMargin(bool positive) const {
        if (positive)
            if (marginBottom() > 0)
                return marginBottom();
            else
                return 0;
        else
            if (marginBottom() < 0)
                return 0 - marginBottom();
            else
                return 0;
    }

kocienda's avatar
kocienda committed
438
439
440
441
442
    virtual short marginTop() const { return 0; }
    virtual short marginBottom() const { return 0; }
    virtual short marginLeft() const { return 0; }
    virtual short marginRight() const { return 0; }

443
444
445
446
447
448
449
    // Virtual since table cells override 
    virtual int paddingTop() const;
    virtual int paddingBottom() const;
    virtual int paddingLeft() const;
    virtual int paddingRight() const;
    virtual bool hasPadding() const { return style()->hasPadding(); }
    
450
451
452
453
    virtual int borderTop() const { return style()->borderTopWidth(); }
    virtual int borderBottom() const { return style()->borderBottomWidth(); }
    virtual int borderLeft() const { return style()->borderLeftWidth(); }
    virtual int borderRight() const { return style()->borderRightWidth(); }
kocienda's avatar
kocienda committed
454
455
456

    virtual short minWidth() const { return 0; }
    virtual short maxWidth() const { return 0; }
457
        
458
459
460
461
462
463
464
465
466
467
    RenderStyle* style() const { return m_style; }
    RenderStyle* style( bool firstLine ) const {
	RenderStyle *s = m_style;
	if( firstLine && hasFirstLine() ) {
	    RenderStyle *pseudoStyle  = style()->getPseudoStyle(RenderStyle::FIRST_LINE);
	    if ( pseudoStyle )
		s = pseudoStyle;
	}
	return s;
    }
kocienda's avatar
kocienda committed
468
469
470
471

    enum BorderSide {
        BSTop, BSBottom, BSLeft, BSRight
    };
472
473
    void drawBorder(QPainter *p, int x1, int y1, int x2, int y2, BorderSide s,
                    QColor c, const QColor& textcolor, EBorderStyle style,
kocienda's avatar
kocienda committed
474
475
476
477
                    int adjbw1, int adjbw2, bool invalidisInvert = false);

    virtual void setTable(RenderTable*) {};

478
    // force a complete repaint
479
480
    virtual void repaint(bool immediate = false) { if(m_parent) m_parent->repaint(immediate); }
    virtual void repaintRectangle(int x, int y, int w, int h, bool immediate = false, bool f=false);
kocienda's avatar
kocienda committed
481
482
483
484

    virtual unsigned int length() const { return 1; }

    virtual bool isHidden() const { return isFloating() || isPositioned(); }
485

kocienda's avatar
kocienda committed
486
487
488
489
490
491
    // Special objects are objects that are neither really inline nor blocklevel
    bool isSpecial() const { return (isFloating() || isPositioned()); };
    virtual bool containsSpecial() { return false; }
    virtual bool hasOverhangingFloats() { return false; }

    // positioning of inline childs (bidi)
darin's avatar
darin committed
492
    virtual void position(int, int, int, int, int, bool, bool, int) {}
kocienda's avatar
kocienda committed
493
494
495
496
497
498
499
500
501
502
503
504
505

    enum SelectionState {
        SelectionNone,
        SelectionStart,
        SelectionInside,
        SelectionEnd,
        SelectionBoth
    };

    virtual SelectionState selectionState() const { return SelectionNone;}
    virtual void setSelectionState(SelectionState) {}

    virtual void cursorPos(int /*offset*/, int &/*_x*/, int &/*_y*/, int &/*height*/);
506

kocienda's avatar
kocienda committed
507
    virtual int lowestPosition() const {return 0;}
508

kocienda's avatar
kocienda committed
509
    virtual int rightmostPosition() const {return 0;}
510

kocienda's avatar
kocienda committed
511
    // recursively invalidate current layout
512
513
    // unused: void invalidateLayout();

kocienda's avatar
kocienda committed
514
515
516
    virtual void calcVerticalMargins() {}
    void removeFromSpecialObjects();

517
    virtual void detach(RenderArena* renderArena);
kocienda's avatar
kocienda committed
518

519
520
521
522
523
524
525
    const QFont &font(bool firstLine) const {
	return style( firstLine )->font();
    }

    const QFontMetrics &fontMetrics(bool firstLine) const {
	return style( firstLine )->fontMetrics();
    }
kocienda's avatar
kocienda committed
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
protected:
    virtual void selectionStartEnd(int& spos, int& epos);

    virtual void printBoxDecorations(QPainter* /*p*/, int /*_x*/, int /*_y*/,
                                     int /*_w*/, int /*_h*/, int /*_tx*/, int /*_ty*/) {}

    virtual QRect viewRect() const;
    void remove() {
        removeFromSpecialObjects();

        if ( parent() )
            //have parent, take care of the tree integrity
            parent()->removeChild(this);
    }

    void invalidateVerticalPositions();
    short getVerticalPosition( bool firstLine ) const;

darin's avatar
darin committed
544
545
    virtual void removeLeftoverAnonymousBoxes();
    
kocienda's avatar
kocienda committed
546
private:
547
548
    RenderStyle* m_style;
    DOM::NodeImpl* m_node;
kocienda's avatar
kocienda committed
549
550
551
    RenderObject *m_parent;
    RenderObject *m_previous;
    RenderObject *m_next;
552

kocienda's avatar
kocienda committed
553
554
    short m_verticalPosition;

555
556
557
558
559
560
561
562
    bool m_layouted                  : 1;
    bool m_unused                   : 1;
    bool m_minMaxKnown               : 1;
    bool m_floating                  : 1;

    bool m_positioned                : 1;
    bool m_overhangingContents : 1;
    bool m_relPositioned             : 1;
563
564
    bool m_paintBackground           : 1; // if the box has something to paint in the
                                          // background painting phase (background, border, etc)
565
566
567
568
569
570
571
572
573
574

    bool m_isAnonymous               : 1;
    bool m_recalcMinMax 	     : 1;
    bool m_isText                    : 1;
    bool m_inline                    : 1;

    bool m_replaced                  : 1;
    bool m_mouseInside : 1;
    bool m_hasFirstLine              : 1;
    bool m_isSelectionBorder          : 1;
kocienda's avatar
kocienda committed
575

576
577
    // note: do not add unnecessary bitflags, we have 32 bit already!
    friend class RenderListItem;
kocienda's avatar
kocienda committed
578
579
580
581
582
583
584
585
586
587
588
589
590
    friend class RenderContainer;
    friend class RenderRoot;
};


enum VerticalPositionHint {
    PositionTop = -0x4000,
    PositionBottom = 0x4000,
    PositionUndefined = 0x3fff
};

}; //namespace
#endif