mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-01 08:59:25 +00:00
Don't call methods that may flush in nsRange::GetInnerTextNoFlush.
Follow-up to 0059ff300306742bd0a78899566f056704e9039b
This commit is contained in:
@@ -3187,13 +3187,14 @@ IsVisibleAndNotInReplacedElement(nsIFrame* aFrame)
|
||||
}
|
||||
|
||||
static bool
|
||||
ElementIsVisible(Element* aElement)
|
||||
ElementIsVisibleNoFlush(Element* aElement)
|
||||
{
|
||||
if (!aElement) {
|
||||
return false;
|
||||
}
|
||||
nsRefPtr<nsStyleContext> sc = nsComputedDOMStyle::GetStyleContextForElement(
|
||||
aElement, nullptr, nullptr);
|
||||
nsRefPtr<nsStyleContext> 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);
|
||||
|
||||
Reference in New Issue
Block a user