diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering/InlineBox.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/rendering/InlineBox.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/InlineBox.cpp b/src/3rdparty/webkit/WebCore/rendering/InlineBox.cpp index 2d956a8fe1..bbf11b3443 100644 --- a/src/3rdparty/webkit/WebCore/rendering/InlineBox.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/InlineBox.cpp @@ -88,10 +88,10 @@ void InlineBox::showTreeForThis() const int InlineBox::height() const { #if ENABLE(SVG) - if (isSVG()) - return svgBoxHeight(); + if (hasVirtualHeight()) + return virtualHeight(); #endif - + if (renderer()->isText()) return m_isText ? renderer()->style(m_firstLine)->font().height() : 0; if (renderer()->isBox() && parent()) @@ -244,26 +244,26 @@ bool InlineBox::prevOnLineExists() const return m_prevOnLineExists; } -InlineBox* InlineBox::firstLeafChild() -{ - return this; -} - -InlineBox* InlineBox::lastLeafChild() -{ - return this; -} - -InlineBox* InlineBox::nextLeafChild() +InlineBox* InlineBox::nextLeafChild() const { - return parent() ? parent()->firstLeafChildAfterBox(this) : 0; + InlineBox* leaf = 0; + for (InlineBox* box = nextOnLine(); box && !leaf; box = box->nextOnLine()) + leaf = box->isLeaf() ? box : static_cast<InlineFlowBox*>(box)->firstLeafChild(); + if (!leaf && parent()) + leaf = parent()->nextLeafChild(); + return leaf; } - -InlineBox* InlineBox::prevLeafChild() + +InlineBox* InlineBox::prevLeafChild() const { - return parent() ? parent()->lastLeafChildBeforeBox(this) : 0; + InlineBox* leaf = 0; + for (InlineBox* box = prevOnLine(); box && !leaf; box = box->prevOnLine()) + leaf = box->isLeaf() ? box : static_cast<InlineFlowBox*>(box)->lastLeafChild(); + if (!leaf && parent()) + leaf = parent()->prevLeafChild(); + return leaf; } - + RenderObject::SelectionState InlineBox::selectionState() { return renderer()->selectionState(); |