Composer's structure toolbar was showing anonymous content; b=190279, r=Neil, sr=peterv

This commit is contained in:
glazman%netscape.com 2003-06-19 14:06:05 +00:00
Родитель deb380f918
Коммит 3cb1785e6d
4 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -570,5 +570,7 @@ interface nsIHTMLEditor : nsISupports
void removeInsertionListener(in nsIContentFilter inFilter);
nsIDOMCSSStyleRule parseStyleAttrIntoCSSRule(in AString aString);
boolean isAnonymousElement(in nsIDOMElement aElement);
};

Просмотреть файл

@ -6178,3 +6178,11 @@ nsHTMLEditor::EndUpdateViewBatch()
return res;
}
NS_IMETHODIMP
nsHTMLEditor::IsAnonymousElement(nsIDOMElement * aElement, PRBool * aReturn)
{
NS_ENSURE_TRUE(aElement, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
*aReturn = content->IsNativeAnonymous();
return NS_OK;
}

Просмотреть файл

@ -242,6 +242,8 @@ public:
NS_IMETHOD AddInsertionListener(nsIContentFilter *aFilter);
NS_IMETHOD RemoveInsertionListener(nsIContentFilter *aFilter);
NS_IMETHOD IsAnonymousElement(nsIDOMElement * aElement, PRBool * aReturn);
/* ------------ nsIEditorIMESupport overrides -------------- */
NS_IMETHOD SetCompositionString(const nsAString& aCompositionString, nsIPrivateTextRangeList* aTextRangeList,nsTextEventReply* aReply);

Просмотреть файл

@ -3359,7 +3359,9 @@ function GetSelectionContainer()
// and make sure the element is not a special editor node like
// the <br> we insert in blank lines
while (result.node.hasAttribute("_moz_editor_bogus_node"))
// and don't select anonymous content !!! (fix for bug 190279)
while (result.node.hasAttribute("_moz_editor_bogus_node") ||
editor.isAnonymousElement(result.node))
result.node = result.node.parentNode;
return result;