Changeset 68904 in webkit
- Timestamp:
- Oct 1, 2010 11:25:59 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68897 r68904 1 2010-09-30 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Implement queryCommandState('justifyFull') 6 https://bugs.webkit.org/show_bug.cgi?id=46954 7 8 Added tests for queryCommandState('justifyFull') to editing/execCommand/query-text-alignment.html 9 10 * editing/execCommand/query-text-alignment-expected.txt: 11 * editing/execCommand/script-tests/query-text-alignment.js: 12 (queryTextAlignment): 13 (runRangeTests): 14 1 15 2010-10-01 David Hyatt <hyatt@apple.com> 2 16 -
trunk/LayoutTests/editing/execCommand/query-text-alignment-expected.txt
r68465 r68904 1 Tests queryCommandState('justifyCenter'), queryCommandState('justify Left'),queryCommandState('justifyRight')1 Tests queryCommandState('justifyCenter'), queryCommandState('justifyFull'), queryCommandState('justifyLeft'), and queryCommandState('justifyRight') 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 9 9 PASS queryCommand('format') returns "" when selecting first position of "<p>hello</p>" 10 10 PASS queryCommand('format') returns "center" when selecting first position of "<p align="center">hello</p>" 11 PASS queryCommand('format') returns "full" when selecting first position of "<p align="justify">hello</p>" 11 12 PASS queryCommand('format') returns "left" when selecting first position of "<p align="left">hello</p>" 12 13 PASS queryCommand('format') returns "right" when selecting first position of "<p align="right">hello</p>" 13 14 PASS queryCommand('format') returns "center" when selecting first position of "<p style="text-align: center;">hello</p>" 15 PASS queryCommand('format') returns "full" when selecting first position of "<p style="text-align: justify;">hello</p>" 14 16 PASS queryCommand('format') returns "left" when selecting first position of "<p style="text-align: left;">hello</p>" 15 17 PASS queryCommand('format') returns "right" when selecting first position of "<p style="text-align: right;">hello</p>" 18 PASS queryCommand('format') returns "full" when selecting first position of "<p align="center" style="text-align: justify;">hello</p>" 16 19 PASS queryCommand('format') returns "left" when selecting first position of "<p align="right" style="text-align: left;">hello</p>" 17 20 PASS queryCommand('format') returns "right" when selecting first position of "<p align="center" style="text-align: right;">hello</p>" … … 22 25 PASS queryCommand('format') returns "" when selecting first position of "<h1>hello</h1>" 23 26 PASS queryCommand('format') returns "center" when selecting first position of "<h1 align="center">hello</h1>" 27 PASS queryCommand('format') returns "full" when selecting first position of "<h1 align="justify">hello</h1>" 24 28 PASS queryCommand('format') returns "left" when selecting first position of "<h2 align="left">hello</h2>" 25 29 PASS queryCommand('format') returns "right" when selecting first position of "<h3 align="right">hello</h3>" … … 27 31 PASS queryCommand('format') returns "left" when selecting first position of "<h5 align="left">hello</h5>" 28 32 PASS queryCommand('format') returns "right" when selecting first position of "<h6 align="right">hello</h6>" 33 PASS queryCommand('format') returns "full" when selecting first position of "<div align="justify">hello</div>" 29 34 PASS queryCommand('format') returns "center" when selecting first position of "<div align="center">hello</div>" 30 35 PASS queryCommand('format') returns "left" when selecting first position of "<div align="left">hello</div>" … … 37 42 PASS queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p align="right">world</p>" 38 43 PASS queryCommand('format') returns "center" when selecting middle of "<p align="center">hello</p><p align="center">world</p>" 44 PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p align="justify">world</p>" 39 45 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="left">world</p>" 40 46 PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p align="right">world</p>" 41 47 PASS queryCommand('format') returns "" when selecting middle of "<div align="right">hello<p align="left">world</p></div>" 42 48 PASS queryCommand('format') returns "" when selecting middle of "<div align="left"><p align="center">world</p>hello</div>" 43 FAIL queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>" but expected "[object Object]" 49 PASS queryCommand('format') returns "" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>" 50 PASS queryCommand('format') returns "" when selecting middle of "<p align="justify">hello</p><p>w</p><p align="center">orld</p>" 44 51 45 52 Tests for mac … … 49 56 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="right">world</p>" 50 57 PASS queryCommand('format') returns "center" when selecting middle of "<p align="center">hello</p><p align="center">world</p>" 58 PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p align="justify">world</p>" 51 59 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p align="left">world</p>" 52 60 PASS queryCommand('format') returns "right" when selecting middle of "<p align="right">hello</p><p align="right">world</p>" 53 61 PASS queryCommand('format') returns "right" when selecting middle of "<div align="right">hello<p align="left">world</p></div>" 54 62 PASS queryCommand('format') returns "center" when selecting middle of "<div align="left"><p align="center">world</p>hello</div>" 55 FAIL queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>" but expected "[object Object]" 63 PASS queryCommand('format') returns "left" when selecting middle of "<p align="left">hello</p><p>w</p><p align="left">orld</p>" 64 PASS queryCommand('format') returns "full" when selecting middle of "<p align="justify">hello</p><p>w</p><p align="center">orld</p>" 56 65 PASS successfullyParsed is true 57 66 -
trunk/LayoutTests/editing/execCommand/script-tests/query-text-alignment.js
r68465 r68904 1 description("Tests queryCommandState('justifyCenter'), queryCommandState('justify Left'),queryCommandState('justifyRight')")1 description("Tests queryCommandState('justifyCenter'), queryCommandState('justifyFull'), queryCommandState('justifyLeft'), and queryCommandState('justifyRight')") 2 2 3 3 var testContainer = document.createElement("div"); … … 10 10 var selected = selector(testContainer); 11 11 var center = document.queryCommandState('justifyCenter'); 12 var full = document.queryCommandState('justifyFull'); 12 13 var left = document.queryCommandState('justifyLeft'); 13 14 var right = document.queryCommandState('justifyRight'); 14 if ((center && left) || (left && right) || (right && center))15 testFailed('Inconsistent state when selecting ' + selected + ' of "' + content + '". More than one of justifyCenter, justify Right, and justifyLeft returned true.')15 if ((center && full) || (full && left) || (left && right) || (right && center)) 16 testFailed('Inconsistent state when selecting ' + selected + ' of "' + content + '". More than one of justifyCenter, justifyFull, justifyRight, and justifyLeft returned true.') 16 17 17 var actual = center ? 'center' : left ? 'left' : right ? 'right' : '';18 var actual = center ? 'center' : full ? 'full' : left ? 'left' : right ? 'right' : ''; 18 19 var action = "queryCommand('format') returns \"" + actual + '" when selecting ' + selected + ' of "' + content + '"'; 19 20 if (actual == expected) … … 46 47 queryTextAlignment(selectFirstPosition, '<p>hello</p>', ''); 47 48 queryTextAlignment(selectFirstPosition, '<p align="center">hello</p>', 'center'); 49 queryTextAlignment(selectFirstPosition, '<p align="justify">hello</p>', 'full'); 48 50 queryTextAlignment(selectFirstPosition, '<p align="left">hello</p>', 'left'); 49 51 queryTextAlignment(selectFirstPosition, '<p align="right">hello</p>', 'right'); 50 52 queryTextAlignment(selectFirstPosition, '<p style="text-align: center;">hello</p>', 'center'); 53 queryTextAlignment(selectFirstPosition, '<p style="text-align: justify;">hello</p>', 'full'); 51 54 queryTextAlignment(selectFirstPosition, '<p style="text-align: left;">hello</p>', 'left'); 52 55 queryTextAlignment(selectFirstPosition, '<p style="text-align: right;">hello</p>', 'right'); 56 queryTextAlignment(selectFirstPosition, '<p align="center" style="text-align: justify;">hello</p>', 'full'); 53 57 queryTextAlignment(selectFirstPosition, '<p align="right" style="text-align: left;">hello</p>', 'left'); 54 58 queryTextAlignment(selectFirstPosition, '<p align="center" style="text-align: right;">hello</p>', 'right'); … … 59 63 queryTextAlignment(selectFirstPosition, '<h1>hello</h1>', ''); 60 64 queryTextAlignment(selectFirstPosition, '<h1 align="center">hello</h1>', 'center'); 65 queryTextAlignment(selectFirstPosition, '<h1 align="justify">hello</h1>', 'full'); 61 66 queryTextAlignment(selectFirstPosition, '<h2 align="left">hello</h2>', 'left'); 62 67 queryTextAlignment(selectFirstPosition, '<h3 align="right">hello</h3>', 'right'); … … 64 69 queryTextAlignment(selectFirstPosition, '<h5 align="left">hello</h5>', 'left'); 65 70 queryTextAlignment(selectFirstPosition, '<h6 align="right">hello</h6>', 'right'); 71 queryTextAlignment(selectFirstPosition, '<div align="justify">hello</div>', 'full'); 66 72 queryTextAlignment(selectFirstPosition, '<div align="center">hello</div>', 'center'); 67 73 queryTextAlignment(selectFirstPosition, '<div align="left">hello</div>', 'left'); … … 79 85 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p align="right">world</p>', {'mac': 'left', 'win': ''}[editingBehavior]); 80 86 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="center">hello</p><p align="center">world</p>', 'center'); 87 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="justify">hello</p><p align="justify">world</p>', 'full'); 81 88 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p align="left">world</p>', 'left'); 82 89 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="right">hello</p><p align="right">world</p>', 'right'); 83 90 queryTextAlignment(selectMiddleOfHelloWorld, '<div align="right">hello<p align="left">world</p></div>', {'mac': 'right', 'win': ''}[editingBehavior]); 84 91 queryTextAlignment(selectMiddleOfHelloWorld, '<div align="left"><p align="center">world</p>hello</div>', {'mac': 'center', 'win': ''}[editingBehavior]); 85 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p>w</p><p align="left">orld</p>', {'mac': 'left', 'win': ''}); 92 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="left">hello</p><p>w</p><p align="left">orld</p>', {'mac': 'left', 'win': ''}[editingBehavior]); 93 queryTextAlignment(selectMiddleOfHelloWorld, '<p align="justify">hello</p><p>w</p><p align="center">orld</p>', {'mac': 'full', 'win': ''}[editingBehavior]); 86 94 } 87 95 -
trunk/WebCore/ChangeLog
r68902 r68904 1 2010-09-30 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Darin Adler. 4 5 Implement queryCommandState('justifyFull') 6 https://bugs.webkit.org/show_bug.cgi?id=46954 7 8 Implemented queryCommandState('justifyFull'). 9 New tests are added to editing/style/inline-style-container.html 10 11 * editing/ApplyStyleCommand.cpp: 12 (WebCore::getTextAlignment): Added support for CSSValueJustify. 13 * editing/EditorCommand.cpp: 14 (WebCore::stateJustifyFull): Added. 15 (WebCore::createCommandMap): Added stateJustifyFull. 16 1 17 2010-10-01 Jia Pu <jpu@apple.com> 2 18 -
trunk/WebCore/editing/ApplyStyleCommand.cpp
r68830 r68904 396 396 case CSSValueWebkitCenter: 397 397 return CSSValueCenter; 398 case CSSValueJustify: 399 return CSSValueJustify; 398 400 case CSSValueLeft: 399 401 case CSSValueWebkitLeft: -
trunk/WebCore/editing/EditorCommand.cpp
r68670 r68904 1303 1303 { 1304 1304 return stateStyle(frame, CSSPropertyTextAlign, "center"); 1305 } 1306 1307 static TriState stateJustifyFull(Frame* frame, Event*) 1308 { 1309 return stateStyle(frame, CSSPropertyTextAlign, "justify"); 1305 1310 } 1306 1311 … … 1410 1415 { "Italic", { executeToggleItalic, supported, enabledInRichlyEditableText, stateItalic, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1411 1416 { "JustifyCenter", { executeJustifyCenter, supported, enabledInRichlyEditableText, stateJustifyCenter, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1412 { "JustifyFull", { executeJustifyFull, supported, enabledInRichlyEditableText, state None, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },1417 { "JustifyFull", { executeJustifyFull, supported, enabledInRichlyEditableText, stateJustifyFull, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1413 1418 { "JustifyLeft", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateJustifyLeft, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1414 1419 { "JustifyNone", { executeJustifyLeft, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
Note: See TracChangeset
for help on using the changeset viewer.