Bug 1241752 - Remove runtime warning for nsIContent::GetEditingHost(). r=smaug

Returning a null editing host for a non-editable is a normal failing case,
which does not need a warning.
This commit is contained in:
Ting-Yu Lin 2016-01-22 14:18:47 +08:00
parent 6e798db711
commit 37c666ef89

View File

@ -239,10 +239,15 @@ dom::Element*
nsIContent::GetEditingHost()
{
// If this isn't editable, return nullptr.
NS_ENSURE_TRUE(IsEditableInternal(), nullptr);
if (!IsEditableInternal()) {
return nullptr;
}
nsIDocument* doc = GetComposedDoc();
NS_ENSURE_TRUE(doc, nullptr);
if (!doc) {
return nullptr;
}
// If this is in designMode, we should return <body>
if (doc->HasFlag(NODE_IS_EDITABLE) && !IsInShadowTree()) {
return doc->GetBodyElement();