Bug 796839 - Part 3: Don't get the inline properties from empty text nodes; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 04 Oct 2012 20:58:00 -0400
changeset 109316 7297e7f7b7481785eb2645178718648aa856b5da
parent 109315 d97ca37eaa2d37073c9465d31c4e50a85ab05ced
child 109317 e92287b62a547f0ae7cac5d8487e1159f4b13557
push id23619
push useremorley@mozilla.com
push dateFri, 05 Oct 2012 10:54:02 +0000
treeherdermozilla-central@3b458f4e0f42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs796839
milestone18.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
Bug 796839 - Part 3: Don't get the inline properties from empty text nodes; r=roc This is basically the equivalent of the previous part, just for getting the inline properties.
editor/libeditor/html/nsHTMLEditorStyle.cpp
--- a/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -1215,17 +1215,17 @@ nsHTMLEditor::GetInlinePropertyBase(nsIA
       if (nsTextEditUtils::IsBody(node)) {
         break;
       }
 
       nsCOMPtr<nsIDOMCharacterData> text;
       text = do_QueryInterface(content);
       
       // just ignore any non-editable nodes
-      if (text && !IsEditable(text)) {
+      if (text && (!IsEditable(text) || IsEmptyTextNode(this, content))) {
         continue;
       }
       if (text) {
         if (!isCollapsed && first && firstNodeInRange) {
           firstNodeInRange = false;
           int32_t startOffset;
           range->GetStartOffset(&startOffset);
           uint32_t count;