Bug 1479914 - Always use the new caret display item when available as these can change without an invalidation. r?miko
MozReview-Commit-ID: 8Le6xRfv5RL
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -361,16 +361,21 @@ public:
// if they might have changed rendering, and it's easier to just use the new items
// rather than computing if we actually need them.
return true;
} else if (type == DisplayItemType::TYPE_SUBDOCUMENT) {
// nsDisplaySubDocument::mShouldFlatten can change without an invalidation
// (and is the reason we unconditionally build the subdocument item), so always
// use the new one to make sure we get the right value.
return true;
+ } else if (type == DisplayItemType::TYPE_CARET) {
+ // The caret can change position while still being owned by the same frame
+ // and we don't invalidate in that case. Use the new version since the changed
+ // bounds are needed for DLBI.
+ return true;
}
return false;
}
RetainedDisplayList Finalize() {
for (size_t i = 0; i < mOldDAG.Length(); i++) {
if (mOldItems[i].IsUsed()) {
continue;