| Index: Source/core/rendering/RenderText.cpp
|
| diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
|
| index 2ea7e66ff84fd0cf3010362f7004870c16d9cb8e..ab7ceb954a3f3cc69e13c780eee41924446adf5c 100644
|
| --- a/Source/core/rendering/RenderText.cpp
|
| +++ b/Source/core/rendering/RenderText.cpp
|
| @@ -1863,4 +1863,70 @@ void RenderText::momentarilyRevealLastTypedCharacter(unsigned lastTypedCharacter
|
| secureTextTimer->restartWithNewText(lastTypedCharacterOffset);
|
| }
|
|
|
| +RenderText::AbstractInlineTextBox* RenderText::firstInlineTextBox() const
|
| +{
|
| + return m_firstTextBox;
|
| +}
|
| +
|
| +RenderText::AbstractInlineTextBox* RenderText::nextInlineTextBox(RenderText::AbstractInlineTextBox* inlineTextBox) const
|
| +{
|
| + return inlineTextBox->nextTextBox();
|
| +}
|
| +
|
| +LayoutRect RenderText::inlineTextBoxBounds(RenderText::AbstractInlineTextBox* inlineTextBox) const
|
| +{
|
| + FloatRect boundaries = inlineTextBox->calculateBoundaries();
|
| + return localToAbsoluteQuad(boundaries).enclosingBoundingBox();
|
| +}
|
| +
|
| +unsigned RenderText::inlineTextBoxStart(RenderText::AbstractInlineTextBox* inlineTextBox) const
|
| +{
|
| + return inlineTextBox->start();
|
| +}
|
| +
|
| +unsigned RenderText::inlineTextBoxLen(RenderText::AbstractInlineTextBox* inlineTextBox) const
|
| +{
|
| + return inlineTextBox->len();
|
| +}
|
| +
|
| +RenderText::AbstractInlineTextBoxDirection RenderText::inlineTextBoxDirection(RenderText::AbstractInlineTextBox* inlineTextBox) const
|
| +{
|
| + if (style()->isHorizontalWritingMode())
|
| + return (inlineTextBox->direction() == RTL ? AbstractInlineTextBoxDirectionRL : AbstractInlineTextBoxDirectionLR);
|
| + return (inlineTextBox->direction() == RTL ? AbstractInlineTextBoxDirectionBT : AbstractInlineTextBoxDirectionTB);
|
| +}
|
| +
|
| +void RenderText::inlineTextBoxCharacterWidths(RenderText::AbstractInlineTextBox* inlineTextBox, Vector<float>& widths) const
|
| +{
|
| + inlineTextBox->characterWidths(widths);
|
| +}
|
| +
|
| +void RenderText::inlineTextBoxWordBoundaries(RenderText::AbstractInlineTextBox* inlineTextBox, Vector<WordBoundaries>& words) const
|
| +{
|
| + int start = inlineTextBox->start();
|
| + int len = inlineTextBox->len();
|
| + TextBreakIterator* iterator = wordBreakIterator(text(), start, len);
|
| + int pos = textBreakFirst(iterator);
|
| + while (pos >= 0 && pos < len) {
|
| + int next = textBreakNext(iterator);
|
| + if (isWordTextBreak(iterator))
|
| + words.append(WordBoundaries(pos, next));
|
| + pos = next;
|
| + }
|
| +}
|
| +
|
| +String RenderText::inlineTextBoxText(RenderText::AbstractInlineTextBox* inlineTextBox) const
|
| +{
|
| + unsigned start = inlineTextBox->start();
|
| + unsigned len = inlineTextBox->len();
|
| + if (Node* node = this->node()) {
|
| + RefPtr<Range> range = Range::create(node->document());
|
| + range->setStart(node, start, IGNORE_EXCEPTION);
|
| + range->setEnd(node, start + len, IGNORE_EXCEPTION);
|
| + return plainText(range.get(), TextIteratorIgnoresStyleVisibility);
|
| + }
|
| +
|
| + return text().substring(start, len);
|
| +}
|
| +
|
| } // namespace WebCore
|
|
|