Commit 332d3a5a authored by mitz@apple.com's avatar mitz@apple.com

Rubber-stamped by John Sullivan.

        - remove unreachable code which was added in r8802

        * rendering/RenderText.cpp:
        (WebCore::RenderText::caretRect):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent af12b541
2008-04-16 Dan Bernstein <mitz@apple.com>
Rubber-stamped by John Sullivan.
- remove unreachable code which was added in r8802
* rendering/RenderText.cpp:
(WebCore::RenderText::caretRect):
2008-04-15 Timothy Hatcher <timothy@apple.com>
Adds a script resource icon. Update the CSS icon to better match the script icon.
......@@ -324,29 +324,6 @@ VisiblePosition RenderText::positionForCoordinates(int x, int y)
return VisiblePosition(element(), lastBoxAbove ? lastBoxAbove->m_start + lastBoxAbove->m_len : 0, DOWNSTREAM);
}
static RenderObject* lastRendererOnPrevLine(InlineBox* box)
{
if (!box)
return 0;
RootInlineBox* root = box->root();
if (!root)
return 0;
if (root->endsWithBreak())
return 0;
RootInlineBox* prevRoot = root->prevRootBox();
if (!prevRoot)
return 0;
InlineBox* lastChild = prevRoot->lastChild();
if (!lastChild)
return 0;
return lastChild->object();
}
static inline bool atLineWrap(InlineTextBox* box, int offset)
{
return box->nextTextBox() && !box->nextOnLine() && offset == box->m_start + box->m_len;
......@@ -369,14 +346,8 @@ IntRect RenderText::caretRect(int offset, EAffinity affinity, int* extraWidthToE
} else {
InlineTextBox* prevBox = box->prevTextBox();
if (offset == box->m_start && affinity == UPSTREAM && prevBox && !box->prevOnLine()) {
if (prevBox) {
box = prevBox;
offset = box->m_start + box->m_len;
} else {
RenderObject *object = lastRendererOnPrevLine(box);
if (object)
return object->caretRect(0, affinity);
}
box = prevBox;
offset = box->m_start + box->m_len;
}
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment