haikuwebkit/LayoutTests/editing/inserting/break-blockquote-after-dele...

40 lines
1.2 KiB
HTML
Raw Permalink Normal View History

WebCore: 2009-06-26 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. Fix for <rdar://problem/7000796> REGRESSION(34681): Breaking up quoted text makes new, unquoted text blue after certain steps; repros with some messages Test: editing/inserting/break-blockquote-after-delete.html Keep track of whether the typing style should be preserved after the TypingCommand is applied. When adding onto an open typing command, keep that flag up to date. In this case, an InsertParagraphSeparatorInQuotedContent command, which should not preserve typing style, was following an open Delete command, which does preserve the typing style. So we were applying the original typing style (from before the delete, so blue text) to the cursor in the unquoted area after breaking up the blockquote. * editing/TypingCommand.cpp: (WebCore::TypingCommand::TypingCommand): (WebCore::TypingCommand::typingAddedToOpenCommand): (WebCore::TypingCommand::insertTextRunWithoutNewlines): (WebCore::TypingCommand::insertLineBreak): (WebCore::TypingCommand::insertParagraphSeparator): (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): (WebCore::TypingCommand::deleteKeyPressed): (WebCore::TypingCommand::forwardDeleteKeyPressed): (WebCore::TypingCommand::deleteSelection): (WebCore::TypingCommand::updatePreservesTypingStyle): * editing/TypingCommand.h: (WebCore::TypingCommand::preservesTypingStyle): LayoutTests: 2009-06-26 Adele Peterson <adele@apple.com> Reviewed by Darin Adler. Test for <rdar://problem/7000796> REGRESSION(34681): Breaking up quoted text makes new, unquoted text blue after certain steps; repros with some messages * editing/inserting/break-blockquote-after-delete.html: Added. * platform/mac/editing/inserting/break-blockquote-after-delete-expected.checksum: Added. * platform/mac/editing/inserting/break-blockquote-after-delete-expected.png: Added. * platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt: Added. Canonical link: https://commits.webkit.org/36954@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2009-06-26 16:53:24 +00:00
<html>
<head>
<style>
blockquote {
color: blue;
border-left: 2px solid blue;
margin: 0px;
padding-left: 10px;
}
blockquote #dq {
color: green;
border-color: green;
}
</style>
<script>
function test()
{
window.getSelection().setBaseAndExtent(document.getElementById('line'), 0, document.getElementById('dq'), 0);
document.execCommand("Delete");
document.execCommand("InsertNewlineInQuotedContent");
document.execCommand("InsertText", true, "black");
}
</script>
</head>
<body onload="test()">This tests that the blockquote's typing style doesn't remain after breaking the blockquote and typing in the unquoted area.<br><br>
<div contenteditable>
<blockquote type="cite">blue
<div id="line"><br></div>
<div>
<blockquote type="cite" id="dq">green</blockquote>
</div>
</blockquote>
</div>
</body>
</html>