diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp
index 24213de4baf..d8de90868d4 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -1030,6 +1030,12 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
nsCOMPtr content;
nsAutoString firstValue, theValue;
iter->CurrentNode(getter_AddRefs(content));
+ nsCOMPtr endNode;
+ PRInt32 endOffset;
+ result = range->GetEndContainer(getter_AddRefs(endNode));
+ if (NS_FAILED(result)) return result;
+ result = range->GetEndOffset(&endOffset);
+ if (NS_FAILED(result)) return result;
while (NS_ENUMERATOR_FALSE == iter->IsDone())
{
nsCOMPtr node = do_QueryInterface(content);
@@ -1063,6 +1069,10 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
skipNode = PR_TRUE;
}
}
+ else if (node == endNode && !endOffset)
+ {
+ skipNode = PR_TRUE;
+ }
}
else
{ // handle non-text leaf nodes here