Commit 9f47d581 authored by hyatt@apple.com's avatar hyatt@apple.com
Browse files

https://bugs.webkit.org/show_bug.cgi?id=36069

        
Reviewed by Dan Bernstein.

Eliminate InlineRunBox.

* WebCore.xcodeproj/project.pbxproj:
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::adjustPosition):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
(WebCore::InlineFlowBox::prevLineBox):
(WebCore::InlineFlowBox::nextLineBox):
(WebCore::InlineFlowBox::setNextLineBox):
(WebCore::InlineFlowBox::setPreviousLineBox):
* rendering/InlineRunBox.h: Removed.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::InlineTextBox):
(WebCore::InlineTextBox::prevTextBox):
(WebCore::InlineTextBox::nextTextBox):
(WebCore::InlineTextBox::setNextTextBox):
(WebCore::InlineTextBox::setPreviousTextBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::destroy):
(WebCore::RenderBlock::rightmostPosition):
(WebCore::RenderBlock::leftmostPosition):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::destroy):
(WebCore::RenderInline::absoluteRects):
(WebCore::RenderInline::absoluteQuads):
(WebCore::RenderInline::linesBoundingBox):
(WebCore::RenderInline::linesVisibleOverflowBoundingBox):
(WebCore::RenderInline::addFocusRingRects):
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::localBoundingBox):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::deleteLineBoxTree):
(WebCore::RenderLineBoxList::extractLineBox):
(WebCore::RenderLineBoxList::attachLineBox):
(WebCore::RenderLineBoxList::removeLineBox):
(WebCore::RenderLineBoxList::deleteLineBoxes):
(WebCore::RenderLineBoxList::dirtyLineBoxes):
(WebCore::RenderLineBoxList::paint):
(WebCore::RenderLineBoxList::hitTest):
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
(WebCore::RenderLineBoxList::checkConsistency):
* rendering/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::absoluteRects):
(WebCore::RenderSVGInline::absoluteQuads):
* rendering/RenderSVGText.cpp:
(WebCore::RenderSVGText::absoluteRects):
(WebCore::RenderSVGText::absoluteQuads):
(WebCore::RenderSVGText::objectBoundingBox):
* rendering/RenderText.cpp:
(WebCore::RenderText::extractTextBox):
(WebCore::RenderText::attachTextBox):
(WebCore::RenderText::removeTextBox):
(WebCore::RenderText::createInlineTextBox):
(WebCore::RenderText::positionLineBox):
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::nextRootBox):
(WebCore::RootInlineBox::prevRootBox):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent df1a34bb
2010-03-12 David Hyatt <hyatt@apple.com>
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=36069
Eliminate InlineRunBox.
* WebCore.xcodeproj/project.pbxproj:
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::adjustPosition):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
(WebCore::InlineFlowBox::prevLineBox):
(WebCore::InlineFlowBox::nextLineBox):
(WebCore::InlineFlowBox::setNextLineBox):
(WebCore::InlineFlowBox::setPreviousLineBox):
* rendering/InlineRunBox.h: Removed.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::InlineTextBox):
(WebCore::InlineTextBox::prevTextBox):
(WebCore::InlineTextBox::nextTextBox):
(WebCore::InlineTextBox::setNextTextBox):
(WebCore::InlineTextBox::setPreviousTextBox):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::destroy):
(WebCore::RenderBlock::rightmostPosition):
(WebCore::RenderBlock::leftmostPosition):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::destroy):
(WebCore::RenderInline::absoluteRects):
(WebCore::RenderInline::absoluteQuads):
(WebCore::RenderInline::linesBoundingBox):
(WebCore::RenderInline::linesVisibleOverflowBoundingBox):
(WebCore::RenderInline::addFocusRingRects):
(WebCore::RenderInline::paintOutline):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::localBoundingBox):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::deleteLineBoxTree):
(WebCore::RenderLineBoxList::extractLineBox):
(WebCore::RenderLineBoxList::attachLineBox):
(WebCore::RenderLineBoxList::removeLineBox):
(WebCore::RenderLineBoxList::deleteLineBoxes):
(WebCore::RenderLineBoxList::dirtyLineBoxes):
(WebCore::RenderLineBoxList::paint):
(WebCore::RenderLineBoxList::hitTest):
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
(WebCore::RenderLineBoxList::checkConsistency):
* rendering/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::absoluteRects):
(WebCore::RenderSVGInline::absoluteQuads):
* rendering/RenderSVGText.cpp:
(WebCore::RenderSVGText::absoluteRects):
(WebCore::RenderSVGText::absoluteQuads):
(WebCore::RenderSVGText::objectBoundingBox):
* rendering/RenderText.cpp:
(WebCore::RenderText::extractTextBox):
(WebCore::RenderText::attachTextBox):
(WebCore::RenderText::removeTextBox):
(WebCore::RenderText::createInlineTextBox):
(WebCore::RenderText::positionLineBox):
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::nextRootBox):
(WebCore::RootInlineBox::prevRootBox):
2010-03-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
 
