Changeset 185287 in webkit
- Timestamp:
- Jun 6, 2015 1:21:20 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185286 r185287 1 2015-06-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 Typing is slow in Gmail on iPads 4 https://bugs.webkit.org/show_bug.cgi?id=145686 5 6 Reviewed by Enrica Casucci. 7 8 The bug was caused by nextCandidate and nextVisuallyDistinctCandidate traversing through each character 9 in a text node without a renderer. Skip any node that doesn't have a renderer in both of those functions 10 and corresponding previous* functions. 11 12 It's fine to skip unrendered nodes in PositionIterator because only other clients of PositionIterator 13 are Position::upstream and Position::downstream and they don't care about un-rendered nodes either. 14 15 * dom/PositionIterator.cpp: 16 (WebCore::PositionIterator::increment): 17 (WebCore::PositionIterator::decrement): 18 * editing/htmlediting.cpp: 19 (WebCore::nextVisuallyDistinctCandidate): 20 (WebCore::previousVisuallyDistinctCandidate): 21 1 22 2015-06-06 Mark Lam <mark.lam@apple.com> 2 23 -
trunk/Source/WebCore/dom/PositionIterator.cpp
r180726 r185287 67 67 } 68 68 69 if ( !m_anchorNode->hasChildNodes() && m_offsetInAnchor < lastOffsetForEditing(m_anchorNode))69 if (m_anchorNode->renderer() && !m_anchorNode->hasChildNodes() && m_offsetInAnchor < lastOffsetForEditing(m_anchorNode)) 70 70 m_offsetInAnchor = Position::uncheckedNextOffset(m_anchorNode, m_offsetInAnchor); 71 71 else { … … 99 99 m_offsetInAnchor = m_anchorNode->hasChildNodes()? 0: lastOffsetForEditing(m_anchorNode); 100 100 } else { 101 if (m_offsetInAnchor )101 if (m_offsetInAnchor && m_anchorNode->renderer()) 102 102 m_offsetInAnchor = Position::uncheckedPreviousOffset(m_anchorNode, m_offsetInAnchor); 103 103 else { -
trunk/Source/WebCore/editing/htmlediting.cpp
r180809 r185287 243 243 Position nextVisuallyDistinctCandidate(const Position& position) 244 244 { 245 // FIXME: Use PositionIterator instead. 245 246 Position p = position; 246 247 Position downstreamStart = p.downstream(); … … 249 250 if (p.isCandidate() && p.downstream() != downstreamStart) 250 251 return p; 252 if (auto* node = p.containerNode()) { 253 if (!node->renderer()) 254 p = lastPositionInOrAfterNode(node); 255 } 251 256 } 252 257 return Position(); … … 266 271 Position previousVisuallyDistinctCandidate(const Position& position) 267 272 { 273 // FIXME: Use PositionIterator instead. 268 274 Position p = position; 269 275 Position downstreamStart = p.downstream(); … … 272 278 if (p.isCandidate() && p.downstream() != downstreamStart) 273 279 return p; 280 if (auto* node = p.containerNode()) { 281 if (!node->renderer()) 282 p = firstPositionInOrBeforeNode(node); 283 } 274 284 } 275 285 return Position();
Note: See TracChangeset
for help on using the changeset viewer.