Changeset 39114 in webkit
- Timestamp:
- Dec 8, 2008 4:15:34 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 13 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r39110 r39114 1 2008-12-08 Darin Adler <darin@apple.com> 2 3 Reviewed by John Sullivan. 4 5 - tests for https://bugs.webkit.org/show_bug.cgi?id=22409 6 REGRESSION: cmd-shift-left/right don't switch tabs, instead select text 7 8 * editing/execCommand/enabling-and-selection-2-expected.txt: Added. 9 * editing/execCommand/enabling-and-selection-2.html: Added. 10 * editing/execCommand/enabling-and-selection-expected.txt: Added. 11 * editing/execCommand/enabling-and-selection.html: Added. 12 * editing/execCommand/resources: Added. 13 * editing/execCommand/resources/TEMPLATE.html: Copied from LayoutTests/fast/js/resources/TEMPLATE.html. 14 * editing/execCommand/resources/enabling-and-selection-2.js: Added. 15 * editing/execCommand/resources/enabling-and-selection.js: Added. 16 17 * fast/canvas/canvas-setTransform.html: Let make-js-test-wrappers update this. 18 * fast/canvas/canvas-strokeRect.html: Ditto. 19 20 * platform/qt/Skipped: Added enabling-and-selection-2 to the skipped list. 21 * platform/win/Skipped: Ditto. 22 1 23 2008-12-08 Pamela Greene <pam@chromium.org> 2 24 -
trunk/LayoutTests/editing/execCommand/resources/TEMPLATE.html
r39099 r39114 2 2 <html> 3 3 <head> 4 <link rel="stylesheet" href=" resources/js-test-style.css">5 <script src=" resources/js-test-pre.js"></script>4 <link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"> 5 <script src="../../fast/js/resources/js-test-pre.js"></script> 6 6 </head> 7 7 <body> … … 9 9 <div id="console"></div> 10 10 <script src="YOUR_JS_FILE_HERE"></script> 11 <script src=" resources/js-test-post.js"></script>11 <script src="../../fast/js/resources/js-test-post.js"></script> 12 12 </body> 13 13 </html> -
trunk/LayoutTests/fast/canvas/canvas-setTransform.html
r39079 r39114 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 <html> 3 <head> 1 4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> 2 5 <script src="../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 3 8 <p id="description"></p> 4 9 <div id="console"></div> 5 10 <script src="resources/canvas-setTransform.js"></script> 6 11 <script src="../js/resources/js-test-post.js"></script> 12 </body> 13 </html> -
trunk/LayoutTests/fast/canvas/canvas-strokeRect.html
r39080 r39114 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 <html> 3 <head> 1 4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> 2 5 <script src="../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 3 8 <p id="description"></p> 4 9 <div id="console"></div> 5 10 <script src="resources/canvas-strokeRect.js"></script> 6 11 <script src="../js/resources/js-test-post.js"></script> 12 </body> 13 </html> -
trunk/LayoutTests/platform/qt/Skipped
r38884 r39114 13 13 # ------- failing editing tests 14 14 editing/deleting/delete-to-end-of-paragraph.html 15 editing/execCommand/enabling-and-selection-2.html 15 16 editing/execCommand/italicizeByCharacter.html 16 17 editing/execCommand/nsresponder-indent.html -
trunk/LayoutTests/platform/win/Skipped
r38957 r39114 354 354 editing/pasteboard/undoable-fragment-removes.html 355 355 356 # Command enabling 357 editing/execCommand/enabling-and-selection-2.html 358 356 359 ################################################################################ 357 360 ######################### All of above may be related ########################## -
trunk/WebCore/ChangeLog
r39112 r39114 1 2008-12-03 Darin Adler <darin@apple.com> 2 3 Reviewed by John Sullivan. 4 5 - fix https://bugs.webkit.org/show_bug.cgi?id=22409 6 REGRESSION: cmd-shift-left/right don't switch tabs, instead select text 7 8 Tests: editing/execCommand/enabling-and-selection-2.html 9 editing/execCommand/enabling-and-selection.html 10 11 * editing/EditorCommand.cpp: Updated table to use these functions by their new names. 12 (WebCore::enabledVisibleSelection): Renamed this to reflect its new algorithm. 13 An invisible selection with a position that selects no characters doesn't count 14 as a visible selection. 15 (WebCore::enabledVisibleSelectionAndMark): Ditto. 16 1 17 2008-12-08 David Kilzer <ddkilzer@apple.com> 2 18 -
trunk/WebCore/editing/EditorCommand.cpp
r38629 r39114 1031 1031 } 1032 1032 1033 static bool enabledAnySelection(Frame* frame, Event*, EditorCommandSource) 1034 { 1035 return frame->selection()->isCaretOrRange(); 1036 } 1037 1038 static bool enabledAnySelectionAndMark(Frame* frame, Event*, EditorCommandSource) 1039 { 1040 return frame->selection()->isCaretOrRange() && frame->mark().isCaretOrRange(); 1033 static bool enabledVisibleSelection(Frame* frame, Event* event, EditorCommandSource) 1034 { 1035 // The term "visible" here includes a caret in editable text or a range in any text. 1036 const Selection& selection = frame->editor()->selectionForCommand(event); 1037 return (selection.isCaret() && selection.isContentEditable()) || selection.isRange(); 1038 } 1039 1040 static bool enabledVisibleSelectionAndMark(Frame* frame, Event* event, EditorCommandSource) 1041 { 1042 const Selection& selection = frame->editor()->selectionForCommand(event); 1043 return ((selection.isCaret() && selection.isContentEditable()) || selection.isRange()) 1044 && frame->mark().isCaretOrRange(); 1041 1045 } 1042 1046 … … 1262 1266 { "MakeTextWritingDirectionRightToLeft", { executeMakeTextWritingDirectionRightToLeft, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateTextWritingDirectionRightToLeft, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1263 1267 { "MoveBackward", { executeMoveBackward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1264 { "MoveBackwardAndModifySelection", { executeMoveBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1268 { "MoveBackwardAndModifySelection", { executeMoveBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1265 1269 { "MoveDown", { executeMoveDown, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1266 { "MoveDownAndModifySelection", { executeMoveDownAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1270 { "MoveDownAndModifySelection", { executeMoveDownAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1267 1271 { "MoveForward", { executeMoveForward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1268 { "MoveForwardAndModifySelection", { executeMoveForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1272 { "MoveForwardAndModifySelection", { executeMoveForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1269 1273 { "MoveLeft", { executeMoveLeft, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1270 { "MoveLeftAndModifySelection", { executeMoveLeftAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1274 { "MoveLeftAndModifySelection", { executeMoveLeftAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1271 1275 { "MovePageDown", { executeMovePageDown, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1272 { "MovePageDownAndModifySelection", { executeMovePageDownAndModifySelection, supportedFromMenuOrKeyBinding, enabled InEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1276 { "MovePageDownAndModifySelection", { executeMovePageDownAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1273 1277 { "MovePageUp", { executeMovePageUp, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1274 { "MovePageUpAndModifySelection", { executeMovePageUpAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1275 { "MoveParagraphBackwardAndModifySelection", { executeMoveParagraphBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1276 { "MoveParagraphForwardAndModifySelection", { executeMoveParagraphForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1278 { "MovePageUpAndModifySelection", { executeMovePageUpAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1279 { "MoveParagraphBackwardAndModifySelection", { executeMoveParagraphBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1280 { "MoveParagraphForwardAndModifySelection", { executeMoveParagraphForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1277 1281 { "MoveRight", { executeMoveRight, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1278 { "MoveRightAndModifySelection", { executeMoveRightAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1282 { "MoveRightAndModifySelection", { executeMoveRightAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1279 1283 { "MoveToBeginningOfDocument", { executeMoveToBeginningOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1280 { "MoveToBeginningOfDocumentAndModifySelection", { executeMoveToBeginningOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1284 { "MoveToBeginningOfDocumentAndModifySelection", { executeMoveToBeginningOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1281 1285 { "MoveToBeginningOfLine", { executeMoveToBeginningOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1282 { "MoveToBeginningOfLineAndModifySelection", { executeMoveToBeginningOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1286 { "MoveToBeginningOfLineAndModifySelection", { executeMoveToBeginningOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1283 1287 { "MoveToBeginningOfParagraph", { executeMoveToBeginningOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1284 { "MoveToBeginningOfParagraphAndModifySelection", { executeMoveToBeginningOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1288 { "MoveToBeginningOfParagraphAndModifySelection", { executeMoveToBeginningOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1285 1289 { "MoveToBeginningOfSentence", { executeMoveToBeginningOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1286 { "MoveToBeginningOfSentenceAndModifySelection", { executeMoveToBeginningOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1290 { "MoveToBeginningOfSentenceAndModifySelection", { executeMoveToBeginningOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1287 1291 { "MoveToEndOfDocument", { executeMoveToEndOfDocument, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1288 { "MoveToEndOfDocumentAndModifySelection", { executeMoveToEndOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1292 { "MoveToEndOfDocumentAndModifySelection", { executeMoveToEndOfDocumentAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1289 1293 { "MoveToEndOfLine", { executeMoveToEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1290 { "MoveToEndOfLineAndModifySelection", { executeMoveToEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1294 { "MoveToEndOfLineAndModifySelection", { executeMoveToEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1291 1295 { "MoveToEndOfParagraph", { executeMoveToEndOfParagraph, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1292 { "MoveToEndOfParagraphAndModifySelection", { executeMoveToEndOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1296 { "MoveToEndOfParagraphAndModifySelection", { executeMoveToEndOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1293 1297 { "MoveToEndOfSentence", { executeMoveToEndOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1294 { "MoveToEndOfSentenceAndModifySelection", { executeMoveToEndOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1298 { "MoveToEndOfSentenceAndModifySelection", { executeMoveToEndOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1295 1299 { "MoveUp", { executeMoveUp, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1296 { "MoveUpAndModifySelection", { executeMoveUpAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1300 { "MoveUpAndModifySelection", { executeMoveUpAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1297 1301 { "MoveWordBackward", { executeMoveWordBackward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1298 { "MoveWordBackwardAndModifySelection", { executeMoveWordBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1302 { "MoveWordBackwardAndModifySelection", { executeMoveWordBackwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1299 1303 { "MoveWordForward", { executeMoveWordForward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1300 { "MoveWordForwardAndModifySelection", { executeMoveWordForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1304 { "MoveWordForwardAndModifySelection", { executeMoveWordForwardAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1301 1305 { "MoveWordLeft", { executeMoveWordLeft, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1302 { "MoveWordLeftAndModifySelection", { executeMoveWordLeftAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1306 { "MoveWordLeftAndModifySelection", { executeMoveWordLeftAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1303 1307 { "MoveWordRight", { executeMoveWordRight, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1304 { "MoveWordRightAndModifySelection", { executeMoveWordRightAndModifySelection, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1308 { "MoveWordRightAndModifySelection", { executeMoveWordRightAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1305 1309 { "Outdent", { executeOutdent, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1306 1310 { "Paste", { executePaste, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } }, … … 1310 1314 { "RemoveFormat", { executeRemoveFormat, supported, enabledRangeInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1311 1315 { "SelectAll", { executeSelectAll, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1312 { "SelectLine", { executeSelectLine, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1313 { "SelectParagraph", { executeSelectParagraph, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1314 { "SelectSentence", { executeSelectSentence, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1315 { "SelectToMark", { executeSelectToMark, supportedFromMenuOrKeyBinding, enabled AnySelectionAndMark, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1316 { "SelectWord", { executeSelectWord, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1317 { "SetMark", { executeSetMark, supportedFromMenuOrKeyBinding, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1316 { "SelectLine", { executeSelectLine, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1317 { "SelectParagraph", { executeSelectParagraph, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1318 { "SelectSentence", { executeSelectSentence, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1319 { "SelectToMark", { executeSelectToMark, supportedFromMenuOrKeyBinding, enabledVisibleSelectionAndMark, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1320 { "SelectWord", { executeSelectWord, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1321 { "SetMark", { executeSetMark, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1318 1322 { "Strikethrough", { executeStrikethrough, supported, enabledInRichlyEditableText, stateStrikethrough, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1319 1323 { "Subscript", { executeSubscript, supported, enabledInRichlyEditableText, stateSubscript, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1320 1324 { "Superscript", { executeSuperscript, supported, enabledInRichlyEditableText, stateSuperscript, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1321 { "SwapWithMark", { executeSwapWithMark, supportedFromMenuOrKeyBinding, enabled AnySelectionAndMark, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1325 { "SwapWithMark", { executeSwapWithMark, supportedFromMenuOrKeyBinding, enabledVisibleSelectionAndMark, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1322 1326 { "ToggleBold", { executeToggleBold, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateBold, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1323 1327 { "ToggleItalic", { executeToggleItalic, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateItalic, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, … … 1328 1332 { "Unlink", { executeUnlink, supported, enabledRangeInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1329 1333 { "Unscript", { executeUnscript, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1330 { "Unselect", { executeUnselect, supported, enabled AnySelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1334 { "Unselect", { executeUnselect, supported, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1331 1335 { "Yank", { executeYank, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1332 1336 { "YankAndSelect", { executeYankAndSelect, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, -
trunk/WebKitTools/ChangeLog
r39109 r39114 1 2008-12-08 Darin Adler <darin@apple.com> 2 3 Reviewed by John Sullivan. 4 5 - test machinery for https://bugs.webkit.org/show_bug.cgi?id=22409 6 REGRESSION: cmd-shift-left/right don't switch tabs, instead select text 7 8 * DumpRenderTree/LayoutTestController.cpp: 9 (isCommandEnabledCallback): Added. 10 (LayoutTestController::staticFunctions): Added "isCommandEnabled". 11 * DumpRenderTree/LayoutTestController.h: Ditto. 12 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 13 (LayoutTestController::isCommandEnabled): Ditto. 14 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 15 (-[CommandValidationTarget initWithAction:]): Added. Used to get the 16 command validation system to tell us if a comment is enabled. 17 (-[CommandValidationTarget action]): Ditto. 18 (-[CommandValidationTarget tag]): Ditto. 19 (LayoutTestController::isCommandEnabled): Ditto. 20 * DumpRenderTree/win/LayoutTestControllerWin.cpp: 21 (LayoutTestController::isCommandEnabled): Ditto. 22 1 23 2008-12-08 David Kilzer <ddkilzer@apple.com> 2 24 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r38735 r39114 334 334 } 335 335 336 static JSValueRef isCommandEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 337 { 338 // Has Mac implementation. 339 340 if (argumentCount < 1) 341 return JSValueMakeUndefined(context); 342 343 JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); 344 ASSERT(!*exception); 345 346 LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 347 348 return JSValueMakeBoolean(context, controller->isCommandEnabled(name.get())); 349 } 350 336 351 static JSValueRef keepWebHistoryCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 337 352 { … … 781 796 { "encodeHostName", encodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 782 797 { "execCommand", execCommandCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 798 { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 783 799 { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 784 800 { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r38735 r39114 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 49 49 void execCommand(JSStringRef name, JSStringRef value); 50 50 void display(); 51 bool isCommandEnabled(JSStringRef name); 51 52 void keepWebHistory(); 52 53 void notifyDone(); -
trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r38739 r39114 255 255 } 256 256 257 bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) 258 { 259 // FIXME: implement 260 return false; 261 } 262 257 263 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) 258 264 { -
trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r38735 r39114 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 56 56 #import <wtf/RetainPtr.h> 57 57 58 @interface CommandValidationTarget : NSObject <NSValidatedUserInterfaceItem> 59 { 60 SEL _action; 61 } 62 - (id)initWithAction:(SEL)action; 63 @end 64 65 @implementation CommandValidationTarget 66 67 - (id)initWithAction:(SEL)action 68 { 69 self = [super init]; 70 if (!self) 71 return nil; 72 73 _action = action; 74 return self; 75 } 76 77 - (SEL)action 78 { 79 return _action; 80 } 81 82 - (NSInteger)tag 83 { 84 return 0; 85 } 86 87 @end 88 58 89 LayoutTestController::~LayoutTestController() 59 90 { … … 318 349 } 319 350 351 bool LayoutTestController::isCommandEnabled(JSStringRef name) 352 { 353 RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); 354 NSString *nameNS = reinterpret_cast<const NSString *>(nameCF.get()); 355 356 // Accept command strings with capital letters for first letter without trailing colon. 357 if (![nameNS hasSuffix:@":"] && [nameNS length]) { 358 nameNS = [[[[nameNS substringToIndex:1] lowercaseString] 359 stringByAppendingString:[nameNS substringFromIndex:1]] 360 stringByAppendingString:@":"]; 361 } 362 363 SEL selector = NSSelectorFromString(nameNS); 364 RetainPtr<CommandValidationTarget> target(AdoptNS, [[CommandValidationTarget alloc] initWithAction:selector]); 365 id validator = [NSApp targetForAction:selector to:[mainFrame webView] from:target.get()]; 366 if (!validator) 367 return false; 368 if (![validator respondsToSelector:selector]) 369 return false; 370 if (![validator respondsToSelector:@selector(validateUserInterfaceItem:)]) 371 return true; 372 return [validator validateUserInterfaceItem:target.get()]; 373 } 374 320 375 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) 321 376 { -
trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r38735 r39114 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc.All rights reserved.2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 633 633 } 634 634 635 bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) 636 { 637 printf("ERROR: LayoutTestController::isCommandEnabled() not implemented\n"); 638 return false; 639 } 640 635 641 void LayoutTestController::clearAllDatabases() 636 642 {
Note: See TracChangeset
for help on using the changeset viewer.