Changeset 68423 in webkit
- Timestamp:
- Sep 27, 2010 2:10:54 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68418 r68423 1 2010-09-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Antonio Gomes. 4 5 stateStyle (@EditorCommand.cpp) should ask EditingBehavior for platform specific behavior 6 https://bugs.webkit.org/show_bug.cgi?id=41989 7 8 Added a test to ensure queryCommandState returns correct values on Mac and Windows. 9 10 * editing/execCommand/query-command-state-expected.txt: Added. 11 * editing/execCommand/script-tests/query-command-state.js: Added. 12 (testQueryCommandState): 13 (selectAll): 14 (selectSecondWord): 15 (selectFirstTwoWords): 16 (runTests): 17 1 18 2010-09-27 Martin Robinson <mrobinson@igalia.com> 2 19 -
trunk/WebCore/ChangeLog
r68420 r68423 1 2010-09-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Antonio Gomes. 4 5 stateStyle (@EditorCommand.cpp) should ask EditingBehavior for platform specific behavior 6 https://bugs.webkit.org/show_bug.cgi?id=41989 7 8 queryCommandState returns true even when in the mixed state 9 https://bugs.webkit.org/show_bug.cgi?id=46382 10 11 Fixed stateStyle so that it calls selectionStartHasStyle when shouldToggleStyleBasedOnStartOfSelection 12 is true (Mac platforms) and calls selectionHasStyle otherwise (non-Mac platforms). 13 14 Also fixed queryCommandState so that it only returns true when the state is TrueTriState 15 as supposed to returning true whenever the state is not FalseTriState. New behavior matches that of 16 other browsers such as Firefox and Internet Explorer. 17 18 * dom/Document.cpp: 19 (WebCore::Document::queryCommandState): 20 * editing/EditorCommand.cpp: 21 (WebCore::executeToggleStyle): 22 (WebCore::stateStyle): 23 1 24 2010-09-27 David Hyatt <hyatt@apple.com> 2 25 -
trunk/WebCore/dom/Document.cpp
r68369 r68423 3914 3914 bool Document::queryCommandState(const String& commandName) 3915 3915 { 3916 return command(this, commandName).state() != FalseTriState;3916 return command(this, commandName).state() == TrueTriState; 3917 3917 } 3918 3918 -
trunk/WebCore/editing/EditorCommand.cpp
r68149 r68423 161 161 162 162 // Style is considered present when 163 // mac: present at the beginning of selection163 // Mac: present at the beginning of selection 164 164 // other: present throughout the selection 165 165 166 // FIXME: Make stateStyle() to use this editing method too for the cases where it's used for queryCommandState.167 166 bool styleIsPresent; 168 167 if (frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection()) … … 232 231 RefPtr<CSSMutableStyleDeclaration> style = CSSMutableStyleDeclaration::create(); 233 232 style->setProperty(propertyID, desiredValue); 233 234 if (frame->editor()->behavior().shouldToggleStyleBasedOnStartOfSelection()) 235 return frame->editor()->selectionStartHasStyle(style.get()) ? TrueTriState : FalseTriState; 234 236 return frame->editor()->selectionHasStyle(style.get()); 235 237 }
Note: See TracChangeset
for help on using the changeset viewer.