~ubuntu-branches/ubuntu/karmic/webkit/karmic-proposed

« back to all changes in this revision

Viewing changes to WebCore/editing/TextIterator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-05-15 18:30:58 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090515183058-50q5exjo9b1kxy9s
Tags: 1.1.7-1
* New upstream release
* debian/libwebkit-1.0-2.symbols:
- updated with the new symbols in 1.1.7
* debian/libwebkit-dev.install, debian/libwebkit-dev.links,
  debian/rules:
- Build, and ship gtk-doc documentation (Closes: #526683)
* debian/copyright:
- updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
613
613
    if (!m_node->renderer() || m_node->renderer()->style()->visibility() != VISIBLE)
614
614
        return false;
615
615
    
616
 
    // The currPos.isNotNull() check is needed because positions in non-html content
617
 
    // (like svg) do not have visible positions, and we don't want to emit for them either.
 
616
    // The startPos.isNotNull() check is needed because the start could be before the body,
 
617
    // and in that case we'll get null. We don't want to put in newlines at the start in that case.
 
618
    // The currPos.isNotNull() check is needed because positions in non-HTML content
 
619
    // (like SVG) do not have visible positions, and we don't want to emit for them either.
618
620
    VisiblePosition startPos = VisiblePosition(m_startContainer, m_startOffset, DOWNSTREAM);
619
621
    VisiblePosition currPos = VisiblePosition(m_node, 0, DOWNSTREAM);
620
 
    return currPos.isNotNull() && !inSameLine(startPos, currPos);
 
622
    return startPos.isNotNull() && currPos.isNotNull() && !inSameLine(startPos, currPos);
621
623
}
622
624
 
623
625
bool TextIterator::shouldEmitSpaceBeforeAndAfterNode(Node* node)
1562
1564
                Position runEnd = VisiblePosition(runStart).next().deepEquivalent();
1563
1565
                if (runEnd.isNotNull()) {
1564
1566
                    ExceptionCode ec = 0;
1565
 
                    textRunRange->setEnd(runEnd.node(), runEnd.m_offset, ec);
 
1567
                    textRunRange->setEnd(runEnd.node(), runEnd.deprecatedEditingOffset(), ec);
1566
1568
                    ASSERT(!ec);
1567
1569
                }
1568
1570
            }