summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/RenderObject.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-06-08 08:26:01 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-08 08:26:01 -0700
commit3742ac093d35d923c81693096ab6671e9b147700 (patch)
treec2add9100f789dad45ef1ec5328bddde02c47a4c /Source/WebCore/rendering/RenderObject.h
parent901401d90459bc22580842455d4588b9a697514d (diff)
parente5926f4a0d6adc9ad4a75824129f117181953560 (diff)
downloadexternal_webkit-3742ac093d35d923c81693096ab6671e9b147700.zip
external_webkit-3742ac093d35d923c81693096ab6671e9b147700.tar.gz
external_webkit-3742ac093d35d923c81693096ab6671e9b147700.tar.bz2
Merge changes I55c6d71a,Ifb3277d4,Ia1b847a2,I7ba9cf3f,Ida2b2a8a,I1280ec90,I72f818d5,I2e3b588b,I9a4e6289,Ia724c78b,Icd8612c8,Ie31b15d7,Ie125edae,I77941a88,I89dae78b,I3516e5ca,I1a4c17b5,I2c4ecc1a,I9c8e6537,Ifac13115,Ie1f80e09,Ia541ed77,I60ce9d78
* changes: Merge WebKit at r82507: Update ThirdPartyProject.prop Merge WebKit at r82507: Cherry-pick change r88166 to add INSPECTOR guards to ScriptProfiler Merge WebKit at r82507: Work around a V8 bug Merge WebKit at r82507: JNIType renamed to JavaType Merge WebKit at r82507: IconDatabaseClient interface expanded Merge WebKit at r82507: Don't use new loss-free code path in HTMLCanvasElement::toDataURL() Merge WebKit at r82507: IcondDatabaseBase::iconForPageURL() renamed Merge WebKit at r82507: IconDatabaseBase::Open() signature changed Merge WebKit at r82507: Node::isContentEditable() renamed Merge WebKit at r82507: Use icon database through IconDatabaseBase Merge WebKit at r82507: toInputElement() is now a member of Node Merge WebKit at r82507: FrameLoaderClient::objectContentType() signature changed Merge WebKit at r82507: StringImpl::computeHash() removed Merge WebKit at r82507: Stub out FontPlatformData::setOrientation() Merge WebKit at r82507: Path::strokeBoundingRect() is now const Merge WebKit at r82507: Add missing UnusedParam.h include in ApplicationCacheGroup.cpp Merge WebKit at r82507: Continue to use Android's version of FontPlatformData.h Merge WebKit at r82507: Update signature of FontCustomPlatformData::fontPlatformData() Merge WebKit at r82507: Fix conflicts due to JNI refactoring Merge WebKit at r82507: Fix conflicts due to new StorageTracker Merge WebKit at r82507: Fix conflicts Merge WebKit at r82507: Fix makefiles Merge WebKit at r82507: Initial merge by git
Diffstat (limited to 'Source/WebCore/rendering/RenderObject.h')
-rw-r--r--Source/WebCore/rendering/RenderObject.h59
1 files changed, 41 insertions, 18 deletions
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index 8b9fa38..41564dd 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -320,8 +320,6 @@ public:
void setChildrenInline(bool b = true) { m_childrenInline = b; }
bool hasColumns() const { return m_hasColumns; }
void setHasColumns(bool b = true) { m_hasColumns = b; }
- bool cellWidthChanged() const { return m_cellWidthChanged; }
- void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
virtual bool requiresForcedStyleRecalcPropagation() const { return false; }
@@ -388,7 +386,11 @@ public:
void setIsAnonymous(bool b) { m_isAnonymous = b; }
bool isAnonymousBlock() const
{
- return m_isAnonymous && style()->display() == BLOCK && style()->styleType() == NOPSEUDO && !isListMarker();
+ // This function is kept in sync with anonymous block creation conditions in
+ // RenderBlock::createAnonymousBlock(). This includes creating an anonymous
+ // RenderBlock having a BLOCK or BOX display. Other classes such as RenderTextFragment
+ // are not RenderBlocks and will return false. See https://bugs.webkit.org/show_bug.cgi?id=56709.
+ return m_isAnonymous && (style()->display() == BLOCK || style()->display() == BOX) && style()->styleType() == NOPSEUDO && isRenderBlock() && !isListMarker();
}
bool isAnonymousColumnsBlock() const { return style()->specifiesColumns() && isAnonymousBlock(); }
bool isAnonymousColumnSpanBlock() const { return style()->columnSpan() && isAnonymousBlock(); }
@@ -406,17 +408,19 @@ public:
bool isRunIn() const { return style()->display() == RUN_IN; } // run-in object
bool isDragging() const { return m_isDragging; }
bool isReplaced() const { return m_replaced; } // a "replaced" element (see CSS)
-
+ bool isHorizontalWritingMode() const { return m_horizontalWritingMode; }
+
bool hasLayer() const { return m_hasLayer; }
bool hasBoxDecorations() const { return m_paintBackground; }
bool mustRepaintBackgroundOrBorder() const;
bool hasBackground() const { return style()->hasBackground(); }
- bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsPositionedMovementLayout; }
+ bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsSimplifiedNormalFlowLayout || m_needsPositionedMovementLayout; }
bool selfNeedsLayout() const { return m_needsLayout; }
bool needsPositionedMovementLayout() const { return m_needsPositionedMovementLayout; }
- bool needsPositionedMovementLayoutOnly() const { return m_needsPositionedMovementLayout && !m_needsLayout && !m_normalChildNeedsLayout && !m_posChildNeedsLayout; }
+ bool needsPositionedMovementLayoutOnly() const { return m_needsPositionedMovementLayout && !m_needsLayout && !m_normalChildNeedsLayout && !m_posChildNeedsLayout && !m_needsSimplifiedNormalFlowLayout; }
bool posChildNeedsLayout() const { return m_posChildNeedsLayout; }
+ bool needsSimplifiedNormalFlowLayout() const { return m_needsSimplifiedNormalFlowLayout; }
bool normalChildNeedsLayout() const { return m_normalChildNeedsLayout; }
bool preferredLogicalWidthsDirty() const { return m_preferredLogicalWidthsDirty; }
@@ -432,13 +436,13 @@ public:
void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
Color, EBorderStyle, int adjbw1, int adjbw2);
#if HAVE(PATH_BASED_BORDER_RADIUS_DRAWING)
- void drawBoxSideFromPath(GraphicsContext*, IntRect, Path,
+ void drawBoxSideFromPath(GraphicsContext*, const IntRect&, const Path&,
float thickness, float drawThickness, BoxSide, const RenderStyle*,
Color, EBorderStyle);
#else
// FIXME: This function should be removed when all ports implement GraphicsContext::clipConvexPolygon()!!
// At that time, everyone can use RenderObject::drawBoxSideFromPath() instead. This should happen soon.
- void drawArcForBoxSide(GraphicsContext*, int x, int y, float thickness, IntSize radius, int angleStart,
+ void drawArcForBoxSide(GraphicsContext*, int x, int y, float thickness, const IntSize& radius, int angleStart,
int angleSpan, BoxSide, Color, EBorderStyle, bool firstCorner);
#endif
@@ -485,6 +489,7 @@ public:
void setNeedsLayout(bool b, bool markParents = true);
void setChildNeedsLayout(bool b, bool markParents = true);
void setNeedsPositionedMovementLayout();
+ void setNeedsSimplifiedNormalFlowLayout();
void setPreferredLogicalWidthsDirty(bool, bool markParents = true);
void invalidateContainerPreferredLogicalWidths();
@@ -502,6 +507,7 @@ public:
void setIsText() { m_isText = true; }
void setIsBox() { m_isBox = true; }
void setReplaced(bool b = true) { m_replaced = b; }
+ void setHorizontalWritingMode(bool b = true) { m_horizontalWritingMode = 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; }
@@ -557,8 +563,8 @@ public:
// Convert the given local point to absolute coordinates
// FIXME: Temporary. If useTransforms is true, take transforms into account. Eventually localToAbsolute() will always be transform-aware.
- FloatPoint localToAbsolute(FloatPoint localPoint = FloatPoint(), bool fixed = false, bool useTransforms = false) const;
- FloatPoint absoluteToLocal(FloatPoint, bool fixed = false, bool useTransforms = false) const;
+ FloatPoint localToAbsolute(const FloatPoint& localPoint = FloatPoint(), bool fixed = false, bool useTransforms = false) const;
+ FloatPoint absoluteToLocal(const FloatPoint&, bool fixed = false, bool useTransforms = false) const;
// Convert a local quad to absolute coordinates, taking transforms into account.
FloatQuad localToAbsoluteQuad(const FloatQuad& quad, bool fixed = false) const
@@ -730,6 +736,8 @@ public:
virtual bool isFlexingChildren() const { return false; }
virtual bool isStretchingChildren() const { return false; }
+ virtual bool isCombineText() const { return false; }
+
virtual int caretMinOffset() const;
virtual int caretMaxOffset() const;
virtual unsigned caretMaxRenderedOffset() const;
@@ -840,6 +848,7 @@ private:
bool m_needsPositionedMovementLayout :1;
bool m_normalChildNeedsLayout : 1;
bool m_posChildNeedsLayout : 1;
+ bool m_needsSimplifiedNormalFlowLayout : 1;
bool m_preferredLogicalWidthsDirty : 1;
bool m_floating : 1;
@@ -853,6 +862,7 @@ private:
bool m_isBox : 1;
bool m_inline : 1;
bool m_replaced : 1;
+ bool m_horizontalWritingMode : 1;
bool m_isDragging : 1;
bool m_hasLayer : 1;
@@ -924,6 +934,7 @@ inline void RenderObject::setNeedsLayout(bool b, bool markParents)
} else {
m_everHadLayout = true;
m_posChildNeedsLayout = false;
+ m_needsSimplifiedNormalFlowLayout = false;
m_normalChildNeedsLayout = false;
m_needsPositionedMovementLayout = false;
}
@@ -939,6 +950,7 @@ inline void RenderObject::setChildNeedsLayout(bool b, bool markParents)
markContainingBlocksForLayout();
} else {
m_posChildNeedsLayout = false;
+ m_needsSimplifiedNormalFlowLayout = false;
m_normalChildNeedsLayout = false;
m_needsPositionedMovementLayout = false;
}
@@ -955,6 +967,17 @@ inline void RenderObject::setNeedsPositionedMovementLayout()
}
}
+inline void RenderObject::setNeedsSimplifiedNormalFlowLayout()
+{
+ bool alreadyNeededLayout = needsLayout();
+ m_needsSimplifiedNormalFlowLayout = true;
+ if (!alreadyNeededLayout) {
+ markContainingBlocksForLayout();
+ if (hasLayer())
+ setLayerNeedsFullRepaint();
+ }
+}
+
inline bool objectIsRelayoutBoundary(const RenderObject *obj)
{
// FIXME: In future it may be possible to broaden this condition in order to improve performance.
@@ -975,6 +998,8 @@ inline void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, R
RenderObject* o = container();
RenderObject* last = this;
+ bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && !selfNeedsLayout() && !normalChildNeedsLayout();
+
while (o) {
// Don't mark the outermost object of an unrooted subtree. That object will be
// marked when the subtree is added to the document.
@@ -982,17 +1007,15 @@ inline void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, R
if (!container && !o->isRenderView())
return;
if (!last->isText() && (last->style()->position() == FixedPosition || last->style()->position() == AbsolutePosition)) {
- if (last->style()->top().isAuto() && last->style()->bottom().isAuto()) {
- RenderObject* parent = last->parent();
- if (!parent->normalChildNeedsLayout()) {
- parent->setChildNeedsLayout(true, false);
- if (parent != newRoot)
- parent->markContainingBlocksForLayout(scheduleRelayout, newRoot);
- }
- }
if (o->m_posChildNeedsLayout)
return;
o->m_posChildNeedsLayout = true;
+ simplifiedNormalFlowLayout = true;
+ ASSERT(!o->isSetNeedsLayoutForbidden());
+ } else if (simplifiedNormalFlowLayout) {
+ if (o->m_needsSimplifiedNormalFlowLayout)
+ return;
+ o->m_needsSimplifiedNormalFlowLayout = true;
ASSERT(!o->isSetNeedsLayoutForbidden());
} else {
if (o->m_normalChildNeedsLayout)