From 5323722f178dfd03b4415202a56666c55437a0ce Mon Sep 17 00:00:00 2001 From: "ehsan.akhgari%gmail.com" Date: Mon, 1 Mar 2010 21:05:40 +0000 Subject: [PATCH] Bug 499844; r=peterv a19=beltzner git-svn-id: svn://10.0.0.236/trunk@259857 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/libeditor/html/nsHTMLEditRules.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp index 251ca22b1d5..22f1282b09b 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp @@ -4125,7 +4125,19 @@ nsHTMLEditRules::WillOutdent(nsISelection *aSelection, PRBool *aCancel, PRBool * if (NS_FAILED(res)) return res; } else if (useCSS) { - RelativeChangeIndentationOfElementNode(curNode, -1); + nsCOMPtr element; + nsCOMPtr textNode = do_QueryInterface(curNode); + if (textNode) { + // We want to outdent the parent of text nodes + nsCOMPtr parent; + textNode->GetParentNode(getter_AddRefs(parent)); + element = do_QueryInterface(parent); + } else { + element = do_QueryInterface(curNode); + } + if (element) { + RelativeChangeIndentationOfElementNode(element, -1); + } } } }