зеркало из https://github.com/mozilla/pjs.git
Composer's structure toolbar was showing anonymous content; b=190279, r=Neil, sr=peterv
This commit is contained in:
Родитель
deb380f918
Коммит
3cb1785e6d
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче