mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 290026 - Outdent of List does not work properly; r=ehsan
This commit is contained in:
parent
944a5d2ef2
commit
c5be62f04a
@ -4047,6 +4047,21 @@ nsHTMLEditRules::WillOutdent(nsISelection *aSelection, PRBool *aCancel, PRBool *
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
continue;
|
||||
}
|
||||
// is it a block with a 'margin' property?
|
||||
if (useCSS && IsBlockNode(curNode))
|
||||
{
|
||||
nsIAtom* marginProperty = MarginPropertyAtomForIndent(mHTMLEditor->mHTMLCSSUtils, curNode);
|
||||
nsAutoString value;
|
||||
mHTMLEditor->mHTMLCSSUtils->GetSpecifiedProperty(curNode, marginProperty, value);
|
||||
float f;
|
||||
nsCOMPtr<nsIAtom> unit;
|
||||
mHTMLEditor->mHTMLCSSUtils->ParseLength(value, &f, getter_AddRefs(unit));
|
||||
if (f > 0)
|
||||
{
|
||||
RelativeChangeIndentationOfElementNode(curNode, -1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// is it a list item?
|
||||
if (nsHTMLEditUtils::IsListItem(curNode))
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ addLoadEvent(function() {
|
||||
var twoindent = '<p></p><ul style="margin-left: 80px;"><li>Item 1</li><li>Item 2</li></ul><p></p>';
|
||||
is(editor.innerHTML, twoindent, "a twice indented bulleted list");
|
||||
document.execCommand("outdent", false, false);
|
||||
todo_is(editor.innerHTML, oneindent, "outdenting a twice indented bulleted list");
|
||||
is(editor.innerHTML, oneindent, "outdenting a twice indented bulleted list");
|
||||
|
||||
// done
|
||||
SimpleTest.finish();
|
||||
|
Loading…
Reference in New Issue
Block a user