Bug 1591588, remove ComputeIndexOf call and negative index check from within GetWholeText r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D50885

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emma Malysz 2019-10-29 16:04:29 +00:00
parent ba4d0ad27c
commit 5d8c10a424

View File

@ -89,15 +89,6 @@ void Text::GetWholeText(nsAString& aWholeText, ErrorResult& aRv) {
return;
}
int32_t index = parent->ComputeIndexOf(this);
NS_WARNING_ASSERTION(index >= 0,
"Trying to use .wholeText with an anonymous"
"text node child of a binding parent?");
if (NS_WARN_IF(index < 0)) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
Text* first = FirstLogicallyAdjacentTextNode(this);
Text* last = LastLogicallyAdjacentTextNode(this);