Changeset 52235 in webkit
- Timestamp:
- Dec 16, 2009 10:30:20 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r52233 r52235 1 2009-12-16 MORITA Hajime <morrita@gmail.com> 2 3 Reviewed by Eric Seidel. 4 5 Bug 28306: double-clicking a word inside <b> beside newline select two words 6 https://bugs.webkit.org/show_bug.cgi?id=28306 7 8 SimplifiedBackwardsTextIterator missed trailing whitespaces just 9 before folding line-break, which is used to detect word 10 boundaries. This fix checks strings on RenderText and expand text 11 range on SimplifiedBackwardsTextIterator to include trailing 12 whitespaces if availble. 13 14 * editing/selection/doubleclick-beside-cr-span-expected.txt: Added. 15 * editing/selection/doubleclick-beside-cr-span.html: Added. 16 1 17 2009-12-16 Jon Honeycutt <jhoneycutt@apple.com> 2 18 -
trunk/WebCore/ChangeLog
r52234 r52235 1 2009-12-15 MORITA Hajime <morrita@gmail.com> 2 3 Reviewed by Eric Seidel. 4 5 Bug 28306: double-clicking a word inside <b> beside newline select two words 6 https://bugs.webkit.org/show_bug.cgi?id=28306 7 8 SimplifiedBackwardsTextIterator missed trailing whitespaces just 9 before folding line-break, which is used to detect word 10 boundaries. This fix checks strings on RenderText and expand text 11 range on SimplifiedBackwardsTextIterator to include trailing 12 whitespaces if availble. 13 14 Test: editing/selection/doubleclick-beside-cr-span.html 15 16 * editing/TextIterator.cpp: 17 (WebCore::collapsedSpaceLength): 18 (WebCore::maxOffsetIncludingCollapsedSpaces): 19 (WebCore::SimplifiedBackwardsTextIterator::advance): 20 1 21 2009-12-16 Fumitoshi Ukai <ukai@chromium.org> 2 22 -
trunk/WebCore/editing/TextIterator.cpp
r50675 r52235 704 704 705 705 return false; 706 } 707 708 static int collapsedSpaceLength(RenderText* renderer, int textEnd) 709 { 710 const UChar* characters = renderer->text()->characters(); 711 int length = renderer->text()->length(); 712 for (int i = textEnd; i < length; ++i) { 713 if (!renderer->style()->isCollapsibleWhiteSpace(characters[i])) 714 return i - textEnd; 715 } 716 717 return length - textEnd; 718 } 719 720 static int maxOffsetIncludingCollapsedSpaces(Node* node) 721 { 722 int offset = caretMaxOffset(node); 723 724 if (node->renderer() && node->renderer()->isText()) 725 offset += collapsedSpaceLength(toRenderText(node->renderer()), offset); 726 727 return offset; 706 728 } 707 729 … … 1030 1052 if (m_node) 1031 1053 pushFullyClippedState(m_fullyClippedStack, m_node); 1032 m_offset = m_node ? caretMaxOffset(m_node) : 0; 1054 // For the purpose of word boundary detection, 1055 // we should iterate all visible text and trailing (collapsed) whitespaces. 1056 m_offset = m_node ? maxOffsetIncludingCollapsedSpaces(m_node) : 0; 1033 1057 m_handledNode = false; 1034 1058 m_handledChildren = false;
Note: See TracChangeset
for help on using the changeset viewer.