Bug 824926 Make relative font size change handle nested font size tags correctly r=ehsan
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 31 Dec 2012 21:49:49 +0000
changeset 126349 dec6aa71da64eec39c7921291abb461b6538ca4f
parent 126348 0d771761b9b360a73e4add37d38d5ef6e42f71e9
child 126394 a812ef63de87c9e3b22f125c448f997062f3fb1d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs824926
milestone20.0a1
first release with
nightly linux32
dec6aa71da64 / 20.0a1 / 20130101030838 / files
nightly linux64
dec6aa71da64 / 20.0a1 / 20130101030838 / files
nightly mac
dec6aa71da64 / 20.0a1 / 20130101030838 / files
nightly win32
dec6aa71da64 / 20.0a1 / 20130101030838 / files
nightly win64
dec6aa71da64 / 20.0a1 / 20130101030838 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 824926 Make relative font size change handle nested font size tags correctly r=ehsan
editor/libeditor/html/nsHTMLEditorStyle.cpp
--- a/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -1778,19 +1778,23 @@ nsHTMLEditor::RelativeFontChangeHelper(i
   // 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 (uint32_t i = aNode->GetChildCount(); i--; ) {
       nsresult rv = RelativeFontChangeOnNode(aSizeChange, aNode->GetChildAt(i));
       NS_ENSURE_SUCCESS(rv, rv);
     }
+
+    // RelativeFontChangeOnNode already calls us recursively,
+    // so we don't need to check our children again.
+    return NS_OK;
   }
 
-  // Now cycle through the children.
+  // Otherwise cycle through the children.
   for (uint32_t i = aNode->GetChildCount(); i--; ) {
     nsresult rv = RelativeFontChangeHelper(aSizeChange, aNode->GetChildAt(i));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }