Changeset 163056 in webkit
- Timestamp:
- Jan 29, 2014 5:53:42 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163055 r163056 1 2014-01-29 Ryosuke Niwa <rniwa@webkit.org> 2 3 EventHandler::handleMouseReleaseEvent shouldn't call updateSelectionCachesIfSelectionIsInsideTextFormControl 4 and selectFrameElementInParentIfFullySelected 5 https://bugs.webkit.org/show_bug.cgi?id=127834 6 7 Reviewed by Alexey Proskuryakov. 8 9 Removed the calls and made setNonDirectionalSelectionIfNeeded pass in UserTriggered option. 10 11 In addition, removed the rather error-prone function override of setSelection since TextGranularity, 12 which is an enum, could be implicitly coerced into SetSelectionOptions which is a typedefed unsigned int. 13 14 * editing/FrameSelection.cpp: 15 (WebCore::FrameSelection::setSelectionByMouseIfDifferent): Renamed from setNonDirectionalSelectionIfNeeded. 16 Pass in DoNotRevealSelection to avoid revealing the selection to preserve the existing behavior. 17 There are two layout tests that fail without this. 18 (WebCore::FrameSelection::setSelection): Check the newly addeed DoNotRevealSelection option. 19 (WebCore::FrameSelection::wordSelectionContainingCaretSelection): Call 20 21 * editing/FrameSelection.h: Made updateSelectionCachesIfSelectionIsInsideTextFormControl and 22 selectFrameElementInParentIfFullySelected private as they are no longer called outside of FrameSelection. 23 24 * page/EventHandler.cpp: 25 (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart): 26 (WebCore::EventHandler::updateSelectionForMouseDrag): 27 (WebCore::EventHandler::handleMouseReleaseEvent): Removed calls to the functions. 28 1 29 2014-01-29 Jer Noble <jer.noble@apple.com> 2 30 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r163012 r163056 221 221 } 222 222 223 void FrameSelection::set NonDirectionalSelectionIfNeeded(const VisibleSelection& passedNewSelection, TextGranularity granularity,223 void FrameSelection::setSelectionByMouseIfDifferent(const VisibleSelection& passedNewSelection, TextGranularity granularity, 224 224 EndPointsAdjustmentMode endpointsAdjustmentMode) 225 225 { … … 248 248 return; 249 249 250 setSelection(newSelection, granularity);250 setSelection(newSelection, UserTriggered | DoNotRevealSelection | CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, granularity); 251 251 } 252 252 … … 323 323 updateSelectionCachesIfSelectionIsInsideTextFormControl(userTriggered); 324 324 m_frame->editor().respondToChangedSelection(oldSelection, options); 325 if (userTriggered == UserTriggered ) {325 if (userTriggered == UserTriggered && !(options & DoNotRevealSelection)) { 326 326 ScrollAlignment alignment; 327 327 … … 2430 2430 VisibleSelection newSelection = frameSelection.selection(); 2431 2431 newSelection.expandUsingGranularity(WordGranularity); 2432 frameSelection.setSelection(newSelection, frameSelection.granularity());2432 frameSelection.setSelection(newSelection, CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, frameSelection.granularity()); 2433 2433 2434 2434 Position startPos(frameSelection.selection().start()); -
trunk/Source/WebCore/editing/FrameSelection.h
r163012 r163056 126 126 DictationTriggered = 1 << 5, 127 127 DoNotUpdateAppearance = 1 << 6, 128 DoNotRevealSelection = 1 << 7, 128 129 }; 129 130 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOption and EUserTriggered … … 150 151 const VisibleSelection& selection() const { return m_selection; } 151 152 void setSelection(const VisibleSelection&, SetSelectionOptions = CloseTyping | ClearTypingStyle, CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGranularity = CharacterGranularity); 152 void setSelection(const VisibleSelection& selection, TextGranularity granularity) { setSelection(selection, CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, granularity); }153 153 bool setSelectedRange(Range*, EAffinity, bool closeTyping); 154 154 void selectAll(); 155 155 void clear(); 156 156 void prepareForDestruction(); 157 158 // Call this after doing user-triggered selections to make it easy to delete the frame you entirely selected.159 void selectFrameElementInParentIfFullySelected();160 157 161 158 bool contains(const LayoutPoint&); … … 273 270 bool shouldDeleteSelection(const VisibleSelection&) const; 274 271 enum EndPointsAdjustmentMode { AdjustEndpointsAtBidiBoundary, DoNotAdjsutEndpoints }; 275 void setNonDirectionalSelectionIfNeeded(const VisibleSelection&, TextGranularity, EndPointsAdjustmentMode = DoNotAdjsutEndpoints); 276 void updateSelectionCachesIfSelectionIsInsideTextFormControl(EUserTriggered); 272 void setSelectionByMouseIfDifferent(const VisibleSelection&, TextGranularity, EndPointsAdjustmentMode = DoNotAdjsutEndpoints); 277 273 278 274 void paintDragCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const; … … 322 318 #endif 323 319 320 void updateSelectionCachesIfSelectionIsInsideTextFormControl(EUserTriggered); 321 322 void selectFrameElementInParentIfFullySelected(); 323 324 324 void setFocusedElementIfNeeded(); 325 325 void focusedOrActiveStateChanged(); -
trunk/Source/WebCore/page/EventHandler.cpp
r163018 r163056 507 507 } 508 508 509 m_frame.selection().set NonDirectionalSelectionIfNeeded(selection, granularity);509 m_frame.selection().setSelectionByMouseIfDifferent(selection, granularity); 510 510 511 511 return true; … … 919 919 newSelection.expandUsingGranularity(m_frame.selection().granularity()); 920 920 921 m_frame.selection().set NonDirectionalSelectionIfNeeded(newSelection, m_frame.selection().granularity(),921 m_frame.selection().setSelectionByMouseIfDifferent(newSelection, m_frame.selection().granularity(), 922 922 FrameSelection::AdjustEndpointsAtBidiBoundary); 923 923 } … … 985 985 handled = true; 986 986 } 987 988 m_frame.selection().updateSelectionCachesIfSelectionIsInsideTextFormControl(UserTriggered);989 990 m_frame.selection().selectFrameElementInParentIfFullySelected();991 987 992 988 if (event.event().button() == MiddleButton) {
Note: See TracChangeset
for help on using the changeset viewer.