From 981237edb640dce6a7490c63d152e0da066d926b Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Fri, 21 Apr 2017 23:16:52 +0200 Subject: [PATCH] Don't call methods that may flush in nsRange::GetInnerTextNoFlush. Follow-up to 0059ff300306742bd0a78899566f056704e9039b --- dom/base/nsRange.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dom/base/nsRange.cpp b/dom/base/nsRange.cpp index 9a025390f9..fc35b90fe4 100644 --- a/dom/base/nsRange.cpp +++ b/dom/base/nsRange.cpp @@ -3187,13 +3187,14 @@ IsVisibleAndNotInReplacedElement(nsIFrame* aFrame) } static bool -ElementIsVisible(Element* aElement) +ElementIsVisibleNoFlush(Element* aElement) { if (!aElement) { return false; } - nsRefPtr sc = nsComputedDOMStyle::GetStyleContextForElement( - aElement, nullptr, nullptr); + nsRefPtr sc = + nsComputedDOMStyle::GetStyleContextForElementNoFlush(aElement, nullptr, + nullptr); return sc && sc->StyleVisibility()->IsVisible(); } @@ -3321,7 +3322,7 @@ nsRange::GetInnerTextNoFlush(DOMString& aValue, ErrorResult& aError, if (currentState == AT_NODE) { bool isText = currentNode->IsNodeOfType(nsINode::eTEXT); if (isText && currentNode->GetParent()->IsHTML(nsGkAtoms::rp) && - ElementIsVisible(currentNode->GetParent()->AsElement())) { + ElementIsVisibleNoFlush(currentNode->GetParent()->AsElement())) { nsAutoString str; currentNode->GetTextContent(str, aError); result.Append(str);