Changeset 87008 in webkit
- Timestamp:
- May 20, 2011 6:15:40 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87007 r87008 1 2011-05-20 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Kent Tamura. 4 5 Special characters can be inserted in text field having reached maxlength 6 https://bugs.webkit.org/show_bug.cgi?id=19479 7 <rdar://problem/7828739> 8 9 * platform/mac/editing/input/maxlength-expected.txt: Added. 10 * platform/mac/editing/input/maxlength.html: Added. 11 12 * fast/forms/input-number-commit-valid-only-expected.txt: 13 * fast/forms/script-tests/input-number-commit-valid-only.js: 14 The user can make a number field empty by deleting its content, so there is no reason why 15 execCommand shouldn't be able to make it empty. 16 1 17 2011-05-20 Andy Estes <aestes@apple.com> 2 18 -
trunk/LayoutTests/fast/forms/input-number-commit-valid-only-expected.txt
r67164 r87008 6 6 PASS input.value is "512" 7 7 PASS input.value is "512" 8 PASS input.value is " 512"8 PASS input.value is "" 9 9 PASS successfullyParsed is true 10 10 -
trunk/LayoutTests/fast/forms/script-tests/input-number-commit-valid-only.js
r67164 r87008 20 20 document.execCommand('InsertText', false, ''); 21 21 input.blur(); 22 shouldBe('input.value', '" 512"');22 shouldBe('input.value', '""'); 23 23 24 24 var successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r87007 r87008 1 2011-05-20 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Kent Tamura. 4 5 Special characters can be inserted in text field having reached maxlength 6 https://bugs.webkit.org/show_bug.cgi?id=19479 7 <rdar://problem/7828739> 8 9 Test: platform/mac/editing/input/maxlength.html 10 11 * editing/CompositeEditCommand.cpp: 12 (WebCore::CompositeEditCommand::insertTextIntoNode): 13 (WebCore::CompositeEditCommand::replaceTextInNode): 14 Avoid hitting an assertion below, now that we can get here with empty text. 15 16 * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertText): There is still work to do 17 even if beforetextinput removed all text from the event. At the very least, we should delete 18 the current selection. 19 1 20 2011-05-20 Andy Estes <aestes@apple.com> 2 21 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r86854 r87008 322 322 void CompositeEditCommand::insertTextIntoNode(PassRefPtr<Text> node, unsigned offset, const String& text) 323 323 { 324 applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, text)); 324 if (!text.isEmpty()) 325 applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, text)); 325 326 } 326 327 … … 333 334 { 334 335 applyCommandToComposite(DeleteFromTextNodeCommand::create(node.get(), offset, count)); 335 applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, replacementText)); 336 if (!replacementText.isEmpty()) 337 applyCommandToComposite(InsertIntoTextNodeCommand::create(node, offset, replacementText)); 336 338 } 337 339 -
trunk/Source/WebCore/editing/TypingCommand.cpp
r85864 r87008 183 183 } 184 184 185 if (newText.isEmpty())186 return;187 188 185 // Set the starting and ending selection appropriately if we are using a selection 189 186 // that is different from the current selection. In the future, we should change EditCommand
Note: See TracChangeset
for help on using the changeset viewer.