| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 DoNotUpdateAppearance = 1 << 5, | 84 DoNotUpdateAppearance = 1 << 5, |
| 85 DoNotClearStrategy = 1 << 6, | 85 DoNotClearStrategy = 1 << 6, |
| 86 DoNotAdjustInComposedTree = 1 << 7, | 86 DoNotAdjustInComposedTree = 1 << 7, |
| 87 }; | 87 }; |
| 88 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOpti
on and EUserTriggered | 88 typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOpti
on and EUserTriggered |
| 89 static inline EUserTriggered selectionOptionsToUserTriggered(SetSelectionOpt
ions options) | 89 static inline EUserTriggered selectionOptionsToUserTriggered(SetSelectionOpt
ions options) |
| 90 { | 90 { |
| 91 return static_cast<EUserTriggered>(options & UserTriggered); | 91 return static_cast<EUserTriggered>(options & UserTriggered); |
| 92 } | 92 } |
| 93 | 93 |
| 94 enum ResetCaretBlinkOption { | |
| 95 None, | |
| 96 ResetCaretBlink | |
| 97 }; | |
| 98 | |
| 99 LocalFrame* frame() const { return m_frame; } | 94 LocalFrame* frame() const { return m_frame; } |
| 100 Element* rootEditableElement() const { return selection().rootEditableElemen
t(); } | 95 Element* rootEditableElement() const { return selection().rootEditableElemen
t(); } |
| 101 Element* rootEditableElementOrDocumentElement() const; | 96 Element* rootEditableElementOrDocumentElement() const; |
| 102 ContainerNode* rootEditableElementOrTreeScopeRootNode() const; | 97 ContainerNode* rootEditableElementOrTreeScopeRootNode() const; |
| 103 | 98 |
| 104 bool hasEditableStyle() const { return selection().hasEditableStyle(); } | 99 bool hasEditableStyle() const { return selection().hasEditableStyle(); } |
| 105 bool isContentEditable() const { return selection().isContentEditable(); } | 100 bool isContentEditable() const { return selection().isContentEditable(); } |
| 106 bool isContentRichlyEditable() const { return selection().isContentRichlyEdi
table(); } | 101 bool isContentRichlyEditable() const { return selection().isContentRichlyEdi
table(); } |
| 107 | 102 |
| 108 void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, Curso
rAlignOnScroll = CursorAlignOnScroll::IfNeeded); | 103 void moveTo(const VisiblePosition&, EUserTriggered = NotUserTriggered, Curso
rAlignOnScroll = CursorAlignOnScroll::IfNeeded); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // the return value from underlying VisibleSelection's firstRange() is retur
ned. | 174 // the return value from underlying VisibleSelection's firstRange() is retur
ned. |
| 180 PassRefPtrWillBeRawPtr<Range> firstRange() const; | 175 PassRefPtrWillBeRawPtr<Range> firstRange() const; |
| 181 | 176 |
| 182 void nodeWillBeRemoved(Node&); | 177 void nodeWillBeRemoved(Node&); |
| 183 void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLen
gth, unsigned newLength); | 178 void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLen
gth, unsigned newLength); |
| 184 void didMergeTextNodes(const Text& oldNode, unsigned offset); | 179 void didMergeTextNodes(const Text& oldNode, unsigned offset); |
| 185 void didSplitTextNode(const Text& oldNode); | 180 void didSplitTextNode(const Text& oldNode); |
| 186 | 181 |
| 187 bool isAppearanceDirty() const; | 182 bool isAppearanceDirty() const; |
| 188 void commitAppearanceIfNeeded(LayoutView&); | 183 void commitAppearanceIfNeeded(LayoutView&); |
| 189 void updateAppearance(ResetCaretBlinkOption = None); | 184 void updateAppearance(); |
| 190 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl
e ? Visible : Hidden); } | 185 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl
e ? Visible : Hidden); } |
| 191 bool isCaretBoundsDirty() const { return m_caretRectDirty; } | 186 bool isCaretBoundsDirty() const { return m_caretRectDirty; } |
| 192 void setCaretRectNeedsUpdate(); | 187 void setCaretRectNeedsUpdate(); |
| 193 void scheduleVisualUpdate() const; | 188 void scheduleVisualUpdate() const; |
| 194 void invalidateCaretRect(); | 189 void invalidateCaretRect(); |
| 195 void paintCaret(GraphicsContext&, const LayoutPoint&); | 190 void paintCaret(GraphicsContext&, const LayoutPoint&); |
| 196 bool ShouldPaintCaretForTesting() const { return m_shouldPaintCaret; } | 191 bool ShouldPaintCaretForTesting() const { return m_shouldPaintCaret; } |
| 197 | 192 |
| 198 // Used to suspend caret blinking while the mouse is down. | 193 // Used to suspend caret blinking while the mouse is down. |
| 199 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended
= suspended; } | 194 void setCaretBlinkingSuspended(bool suspended) { m_isCaretBlinkingSuspended
= suspended; } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 269 |
| 275 void respondToNodeModification(Node&, bool baseRemoved, bool extentRemoved,
bool startRemoved, bool endRemoved); | 270 void respondToNodeModification(Node&, bool baseRemoved, bool extentRemoved,
bool startRemoved, bool endRemoved); |
| 276 | 271 |
| 277 void notifyAccessibilityForSelectionChange(); | 272 void notifyAccessibilityForSelectionChange(); |
| 278 void notifyCompositorForSelectionChange(); | 273 void notifyCompositorForSelectionChange(); |
| 279 void notifyEventHandlerForSelectionChange(); | 274 void notifyEventHandlerForSelectionChange(); |
| 280 | 275 |
| 281 void focusedOrActiveStateChanged(); | 276 void focusedOrActiveStateChanged(); |
| 282 | 277 |
| 283 void caretBlinkTimerFired(Timer<FrameSelection>*); | 278 void caretBlinkTimerFired(Timer<FrameSelection>*); |
| 279 void stopCaretBlinkTimer(); |
| 284 | 280 |
| 285 void setUseSecureKeyboardEntry(bool); | 281 void setUseSecureKeyboardEntry(bool); |
| 286 | 282 |
| 287 void setCaretVisibility(CaretVisibility); | 283 void setCaretVisibility(CaretVisibility); |
| 288 bool shouldBlinkCaret() const; | 284 bool shouldBlinkCaret() const; |
| 289 | 285 |
| 290 void updateSelectionIfNeeded(const Position& base, const Position& extent, c
onst Position& start, const Position& end); | 286 void updateSelectionIfNeeded(const Position& base, const Position& extent, c
onst Position& start, const Position& end); |
| 291 | 287 |
| 292 template <typename Strategy> | 288 template <typename Strategy> |
| 293 VisibleSelectionTemplate<Strategy> validateSelection(const VisibleSelectionT
emplate<Strategy>&); | 289 VisibleSelectionTemplate<Strategy> validateSelection(const VisibleSelectionT
emplate<Strategy>&); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 } | 333 } |
| 338 } // namespace blink | 334 } // namespace blink |
| 339 | 335 |
| 340 #ifndef NDEBUG | 336 #ifndef NDEBUG |
| 341 // Outside the WebCore namespace for ease of invocation from gdb. | 337 // Outside the WebCore namespace for ease of invocation from gdb. |
| 342 void showTree(const blink::FrameSelection&); | 338 void showTree(const blink::FrameSelection&); |
| 343 void showTree(const blink::FrameSelection*); | 339 void showTree(const blink::FrameSelection*); |
| 344 #endif | 340 #endif |
| 345 | 341 |
| 346 #endif // FrameSelection_h | 342 #endif // FrameSelection_h |
| OLD | NEW |