Changeset 21212 in webkit
- Timestamp:
- May 1, 2007, 3:20:46 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r21211 r21212 1 2007-05-01 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by darin 4 5 <rdar://problem/5002441> 6 Pressing space key does nothing above quoted content or a signature 7 8 Demonstrates the bug: 9 * editing/inserting/5002441-expected.checksum: Added. 10 * editing/inserting/5002441-expected.png: Added. 11 * editing/inserting/5002441-expected.txt: Added. 12 * editing/inserting/5002441.html: Added. 13 14 Fixed. Spaces passed to execCommand("InsertText", ...) 15 are no longer collapsed: 16 * editing/inserting/editable-html-element-expected.checksum: 17 * editing/inserting/editable-html-element-expected.png: 18 * editing/inserting/editable-html-element-expected.txt: 19 * editing/pasteboard/4989774-expected.checksum: 20 * editing/pasteboard/4989774-expected.png: 21 * editing/pasteboard/4989774-expected.txt: 22 * editing/selection/4983858-expected.checksum: 23 * editing/selection/4983858-expected.png: 24 * editing/selection/4983858-expected.txt: 25 1 26 2007-05-01 Darin Adler <darin@apple.com> 2 27 -
trunk/LayoutTests/editing/inserting/editable-html-element-expected.checksum
r14195 r21212 1 d53960e87b7f062db7c195bd7a7a7f9a 1 1186e4514352fbbb37f6518c9093f1c3 -
trunk/LayoutTests/editing/inserting/editable-html-element-expected.txt
r20950 r21212 18 18 RenderBody {BODY} at (8,8) size 784x584 19 19 RenderBlock (anonymous) at (0,0) size 784x54 20 RenderText {#text} at (0,0) size 78 3x5421 text run at (0,0) width 7 14: "This tests to make sure that when the enclosing block is the body element, and when the html element is editable,"22 text run at (7 14,0) width 69: "inserting a"20 RenderText {#text} at (0,0) size 784x54 21 text run at (0,0) width 783: "This tests to make sure that when the enclosing block is the body element, and when the html element is editable, inserting a" 22 text run at (783,0) width 1: " " 23 23 text run at (0,18) width 755: "paragraph separator doesn't split the body (inserting a paragraph separator usually splits/clones the enclosing block flow " 24 24 text run at (0,36) width 58: "element)." -
trunk/LayoutTests/editing/pasteboard/4989774-expected.checksum
r20963 r21212 1 6c03d26dbbfba19f07b9a4e4a1c322d0 1 be6fd52ad002752178c046831f449f1c -
trunk/LayoutTests/editing/pasteboard/4989774-expected.txt
r19648 r21212 8 8 RenderImage {IMG} at (152,0) size 76x103 9 9 RenderBR {BR} at (228,103) size 0x0 10 RenderText {#text} at (0,103) size 784x36 11 text run at (0,103) width 629: "This tests for a bug where an images pasted on the same line would appear on different lines. " 12 text run at (629,103) width 153: "You should see several" 13 text run at (782,103) width 2: " " 14 text run at (0,121) width 307: "pictures above all in the same line/paragraph." 10 RenderText {#text} at (0,103) size 739x36 11 text run at (0,103) width 739: "This tests for a bug where an images pasted on the same line would appear on different lines. You should see " 12 text run at (0,121) width 358: "several pictures above all in the same line/paragraph." 15 13 RenderText {#text} at (0,0) size 0x0 16 14 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/editing/selection/4983858-expected.checksum
r20275 r21212 1 2 7a07777535624367be11a3a86abf0961 28b7b7fc983f2d802da039a49859f928 -
trunk/LayoutTests/editing/selection/4983858-expected.txt
r19542 r21212 5 5 RenderBody {BODY} at (8,8) size 784x584 6 6 RenderBlock (anonymous) at (0,0) size 784x36 7 RenderText {#text} at (0,0) size 772x36 8 text run at (0,0) width 570: "This tests for a bug where selecting a word would select the line break and word before it. " 9 text run at (570,0) width 135: "Only the word in the " 10 text run at (705,0) width 67: "paragraph " 7 RenderText {#text} at (0,0) size 780x36 8 text run at (0,0) width 780: "This tests for a bug where selecting a word would select the line break and word before it. Only the word in the paragraph " 11 9 text run at (0,18) width 162: "below should be selected:" 12 10 RenderBlock {DIV} at (0,36) size 784x18 -
trunk/WebCore/ChangeLog
r21211 r21212 1 2007-05-01 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by darin 4 5 <rdar://problem/5002441> 6 Pressing space key does nothing above quoted content or a signature 7 8 Inserting a space under these circumstances inserts a single 9 text node containing a regular space and then does a layout. 10 That space isn't rendered (which is correct). Whitespace 11 rebalancing is supposed to correct it but failed. It replaces 12 the space with a non-breaking space, but that change doesn't 13 dirty line boxes (9441) and so the space isn't rendered. 14 15 This workaround turns all incoming spaces into non-breaking 16 spaces before they're inserted (they're rebalanced after 17 insertion and turned back into regular spaces if possible). 18 19 * editing/InsertTextCommand.cpp: 20 (WebCore::InsertTextCommand::prepareForTextInsertion): Removed 21 an old irrelevant FIXME. 22 (WebCore::InsertTextCommand::input): Turn incoming spaces into 23 non breaking spaces before inserting them. 24 1 25 2007-05-01 Darin Adler <darin@apple.com> 2 26 -
trunk/WebCore/editing/InsertTextCommand.cpp
r20960 r21212 27 27 #include "InsertTextCommand.h" 28 28 29 #include "CharacterNames.h" 29 30 #include "CSSMutableStyleDeclaration.h" 30 31 #include "CSSComputedStyleDeclaration.h" … … 64 65 // Prepare for text input by looking at the specified position. 65 66 // It may be necessary to insert a text node to receive characters. 66 // FIXME: What is the rootEditable() check about? Seems like it67 // assumes that the content before (or after) pos.node() is editable68 // (i.e. pos is at an editable/non-editable boundary). That seems69 // like a bad assumption.70 67 if (!pos.node()->isTextNode()) { 71 68 RefPtr<Node> textNode = document()->createEditingTextNode(""); 72 73 69 insertNodeAt(textNode.get(), pos); 74 75 70 return Position(textNode.get(), 0); 76 71 } … … 85 80 } 86 81 87 void InsertTextCommand::input(const String &text, bool selectInsertedText)82 void InsertTextCommand::input(const String& originalText, bool selectInsertedText) 88 83 { 84 String text = originalText; 85 89 86 ASSERT(text.find('\n') == -1); 90 87 91 88 if (endingSelection().isNone()) 92 89 return; 90 91 if (RenderObject* renderer = endingSelection().start().node()->renderer()) 92 if (renderer->style()->collapseWhiteSpace()) 93 // Turn all spaces into non breaking spaces, to make sure that they are treated 94 // literally, and aren't collapsed after insertion. They will be rebalanced 95 // (turned into a sequence of regular and non breaking spaces) below. 96 text.replace(' ', noBreakSpace); 93 97 94 98 // Delete the current selection. … … 128 132 rebalanceWhitespaceAt(endPosition); 129 133 // Rebalancing on both sides isn't necessary if we've inserted a space. 130 if ( text != " ")134 if (originalText != " ") 131 135 rebalanceWhitespaceAt(startPosition); 132 136
Note:
See TracChangeset
for help on using the changeset viewer.