Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 2680943004: Make FrameSelection to hold non-canonicalized positions (Closed)
Patch Set: 2014-02-14T23:34:22 Update TestExpectation to include extend-{0,2,4}0.html and selectAllChildren.html Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame, 1069 static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame,
1070 LocalFrame* newFocusedFrame, 1070 LocalFrame* newFocusedFrame,
1071 Element* newFocusedElement) { 1071 Element* newFocusedElement) {
1072 if (!oldFocusedFrame || !newFocusedFrame) 1072 if (!oldFocusedFrame || !newFocusedFrame)
1073 return; 1073 return;
1074 1074
1075 if (oldFocusedFrame->document() != newFocusedFrame->document()) 1075 if (oldFocusedFrame->document() != newFocusedFrame->document())
1076 return; 1076 return;
1077 1077
1078 FrameSelection& selection = oldFocusedFrame->selection(); 1078 FrameSelection& selection = oldFocusedFrame->selection();
1079 if (selection.isNone()) 1079 const SelectionInDOMTree& selectionInDOMTree = selection.selectionInDOMTree();
1080 if (selectionInDOMTree.isNone())
1080 return; 1081 return;
1081 1082
1082 Node* selectionStartNode = selection.selection().start().anchorNode(); 1083 Node* selectionStartNode = selectionInDOMTree.base().anchorNode();
1083 if (selectionStartNode == newFocusedElement || 1084 if (selectionStartNode == newFocusedElement ||
1084 selectionStartNode->isDescendantOf(newFocusedElement)) 1085 selectionStartNode->isDescendantOf(newFocusedElement))
1085 return; 1086 return;
1086 1087
1087 if (!enclosingTextControl(selectionStartNode)) 1088 if (!enclosingTextControl(selectionStartNode))
1088 return; 1089 return;
1089 1090
1090 if (selectionStartNode->isInShadowTree() && 1091 if (selectionStartNode->isInShadowTree() &&
1091 selectionStartNode->ownerShadowHost() == newFocusedElement) 1092 selectionStartNode->ownerShadowHost() == newFocusedElement)
1092 return; 1093 return;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 it->focusedFrameChanged(); 1415 it->focusedFrameChanged();
1415 } 1416 }
1416 1417
1417 DEFINE_TRACE(FocusController) { 1418 DEFINE_TRACE(FocusController) {
1418 visitor->trace(m_page); 1419 visitor->trace(m_page);
1419 visitor->trace(m_focusedFrame); 1420 visitor->trace(m_focusedFrame);
1420 visitor->trace(m_focusChangedObservers); 1421 visitor->trace(m_focusChangedObservers);
1421 } 1422 }
1422 1423
1423 } // namespace blink 1424 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698