Commit 05b6f4be authored by wkorman's avatar wkorman Committed by Commit bot

Fix mismatched nullptr check for caret paint invalidation.

We moved to checking need-for-repaint and invalidating based
on anchor node in http://crrev.com/2401363003 but we
incorrectly left null-checking based on non-anchor node.

BUG=663319

Review-Url: https://codereview.chromium.org/2565103002
Cr-Commit-Position: refs/heads/master@{#437804}
parent db41bb45
<!DOCTYPE html>
<script src="resources/text-based-repaint.js"></script>
<script>
function repaintTest() {
editor.focus();
if (!window.eventSender)
return;
eventSender.keyDown('a');
eventSender.keyDown('b');
eventSender.keyDown('c');
}
onload = runRepaintAndPixelTest;
</script>
<style>
#editor:after {
content:"x";
}
</style>
Test passes if caret is visible after the 'c' but before the 'x'.<br>
To reproduce manually, type 'abc'.
<div id="editor" contenteditable="true"></div>
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 48, 22, 19],
"reason": "full"
},
{
"object": "LayoutText #text",
"rect": [8, 48, 15, 19],
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [30, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 48, 7, 19],
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [8, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "style change"
},
{
"object": "RootInlineBox",
"reason": "style change"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "layoutObject insertion"
},
{
"object": "InlineTextBox 'a'",
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'ab'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'abc'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 786, 22],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 48, 22, 19],
"reason": "full"
},
{
"object": "LayoutText #text",
"rect": [8, 48, 15, 19],
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [30, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 48, 7, 19],
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [8, 48, 7, 19],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 47, 3, 22],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 47, 3, 21],
"reason": "invalidate paint rectangle"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "style change"
},
{
"object": "RootInlineBox",
"reason": "style change"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "layoutObject insertion"
},
{
"object": "InlineTextBox 'a'",
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'ab'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'abc'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 23, 18],
"reason": "full"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 16, 18],
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [30, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 8, 18],
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [8, 44, 8, 18],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "style change"
},
{
"object": "RootInlineBox",
"reason": "style change"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "layoutObject insertion"
},
{
"object": "InlineTextBox 'a'",
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'ab'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'abc'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [3, 39, 794, 28],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 23, 18],
"reason": "full"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 16, 18],
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [30, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 18],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 8, 18],
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [8, 44, 8, 18],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "style change"
},
{
"object": "RootInlineBox",
"reason": "style change"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "layoutObject insertion"
},
{
"object": "InlineTextBox 'a'",
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'ab'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'abc'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 23, 17],
"reason": "full"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 16, 17],
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [30, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 8, 17],
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [8, 44, 8, 17],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "style change"
},
{
"object": "RootInlineBox",
"reason": "style change"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "layoutObject insertion"
},
{
"object": "InlineTextBox 'a'",
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'ab'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'abc'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 786, 20],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 23, 17],
"reason": "full"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 16, 17],
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [30, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [23, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [15, 44, 9, 17],
"reason": "forced by layout"
},
{
"object": "LayoutText #text",
"rect": [8, 44, 8, 17],
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"rect": [8, 44, 8, 17],
"reason": "forced by layout"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"rect": [7, 43, 3, 20],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [29, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [22, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"rect": [14, 43, 3, 19],
"reason": "invalidate paint rectangle"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "style change"
},
{
"object": "RootInlineBox",
"reason": "style change"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "layoutObject insertion"
},
{
"object": "InlineTextBox 'a'",
"reason": "layoutObject insertion"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'ab'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutBlockFlow DIV id='editor'",
"reason": "forced by layout"
},
{
"object": "RootInlineBox",
"reason": "forced by layout"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "Caret",
"reason": "invalidate paint rectangle"
},
{
"object": "LayoutText #text",
"reason": "full"
},
{
"object": "InlineTextBox 'abc'",
"reason": "full"
},
{
"object": "LayoutTextFragment (anonymous)",
"reason": "forced by layout"
},
{
"object": "InlineTextBox 'x'",
"reason": "forced by layout"
}
]
}
...@@ -187,11 +187,12 @@ void FrameCaret::invalidateCaretRect(bool forceInvalidation) { ...@@ -187,11 +187,12 @@ void FrameCaret::invalidateCaretRect(bool forceInvalidation) {
m_caretVisibility == m_previousCaretVisibility) m_caretVisibility == m_previousCaretVisibility)
return; return;
if (m_previousCaretNode && shouldRepaintCaret(*m_previousCaretAnchorNode)) { if (m_previousCaretAnchorNode &&
shouldRepaintCaret(*m_previousCaretAnchorNode)) {
invalidateLocalCaretRect(m_previousCaretAnchorNode.get(), invalidateLocalCaretRect(m_previousCaretAnchorNode.get(),
m_previousCaretRect); m_previousCaretRect);
} }
if (newNode && shouldRepaintCaret(*newAnchorNode)) if (newAnchorNode && shouldRepaintCaret(*newAnchorNode))
invalidateLocalCaretRect(newAnchorNode, newRect); invalidateLocalCaretRect(newAnchorNode, newRect);
m_previousCaretNode = newNode; m_previousCaretNode = newNode;
m_previousCaretAnchorNode = newAnchorNode; m_previousCaretAnchorNode = newAnchorNode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment