Changeset 62815 in webkit
- Timestamp:
- Jul 8, 2010 12:10:16 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r62809 r62815 1 2010-07-08 Antonio Gomes <tonikitoo@webkit.org> 2 3 Reviewed by Ojan Vafai. 4 5 Refactor platform dependent editing behavior code out of Settings (part II) 6 https://bugs.webkit.org/show_bug.cgi?id=39854 7 8 Mac port is currently the only port relying on a style to be present on the start 9 of a selection to consider the style as applied or not. All other ports 10 have to have the style present in all text node of the selection for such. 11 12 Patch makes situations that depend on this check like this to be controlled by 13 the EditingBehavior class. 14 15 Refactoring, so no new tests needed. 16 17 * editing/EditingBehavior.h: 18 (WebCore::EditingBehavior::shouldToggleStyleBasedOnStartOfSelection): 19 * editing/EditorCommand.cpp: 20 (WebCore::executeToggleStyle): 21 1 22 2010-07-08 Anders Carlsson <andersca@apple.com> 2 23 -
trunk/WebCore/editing/EditingBehavior.h
r60841 r62815 50 50 bool shouldCenterAlignWhenSelectionIsRevealed() const { return m_type == EditingMacBehavior; } 51 51 52 // On Mac, style is considered present when present at the beginning of selection. On other platforms, 53 // style has to be present throughout the selection. 54 bool shouldToggleStyleBasedOnStartOfSelection() const { return m_type == EditingMacBehavior; } 55 52 56 private: 53 57 EditingBehaviorType m_type; -
trunk/WebCore/editing/EditorCommand.cpp
r61794 r62815 166 166 // mac: present at the beginning of selection 167 167 // other: present throughout the selection 168 Settings* settings = frame->document()->settings(); 168 169 // FIXME: Make stateStyle() to use this editing method too for the cases where it's used for queryCommandState. 169 170 bool styleIsPresent; 170 if ( settings && settings->editingBehaviorType() == EditingMacBehavior)171 if (!frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection()) 171 172 styleIsPresent = frame->editor()->selectionStartHasStyle(style.get()); 172 173 else
Note: See TracChangeset
for help on using the changeset viewer.