author | Neil Rashbrook <neil@parkwaycc.co.uk> |
Thu, 05 Jul 2012 21:33:10 +0100 | |
changeset 98443 | aa7493c796cefc4885f70ab4c75ff30e422b13be |
parent 98442 | 34c8a2369cbc1faa386cd8bd3af2d72113659959 |
child 98444 | 7851dc0f395cc916ce188de45d276223080444fb |
push id | 11482 |
push user | neil@parkwaycc.co.uk |
push date | Thu, 05 Jul 2012 20:35:18 +0000 |
treeherder | mozilla-inbound@7851dc0f395c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | ehsan |
bugs | 767684, 752210 |
milestone | 16.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/editor/libeditor/html/nsHTMLEditorStyle.cpp +++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp @@ -1749,29 +1749,25 @@ nsHTMLEditor::RelativeFontChangeHelper(P if (aSizeChange != 1 && aSizeChange != -1) { return NS_ERROR_ILLEGAL_VALUE; } // If this is a font node with size, put big/small inside it. if (aNode->IsElement() && aNode->AsElement()->IsHTML(nsGkAtoms::font) && aNode->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::size)) { // Cycle through children and adjust relative font size. - for (nsIContent* child = aNode->GetLastChild(); - child; - child = child->GetPreviousSibling()) { - nsresult rv = RelativeFontChangeOnNode(aSizeChange, child); + for (PRUint32 i = aNode->GetChildCount(); i--; ) { + nsresult rv = RelativeFontChangeOnNode(aSizeChange, aNode->GetChildAt(i)); NS_ENSURE_SUCCESS(rv, rv); } } // Now cycle through the children. - for (nsIContent* child = aNode->GetLastChild(); - child; - child = child->GetPreviousSibling()) { - nsresult rv = RelativeFontChangeHelper(aSizeChange, child); + for (PRUint32 i = aNode->GetChildCount(); i--; ) { + nsresult rv = RelativeFontChangeHelper(aSizeChange, aNode->GetChildAt(i)); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } nsresult @@ -1827,20 +1823,18 @@ nsHTMLEditor::RelativeFontChangeOnNode(P return InsertContainerAbove(aNode->AsDOMNode(), address_of(tmp), nsAtomString(atom)); } // none of the above? then cycle through the children. // MOOSE: we should group the children together if possible // into a single "big" or "small". For the moment they are // each getting their own. - for (nsIContent* child = aNode->GetLastChild(); - child; - child = child->GetPreviousSibling()) { - nsresult rv = RelativeFontChangeOnNode(aSizeChange, child); + for (PRUint32 i = aNode->GetChildCount(); i--; ) { + nsresult rv = RelativeFontChangeOnNode(aSizeChange, aNode->GetChildAt(i)); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } NS_IMETHODIMP nsHTMLEditor::GetFontFaceState(bool *aMixed, nsAString &outFace)