Commit 9b1c7761 authored by justing's avatar justing

Reviewed by levi

        
        svg/custom/text-hit-test.svg was failing

        * rendering/RenderContainer.cpp:
        (WebCore::RenderContainer::positionForCoordinates): Don't skip child
        renderers that have a height of 0 when looking for the closest child
        renderer, they may contain content that overflows.
        * rendering/RenderText.cpp:
        (WebCore::RenderText::positionForCoordinates): Fixed typos.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 884a874e
2006-06-28 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
svg/custom/text-hit-test.svg was failing
* rendering/RenderContainer.cpp:
(WebCore::RenderContainer::positionForCoordinates): Don't skip child
renderers that have a height of 0 when looking for the closest child
renderer, they may contain content that overflows.
* rendering/RenderText.cpp:
(WebCore::RenderText::positionForCoordinates): Fixed typos.
2006-06-28 David Hyatt <hyatt@apple.com>
Make the view source document properly handle <script>. We don't syntax
......
......@@ -517,7 +517,7 @@ VisiblePosition RenderContainer::positionForCoordinates(int x, int y)
RenderObject* closestRenderer = 0;
for (RenderObject* renderer = firstChild(); renderer; renderer = renderer->nextSibling()) {
if (!renderer->firstChild() && !renderer->isInline() && !renderer->isBlockFlow()
|| renderer->height() == 0 || renderer->style()->visibility() != VISIBLE)
|| renderer->style()->visibility() != VISIBLE)
continue;
int absx, absy;
......
......@@ -264,13 +264,13 @@ VisiblePosition RenderText::positionForCoordinates(int _x, int _y)
// FIXME: We should be able to roll these special cases into the general cases in the loop below.
if (firstTextBox() && _y < absy + firstTextBox()->root()->bottomOverflow() && _x < absx + firstTextBox()->m_x) {
// at the y coordinate of the first line or above
// and the x coordinate is to the left than the first text box left edge
// and the x coordinate is to the left of the first text box left edge
offset = firstTextBox()->offsetForPosition(_x - absx);
return VisiblePosition(element(), offset + firstTextBox()->m_start, DOWNSTREAM);
}
if (lastTextBox() && _y >= absy + lastTextBox()->root()->topOverflow() && _x >= absx + lastTextBox()->m_x + lastTextBox()->m_width) {
// at the y coordinate of the last line or below
// and the x coordinate is to the right than the last text box right edge
// and the x coordinate is to the right of the last text box right edge
offset = lastTextBox()->offsetForPosition(_x - absx);
return VisiblePosition(element(), offset + lastTextBox()->m_start, DOWNSTREAM);
}
......
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