https://bugs.webkit.org/show_bug.cgi?id=166791
Reviewed by Simon Fraser.
Source/WebCore:
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::IndentOutdentCommand):
(WebCore::IndentOutdentCommand::outdentRegion):
* editing/IndentOutdentCommand.h:
(WebCore::IndentOutdentCommand::create):
Remove the unused m_marginInPixels and fix the copyright header.
Tools:
* WebEditingTester/EditingOperations.m:
(editingOperations):
Add the outdent operation to WebEditingTester.
LayoutTests:
* editing/execCommand/19653-1-expected.txt:
* editing/execCommand/19653-1.html:
Adjust this indenting test. It had a mislabeled test case (it outdents, not indents),
and also was copy-pasted wrong (it wasn't indented in the first place).
However, since this technically reduces test coverage, keep the existing
(but now correctly labeled) test case, since it caught a bug in code I was changing.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210466
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-01-06 Tim Horton <timothy_horton@apple.com>
+
+ Minor cleanups to IndentOutdentCommand and related code
+ https://bugs.webkit.org/show_bug.cgi?id=166791
+
+ Reviewed by Simon Fraser.
+
+ * editing/execCommand/19653-1-expected.txt:
+ * editing/execCommand/19653-1.html:
+ Adjust this indenting test. It had a mislabeled test case (it outdents, not indents),
+ and also was copy-pasted wrong (it wasn't indented in the first place).
+
+ However, since this technically reduces test coverage, keep the existing
+ (but now correctly labeled) test case, since it caught a bug in code I was changing.
+
2017-01-06 Ryan Haddad <ryanhaddad@apple.com>
Marking fast/text/variations/advances.html as failing on Sierra.
This tests outdenting an empty paragraph with bold already applied to it. The word below should be bold.
<b>Bold</b>
-This tests indenting an empty paragraph when the typing style was Bold. The word below should be bold.
+This tests outdenting an empty paragraph when the typing style was Bold. The word below should be bold.
+<b>Bold</b>
+
+This tests outdenting an non-indented empty paragraph when the typing style was Bold. The word below should be bold.
<b>Bold</b>
<div id="description5">This tests outdenting an empty paragraph with bold already applied to it. The word below should be bold.</div>
<div id="edit5" contentEditable="true"><blockquote class="webkit-indent-blockquote"><b><br></b></blockquote></div>
-<div id="description6">This tests indenting an empty paragraph when the typing style was Bold. The word below should be bold.</div>
-<div id="edit6" contentEditable="true"></div>
+<div id="description6">This tests outdenting an empty paragraph when the typing style was Bold. The word below should be bold.</div>
+<div id="edit6" contentEditable="true"><blockquote class="webkit-indent-blockquote"><br></blockquote></div>
+
+<div id="description7">This tests outdenting an non-indented empty paragraph when the typing style was Bold. The word below should be bold.</div>
+<div id="edit7" contentEditable="true"></div>
<script>
if (window.testRunner)
document.execCommand("Outdent");
document.execCommand("InsertText", false, "Bold");
+edit7 = document.getElementById("edit7");
+edit7.focus();
+document.execCommand("Bold");
+document.execCommand("Outdent");
+document.execCommand("InsertText", false, "Bold");
+
if (window.testRunner)
document.body.innerText = document.getElementById("description1").innerText + "\n" + edit1.innerHTML + "\n\n" +
document.getElementById("description2").innerText + "\n" + edit2.innerHTML + "\n\n" +
document.getElementById("description3").innerText + "\n" + edit3.innerHTML + "\n\n" +
document.getElementById("description4").innerText + "\n" + edit4.innerHTML + "\n\n" +
document.getElementById("description5").innerText + "\n" + edit5.innerHTML + "\n\n" +
- document.getElementById("description6").innerText + "\n" + edit6.innerHTML;
+ document.getElementById("description6").innerText + "\n" + edit6.innerHTML + "\n\n" +
+ document.getElementById("description7").innerText + "\n" + edit7.innerHTML;
</script>
+2017-01-06 Tim Horton <timothy_horton@apple.com>
+
+ Minor cleanups to IndentOutdentCommand and related code
+ https://bugs.webkit.org/show_bug.cgi?id=166791
+
+ Reviewed by Simon Fraser.
+
+ * editing/IndentOutdentCommand.cpp:
+ (WebCore::IndentOutdentCommand::IndentOutdentCommand):
+ (WebCore::IndentOutdentCommand::outdentRegion):
+ * editing/IndentOutdentCommand.h:
+ (WebCore::IndentOutdentCommand::create):
+ Remove the unused m_marginInPixels and fix the copyright header.
+
2017-01-06 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r210319.
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (IndentOutdentCommandINCLUDING, BUT NOT LIMITED TO,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
return node && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(blockquoteTag));
}
-IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeOfAction, int marginInPixels)
+IndentOutdentCommand::IndentOutdentCommand(Document& document, EIndentType typeOfAction)
: ApplyBlockElementCommand(document, blockquoteTag, "margin: 0 0 0 40px; border: none; padding: 0px;")
, m_typeOfAction(typeOfAction)
- , m_marginInPixels(marginInPixels)
{
}
outdentParagraph();
return;
}
-
+
Position originalSelectionEnd = endingSelection().end();
VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
VisiblePosition endAfterSelection = endOfParagraph(endOfParagraph(endOfSelection).next());
setEndingSelection(VisibleSelection(originalSelectionEnd, DOWNSTREAM));
else
setEndingSelection(endOfCurrentParagraph);
-
+
outdentParagraph();
-
+
// outdentParagraph could move more than one paragraph if the paragraph
// is in a list item. As a result, endAfterSelection and endOfNextParagraph
// could refer to positions no longer in the document.
if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent().anchorNode()->inDocument())
break;
-
+
if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent().anchorNode()->inDocument()) {
endOfCurrentParagraph = endingSelection().end();
endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next());
class IndentOutdentCommand : public ApplyBlockElementCommand {
public:
enum EIndentType { Indent, Outdent };
- static Ref<IndentOutdentCommand> create(Document& document, EIndentType type, int marginInPixels = 0)
+ static Ref<IndentOutdentCommand> create(Document& document, EIndentType type)
{
- return adoptRef(*new IndentOutdentCommand(document, type, marginInPixels));
+ return adoptRef(*new IndentOutdentCommand(document, type));
}
bool preservesTypingStyle() const override { return true; }
private:
- IndentOutdentCommand(Document&, EIndentType, int marginInPixels);
+ IndentOutdentCommand(Document&, EIndentType);
EditAction editingAction() const override { return m_typeOfAction == Indent ? EditActionIndent : EditActionOutdent; }
void formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtr<Element>& blockquoteForNextIndent) override;
EIndentType m_typeOfAction;
- int m_marginInPixels;
};
} // namespace WebCore
+2017-01-06 Tim Horton <timothy_horton@apple.com>
+
+ Minor cleanups to IndentOutdentCommand and related code
+ https://bugs.webkit.org/show_bug.cgi?id=166791
+
+ Reviewed by Simon Fraser.
+
+ * WebEditingTester/EditingOperations.m:
+ (editingOperations):
+ Add the outdent operation to WebEditingTester.
+
2017-01-06 Said Abou-Hallawa <sabouhallawa@apple.com>
Create a plan and a patch files for MotionMark and delete the Animometer's ones
@"moveWordLeftAndModifySelection:",
@"moveWordRight:",
@"moveWordRightAndModifySelection:",
+ @"outdent:",
@"outline:",
@"pageDown:",
@"pageDownAndModifySelection:",