contenteditable justify commands applied to next paragraph as well
[WebKit-https.git] / Source / WebCore / editing / ApplyStyleCommand.cpp
index 46df6e602d7c07457f3644d2464acb2f30e84ec5..fbac83360cf47c0a58e77f68526e15801564899f 100644 (file)
@@ -271,6 +271,8 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
 
     VisiblePosition paragraphStart(startOfParagraph(visibleStart));
     VisiblePosition nextParagraphStart(endOfParagraph(paragraphStart).next());
+    if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd))
+        visibleEnd = visibleEnd.previous(CannotCrossEditingBoundary);
     VisiblePosition beyondEnd(endOfParagraph(visibleEnd).next());
     while (paragraphStart.isNotNull() && paragraphStart != beyondEnd) {
         StyleChange styleChange(style, paragraphStart.deepEquivalent());