#ifndef RenderObject_h
#define RenderObject_h
#include "CachedResourceClient.h"
#include "Document.h"
#include "Element.h"
#include "RenderStyle.h"
#include "ScrollTypes.h"
#include "VisiblePosition.h"
#include <wtf/HashMap.h>
namespace WebCore {
class AffineTransform;
class AnimationController;
class Color;
class Document;
class Element;
class Event;
class FloatRect;
class FloatQuad;
class FrameView;
class HTMLAreaElement;
class HitTestResult;
class InlineBox;
class InlineFlowBox;
class PlatformScrollbar;
class Position;
class RenderArena;
class RenderBlock;
class RenderFlow;
class RenderFrameSet;
class RenderLayer;
class RenderTable;
class RenderText;
class RenderView;
class String;
class TextStream;
struct HitTestRequest;
enum PaintPhase {
PaintPhaseBlockBackground,
PaintPhaseChildBlockBackground,
PaintPhaseChildBlockBackgrounds,
PaintPhaseFloat,
PaintPhaseForeground,
PaintPhaseOutline,
PaintPhaseChildOutlines,
PaintPhaseSelfOutline,
PaintPhaseSelection,
PaintPhaseCollapsedTableBorders
};
enum PaintRestriction {
PaintRestrictionNone,
PaintRestrictionSelectionOnly,
PaintRestrictionSelectionOnlyBlackText
};
enum HitTestFilter {
HitTestAll,
HitTestSelf,
HitTestDescendants
};
enum HitTestAction {
HitTestBlockBackground,
HitTestChildBlockBackground,
HitTestChildBlockBackgrounds,
HitTestFloat,
HitTestForeground
};
enum VerticalPositionHint {
PositionTop = -0x2000,
PositionBottom = 0x2000,
PositionUndefined = 0x1fff
};
#if ENABLE(DASHBOARD_SUPPORT)
struct DashboardRegionValue {
bool operator==(const DashboardRegionValue& o) const
{
return type == o.type && bounds == o.bounds && label == o.label;
}
String label;
IntRect bounds;
IntRect clip;
int type;
};
#endif
typedef HashSet<RenderFlow*> RenderFlowSequencedSet;
class RenderObject : public CachedResourceClient {
friend class RenderContainer;
friend class RenderSVGContainer;
public:
RenderObject(Node*);
virtual ~RenderObject();
virtual const char* renderName() const { return "RenderObject"; }
RenderObject* parent() const { return m_parent; }
bool isDescendantOf(const RenderObject*) const;
RenderObject* previousSibling() const { return m_previous; }
RenderObject* nextSibling() const { return m_next; }
virtual RenderObject* firstChild() const { return 0; }
virtual RenderObject* lastChild() const { return 0; }
RenderObject* nextInPreOrder() const;
RenderObject* nextInPreOrder(RenderObject* stayWithin) const;
RenderObject* nextInPreOrderAfterChildren() const;
RenderObject* nextInPreOrderAfterChildren(RenderObject* stayWithin) const;
RenderObject* previousInPreOrder() const;
RenderObject* childAt(unsigned) const;
RenderObject* firstLeafChild() const;
RenderObject* lastLeafChild() const;
RenderObject *traverseNext(const RenderObject *stayWithin) const;
typedef bool (*TraverseNextInclusionFunction)(const RenderObject *);
RenderObject *traverseNext(const RenderObject *stayWithin, TraverseNextInclusionFunction inclusionFunction) const;
void adjustComputedFontSizesOnBlocks(float size, float visibleWidth);
virtual RenderLayer* layer() const { return 0; }
RenderLayer* enclosingLayer() const;
void addLayers(RenderLayer* parentLayer, RenderObject* newObject);
void removeLayers(RenderLayer* parentLayer);
void moveLayers(RenderLayer* oldParent, RenderLayer* newParent);
RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint, bool checkParent = true);
virtual void positionChildLayers() { }
virtual bool requiresLayer() const;
virtual IntRect getOverflowClipRect(int , int ) { return IntRect(0, 0, 0, 0); }
virtual IntRect getClipRect(int , int ) { return IntRect(0, 0, 0, 0); }
bool hasClip() { return isPositioned() && style()->hasClip(); }
virtual int getBaselineOfFirstLineBox() const { return -1; }
virtual int getBaselineOfLastLineBox() const { return -1; }
virtual bool isEmpty() const { return firstChild() == 0; }
virtual bool isEdited() const { return false; }
virtual void setEdited(bool) { }
virtual RenderBlock* firstLineBlock() const;
void handleDynamicFloatPositionChange();
RenderBlock* createAnonymousBlock();
bool hasStaticX() const;
bool hasStaticY() const;
virtual void setStaticX(int ) { }
virtual void setStaticY(int ) { }
virtual int staticX() const { return 0; }
virtual int staticY() const { return 0; }
virtual bool canHaveChildren() const;
virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { return true; }
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0);
virtual void removeChild(RenderObject*);
virtual bool createsAnonymousWrapper() const { return false; }
virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true);
virtual void appendChildNode(RenderObject*, bool fullAppend = true);
virtual void insertChildNode(RenderObject* child, RenderObject* before, bool fullInsert = true);
virtual void moveChildNode(RenderObject*);
protected:
void setPreviousSibling(RenderObject* previous) { m_previous = previous; }
void setNextSibling(RenderObject* next) { m_next = next; }
void setParent(RenderObject* parent) { m_parent = parent; }
private:
void addAbsoluteRectForLayer(IntRect& result);
public:
#ifndef NDEBUG
DeprecatedString information() const;
virtual void dump(TextStream*, DeprecatedString ind = "") const;
void showTreeForThis() const;
#endif
static RenderObject* createObject(Node*, RenderStyle*);
void* operator new(size_t, RenderArena*) throw();
void operator delete(void*, size_t);
private:
void* operator new(size_t) throw();
public:
RenderArena* renderArena() const { return document()->renderArena(); }
virtual bool isRenderBlock() const { return false; }
virtual bool isRenderInline() const { return false; }
virtual bool isInlineFlow() const { return false; }
virtual bool isBlockFlow() const { return false; }
virtual bool isInlineBlockOrInlineTable() const { return false; }
virtual bool isInlineContinuation() const;
virtual bool isListItem() const { return false; }
virtual bool isListMarker() const { return false; }
virtual bool isCounter() const { return false; }
virtual bool isRenderView() const { return false; }
virtual bool isBR() const { return false; }
virtual bool isTableCell() const { return false; }
virtual bool isTableRow() const { return false; }
virtual bool isTableSection() const { return false; }
virtual bool isTableCol() const { return false; }
virtual bool isTable() const { return false; }
virtual bool isWidget() const { return false; }
virtual bool isImage() const { return false; }
virtual bool isTextArea() const { return false; }
virtual bool isTextField() const { return false; }
virtual bool isFrame() const { return false; }
virtual bool isFrameSet() const { return false; }
virtual bool isApplet() const { return false; }
virtual bool isMenuList() const { return false; }
virtual bool isListBox() const { return false; }
virtual bool isSlider() const { return false; }
virtual bool isMedia() const { return false; }
virtual bool isVideo() const { return false; }
bool isRoot() const { return document()->documentElement() == node(); }
bool isBody() const;
bool isHR() const;
bool isHTMLMarquee() const;
virtual bool childrenInline() const { return false; }
virtual void setChildrenInline(bool) { }
virtual RenderFlow* continuation() const;
#if ENABLE(SVG)
virtual bool isSVGRoot() const { return false; }
virtual bool isSVGContainer() const { return false; }
virtual bool isSVGHiddenContainer() const { return false; }
virtual bool isRenderPath() const { return false; }
virtual bool isSVGText() const { return false; }
virtual FloatRect relativeBBox(bool includeStroke = true) const;
virtual AffineTransform localTransform() const;
virtual AffineTransform absoluteTransform() const;
#endif
virtual bool isEditable() const;
bool isAnonymous() const { return m_isAnonymous; }
void setIsAnonymous(bool b) { m_isAnonymous = b; }
bool isAnonymousBlock() const
{
return m_isAnonymous && style()->display() == BLOCK && style()->styleType() == RenderStyle::NOPSEUDO && !isListMarker();
}
bool isFloating() const { return m_floating; }
bool isPositioned() const { return m_positioned; } bool isRelPositioned() const { return m_relPositioned; } bool isText() const { return m_isText; }
bool isInline() const { return m_inline; } bool isCompact() const { return style()->display() == COMPACT; } bool isRunIn() const { return style()->display() == RUN_IN; } bool isDragging() const { return m_isDragging; }
bool isReplaced() const { return m_replaced; }
bool hasLayer() const { return m_hasLayer; }
bool hasBoxDecorations() const { return m_paintBackground; }
bool mustRepaintBackgroundOrBorder() const;
bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout; }
bool selfNeedsLayout() const { return m_needsLayout; }
bool posChildNeedsLayout() const { return m_posChildNeedsLayout; }
bool normalChildNeedsLayout() const { return m_normalChildNeedsLayout; }
bool prefWidthsDirty() const { return m_prefWidthsDirty; }
bool isSelectionBorder() const;
bool hasOverflowClip() const { return m_hasOverflowClip; }
virtual bool hasControlClip() const { return false; }
virtual IntRect controlClipRect(int , int ) const { return IntRect(); }
bool hasAutoVerticalScrollbar() const { return hasOverflowClip() && (style()->overflowY() == OAUTO || style()->overflowY() == OOVERLAY); }
bool hasAutoHorizontalScrollbar() const { return hasOverflowClip() && (style()->overflowX() == OAUTO || style()->overflowX() == OOVERLAY); }
bool scrollsOverflow() const { return scrollsOverflowX() || scrollsOverflowY(); }
bool scrollsOverflowX() const { return hasOverflowClip() && (style()->overflowX() == OSCROLL || hasAutoHorizontalScrollbar()); }
bool scrollsOverflowY() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || hasAutoVerticalScrollbar()); }
virtual int verticalScrollbarWidth() const;
virtual int horizontalScrollbarHeight() const;
bool hasTransform() const { return m_hasTransform; }
bool hasTransformOrPerspective() const { return style()->hasTransformOrPerspective(); }
private:
bool includeVerticalScrollbarSize() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || style()->overflowY() == OAUTO); }
bool includeHorizontalScrollbarSize() const { return hasOverflowClip() && (style()->overflowX() == OSCROLL || style()->overflowX() == OAUTO); }
public:
RenderStyle* getPseudoStyle(RenderStyle::PseudoId, RenderStyle* parentStyle = 0) const;
void updateDragState(bool dragOn);
RenderView* view() const;
Node* element() const { return m_isAnonymous ? 0 : m_node; }
Document* document() const { return m_node->document(); }
void setNode(Node* node) { m_node = node; }
Node* node() const { return m_node; }
bool hasOutlineAnnotation() const;
bool hasOutline() const { return style()->hasOutline() || hasOutlineAnnotation(); }
RenderObject* container() const;
RenderObject* hoverAncestor() const;
virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0);
void setNeedsLayout(bool b, bool markParents = true);
void setChildNeedsLayout(bool b, bool markParents = true);
void setPrefWidthsDirty(bool, bool markParents = true);
void invalidateContainerPrefWidths();
void setNeedsLayoutAndPrefWidthsRecalc()
{
setNeedsLayout(true);
setPrefWidthsDirty(true);
}
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; }
void setHasBoxDecorations(bool b = true) { m_paintBackground = b; }
void setRenderText() { m_isText = true; }
void setReplaced(bool b = true) { m_replaced = b; }
void setHasOverflowClip(bool b = true) { m_hasOverflowClip = b; }
void setHasLayer(bool b = true) { m_hasLayer = b; }
void setHasTransform(bool b = true) { m_hasTransform = b; }
void scheduleRelayout();
#if ENABLE(HW_COMP)
void scheduleLayerUpdate();
virtual void compositingStateChanged() { }
#endif
void updateBackgroundImages(RenderStyle* oldStyle);
virtual InlineBox* createInlineBox(bool makePlaceHolderBox, bool isRootLineBox, bool isOnlyRun = false);
virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false);
virtual InlineBox* inlineBoxWrapper() const;
virtual void setInlineBoxWrapper(InlineBox*);
virtual void deleteLineBoxWrapper();
virtual InlineBox* inlineBox(int offset = 0, EAffinity = UPSTREAM);
virtual short lineHeight(bool firstLine, bool isRootLineBox = false) const;
virtual short verticalPositionHint(bool firstLine) const;
virtual short baselinePosition(bool firstLine, bool isRootLineBox = false) const;
virtual short innerLineHeight() const;
struct PaintInfo {
PaintInfo(GraphicsContext* newContext, const IntRect& newRect, PaintPhase newPhase, bool newForceBlackText,
RenderObject* newPaintingRoot, RenderFlowSequencedSet* newOutlineObjects)
: context(newContext)
, rect(newRect)
, phase(newPhase)
, forceBlackText(newForceBlackText)
, paintingRoot(newPaintingRoot)
, outlineObjects(newOutlineObjects)
{
}
GraphicsContext* context;
IntRect rect;
PaintPhase phase;
bool forceBlackText;
RenderObject* paintingRoot; RenderFlowSequencedSet* outlineObjects; };
virtual void paint(PaintInfo&, int tx, int ty);
void paintBorder(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
bool paintBorderImage(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*);
void paintOutline(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*);
void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, bool begin = true, bool end = true);
virtual void paintBoxDecorations(PaintInfo&, int tx, int ty) { }
virtual void paintBackgroundExtended(GraphicsContext*, const Color&, const BackgroundLayer*,
int clipy, int cliph, int tx, int ty, int width, int height,
bool includeLeftEdge = true, bool includeRightEdge = true) { }
virtual void calcWidth() { }
virtual void layout() = 0;
void layoutIfNeeded() { if (needsLayout()) layout(); }
virtual void updateFromElement() { }
virtual int availableWidth() const { return contentWidth(); }
virtual int availableHeight() const { return 0; }
virtual void updateWidgetPosition();
#if ENABLE(DASHBOARD_SUPPORT)
void addDashboardRegions(Vector<DashboardRegionValue>&);
void collectDashboardRegions(Vector<DashboardRegionValue>&);
#endif
struct RepaintInfo {
RepaintInfo(RenderObject* object = 0, const IntRect& repaintRect = IntRect())
: m_object(object)
, m_repaintRect(repaintRect)
{
}
RenderObject* m_object;
IntRect m_repaintRect;
};
bool hitTest(const HitTestRequest&, HitTestResult&, const IntPoint&, int tx, int ty, HitTestFilter = HitTestAll);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
void updateHitTestResult(HitTestResult&, const IntPoint&);
virtual VisiblePosition positionForCoordinates(int x, int y);
VisiblePosition positionForPoint(const IntPoint& point) { return positionForCoordinates(point.x(), point.y()); }
virtual void dirtyLinesFromChangedChild(RenderObject*);
void setAnimatableStyle(RenderStyle*);
bool startAnimation(double beginTime, int index);
bool startTransition(double beginTime, int property, RenderStyle* fromStyle, RenderStyle* toStyle);
void setAnimationStartTime(double t);
void setTransitionStartTime(int property, double t);
void animationFinished(const String& name, int index, bool reset);
void transitionFinished(int property);
void removeAllAnimations();
void suspendAnimations();
void resumeAnimations();
FloatPoint convertToPage(const FloatPoint& inPoint);
FloatPoint convertFromPage(const FloatPoint& inPoint);
FloatQuad convertRectToPageQuad(const FloatRect& inRect, int tx, int tx);
virtual void setStyle(RenderStyle*);
void setStyleInternal(RenderStyle*);
RenderBlock* containingBlock() const;
virtual int containingBlockWidth() const;
virtual int containingBlockHeight() const;
IntRect contentBox() const;
IntRect absoluteContentBox() const;
int contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
int contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
virtual int overrideSize() const { return 0; }
virtual int overrideWidth() const { return 0; }
virtual int overrideHeight() const { return 0; }
virtual void setOverrideSize(int ) { }
virtual void setPos(int , int ) { }
virtual void setWidth(int ) { }
virtual void setHeight(int ) { }
virtual int xPos() const { return 0; }
virtual int yPos() const { return 0; }
virtual bool absolutePosition(int& x, int& y, bool fixed = false) const;
void absolutePositionForContent(int& xPos, int& yPos, bool fixed = false) const
{
absolutePosition(xPos, yPos, fixed);
yPos += borderTopExtra();
}
#if ENABLE(HW_COMP)
void absolutePositionForContentWithTransforms(int& xPos, int& yPos, bool fixed = false);
#endif
virtual int width() const { return 0; }
virtual int height() const { return 0; }
virtual IntRect borderBox() const { return IntRect(0, 0, width(), height()); }
IntRect absoluteOutlineBox() const;
virtual int overflowHeight(bool = true) const { return height(); }
virtual int overflowWidth(bool = true) const { return width(); }
virtual void setOverflowHeight(int) { }
virtual void setOverflowWidth(int) { }
virtual int overflowLeft(bool = true) const { return 0; }
virtual int overflowTop(bool = true) const { return 0; }
virtual IntRect overflowRect(bool = true) const { return borderBox(); }
virtual int offsetWidth() const { return width(); }
virtual int offsetHeight() const { return height() + borderTopExtra() + borderBottomExtra(); }
virtual int offsetLeft() const;
virtual int offsetTop() const;
virtual RenderObject* offsetParent() const;
int clientLeft() const { return borderLeft(); }
int clientTop() const { return borderTop(); }
int clientWidth() const;
int clientHeight() const;
virtual int scrollLeft() const;
virtual int scrollTop() const;
virtual int scrollWidth() const;
virtual int scrollHeight() const;
virtual void setScrollLeft(int);
virtual void setScrollTop(int);
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
virtual bool shouldAutoscroll() const;
virtual void autoscroll();
virtual void stopAutoscroll() { }
virtual bool isScrollable() const;
virtual bool isSelfCollapsingBlock() const { return false; }
virtual int collapsedMarginTop() const { return maxTopMargin(true) - maxTopMargin(false); }
virtual int collapsedMarginBottom() const { return maxBottomMargin(true) - maxBottomMargin(false); }
virtual bool isTopMarginQuirk() const { return false; }
virtual bool isBottomMarginQuirk() const { return false; }
virtual int maxTopMargin(bool positive) const;
virtual int maxBottomMargin(bool positive) const;
virtual int marginTop() const { return 0; }
virtual int marginBottom() const { return 0; }
virtual int marginLeft() const { return 0; }
virtual int marginRight() const { return 0; }
virtual int paddingTop() const;
virtual int paddingBottom() const;
virtual int paddingLeft() const;
virtual int paddingRight() const;
virtual int borderTop() const { return style()->borderTopWidth(); }
virtual int borderBottom() const { return style()->borderBottomWidth(); }
virtual int borderTopExtra() const { return 0; }
virtual int borderBottomExtra() const { return 0; }
virtual int borderLeft() const { return style()->borderLeftWidth(); }
virtual int borderRight() const { return style()->borderRightWidth(); }
virtual void addLineBoxRects(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);
IntRect absoluteBoundingBoxRect();
virtual void addLineBoxQuads(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false);
virtual void absoluteQuads(Vector<FloatQuad>&, int tx, int ty, bool topLevel = true);
FloatQuad absoluteQuadWithTransforms();
IntRect paintingRootRect(IntRect& topLevelRect);
void addPDFURLRect(GraphicsContext*, IntRect);
virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
virtual int minPrefWidth() const { return 0; }
virtual int maxPrefWidth() const { return 0; }
RenderStyle* style() const { return m_style; }
RenderStyle* firstLineStyle() const;
RenderStyle* style(bool firstLine) const { return firstLine ? firstLineStyle() : style(); }
void getTextDecorationColors(int decorations, Color& underline, Color& overline,
Color& linethrough, bool quirksMode = false);
enum BorderSide {
BSTop,
BSBottom,
BSLeft,
BSRight
};
void drawBorderArc(GraphicsContext*, int x, int y, float thickness, IntSize radius, int angleStart,
int angleSpan, BorderSide, Color, const Color& textcolor, EBorderStyle, bool firstCorner);
void drawBorder(GraphicsContext*, int x1, int y1, int x2, int y2, BorderSide,
Color, const Color& textcolor, EBorderStyle, int adjbw1, int adjbw2);
void repaint(bool immediate = false);
void repaintRectangle(const IntRect&, bool immediate = false);
#if ENABLE(HW_COMP)
void repaintAbsoluteRectangle(const IntRect&, bool immediate = false);
#endif
bool repaintAfterLayoutIfNeeded(const IntRect& oldBounds, const IntRect& oldOutlineBox);
virtual void repaintDuringLayoutIfMoved(const IntRect& rect);
virtual void repaintOverhangingFloats(bool paintAllDescendants = false);
bool checkForRepaintDuringLayout() const;
virtual IntRect absoluteClippedOverflowRect();
IntRect getAbsoluteRepaintRectWithOutline(int ow);
virtual void computeAbsoluteRepaintRect(IntRect&, bool fixed = false);
virtual unsigned int length() const { return 1; }
bool isFloatingOrPositioned() const { return (isFloating() || isPositioned()); }
virtual bool containsFloats() { return false; }
virtual bool containsFloat(RenderObject*) { return false; }
virtual bool hasOverhangingFloats() { return false; }
virtual bool expandsToEncloseOverhangingFloats() const { return isFloating() && style()->height().isAuto(); }
virtual void removePositionedObjects(RenderBlock*) { }
virtual bool avoidsFloats() const;
bool shrinkToAvoidFloats() const;
virtual void position(InlineBox*) { }
bool isTransparent() const { return style()->opacity() < 1.0f; }
float opacity() const { return style()->opacity(); }
int maximalOutlineSize(PaintPhase) const;
enum SelectionState {
SelectionNone, SelectionStart, SelectionInside, SelectionEnd, SelectionBoth };
virtual SelectionState selectionState() const { return SelectionNone; }
virtual void setSelectionState(SelectionState state) { if (parent()) parent()->setSelectionState(state); }
virtual IntRect selectionRect(bool) { return IntRect(); }
virtual bool canBeSelectionLeaf() const { return false; }
virtual bool hasSelectedChildren() const { return false; }
Color selectionBackgroundColor() const;
Color selectionForegroundColor() const;
virtual bool shouldPaintSelectionGaps() const { return false; }
struct SelectionInfo {
SelectionInfo()
: m_object(0)
, m_state(SelectionNone)
{
}
SelectionInfo(RenderObject* o, bool clipToVisibleContent)
: m_object(o)
, m_rect(o->needsLayout() ? IntRect() : o->selectionRect(clipToVisibleContent))
, m_state(o->selectionState())
{
}
RenderObject* object() const { return m_object; }
IntRect rect() const { return m_rect; }
SelectionState state() const { return m_state; }
RenderObject* m_object;
IntRect m_rect;
SelectionState m_state;
};
Node* draggableNode(bool dhtmlOK, bool uaOK, int x, int y, bool& dhtmlWillDrag) const;
virtual IntRect caretRect(int offset, EAffinity = UPSTREAM, int* extraWidthToEndOfLine = 0);
FloatQuad absoluteCaretQuad(int offset, EAffinity = UPSTREAM, int* extraWidthToEndOfLine = 0);
virtual int lowestPosition(bool = true, bool = true) const { return 0; }
virtual int rightmostPosition(bool = true, bool = true) const { return 0; }
virtual int leftmostPosition(bool = true, bool = true) const { return 0; }
virtual void calcVerticalMargins() { }
void removeFromObjectLists();
bool documentBeingDestroyed() const;
virtual void destroy();
virtual bool isFlexibleBox() const { return false; }
virtual bool isFlexingChildren() const { return false; }
virtual bool isStretchingChildren() const { return false; }
UChar backslashAsCurrencySymbol() const;
virtual int caretMinOffset() const;
virtual int caretMaxOffset() const;
virtual unsigned caretMaxRenderedOffset() const;
virtual int previousOffset(int current) const;
virtual int nextOffset(int current) const;
virtual void imageChanged(CachedImage*) { }
virtual bool willRenderImage(CachedImage*);
virtual void selectionStartEnd(int& spos, int& epos) const;
RenderObject* paintingRootForChildren(PaintInfo& paintInfo) const
{
return (!paintInfo.paintingRoot || paintInfo.paintingRoot == this) ? 0 : paintInfo.paintingRoot;
}
bool shouldPaintWithinRoot(PaintInfo& paintInfo) const
{
return !paintInfo.paintingRoot || paintInfo.paintingRoot == this;
}
bool hasOverrideSize() const { return m_hasOverrideSize; }
void setHasOverrideSize(bool b) { m_hasOverrideSize = b; }
void remove() { if (parent()) parent()->removeChild(this); }
void invalidateVerticalPosition() { m_verticalPosition = PositionUndefined; }
virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
virtual void capsLockStateMayHaveChanged() { }
AnimationController* animationController() const;
protected:
virtual void printBoxDecorations(GraphicsContext*, int , int , int , int , int , int ) { }
virtual IntRect viewRect() const;
short getVerticalPosition(bool firstLine) const;
void adjustRectForOutlineAndShadow(IntRect&) const;
void arenaDelete(RenderArena*, void* objectBase);
private:
RenderStyle* m_style;
Node* m_node;
RenderObject* m_parent;
RenderObject* m_previous;
RenderObject* m_next;
mutable short m_verticalPosition : 15;
bool m_needsLayout : 1;
bool m_normalChildNeedsLayout : 1;
bool m_posChildNeedsLayout : 1;
bool m_prefWidthsDirty : 1;
bool m_floating : 1;
bool m_positioned : 1;
bool m_relPositioned : 1;
bool m_paintBackground : 1;
bool m_isAnonymous : 1;
bool m_isText : 1;
bool m_inline : 1;
bool m_replaced : 1;
bool m_isDragging : 1;
bool m_hasLayer : 1;
bool m_hasOverflowClip : 1;
bool m_hasTransform : 1;
bool m_hasOverrideSize : 1;
public:
bool m_hasCounterNodeMap : 1;
};
}
#ifndef NDEBUG
void showTree(const WebCore::RenderObject*);
#endif
#endif // RenderObject_h