Changeset 51818 in webkit
- Timestamp:
- Dec 7, 2009 5:22:23 PM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r51813 r51818 1 2009-12-07 Finnur Thorarinsson <finnur.webkit@gmail.com> 2 3 Reviewed by Darin Fisher. 4 5 A patch for Chromium to restrict the scope of the Gmail focus fix, 6 where we set the Selection to 0,0 for content-editable fields and 7 also make sure we set the selection end-state for find to select the 8 text found (when not focusing a link we found). 9 WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=32248 10 11 * src/WebFrameImpl.cpp: 12 (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection): 13 * src/WebViewImpl.cpp: 14 (WebKit::WebViewImpl::setFocus): 15 1 16 2009-12-07 Dmitry Titov <dimich@chromium.org> 2 17 -
trunk/WebKit/chromium/src/WebFrameImpl.cpp
r51394 r51818 1670 1670 // Found a focusable parent node. Set focus to it. 1671 1671 frame()->document()->setFocusedNode(node); 1672 } else {1673 // Iterate over all the nodes in the range until we find a focusable node.1674 // This, for example, sets focus to the first link if you search for 1675 // text and text that is within one or more links.1676 node = m_activeMatch->firstNode();1677 while (node && node != m_activeMatch->pastLastNode()) {1678 if (node->isFocusable()) {1679 frame()->document()->setFocusedNode(node);1680 break;1681 }1682 node = node->traverseNextNode();1672 return; 1673 } 1674 1675 // Iterate over all the nodes in the range until we find a focusable node. 1676 // This, for example, sets focus to the first link if you search for 1677 // text and text that is within one or more links. 1678 node = m_activeMatch->firstNode(); 1679 while (node && node != m_activeMatch->pastLastNode()) { 1680 if (node->isFocusable()) { 1681 frame()->document()->setFocusedNode(node); 1682 return; 1683 1683 } 1684 node = node->traverseNextNode(); 1684 1685 } 1686 1687 // No node related to the active match was focusable, so set the 1688 // active match as the selection (so that when you end the Find session, 1689 // you'll have the last thing you found highlighted) and make sure that 1690 // we have nothing focused (otherwise you might have text selected but 1691 // a link focused, which is weird). 1692 frame()->selection()->setSelection(m_activeMatch.get()); 1693 frame()->document()->setFocusedNode(0); 1685 1694 } 1686 1695 } -
trunk/WebKit/chromium/src/WebViewImpl.cpp
r51719 r51818 926 926 if (element->isTextFormControl()) 927 927 element->updateFocusAppearance(true); 928 else {928 else if (focusedNode->isContentEditable()) { 929 929 // updateFocusAppearance() selects all the text of 930 930 // contentseditable DIVs. So we set the selection explicitly 931 931 // instead. Note that this has the side effect of moving the 932 // caret back to the begin ing of the text.932 // caret back to the beginning of the text. 933 933 Position position(focusedNode, 0, 934 934 Position::PositionIsOffsetInAnchor);
Note: See TracChangeset
for help on using the changeset viewer.