summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/InlineFlowBox.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/rendering/InlineFlowBox.h
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/InlineFlowBox.h')
-rw-r--r--Source/WebCore/rendering/InlineFlowBox.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/Source/WebCore/rendering/InlineFlowBox.h b/Source/WebCore/rendering/InlineFlowBox.h
index 36d48dc87..d3fdd5ec8 100644
--- a/Source/WebCore/rendering/InlineFlowBox.h
+++ b/Source/WebCore/rendering/InlineFlowBox.h
@@ -80,7 +80,7 @@ public:
InlineBox* firstChild() const { checkConsistency(); return m_firstChild; }
InlineBox* lastChild() const { checkConsistency(); return m_lastChild; }
- virtual bool isLeaf() const { return false; }
+ virtual bool isLeaf() const FINAL { return false; }
InlineBox* firstLeafChild() const;
InlineBox* lastLeafChild() const;
@@ -88,7 +88,7 @@ public:
typedef void (*CustomInlineBoxRangeReverse)(void* userData, Vector<InlineBox*>::iterator first, Vector<InlineBox*>::iterator last);
void collectLeafBoxesInLogicalOrder(Vector<InlineBox*>&, CustomInlineBoxRangeReverse customReverseImplementation = 0, void* userData = 0) const;
- virtual void setConstructed()
+ virtual void setConstructed() FINAL
{
InlineBox::setConstructed();
for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
@@ -96,9 +96,9 @@ public:
}
void addToLine(InlineBox* child);
- virtual void deleteLine(RenderArena*);
- virtual void extractLine();
- virtual void attachLine();
+ virtual void deleteLine(RenderArena*) FINAL;
+ virtual void extractLine() FINAL;
+ virtual void attachLine() FINAL;
virtual void adjustPosition(float dx, float dy);
virtual void extractLineBoxFromRenderObject();
@@ -109,8 +109,8 @@ public:
IntRect roundedFrameRect() const;
- virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
- virtual void paintMask(PaintInfo&, const LayoutPoint&);
+ virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&) FINAL;
+ virtual void paintMask(PaintInfo&, const LayoutPoint&) FINAL;
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(const PaintInfo&, RenderStyle*, ShadowStyle, const LayoutRect&);
@@ -173,6 +173,15 @@ public:
void determineSpacingForFlowBoxes(bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer);
LayoutUnit getFlowSpacingLogicalWidth();
float placeBoxesInInlineDirection(float logicalLeft, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
+ float placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastChild, float& logicalLeft, float& minLogicalLeft, float& maxLogicalRight, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
+ void beginPlacingBoxRangesInInlineDirection(float logicalLeft) { setLogicalLeft(logicalLeft); }
+ void endPlacingBoxRangesInInlineDirection(float logicalLeft, float logicalRight, float minLogicalLeft, float maxLogicalRight)
+ {
+ setLogicalWidth(logicalRight - logicalLeft);
+ if (knownToHaveNoOverflow() && (minLogicalLeft < logicalLeft || maxLogicalRight > logicalRight))
+ clearKnownToHaveNoOverflow();
+ }
+
void computeLogicalBoxHeights(RootInlineBox*, LayoutUnit& maxPositionTop, LayoutUnit& maxPositionBottom,
int& maxAscent, int& maxDescent, bool& setMaxAscent, bool& setMaxDescent,
bool strictMode, GlyphOverflowAndFallbackFontsMap&, FontBaseline, VerticalPositionCache&);
@@ -192,7 +201,7 @@ public:
virtual RenderObject::SelectionState selectionState();
- virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth) const OVERRIDE;
+ virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth) const OVERRIDE FINAL;
virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, float &truncatedWidth, bool&) OVERRIDE;
bool hasTextChildren() const { return m_hasTextChildren; }
@@ -210,16 +219,6 @@ public:
{
return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom));
}
- LayoutUnit logicalLeftLayoutOverflow() const
- {
- return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().x() : m_overflow->layoutOverflowRect().y()) :
- static_cast<LayoutUnit>(logicalLeft());
- }
- LayoutUnit logicalRightLayoutOverflow() const
- {
- return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().maxX() : m_overflow->layoutOverflowRect().maxY()) :
- static_cast<LayoutUnit>(ceilf(logicalRight()));
- }
LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const
{
if (m_overflow)
@@ -300,7 +299,7 @@ private:
protected:
OwnPtr<RenderOverflow> m_overflow;
- virtual bool isInlineFlowBox() const { return true; }
+ virtual bool isInlineFlowBox() const FINAL { return true; }
InlineBox* m_firstChild;
InlineBox* m_lastChild;
@@ -308,6 +307,11 @@ protected:
InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
+#if ENABLE(CSS3_TEXT)
+ // Maximum logicalTop among all children of an InlineFlowBox. Used to
+ // calculate the offset for TextUnderlinePositionUnder.
+ void computeMaxLogicalTop(float& maxLogicalTop) const;
+#endif // CSS3_TEXT
private:
unsigned m_includeLogicalLeftEdge : 1;
unsigned m_includeLogicalRightEdge : 1;
@@ -339,13 +343,13 @@ private:
inline InlineFlowBox* toInlineFlowBox(InlineBox* object)
{
- ASSERT(!object || object->isInlineFlowBox());
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isInlineFlowBox());
return static_cast<InlineFlowBox*>(object);
}
inline const InlineFlowBox* toInlineFlowBox(const InlineBox* object)
{
- ASSERT(!object || object->isInlineFlowBox());
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isInlineFlowBox());
return static_cast<const InlineFlowBox*>(object);
}