#ifndef RenderBox_h
#define RenderBox_h
#include "RenderBoxModelObject.h"
#include "RenderOverflow.h"
#include "ScrollTypes.h"
namespace WebCore {
class RenderBoxRegionInfo;
class RenderRegion;
struct PaintInfo;
enum LogicalWidthType { LogicalWidth, MinLogicalWidth, MaxLogicalWidth };
enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayScrollbarSize };
class RenderBox : public RenderBoxModelObject {
public:
RenderBox(Node*);
virtual ~RenderBox();
virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || isRelPositioned() || isTransparent() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasMask() || hasReflection() || hasFilter() || style()->specifiesColumns(); }
RenderBox* firstChildBox() const;
RenderBox* lastChildBox() const;
LayoutUnit x() const { return m_frameRect.x(); }
LayoutUnit y() const { return m_frameRect.y(); }
LayoutUnit width() const { return m_frameRect.width(); }
LayoutUnit height() const { return m_frameRect.height(); }
int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); }
int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); }
LayoutUnit top() const { return topLeftLocation().y(); }
LayoutUnit left() const { return topLeftLocation().x(); }
void setX(LayoutUnit x) { m_frameRect.setX(x); }
void setY(LayoutUnit y) { m_frameRect.setY(y); }
void setWidth(LayoutUnit width) { m_frameRect.setWidth(width); }
void setHeight(LayoutUnit height) { m_frameRect.setHeight(height); }
LayoutUnit logicalLeft() const { return style()->isHorizontalWritingMode() ? x() : y(); }
LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); }
LayoutUnit logicalTop() const { return style()->isHorizontalWritingMode() ? y() : x(); }
LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); }
LayoutUnit logicalWidth() const { return style()->isHorizontalWritingMode() ? width() : height(); }
LayoutUnit logicalHeight() const { return style()->isHorizontalWritingMode() ? height() : width(); }
void setLogicalLeft(LayoutUnit left)
{
if (style()->isHorizontalWritingMode())
setX(left);
else
setY(left);
}
void setLogicalTop(LayoutUnit top)
{
if (style()->isHorizontalWritingMode())
setY(top);
else
setX(top);
}
void setLogicalLocation(const LayoutPoint& location)
{
if (style()->isHorizontalWritingMode())
setLocation(location);
else
setLocation(location.transposedPoint());
}
void setLogicalWidth(LayoutUnit size)
{
if (style()->isHorizontalWritingMode())
setWidth(size);
else
setHeight(size);
}
void setLogicalHeight(LayoutUnit size)
{
if (style()->isHorizontalWritingMode())
setHeight(size);
else
setWidth(size);
}
void setLogicalSize(const LayoutSize& size)
{
if (style()->isHorizontalWritingMode())
setSize(size);
else
setSize(size.transposedSize());
}
LayoutPoint location() const { return m_frameRect.location(); }
LayoutSize locationOffset() const { return LayoutSize(x(), y()); }
LayoutSize size() const { return m_frameRect.size(); }
IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); }
void setLocation(const LayoutPoint& location) { m_frameRect.setLocation(location); }
void setSize(const LayoutSize& size) { m_frameRect.setSize(size); }
void move(LayoutUnit dx, LayoutUnit dy) { m_frameRect.move(dx, dy); }
LayoutRect frameRect() const { return m_frameRect; }
IntRect pixelSnappedFrameRect() const { return pixelSnappedIntRect(m_frameRect); }
void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; }
LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), m_frameRect.pixelSnappedSize()); }
virtual IntRect borderBoundingBox() const { return pixelSnappedBorderBoxRect(); }
LayoutRect contentBoxRect() const { return LayoutRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()); }
IntRect absoluteContentBox() const;
FloatQuad absoluteContentQuad() const;
LayoutRect computedCSSContentBoxRect() const { return LayoutRect(borderLeft() + computedCSSPaddingLeft(), borderTop() + computedCSSPaddingTop(), clientWidth() - computedCSSPaddingLeft() - computedCSSPaddingRight(), clientHeight() - computedCSSPaddingTop() - computedCSSPaddingBottom()); }
virtual LayoutRect outlineBoundsForRepaint(RenderBoxModelObject* , LayoutPoint* cachedOffsetToRepaintContainer) const;
virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint&);
RenderBox* previousSiblingBox() const;
RenderBox* nextSiblingBox() const;
RenderBox* parentBox() const;
LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : clientBoxRect(); }
IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect(layoutOverflowRect()); }
LayoutUnit minYLayoutOverflow() const { return m_overflow? m_overflow->minYLayoutOverflow() : static_cast<LayoutUnit>(borderTop()); }
LayoutUnit maxYLayoutOverflow() const { return m_overflow ? m_overflow->maxYLayoutOverflow() : static_cast<LayoutUnit>(borderTop()) + clientHeight(); }
LayoutUnit minXLayoutOverflow() const { return m_overflow ? m_overflow->minXLayoutOverflow() : static_cast<LayoutUnit>(borderLeft()); }
LayoutUnit maxXLayoutOverflow() const { return m_overflow ? m_overflow->maxXLayoutOverflow() : static_cast<LayoutUnit>(borderLeft()) + clientWidth(); }
LayoutSize maxLayoutOverflow() const { return LayoutSize(maxXLayoutOverflow(), maxYLayoutOverflow()); }
LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalWritingMode() ? minXLayoutOverflow() : minYLayoutOverflow(); }
LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontalWritingMode() ? maxXLayoutOverflow() : maxYLayoutOverflow(); }
virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); }
LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : ZERO_LAYOUT_UNIT; }
LayoutUnit maxYVisualOverflow() const { return m_overflow ? m_overflow->maxYVisualOverflow() : height(); }
LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : ZERO_LAYOUT_UNIT; }
LayoutUnit maxXVisualOverflow() const { return m_overflow ? m_overflow->maxXVisualOverflow() : width(); }
LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? minXVisualOverflow() : minYVisualOverflow(); }
LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontalWritingMode() ? maxXVisualOverflow() : maxYVisualOverflow(); }
void addLayoutOverflow(const LayoutRect&);
void addVisualOverflow(const LayoutRect&);
void addVisualEffectOverflow();
void addOverflowFromChild(RenderBox* child) { addOverflowFromChild(child, child->locationOffset()); }
void addOverflowFromChild(RenderBox* child, const LayoutSize& delta);
void clearLayoutOverflow();
void updateLayerTransform();
LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - paddingRight(); }
LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWritingMode() ? contentWidth() : contentHeight(); }
LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritingMode() ? contentHeight() : contentWidth(); }
virtual LayoutUnit offsetWidth() const { return width(); }
virtual LayoutUnit offsetHeight() const { return height(); }
virtual int pixelSnappedOffsetWidth() const { return pixelSnappedWidth(); }
virtual int pixelSnappedOffsetHeight() const { return pixelSnappedHeight(); }
LayoutUnit clientLeft() const { return borderLeft(); }
LayoutUnit clientTop() const { return borderTop(); }
LayoutUnit clientWidth() const;
LayoutUnit clientHeight() const;
LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientWidth() : pixelSnappedClientHeight(); }
LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientHeight() : pixelSnappedClientWidth(); }
LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
LayoutRect clientBoxRect() const { return LayoutRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }
int pixelSnappedClientWidth() const;
int pixelSnappedClientHeight() 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 LayoutUnit marginTop() const { return m_marginTop; }
virtual LayoutUnit marginBottom() const { return m_marginBottom; }
virtual LayoutUnit marginLeft() const { return m_marginLeft; }
virtual LayoutUnit marginRight() const { return m_marginRight; }
void setMarginTop(LayoutUnit margin) { m_marginTop = margin; }
void setMarginBottom(LayoutUnit margin) { m_marginBottom = margin; }
void setMarginLeft(LayoutUnit margin) { m_marginLeft = margin; }
void setMarginRight(LayoutUnit margin) { m_marginRight = margin; }
virtual LayoutUnit marginBefore() const;
virtual LayoutUnit marginAfter() const;
virtual LayoutUnit marginStart() const;
virtual LayoutUnit marginEnd() const;
void setMarginStart(LayoutUnit);
void setMarginEnd(LayoutUnit);
void setMarginBefore(LayoutUnit);
void setMarginAfter(LayoutUnit);
enum MarginSign { PositiveMargin, NegativeMargin };
virtual bool isSelfCollapsingBlock() const { return false; }
virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); }
virtual LayoutUnit collapsedMarginAfter() const { return marginAfter(); }
virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const;
virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
LayoutRect reflectionBox() const;
int reflectionOffset() const;
LayoutRect reflectedRect(const LayoutRect&) const;
virtual void layout();
virtual void paint(PaintInfo&, const LayoutPoint&);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
virtual LayoutUnit minPreferredLogicalWidth() const;
virtual LayoutUnit maxPreferredLogicalWidth() const;
LayoutUnit overrideWidth() const;
LayoutUnit overrideHeight() const;
bool hasOverrideHeight() const;
bool hasOverrideWidth() const;
void setOverrideHeight(LayoutUnit);
void setOverrideWidth(LayoutUnit);
void clearOverrideSize();
virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&) const;
LayoutUnit computeBorderBoxLogicalWidth(LayoutUnit width) const;
LayoutUnit computeBorderBoxLogicalHeight(LayoutUnit height) const;
LayoutUnit computeContentBoxLogicalWidth(LayoutUnit width) const;
LayoutUnit computeContentBoxLogicalHeight(LayoutUnit height) const;
virtual void borderFitAdjust(LayoutRect&) const { }
void computeInlineDirectionMargins(RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth);
void computeBlockDirectionMargins(RenderBlock* containingBlock);
enum RenderBoxRegionInfoFlags { CacheRenderBoxRegionInfo, DoNotCacheRenderBoxRegionInfo };
LayoutRect borderBoxRectInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage = 0, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const;
void clearRenderBoxRegionInfo();
void positionLineBox(InlineBox*);
virtual InlineBox* createInlineBox();
void dirtyLineBoxes(bool fullLayout);
InlineBox* inlineBoxWrapper() const { return m_inlineBoxWrapper; }
void setInlineBoxWrapper(InlineBox* boxWrapper) { m_inlineBoxWrapper = boxWrapper; }
void deleteLineBoxWrapper();
virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed = false) const;
virtual void repaintDuringLayoutIfMoved(const LayoutRect&);
virtual LayoutUnit containingBlockLogicalWidthForContent() const;
LayoutUnit containingBlockLogicalWidthForContentInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
LayoutUnit containingBlockAvailableLineWidthInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
LayoutUnit perpendicularContainingBlockLogicalHeight() const;
virtual void computeLogicalWidth();
virtual void computeLogicalHeight();
RenderBoxRegionInfo* renderBoxRegionInfo(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const;
void computeLogicalWidthInRegion(RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = ZERO_LAYOUT_UNIT);
bool stretchesToViewport() const
{
return document()->inQuirksMode() && style()->logicalHeight().isAuto() && !isFloatingOrPositioned() && (isRoot() || isBody());
}
virtual IntSize intrinsicSize() const { return IntSize(); }
LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); }
LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); }
bool sizesToIntrinsicLogicalWidth(LogicalWidthType) const;
virtual bool stretchesToMinIntrinsicLogicalWidth() const { return false; }
LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock* cb, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage);
LayoutUnit computeLogicalWidthInRegionUsing(LogicalWidthType, LayoutUnit availableLogicalWidth, const RenderBlock* containingBlock, RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage);
LayoutUnit computeLogicalHeightUsing(const Length& height);
LayoutUnit computeContentLogicalHeightUsing(const Length& height);
LayoutUnit computeReplacedLogicalWidthUsing(Length width) const;
LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, bool includeMaxWidth = true) const;
LayoutUnit computeReplacedLogicalHeightUsing(Length height) const;
LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const;
virtual LayoutUnit computeReplacedLogicalWidth(bool includeMaxWidth = true) const;
virtual LayoutUnit computeReplacedLogicalHeight() const;
LayoutUnit computePercentageLogicalHeight(const Length& height);
virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); }
LayoutUnit availableLogicalHeight() const;
LayoutUnit availableLogicalHeightUsing(const Length&) const;
LayoutUnit availableWidth() const { return style()->isHorizontalWritingMode() ? availableLogicalWidth() : availableLogicalHeight(); }
LayoutUnit availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight() : availableLogicalWidth(); }
virtual int verticalScrollbarWidth() const;
int horizontalScrollbarHeight() const;
int scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
bool canBeScrolledAndHasScrollableArea() const;
virtual bool canBeProgramaticallyScrolled() const;
virtual void autoscroll();
virtual void stopAutoscroll() { }
virtual void panScroll(const IntPoint&);
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()); }
bool hasUnsplittableScrollingOverflow() const;
bool isUnsplittableForPagination() const;
virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0);
virtual LayoutRect overflowClipRect(const LayoutPoint& location, RenderRegion*, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
LayoutRect clipRect(const LayoutPoint& location, RenderRegion*);
virtual bool hasControlClip() const { return false; }
virtual LayoutRect controlClipRect(const LayoutPoint&) const { return LayoutRect(); }
bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset);
void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint& accumulatedOffset);
virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHED(); }
virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
virtual void paintMask(PaintInfo&, const LayoutPoint&);
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
bool tryLayoutDoingPositionedMovementOnly()
{
LayoutUnit oldWidth = width();
computeLogicalWidth();
if (oldWidth != width())
return false;
computeLogicalHeight();
return true;
}
LayoutRect maskClipRect();
virtual VisiblePosition positionForPoint(const LayoutPoint&);
void removeFloatingOrPositionedChildFromBlockLists();
RenderLayer* enclosingFloatPaintingLayer() const;
virtual LayoutUnit firstLineBoxBaseline() const { return -1; }
virtual LayoutUnit lastLineBoxBaseline() const { return -1; }
bool shrinkToAvoidFloats() const;
virtual bool avoidsFloats() const;
virtual void markForPaginationRelayoutIfNeeded() { }
bool isWritingModeRoot() const { return !parent() || parent()->style()->writingMode() != style()->writingMode(); }
bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); }
virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutPoint&) const;
LayoutUnit flipForWritingMode(LayoutUnit position) const; LayoutPoint flipForWritingMode(const LayoutPoint&) const;
LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const;
LayoutSize flipForWritingMode(const LayoutSize&) const;
void flipForWritingMode(LayoutRect&) const;
FloatPoint flipForWritingMode(const FloatPoint&) const;
void flipForWritingMode(FloatRect&) const;
LayoutPoint topLeftLocation() const;
LayoutSize topLeftLocationOffset() const;
LayoutRect logicalVisualOverflowRectForPropagation(RenderStyle*) const;
LayoutRect visualOverflowRectForPropagation(RenderStyle*) const;
LayoutRect logicalLayoutOverflowRectForPropagation(RenderStyle*) const;
LayoutRect layoutOverflowRectForPropagation(RenderStyle*) const;
RenderOverflow* hasRenderOverflow() const { return m_overflow.get(); }
bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().contains(m_overflow->visualOverflowRect()); }
virtual bool needsPreferredWidthsRecalculation() const;
virtual void computeIntrinsicRatioInformation(FloatSize& , double& , bool& ) const { }
IntSize scrolledContentOffset() const;
LayoutSize cachedSizeForOverflowClip() const;
virtual bool hasRelativeDimensions() const;
virtual bool hasRelativeLogicalHeight() const;
bool hasHorizontalLayoutOverflow() const
{
if (RenderOverflow* overflow = hasRenderOverflow()) {
LayoutRect layoutOverflowRect = overflow->layoutOverflowRect();
flipForWritingMode(layoutOverflowRect);
return layoutOverflowRect.x() < x() || layoutOverflowRect.maxX() > x() + logicalWidth();
}
return false;
}
bool hasVerticalLayoutOverflow() const
{
if (RenderOverflow* overflow = hasRenderOverflow()) {
LayoutRect layoutOverflowRect = overflow->layoutOverflowRect();
flipForWritingMode(layoutOverflowRect);
return layoutOverflowRect.y() < y() || layoutOverflowRect.maxY() > y() + logicalHeight();
}
return false;
}
virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject*) const
{
ASSERT_NOT_REACHED();
return 0;
}
protected:
virtual void willBeDestroyed();
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
virtual void updateBoxModelInfoFromStyle();
virtual bool backgroundIsObscured() const { return false; }
void paintBackground(const PaintInfo&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
void paintMaskImages(const PaintInfo&, const LayoutRect&);
BackgroundBleedAvoidance determineBackgroundBleedAvoidance(GraphicsContext*) const;
#if PLATFORM(MAC)
void paintCustomHighlight(const LayoutPoint&, const AtomicString& type, bool behindText);
#endif
void computePositionedLogicalWidth(RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = 0);
virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
void paintRootBoxFillLayers(const PaintInfo&);
void moveChildTo(RenderBox* toBox, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert = false);
void moveChildTo(RenderBox* to, RenderObject* child, bool fullRemoveInsert = false)
{
moveChildTo(to, child, 0, fullRemoveInsert);
}
void moveAllChildrenTo(RenderBox* toBox, bool fullRemoveInsert = false)
{
moveAllChildrenTo(toBox, 0, fullRemoveInsert);
}
void moveAllChildrenTo(RenderBox* toBox, RenderObject* beforeChild, bool fullRemoveInsert = false)
{
moveChildrenTo(toBox, firstChild(), 0, beforeChild, fullRemoveInsert);
}
void moveChildrenTo(RenderBox* toBox, RenderObject* startChild, RenderObject* endChild, bool fullRemoveInsert = false)
{
moveChildrenTo(toBox, startChild, endChild, 0, fullRemoveInsert);
}
void moveChildrenTo(RenderBox* toBox, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert = false);
RenderObject* splitAnonymousBoxesAroundChild(RenderObject* beforeChild);
private:
bool fixedElementLaysOutRelativeToFrame(Frame*, FrameView*) const;
bool includeVerticalScrollbarSize() const;
bool includeHorizontalScrollbarSize() const;
bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layers, bool drawingBackground);
LayoutUnit containingBlockLogicalWidthForPositioned(const RenderBoxModelObject* containingBlock, RenderRegion* = 0,
LayoutUnit offsetFromLogicalTopOfFirstPage = 0, bool checkForPerpendicularWritingMode = true) const;
LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode = true) const;
void computePositionedLogicalHeight();
void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos);
void computePositionedLogicalHeightUsing(Length logicalHeight, const RenderBoxModelObject* containerBlock,
LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
LayoutUnit& logicalHeightValue, LayoutUnit& marginLogicalTopValue, LayoutUnit& marginLogicalBottomValue, LayoutUnit& logicalTopPos);
void computePositionedLogicalHeightReplaced();
void computePositionedLogicalWidthReplaced();
virtual void computePreferredLogicalWidths() { setPreferredLogicalWidthsDirty(false); }
private:
LayoutRect m_frameRect;
protected:
LayoutUnit m_marginLeft;
LayoutUnit m_marginRight;
LayoutUnit m_marginTop;
LayoutUnit m_marginBottom;
LayoutUnit m_minPreferredLogicalWidth;
LayoutUnit m_maxPreferredLogicalWidth;
InlineBox* m_inlineBoxWrapper;
OwnPtr<RenderOverflow> m_overflow;
private:
static bool s_hadOverflowClip;
};
inline RenderBox* toRenderBox(RenderObject* object)
{
ASSERT(!object || object->isBox());
return static_cast<RenderBox*>(object);
}
inline const RenderBox* toRenderBox(const RenderObject* object)
{
ASSERT(!object || object->isBox());
return static_cast<const RenderBox*>(object);
}
void toRenderBox(const RenderBox*);
inline RenderBox* RenderBox::previousSiblingBox() const
{
return toRenderBox(previousSibling());
}
inline RenderBox* RenderBox::nextSiblingBox() const
{
return toRenderBox(nextSibling());
}
inline RenderBox* RenderBox::parentBox() const
{
return toRenderBox(parent());
}
inline RenderBox* RenderBox::firstChildBox() const
{
return toRenderBox(firstChild());
}
inline RenderBox* RenderBox::lastChildBox() const
{
return toRenderBox(lastChild());
}
}
#endif // RenderBox_h