[webkit-changes] cvs commit: WebCore/khtml/editing
composite_edit_command.cpp
Justin
justing at opensource.apple.com
Mon Nov 14 14:09:08 PST 2005
justing 05/11/14 14:09:08
Modified: . ChangeLog
khtml/css css_valueimpl.cpp
khtml/editing composite_edit_command.cpp
Log:
Reviewed by harrison
<rdar://problem/4180820> Erroneous spacing between lines introduced on paste
Updated layout test results in editing/style
Added layout test in editing/pasteboard
* khtml/css/css_valueimpl.cpp:
Fixed a comment.
* khtml/editing/composite_edit_command.cpp:
(khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
Don't use clones of paragraphs already in the document to hold paragraph
contents, since they are likely to introduce unwanted styles, just use
a generic paragraph element. It's less likely, but still possible that a generic
paragraph element will have unwanted style, so we may want to eventually
use class=Apple-style-block.
Revision Changes Path
1.367 +19 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.366
retrieving revision 1.367
diff -u -r1.366 -r1.367
--- ChangeLog 14 Nov 2005 19:53:45 -0000 1.366
+++ ChangeLog 14 Nov 2005 22:09:03 -0000 1.367
@@ -1,3 +1,22 @@
+2005-11-14 Justin Garcia <justin.garcia at apple.com>
+
+ Reviewed by harrison
+
+ <rdar://problem/4180820> Erroneous spacing between lines introduced on paste
+
+ Updated layout test results in editing/style
+ Added layout test in editing/pasteboard
+
+ * khtml/css/css_valueimpl.cpp:
+ Fixed a comment.
+ * khtml/editing/composite_edit_command.cpp:
+ (khtml::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
+ Don't use clones of paragraphs already in the document to hold paragraph
+ contents, since they are likely to introduce unwanted styles, just use
+ a generic paragraph element. It's less likely, but still possible that a generic
+ paragraph element will have unwanted style, so we may want to eventually
+ use class=Apple-style-block.
+
2005-11-11 David Harrison <harrison at apple.com>
Reviewed by Darin.
1.80 +1 -1 WebCore/khtml/css/css_valueimpl.cpp
Index: css_valueimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/css_valueimpl.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- css_valueimpl.cpp 25 Oct 2005 00:07:45 -0000 1.79
+++ css_valueimpl.cpp 14 Nov 2005 22:09:07 -0000 1.80
@@ -617,7 +617,7 @@
const unsigned numInheritableProperties = sizeof(inheritableProperties) / sizeof(inheritableProperties[0]);
// This is the list of properties we want to copy in the copyBlockProperties() function.
-// It is the list of CSS properties that apply to specially to block-level elements.
+// It is the list of CSS properties that apply specially to block-level elements.
static const int blockProperties[] = {
CSS_PROP_ORPHANS,
CSS_PROP_OVERFLOW, // This can be also be applied to replaced elements
1.18 +3 -22 WebCore/khtml/editing/composite_edit_command.cpp
Index: composite_edit_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/composite_edit_command.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- composite_edit_command.cpp 9 Nov 2005 19:56:47 -0000 1.17
+++ composite_edit_command.cpp 14 Nov 2005 22:09:07 -0000 1.18
@@ -571,33 +571,14 @@
}
}
- // Create the block to insert. Most times, this will be a shallow clone of the block containing
- // the start of the selection (the start block), except for two cases:
- // 1) When the start block is a body element.
- // 2) When the start block is a mail blockquote and we are not in a position to insert
- // the new block as a peer of the start block. This prevents creating an unwanted
- // additional level of quoting.
- NodeImpl *startBlock = paragraphStart.node()->enclosingBlockFlowElement();
- NodeImpl *newBlock = 0;
- if (startBlock->hasTagName(bodyTag) || (isMailBlockquote(startBlock) && paragraphStart.node() != startBlock))
- newBlock = createDefaultParagraphElement(document());
- else
- newBlock = startBlock->cloneNode(false);
+ NodeImpl *newBlock = createDefaultParagraphElement(document());
NodeImpl *moveNode = paragraphStart.node();
if (paragraphStart.offset() >= paragraphStart.node()->caretMaxOffset())
moveNode = moveNode->traverseNextNode();
NodeImpl *endNode = paragraphEnd.node();
-
- if (paragraphStart.node()->hasTagName(bodyTag)) {
- insertNodeAt(newBlock, paragraphStart.node(), 0);
- }
- else if (paragraphStart.node()->hasTagName(brTag)) {
- insertNodeAfter(newBlock, paragraphStart.node());
- }
- else {
- insertNodeBefore(newBlock, paragraphStart.upstream().node());
- }
+
+ insertNodeAt(newBlock, paragraphStart.node(), paragraphStart.offset());
while (moveNode && !moveNode->isBlockFlow()) {
NodeImpl *next = moveNode->traverseNextSibling();
More information about the webkit-changes
mailing list