Skip to content

Commit 94b71b2

Browse files
authored
Merge 62f07ac into 49a7741
2 parents 49a7741 + 62f07ac commit 94b71b2

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

nvdaHelper/vbufBase/backend.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,6 @@ VBufStorage_controlFieldNode_t* VBufBackend_t::reuseExistingNodeInRender(VBufSto
271271
LOG_DEBUG(L"Could not locate a node with docHandle "<<docHandle<<L", and ID "<<ID);
272272
return nullptr;
273273
}
274-
// Ensure the node allows us to reuse it
275-
if(!existingNode->allowReuseInAncestorUpdate) {
276-
LOG_DEBUG(L"Existing node refuses to be reused");
277-
return nullptr;
278-
}
279274
// Don't reuse the node if it has no parent (is the root of the buffer).
280275
auto existingParent=existingNode->getParent();
281276
if(!existingParent) {
@@ -286,12 +281,20 @@ VBufStorage_controlFieldNode_t* VBufBackend_t::reuseExistingNodeInRender(VBufSto
286281
// must not reuse descendants.
287282
if (existingParent->alwaysRerenderDescendants) {
288283
// Propagate to descendants.
284+
// Important! This propagation must happen before the early returns for
285+
// existingNode below. Otherwise, we might not respect this flag on
286+
// descendants, making it effectively useless in some cases.
289287
existingNode->alwaysRerenderDescendants = true;
290288
}
291289
if ( existingNode->alwaysRerenderDescendants) {
292290
LOG_DEBUG(L"Existing node and its descendants must not be reused");
293291
return nullptr;
294292
}
293+
// Ensure the node allows us to reuse it
294+
if(!existingNode->allowReuseInAncestorUpdate) {
295+
LOG_DEBUG(L"Existing node refuses to be reused");
296+
return nullptr;
297+
}
295298
if(existingNode->denyReuseIfPreviousSiblingsChanged) {
296299
// This node is not allowed to be reused if any of its previous siblings have changed.
297300
// We work this out by walking back to the previous controlFieldNode in its siblings, and ensuring that it is a reference node that references the existing node's first previous controlFieldNode.

0 commit comments

Comments
 (0)