+2007-09-18 David Harrison <harrison@apple.com>
+
+ Reviewed by Darin.
+
+ Updated for:
+ <rdar://problem/5486974> REGRESSION(r25373): 1/4 second to doubleclick word in GMail when using Kotoeri IM, also slow in other IMs (15163)
+
+ NOTE: This reverts the test result changes I made for rdar://5472125, back to not emitting
+ a newline for collapsed block or hr at start of range.
+
+ * fast/dom/Window/window-xy-properties-expected.txt:
+ * fast/dom/plugin-attributes-enumeration-expected.txt:
+ * fast/events/onerror-bubbling-expected.txt:
+ * fast/events/related-target-expected.txt:
+ * fast/forms/select-namedItem-expected.txt:
+ * fast/table/incomplete-table-in-fragment-2-expected.txt:
+ * fast/table/incomplete-table-in-fragment-hang-expected.txt:
+ * fast/table/large-rowspan-crash-expected.txt:
+ * plugins/embed-attributes-setting-expected.txt:
+
2007-09-17 Antti Koivisto <antti@apple.com>
Reviewed by Darin.
+2007-09-18 David Harrison <harrison@apple.com>
+
+ Reviewed by Darin.
+
+ <rdar://problem/5486974> REGRESSION(r25373): 1/4 second to doubleclick word in GMail when using Kotoeri IM, also slow in other IMs (15163)
+
+ Updated tests:
+ * fast/dom/Window/window-xy-properties-expected.txt:
+ * fast/dom/plugin-attributes-enumeration-expected.txt:
+ * fast/events/onerror-bubbling-expected.txt:
+ * fast/events/related-target-expected.txt:
+ * fast/forms/select-namedItem-expected.txt:
+ * fast/table/incomplete-table-in-fragment-2-expected.txt:
+ * fast/table/incomplete-table-in-fragment-hang-expected.txt:
+ * fast/table/large-rowspan-crash-expected.txt:
+ * plugins/embed-attributes-setting-expected.txt:
+
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
+ Avoid VisiblePosition check if the current node is a descendant
+ of the start container and the start offset was 0. In that case
+ we already had enough context to correctly decide whether to emit
+ a newline after a preceding block. We chose not to emit
+ (m_haveEmitted is false), so don't second guess that.
+
+ (WebCore::TextIterator::exitNode):
+ Changed some comments.
+
2007-09-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin Adler.
// make quicker checks to possibly avoid that. Another check that we could make is
// is whether the inline vs block flow changed since the previous visible element.
// I think we're already in a special enough case that that won't be needed, tho.
- // The currPos.isNotNull() check is needed because positions in non-html content
- // (like svg) do not have visible positions, and we don't want to emit for them either.
+
+ // If we are at the start, obviously no newline is needed.
if (m_node == m_startContainer)
return false;
+ // If we are outside the start container's subtree, assume we need a newline.
+ // FIXME: m_startContainer could be an inline block
if (!m_node->isDescendantOf(m_startContainer))
return true;
+
+ // If we started as m_startContainer offset 0 and the current node is a descendant of
+ // the start container, we already had enough context to correctly decide whether to
+ // emit a newline after a preceding block. We chose not to emit (m_haveEmitted is false),
+ // so don't second guess that now.
+ // NOTE: Is this really correct when m_node is not a leftmost descendant? Probably
+ // immaterial since we likely would have already emitted something by now.
+ if (m_startOffset == 0)
+ return false;
+ // The currPos.isNotNull() check is needed because positions in non-html content
+ // (like svg) do not have visible positions, and we don't want to emit for them either.
VisiblePosition startPos = VisiblePosition(m_startContainer, m_startOffset, DOWNSTREAM);
VisiblePosition currPos = VisiblePosition(m_node, 0, DOWNSTREAM);
return currPos.isNotNull() && !inSameLine(startPos, currPos);
void TextIterator::exitNode()
{
// prevent emitting a newline when exiting a collapsed block at beginning of the range
+ // FIXME: !m_haveEmitted does not necessarily mean there was a collapsed block... it could
+ // have been an hr (e.g.). Also, a collapsed block could have height (e.g. a table) and
+ // therefore look like a blank line.
if (!m_haveEmitted)
return;
// emitted character is positioned visually.
Node* baseNode = m_node->lastChild() ? m_node->lastChild() : m_node;
// FIXME: This shouldn't require the m_lastTextNode to be true, but we can't change that without making
- // the logic in _web_attributedStringFromRange match. We'll get that for free when we switch to use TextIterator in _web_attributedStringFromRange.
+ // the logic in _web_attributedStringFromRange match. We'll get that for free when we switch to use
+ // TextIterator in _web_attributedStringFromRange.
// See <rdar://problem/5428427> for an example of how this mismatch will cause problems.
if (m_lastTextNode && shouldEmitNewlineAfterNode(m_node)) {
// use extra newline to represent margin bottom, as needed