Bug 1382568: Avoid trying to resolve styles in an uninitialized presshell in GetInnerText. r=heycam

MozReview-Commit-ID: DFFb5OCQpHG

--HG--
extra : rebase_source : 2338719ce46efc405d845cc41ea633336c4e971c
This commit is contained in:
Emilio Cobos Álvarez 2017-08-05 08:55:50 +02:00
Родитель a0324a142f
Коммит 9f99a8ad5f
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -3060,7 +3060,10 @@ nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
{
if (!GetPrimaryFrame(FlushType::Layout)) {
nsIPresShell* presShell = nsComputedDOMStyle::GetPresShellForContent(this);
if (!presShell || IsOrHasAncestorWithDisplayNone(this, presShell)) {
// NOTE(emilio): We need to check the presshell is styled in order to ensure
// the document is styled.
if (!presShell || !presShell->DidInitialize() ||
IsOrHasAncestorWithDisplayNone(this, presShell)) {
GetTextContentInternal(aValue, aError);
return;
}