Reviewed by Eric Carlson.
......
......@@ -1777,7 +1777,6 @@ webcore_sources += \
WebCore/rendering/InlineFlowBox.cpp \
WebCore/rendering/InlineFlowBox.h \
WebCore/rendering/InlineIterator.h \
WebCore/rendering/InlineRunBox.h \
WebCore/rendering/InlineTextBox.cpp \
WebCore/rendering/InlineTextBox.h \
WebCore/rendering/LayoutState.cpp \
......
......@@ -3018,7 +3018,6 @@
'rendering/InlineFlowBox.cpp',
'rendering/InlineFlowBox.h',
'rendering/InlineIterator.h',
'rendering/InlineRunBox.h',
'rendering/InlineTextBox.cpp',
'rendering/InlineTextBox.h',
'rendering/LayoutState.cpp',
......
......@@ -27136,10 +27136,6 @@
RelativePath="..\rendering\InlineIterator.h"
>
</File>
<File
RelativePath="..\rendering\InlineRunBox.h"
>
</File>
<File
RelativePath="..\rendering\InlineTextBox.cpp"
>
......
......@@ -2936,7 +2936,6 @@
A8CFF0500A154F09000A4234 /* AutoTableLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */; };
A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF04C0A154F09000A4234 /* TableLayout.h */; };
A8CFF5E10A155A05000A4234 /* RootInlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8CFF5E20A155A05000A4234 /* InlineRunBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DB0A155A05000A4234 /* InlineRunBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */; };
A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = A8CFF5DE0A155A05000A4234 /* InlineBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -8193,7 +8192,6 @@
A8CFF04B0A154F09000A4234 /* AutoTableLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AutoTableLayout.cpp; sourceTree = "<group>"; };
A8CFF04C0A154F09000A4234 /* TableLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TableLayout.h; sourceTree = "<group>"; };
A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RootInlineBox.h; sourceTree = "<group>"; };
A8CFF5DB0A155A05000A4234 /* InlineRunBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineRunBox.h; sourceTree = "<group>"; };
A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineFlowBox.h; sourceTree = "<group>"; };
A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InlineFlowBox.cpp; sourceTree = "<group>"; };
A8CFF5DE0A155A05000A4234 /* InlineBox.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = InlineBox.h; sourceTree = "<group>"; };
......@@ -15687,7 +15685,6 @@
A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */,
A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */,
BCE789151120D6080060ECE5 /* InlineIterator.h */,
A8CFF5DB0A155A05000A4234 /* InlineRunBox.h */,
BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */,
BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
2D9066040BE141D400956998 /* LayoutState.cpp */,
......@@ -17394,7 +17391,6 @@
A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */,
A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */,
BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
A8CFF5E20A155A05000A4234 /* InlineRunBox.h in Headers */,
BCEA485A097D93020094C9E4 /* InlineTextBox.h in Headers */,
08591AA50F085C4E009BACB1 /* InputElement.h in Headers */,
93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */,
......@@ -165,7 +165,7 @@ void InlineFlowBox::attachLineBoxToRenderObject()
void InlineFlowBox::adjustPosition(int dx, int dy)
{
InlineRunBox::adjustPosition(dx, dy);
InlineBox::adjustPosition(dx, dy);
for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
child->adjustPosition(dx, dy);
if (m_overflow)
......@@ -703,11 +703,11 @@ void InlineFlowBox::paintFillLayer(const RenderObject::PaintInfo& paintInfo, con
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
int xOffsetOnLine = 0;
for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
xOffsetOnLine += curr->width();
int startX = tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
totalWidth += curr->width();
paintInfo.context->save();
paintInfo.context->clip(IntRect(tx, ty, width(), height()));
......@@ -788,11 +788,11 @@ void InlineFlowBox::paintBoxDecorations(RenderObject::PaintInfo& paintInfo, int
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
int xOffsetOnLine = 0;
for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
xOffsetOnLine += curr->width();
int startX = tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
totalWidth += curr->width();
context->save();
context->clip(IntRect(tx, ty, w, h));
......@@ -859,11 +859,11 @@ void InlineFlowBox::paintMask(RenderObject::PaintInfo& paintInfo, int tx, int ty
// We have a mask image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
int xOffsetOnLine = 0;
for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
xOffsetOnLine += curr->width();
int startX = tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
totalWidth += curr->width();
paintInfo.context->save();
paintInfo.context->clip(IntRect(tx, ty, w, h));
......
......@@ -21,7 +21,7 @@
#ifndef InlineFlowBox_h
#define InlineFlowBox_h
#include "InlineRunBox.h"
#include "InlineBox.h"
#include "RenderOverflow.h"
namespace WebCore {
......@@ -30,12 +30,14 @@ class HitTestRequest;
class HitTestResult;
class RenderLineBoxList;
class InlineFlowBox : public InlineRunBox {
class InlineFlowBox : public InlineBox {
public:
InlineFlowBox(RenderObject* obj)
: InlineRunBox(obj)
: InlineBox(obj)
, m_firstChild(0)
, m_lastChild(0)
, m_prevLineBox(0)
, m_nextLineBox(0)
, m_includeLeftEdge(false)
, m_includeRightEdge(false)
#ifndef NDEBUG
......@@ -54,8 +56,10 @@ public:
virtual ~InlineFlowBox();
#endif
InlineFlowBox* prevFlowBox() const { return static_cast<InlineFlowBox*>(m_prevLine); }
InlineFlowBox* nextFlowBox() const { return static_cast<InlineFlowBox*>(m_nextLine); }
InlineFlowBox* prevLineBox() const { return m_prevLineBox; }
InlineFlowBox* nextLineBox() const { return m_nextLineBox; }
void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; }
void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; }
InlineBox* firstChild() const { checkConsistency(); return m_firstChild; }
InlineBox* lastChild() const { checkConsistency(); return m_lastChild; }
......@@ -164,12 +168,14 @@ public:
protected:
OwnPtr<RenderOverflow> m_overflow;
private:
virtual bool isInlineFlowBox() const { return true; }
InlineBox* m_firstChild;
InlineBox* m_lastChild;
InlineFlowBox* m_prevLineBox; // The previous box that also uses our RenderObject
InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject
bool m_includeLeftEdge : 1;
bool m_includeRightEdge : 1;
bool m_hasTextChildren : 1;
......
/*
* Copyright (C) 2003, 2006 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef InlineRunBox_h
#define InlineRunBox_h
#include "InlineBox.h"
namespace WebCore {
class InlineRunBox : public InlineBox {
public:
InlineRunBox(RenderObject* obj)
: InlineBox(obj)
, m_prevLine(0)
, m_nextLine(0)
{
}
InlineRunBox* prevLineBox() const { return m_prevLine; }
InlineRunBox* nextLineBox() const { return m_nextLine; }
void setNextLineBox(InlineRunBox* n) { m_nextLine = n; }
void setPreviousLineBox(InlineRunBox* p) { m_prevLine = p; }
virtual void paintBoxDecorations(RenderObject::PaintInfo&, int /*tx*/, int /*ty*/) { }
virtual void paintTextDecorations(RenderObject::PaintInfo&, int /*tx*/, int /*ty*/, bool /*paintedChildren*/ = false) { }
protected:
InlineRunBox* m_prevLine; // The previous box that also uses our RenderObject
InlineRunBox* m_nextLine; // The next box that also uses our RenderObject
};
} // namespace WebCore
#endif // InlineRunBox_h
......@@ -23,7 +23,7 @@
#ifndef InlineTextBox_h
#define InlineTextBox_h
#include "InlineRunBox.h"
#include "InlineBox.h"
#include "RenderText.h" // so textRenderer() can be inline
namespace WebCore {
......@@ -37,18 +37,22 @@ const unsigned short cFullTruncation = USHRT_MAX - 1;
void updateGraphicsContext(GraphicsContext*, const Color& fillColor, const Color& strokeColor, float strokeThickness, ColorSpace);
Color correctedTextColor(Color textColor, Color backgroundColor);
class InlineTextBox : public InlineRunBox {
class InlineTextBox : public InlineBox {
public:
InlineTextBox(RenderObject* obj)
: InlineRunBox(obj)
: InlineBox(obj)
, m_prevTextBox(0)
, m_nextTextBox(0)
, m_start(0)
, m_len(0)
, m_truncation(cNoTruncation)
{
}
InlineTextBox* nextTextBox() const { return static_cast<InlineTextBox*>(nextLineBox()); }
InlineTextBox* prevTextBox() const { return static_cast<InlineTextBox*>(prevLineBox()); }
InlineTextBox* prevTextBox() const { return m_prevTextBox; }
InlineTextBox* nextTextBox() const { return m_nextTextBox; }
void setNextTextBox(InlineTextBox* n) { m_nextTextBox = n; }
void setPreviousTextBox(InlineTextBox* p) { m_prevTextBox = p; }
unsigned start() const { return m_start; }
unsigned end() const { return m_len ? m_start + m_len - 1 : m_start; }
......@@ -116,6 +120,9 @@ public:
bool containsCaretOffset(int offset) const; // false for offset after line break
private:
InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
InlineTextBox* m_nextTextBox; // The next box that also uses our RenderObject
int m_start;
unsigned short m_len;
......
......@@ -183,7 +183,7 @@ void RenderBlock::destroy()
// that will outlast this block. In the non-anonymous block case those
// children will be destroyed by the time we return from this function.
if (isAnonymousBlock()) {
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextFlowBox()) {
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) {
while (InlineBox* childBox = box->firstChild())
childBox->remove();
}
......@@ -2800,7 +2800,7 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
if (!includeSelf) {
right = max(right, borderLeft() + paddingLeft() + paddingRight() + relativeOffset);
if (childrenInline()) {
for (InlineRunBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox()) {
for (InlineFlowBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox()) {
int childRightEdge = currBox->x() + currBox->width();
// If this node is a root editable element, then the rightmostPosition should account for a caret at the end.
......@@ -2895,7 +2895,7 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
}
if (!includeSelf && firstLineBox()) {
for (InlineRunBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox())
for (InlineFlowBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox())
left = min(left, (int)currBox->x() + relativeOffset);
}
......
......@@ -80,7 +80,7 @@ void RenderInline::destroy()
// not have a parent that means they are either already disconnected or
// root lines that can just be destroyed without disconnecting.
if (firstLineBox()->parent()) {
for (InlineRunBox* box = firstLineBox(); box; box = box->nextLineBox())
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
box->remove();
}
} else if (isInline() && parent())
......@@ -410,7 +410,7 @@ void RenderInline::paint(PaintInfo& paintInfo, int tx, int ty)
void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
{
if (InlineRunBox* curr = firstLineBox()) {
if (InlineFlowBox* curr = firstLineBox()) {
for (; curr; curr = curr->nextLineBox())
rects.append(IntRect(tx + curr->x(), ty + curr->y(), curr->width(), curr->height()));
} else
......@@ -429,7 +429,7 @@ void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
void RenderInline::absoluteQuads(Vector<FloatQuad>& quads)
{
if (InlineRunBox* curr = firstLineBox()) {
if (InlineFlowBox* curr = firstLineBox()) {
for (; curr; curr = curr->nextLineBox()) {
FloatRect localRect(curr->x(), curr->y(), curr->width(), curr->height());
quads.append(localToAbsoluteQuad(localRect));
......@@ -534,7 +534,7 @@ IntRect RenderInline::linesBoundingBox() const
// Return the width of the minimal left side and the maximal right side.
int leftSide = 0;
int rightSide = 0;
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
if (curr == firstLineBox() || curr->x() < leftSide)
leftSide = curr->x();
if (curr == firstLineBox() || curr->x() + curr->width() > rightSide)
......@@ -557,7 +557,7 @@ IntRect RenderInline::linesVisibleOverflowBoundingBox() const
// Return the width of the minimal left side and the maximal right side.
int leftSide = numeric_limits<int>::max();
int rightSide = numeric_limits<int>::min();
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextFlowBox()) {
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
leftSide = min(leftSide, curr->leftVisibleOverflow());
rightSide = max(rightSide, curr->rightVisibleOverflow());
}
......@@ -927,7 +927,7 @@ void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
void RenderInline::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
{
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox* root = curr->root();
int top = max(root->lineTop(), curr->y());
int bottom = min(root->lineBottom(), curr->y() + curr->height());
......@@ -985,7 +985,7 @@ void RenderInline::paintOutline(GraphicsContext* graphicsContext, int tx, int ty
Vector<IntRect> rects;
rects.append(IntRect());
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox* root = curr->root();
int top = max(root->lineTop(), curr->y());
int bottom = min(root->lineBottom(), curr->y() + curr->height());
......
......@@ -2981,7 +2981,7 @@ IntRect RenderLayer::localBoundingBox() const
int top = firstBox->topVisibleOverflow();
int bottom = inlineFlow->lastLineBox()->bottomVisibleOverflow();
int left = firstBox->x();
for (InlineRunBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
for (InlineFlowBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
left = min(left, curr->x());
result = IntRect(left, top, width(), bottom - top);
} else if (renderer()->isTableRow()) {
......
......@@ -67,7 +67,7 @@ void RenderLineBoxList::deleteLineBoxTree(RenderArena* arena)
InlineFlowBox* line = m_firstLineBox;
InlineFlowBox* nextLine;
while (line) {
nextLine = line->nextFlowBox();
nextLine = line->nextLineBox();
line->deleteLine(arena);
line = nextLine;
}
......@@ -78,13 +78,13 @@ void RenderLineBoxList::extractLineBox(InlineFlowBox* box)
{
checkConsistency();
m_lastLineBox = box->prevFlowBox();
m_lastLineBox = box->prevLineBox();
if (box == m_firstLineBox)
m_firstLineBox = 0;
if (box->prevLineBox())
box->prevLineBox()->setNextLineBox(0);
box->setPreviousLineBox(0);
for (InlineRunBox* curr = box; curr; curr = curr->nextLineBox())
for (InlineFlowBox* curr = box; curr; curr = curr->nextLineBox())
curr->setExtracted();
checkConsistency();
......@@ -100,7 +100,7 @@ void RenderLineBoxList::attachLineBox(InlineFlowBox* box)
} else
m_firstLineBox = box;
InlineFlowBox* last = box;
for (InlineFlowBox* curr = box; curr; curr = curr->nextFlowBox()) {
for (InlineFlowBox* curr = box; curr; curr = curr->nextLineBox()) {
curr->setExtracted(false);
last = curr;
}
......@@ -114,9 +114,9 @@ void RenderLineBoxList::removeLineBox(InlineFlowBox* box)
checkConsistency();
if (box == m_firstLineBox)
m_firstLineBox = box->nextFlowBox();
m_firstLineBox = box->nextLineBox();
if (box == m_lastLineBox)
m_lastLineBox = box->prevFlowBox();
m_lastLineBox = box->prevLineBox();
if (box->nextLineBox())
box->nextLineBox()->setPreviousLineBox(box->prevLineBox());
if (box->prevLineBox())
......@@ -128,8 +128,8 @@ void RenderLineBoxList::removeLineBox(InlineFlowBox* box)
void RenderLineBoxList::deleteLineBoxes(RenderArena* arena)
{
if (m_firstLineBox) {
InlineRunBox* next;
for (InlineRunBox* curr = m_firstLineBox; curr; curr = next) {
InlineFlowBox* next;
for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
next = curr->nextLineBox();
curr->destroy(arena);
}
......@@ -140,7 +140,7 @@ void RenderLineBoxList::deleteLineBoxes(RenderArena* arena)
void RenderLineBoxList::dirtyLineBoxes()
{
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
curr->dirtyLineBoxes();
}
......@@ -177,7 +177,7 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, RenderObject::Pain
// based off positions of our first line box or our last line box.
RenderView* v = renderer->view();
bool usePrintRect = !v->printRect().isEmpty();
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextFlowBox()) {
for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
if (usePrintRect) {
// FIXME: This is a feeble effort to avoid splitting a line across two pages.
// It is utterly inadequate, and this should not be done at paint time at all.
......@@ -236,7 +236,7 @@ bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq
// See if our root lines contain the point. If so, then we hit test
// them further. Note that boxes can easily overlap, so we can't make any assumptions
// based off positions of our first line box or our last line box.
for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevFlowBox()) {
for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) {
if (y >= ty + curr->root()->topVisibleOverflow() && y < ty + curr->root()->bottomVisibleOverflow()) {
bool inside = curr->nodeAtPoint(request, result, x, y, tx, ty);
if (inside) {
......@@ -281,9 +281,9 @@ void RenderLineBoxList::dirtyLinesFromChangedChild(RenderObject* container, Rend
if (textBox)
box = textBox->root();
} else if (curr->isRenderInline()) {
InlineRunBox* runBox = toRenderInline(curr)->lastLineBox();
if (runBox)
box = runBox->root();
InlineFlowBox* flowBox = toRenderInline(curr)->lastLineBox();
if (flowBox)
box = flowBox->root();
}
if (box)
......@@ -321,8 +321,8 @@ void RenderLineBoxList::checkConsistency() const
{
#ifdef CHECK_CONSISTENCY
const InlineFlowBox* prev = 0;
for (const InlineFlowBox* child = m_firstLineBox; child != 0; child = child->nextFlowBox()) {
ASSERT(child->prevFlowBox() == prev);
for (const InlineFlowBox* child = m_firstLineBox; child != 0; child = child->nextLineBox()) {
ASSERT(child->prevLineBox() == prev);
prev = child;
}
ASSERT(prev == m_lastLineBox);
......
......@@ -48,9 +48,9 @@ InlineFlowBox* RenderSVGInline::createInlineFlowBox()
void RenderSVGInline::absoluteRects(Vector<IntRect>& rects, int, int)
{
InlineRunBox* firstBox = firstLineBox();
InlineFlowBox* firstBox = firstLineBox();
SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
RootInlineBox* rootBox = firstBox ? firstBox->root() : 0;
RenderBox* object = rootBox ? rootBox->block() : 0;
if (!object)
......@@ -59,7 +59,7 @@ void RenderSVGInline::absoluteRects(Vector<IntRect>& rects, int, int)
int xRef = object->x();
int yRef = object->y();
for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
for (InlineFlowBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
rects.append(enclosingIntRect(localToAbsoluteQuad(rect).boundingBox()));
}
......@@ -95,9 +95,9 @@ FloatRect RenderSVGInline::repaintRectInLocalCoordinates() const
void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
{
InlineRunBox* firstBox = firstLineBox();
InlineFlowBox* firstBox = firstLineBox();
SVGRootInlineBox* rootBox = firstBox ? static_cast<SVGInlineTextBox*>(firstBox)->svgRootInlineBox() : 0;
RootInlineBox* rootBox = firstBox ? firstBox->root() : 0;
RenderBox* object = rootBox ? rootBox->block() : 0;
if (!object)
......@@ -106,7 +106,7 @@ void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
int xRef = object->x();
int yRef = object->y();
for (InlineRunBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
for (InlineFlowBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
quads.append(localToAbsoluteQuad(rect));
}
......
......@@ -128,11 +128,8 @@ void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int, int)
// Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
// to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) {
ASSERT(runBox->isInlineFlowBox());
InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox);
for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) {
for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) {
FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
// FIXME: crawling up the parent chain to map each rect is very inefficient
// we should compute the absoluteTransform outside this loop first.
......@@ -149,11 +146,8 @@ void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads)
// Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard