Changeset 70810 in webkit
- Timestamp:
- Oct 28, 2010 2:38:45 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70808 r70810 1 2010-10-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 queryCommandValue should fall back to queryCommandState 6 https://bugs.webkit.org/show_bug.cgi?id=48479 7 8 Modified the existing tests to ensure queryCommandValue returns 'true' or 'false' 9 for commands that supports queryCommandState. 10 11 * editing/execCommand/script-tests/query-command-state.js: 12 (testQueryCommandState): 13 * editing/execCommand/script-tests/query-text-alignment.js: 14 (isEquivalentBoolean): 15 (queryTextAlignment): 16 1 17 2010-10-28 Martin Robinson <mrobinson@igalia.com> 2 18 -
trunk/LayoutTests/editing/execCommand/script-tests/query-command-state.js
r68423 r70810 10 10 var selected = selector(testContainer); 11 11 var actualState = document.queryCommandState(command); 12 var actualValue = document.queryCommandValue(command); 12 13 var action = 'queryCommandState("' + command + '") returns ' + actualState + ' when selecting ' + selected + ' of "' + contents + '"'; 13 if (actualState === expectedState) 14 if (actualState != expectedState) 15 testFailed(action + ', expected ' + expectedState + ''); 16 else if (actualValue != actualState.toString()) 17 testFailed(action + ' but queryCommandValue returned ' + actualValue); 18 else 14 19 testPassed(action); 15 else16 testFailed(action + ', expected ' + expectedState + '');17 20 } 18 21 -
trunk/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
r68904 r70810 13 13 var left = document.queryCommandState('justifyLeft'); 14 14 var right = document.queryCommandState('justifyRight'); 15 var centerValue = document.queryCommandValue('justifyCenter'); 16 var fullValue = document.queryCommandValue('justifyFull'); 17 var leftValue = document.queryCommandValue('justifyLeft'); 18 var rightValue = document.queryCommandValue('justifyRight'); 15 19 if ((center && full) || (full && left) || (left && right) || (right && center)) 16 20 testFailed('Inconsistent state when selecting ' + selected + ' of "' + content + '". More than one of justifyCenter, justifyFull, justifyRight, and justifyLeft returned true.') … … 18 22 var actual = center ? 'center' : full ? 'full' : left ? 'left' : right ? 'right' : ''; 19 23 var action = "queryCommand('format') returns \"" + actual + '" when selecting ' + selected + ' of "' + content + '"'; 20 if (actual == expected) 24 if (actual != expected) 25 testFailed(action + ' but expected "' + expected + '"'); 26 else if (centerValue != center.toString() || fullValue != full.toString() 27 || leftValue != left.toString() || rightValue != right.toString()) 28 testFailed(action + ' but values returned by queryCommandState and queryCommandValue did not match'); 29 else 21 30 testPassed(action); 22 else23 testFailed(action + ' but expected "' + expected + '"');24 31 } 25 32 -
trunk/WebCore/ChangeLog
r70805 r70810 1 2010-10-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 queryCommandValue should fall back to queryCommandState 6 https://bugs.webkit.org/show_bug.cgi?id=48479 7 8 Added a fallback to Command::value so that commands with a state function without a value function 9 returns the value returned by the state function as a string. 10 11 * editing/EditorCommand.cpp: 12 (WebCore::Editor::Command::value): 13 1 14 2010-10-28 Pavel Feldman <pfeldman@chromium.org> 2 15 -
trunk/WebCore/editing/EditorCommand.cpp
r69876 r70810 1639 1639 if (!isSupported() || !m_frame) 1640 1640 return String(); 1641 if (m_command->value == valueNull && m_command->state != stateNone) 1642 return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false"; 1641 1643 return m_command->value(m_frame.get(), triggeringEvent); 1642 1644 }
Note: See TracChangeset
for help on using the changeset viewer.