[Webkit-unassigned] [Bug 71207] An extra line break is inserted when pasting into a font element
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Mar 23 22:00:50 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=71207
--- Comment #13 from Ryosuke Niwa <rniwa at webkit.org> 2012-03-23 22:00:50 PST ---
Anyway, my preference is to do something along the line of:
Index: Source/WebCore/editing/ReplaceSelectionCommand.cpp
===================================================================
--- Source/WebCore/editing/ReplaceSelectionCommand.cpp (revision 111896)
+++ Source/WebCore/editing/ReplaceSelectionCommand.cpp (working copy)
@@ -121,9 +121,14 @@
// same. E.g.,
// <div>foo^</div>^
// The two positions above are the same visual position, but we want to stay in the same block.
- Node* stopNode = pos.deprecatedNode()->enclosingBlockFlowElement();
- while (stopNode != pos.deprecatedNode() && VisiblePosition(pos) == VisiblePosition(pos.next()))
- pos = pos.next();
+ Node* enclosingBlock = pos.containerNode()->enclosingBlockFlowElement();
+ for (Position nextPosition = pos; ;pos = nextPosition) {
+ nextPosition = pos.next();
+ if (nextPosition == pos
+ || nextPosition.containerNode()->enclosingBlockFlowElement() != enclosingBlock
+ || VisiblePosition(pos) != VisiblePosition(nextPosition))
+ break;
+ }
return pos;
}
Note that a couple of tests fail with this change along, and there's about a dozen test to be rebaselined.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list