Bug 290026 - Outdent of List does not work properly; r=ehsan

This commit is contained in:
Fabien Cazenave 2011-09-02 12:21:33 -04:00
parent 944a5d2ef2
commit c5be62f04a
2 changed files with 16 additions and 1 deletions

View File

@ -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))
{

View File

@ -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();