diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/rendering/RenderObject.h | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/rendering/RenderObject.h')
-rw-r--r-- | Source/WebCore/rendering/RenderObject.h | 70 |
1 files changed, 54 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h index 60e2a403c..a4a0596fb 100644 --- a/Source/WebCore/rendering/RenderObject.h +++ b/Source/WebCore/rendering/RenderObject.h @@ -29,16 +29,19 @@ #include "CachedImage.h" #include "Document.h" #include "Element.h" +#include "FractionalLayoutUnit.h" #include "FloatQuad.h" #include "LayoutTypes.h" #include "PaintPhase.h" #include "RenderObjectChildList.h" #include "RenderStyle.h" +#include "ScrollBehavior.h" #include "TextAffinity.h" #include "TransformationMatrix.h" +#include <wtf/HashSet.h> #include <wtf/UnusedParam.h> -#if USE(CG) || USE(CAIRO) || USE(SKIA) || PLATFORM(QT) +#if USE(CG) || USE(CAIRO) || USE(SKIA) || PLATFORM(QT) || PLATFORM(WX) #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING 1 #endif @@ -96,6 +99,11 @@ enum BoxSide { BSLeft }; +enum MarkingBehavior { + MarkOnlyThis, + MarkContainingBlockChain, +}; + const int caretWidth = 1; #if ENABLE(DASHBOARD_SUPPORT) @@ -116,6 +124,8 @@ struct DashboardRegionValue { }; #endif +typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet; + #ifndef NDEBUG const int showTreeCharacterOffset = 39; #endif @@ -195,6 +205,9 @@ public: void moveLayers(RenderLayer* oldParent, RenderLayer* newParent); RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint, bool checkParent = true); + // Scrolling is a RenderBox concept, however some code just cares about recursively scrolling our enclosing ScrollableArea(s). + bool scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded); + // Convenience function for getting to the nearest enclosing box of a RenderObject. RenderBox* enclosingBox() const; RenderBoxModelObject* enclosingBoxModelObject() const; @@ -220,8 +233,6 @@ public: // normal flow object. void handleDynamicFloatPositionChange(); - RenderTable* createAnonymousTable() const; - // RenderObject tree manipulation ////////////////////////////////////////// virtual bool canHaveChildren() const { return virtualChildren(); } @@ -343,6 +354,7 @@ public: #endif virtual bool isRenderFlowThread() const { return false; } + virtual bool isRenderNamedFlowThread() const { return false; } bool canHaveRegionStyle() const { return isRenderBlock() && !isAnonymous() && !isRenderFlowThread(); } bool isRoot() const { return document()->documentElement() == m_node; } @@ -370,6 +382,22 @@ public: bool hasColumns() const { return m_bitfields.hasColumns(); } void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } + bool ancestorLineBoxDirty() const { return s_ancestorLineboxDirtySet && s_ancestorLineboxDirtySet->contains(this); } + void setAncestorLineBoxDirty(bool b = true) + { + if (b) { + if (!s_ancestorLineboxDirtySet) + s_ancestorLineboxDirtySet = new RenderObjectAncestorLineboxDirtySet; + s_ancestorLineboxDirtySet->add(this); + } else if (s_ancestorLineboxDirtySet) { + s_ancestorLineboxDirtySet->remove(this); + if (s_ancestorLineboxDirtySet->isEmpty()) { + delete s_ancestorLineboxDirtySet; + s_ancestorLineboxDirtySet = 0; + } + } + } + bool inRenderFlowThread() const { return m_bitfields.inRenderFlowThread(); } void setInRenderFlowThread(bool b = true) { m_bitfields.setInRenderFlowThread(b); } @@ -502,6 +530,7 @@ public: bool hasTransform() const { return m_bitfields.hasTransform(); } bool hasMask() const { return style() && style()->hasMask(); } + bool hasHiddenBackface() const { return style() && style()->backfaceVisibility() == BackfaceVisibilityHidden; } #if ENABLE(CSS_FILTERS) bool hasFilter() const { return style() && style()->hasFilter(); } @@ -556,11 +585,11 @@ public: RenderBoxModelObject* offsetParent() const; void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderObject* newRoot = 0); - void setNeedsLayout(bool b, bool markParents = true); - void setChildNeedsLayout(bool b, bool markParents = true); + void setNeedsLayout(bool needsLayout, MarkingBehavior = MarkContainingBlockChain); + void setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior = MarkContainingBlockChain); void setNeedsPositionedMovementLayout(); void setNeedsSimplifiedNormalFlowLayout(); - void setPreferredLogicalWidthsDirty(bool, bool markParents = true); + void setPreferredLogicalWidthsDirty(bool, MarkingBehavior = MarkContainingBlockChain); void invalidateContainerPreferredLogicalWidths(); void setNeedsLayoutAndPrefWidthsRecalc() @@ -605,6 +634,8 @@ public: void collectDashboardRegions(Vector<DashboardRegionValue>&); #endif + bool isComposited() const; + bool hitTest(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTestAll); virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); @@ -716,6 +747,7 @@ public: { return clippedOverflowRectForRepaint(0); } + IntRect pixelSnappedAbsoluteClippedOverflowRect() const; virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; virtual LayoutRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const; @@ -744,7 +776,7 @@ public: bool hasReflection() const { return m_bitfields.hasReflection(); } // Applied as a "slop" to dirty rect checks during the outline painting phase's dirty-rect checks. - LayoutUnit maximalOutlineSize(PaintPhase) const; + int maximalOutlineSize(PaintPhase) const; enum SelectionState { SelectionNone, // The object is not selected. @@ -833,7 +865,8 @@ public: // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use // localToAbsolute/absoluteToLocal methods instead. - virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const; + enum ApplyContainerFlipOrNot { DoNotApplyContainerFlip, ApplyContainerFlip }; + virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, ApplyContainerFlipOrNot = ApplyContainerFlip, bool* wasFixed = 0) const; virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const; bool shouldUseTransformFromContainer(const RenderObject* container) const; @@ -849,6 +882,8 @@ public: // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isRoot() is true. RenderObject* rendererForRootBackground(); + RespectImageOrientationEnum shouldRespectImageOrientation() const; + protected: inline bool layerCreationAllowedForSubtree() const; @@ -889,6 +924,8 @@ private: RenderObject* m_previous; RenderObject* m_next; + static RenderObjectAncestorLineboxDirtySet* s_ancestorLineboxDirtySet; + #ifndef NDEBUG bool m_hasAXObject : 1; bool m_setNeedsLayoutForbidden : 1; @@ -1031,14 +1068,14 @@ inline bool RenderObject::isBeforeOrAfterContent() const return isBeforeContent() || isAfterContent(); } -inline void RenderObject::setNeedsLayout(bool b, bool markParents) +inline void RenderObject::setNeedsLayout(bool needsLayout, MarkingBehavior markParents) { bool alreadyNeededLayout = m_bitfields.needsLayout(); - m_bitfields.setNeedsLayout(b); - if (b) { + m_bitfields.setNeedsLayout(needsLayout); + if (needsLayout) { ASSERT(!isSetNeedsLayoutForbidden()); if (!alreadyNeededLayout) { - if (markParents) + if (markParents == MarkContainingBlockChain) markContainingBlocksForLayout(); if (hasLayer()) setLayerNeedsFullRepaint(); @@ -1049,16 +1086,17 @@ inline void RenderObject::setNeedsLayout(bool b, bool markParents) setNeedsSimplifiedNormalFlowLayout(false); setNormalChildNeedsLayout(false); setNeedsPositionedMovementLayout(false); + setAncestorLineBoxDirty(false); } } -inline void RenderObject::setChildNeedsLayout(bool b, bool markParents) +inline void RenderObject::setChildNeedsLayout(bool childNeedsLayout, MarkingBehavior markParents) { bool alreadyNeededLayout = normalChildNeedsLayout(); - setNormalChildNeedsLayout(b); - if (b) { + setNormalChildNeedsLayout(childNeedsLayout); + if (childNeedsLayout) { ASSERT(!isSetNeedsLayoutForbidden()); - if (!alreadyNeededLayout && markParents) + if (!alreadyNeededLayout && markParents == MarkContainingBlockChain) markContainingBlocksForLayout(); } else { setPosChildNeedsLayout(false); |