|
Lines 250-260
void FrameSelection::setSelectionByMouseIfDifferent(const VisibleSelection& pass
a/Source/WebCore/editing/FrameSelection.cpp_sec1
|
| 250 |
setSelection(newSelection, UserTriggered | DoNotRevealSelection | CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, granularity); |
250 |
setSelection(newSelection, UserTriggered | DoNotRevealSelection | CloseTyping | ClearTypingStyle, AlignCursorOnScrollIfNeeded, granularity); |
| 251 |
} |
251 |
} |
| 252 |
|
252 |
|
| 253 |
void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity) |
253 |
void FrameSelection::setSelectionWithoutUpdatingAppearance(const VisibleSelection& newSelection, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity, EUserTriggered userTriggered) |
| 254 |
{ |
254 |
{ |
| 255 |
bool closeTyping = options & CloseTyping; |
255 |
bool closeTyping = options & CloseTyping; |
| 256 |
bool shouldClearTypingStyle = options & ClearTypingStyle; |
256 |
bool shouldClearTypingStyle = options & ClearTypingStyle; |
| 257 |
EUserTriggered userTriggered = selectionOptionsToUserTriggered(options); |
|
|
| 258 |
|
257 |
|
| 259 |
VisibleSelection s = newSelection; |
258 |
VisibleSelection s = newSelection; |
| 260 |
if (shouldAlwaysUseDirectionalSelection(m_frame)) |
259 |
if (shouldAlwaysUseDirectionalSelection(m_frame)) |
|
Lines 307-327
void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec
a/Source/WebCore/editing/FrameSelection.cpp_sec2
|
| 307 |
if (!s.isNone() && !(options & DoNotSetFocus)) |
306 |
if (!s.isNone() && !(options & DoNotSetFocus)) |
| 308 |
setFocusedElementIfNeeded(); |
307 |
setFocusedElementIfNeeded(); |
| 309 |
|
308 |
|
| 310 |
if (!(options & DoNotUpdateAppearance)) { |
|
|
| 311 |
#if ENABLE(TEXT_CARET) |
| 312 |
m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
| 313 |
#else |
| 314 |
m_frame->document()->updateStyleIfNeeded(); |
| 315 |
#endif |
| 316 |
updateAppearance(); |
| 317 |
} |
| 318 |
|
| 319 |
// Always clear the x position used for vertical arrow navigation. |
309 |
// Always clear the x position used for vertical arrow navigation. |
| 320 |
// It will be restored by the vertical arrow navigation code if necessary. |
310 |
// It will be restored by the vertical arrow navigation code if necessary. |
| 321 |
m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); |
311 |
m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); |
| 322 |
selectFrameElementInParentIfFullySelected(); |
312 |
selectFrameElementInParentIfFullySelected(); |
| 323 |
updateSelectionCachesIfSelectionIsInsideTextFormControl(userTriggered); |
313 |
updateSelectionCachesIfSelectionIsInsideTextFormControl(userTriggered); |
| 324 |
m_frame->editor().respondToChangedSelection(oldSelection, options); |
314 |
m_frame->editor().respondToChangedSelection(oldSelection, options); |
|
|
315 |
m_frame->document()->enqueueDocumentEvent(Event::create(eventNames().selectionchangeEvent, false, false)); |
| 316 |
} |
| 317 |
|
| 318 |
void FrameSelection::setSelection(const VisibleSelection& selection, SetSelectionOptions options, CursorAlignOnScroll align, TextGranularity granularity) |
| 319 |
{ |
| 320 |
EUserTriggered userTriggered = selectionOptionsToUserTriggered(options); |
| 321 |
|
| 322 |
setSelectionWithoutUpdatingAppearance(selection, options, align, granularity, userTriggered); |
| 323 |
|
| 324 |
#if ENABLE(TEXT_CARET) |
| 325 |
m_frame->document()->updateLayoutIgnorePendingStylesheets(); |
| 326 |
#else |
| 327 |
m_frame->document()->updateStyleIfNeeded(); |
| 328 |
#endif |
| 329 |
|
| 330 |
updateAppearance(); |
| 331 |
|
| 325 |
if (userTriggered == UserTriggered && !(options & DoNotRevealSelection)) { |
332 |
if (userTriggered == UserTriggered && !(options & DoNotRevealSelection)) { |
| 326 |
ScrollAlignment alignment; |
333 |
ScrollAlignment alignment; |
| 327 |
|
334 |
|
|
Lines 332-341
void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec
a/Source/WebCore/editing/FrameSelection.cpp_sec3
|
| 332 |
|
339 |
|
| 333 |
revealSelection(alignment, RevealExtent); |
340 |
revealSelection(alignment, RevealExtent); |
| 334 |
} |
341 |
} |
| 335 |
#if HAVE(ACCESSIBILITY) |
342 |
|
| 336 |
notifyAccessibilityForSelectionChange(); |
343 |
notifyAccessibilityForSelectionChange(); |
| 337 |
#endif |
|
|
| 338 |
m_frame->document()->enqueueDocumentEvent(Event::create(eventNames().selectionchangeEvent, false, false)); |
| 339 |
} |
344 |
} |
| 340 |
|
345 |
|
| 341 |
static bool removingNodeRemovesPosition(Node* node, const Position& position) |
346 |
static bool removingNodeRemovesPosition(Node* node, const Position& position) |
|
Lines 1237-1243
void FrameSelection::prepareForDestruction()
a/Source/WebCore/editing/FrameSelection.cpp_sec4
|
| 1237 |
if (view) |
1242 |
if (view) |
| 1238 |
view->clearSelection(); |
1243 |
view->clearSelection(); |
| 1239 |
|
1244 |
|
| 1240 |
setSelection(VisibleSelection(), CloseTyping | ClearTypingStyle | DoNotUpdateAppearance); |
1245 |
setSelectionWithoutUpdatingAppearance(VisibleSelection(), CloseTyping | ClearTypingStyle, |
|
|
1246 |
AlignCursorOnScrollIfNeeded, CharacterGranularity, NotUserTriggered); |
| 1241 |
m_previousCaretNode.clear(); |
1247 |
m_previousCaretNode.clear(); |
| 1242 |
} |
1248 |
} |
| 1243 |
|
1249 |
|