diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index 589b620c942..6f795fb5376 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -3334,8 +3334,7 @@ nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue, { if (!GetPrimaryFrame(Flush_Layout)) { nsIPresShell* presShell = nsComputedDOMStyle::GetPresShellForContent(this); - if (!presShell || !IsInComposedDoc() || - IsOrHasAncestorWithDisplayNone(this, presShell)) { + if (!presShell || IsOrHasAncestorWithDisplayNone(this, presShell)) { GetTextContentInternal(aValue, aError); return; } diff --git a/testing/web-platform/tests/innerText/getter-tests.js b/testing/web-platform/tests/innerText/getter-tests.js index 26cd3753325..cc74890882e 100644 --- a/testing/web-platform/tests/innerText/getter-tests.js +++ b/testing/web-platform/tests/innerText/getter-tests.js @@ -73,6 +73,9 @@ testText("
abc def", "abc def", "No whitespace compre testText("
abc def ", " abc def ", "No removal of leading/trailing whitespace in display:none container"); testText("
123abc", "123", "display:none child not rendered"); testText("
abc", "abc", "display:none container with non-display-none target child"); +testTextInSVG("
abc", "", "non-display-none child of svg"); +testTextInSVG("