Bug 1220502 - ignore not visible text nodes for tree update, r=tbsaunde, roc

This commit is contained in:
Alexander Surkov 2016-02-01 17:05:45 -05:00
parent 36c1224fd8
commit cf03195102
2 changed files with 12 additions and 3 deletions

View File

@ -122,7 +122,14 @@ public:
*/
inline void ScheduleTextUpdate(nsIContent* aTextNode)
{
if (mTextHash.PutEntry(aTextNode))
// Make sure we are not called with a node that is not in the DOM tree or
// not visible.
MOZ_ASSERT(aTextNode->GetParentNode(), "A text node is not in DOM");
MOZ_ASSERT(aTextNode->GetPrimaryFrame(), "A text node doesn't have a frame");
MOZ_ASSERT(aTextNode->GetPrimaryFrame()->StyleVisibility()->IsVisible(),
"A text node is not visible");
mTextHash.PutEntry(aTextNode);
ScheduleProcessing();
}

View File

@ -8498,7 +8498,9 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
#ifdef ACCESSIBILITY
// Schedule the update of accessible tree since rendered text might be changed.
if (StyleVisibility()->IsVisible()) {
ReflowTextA11yNotifier(presContext, mContent);
}
#endif
/////////////////////////////////////////////////////////////////////