Block selection gaps are not invalidated

https://codereview.chromium.org/620553009 moved
the selection to invalidate-after-compositing-updates,
except that it lied and we still do some invalidations
on the spot. This is needed as we don't store the old
selection information so we can't generate the old
selection invalidation rect later.

This change just generates the invalidation on the spot
for block selection gaps (like we do for normal selection).

The long-term fix will be to store the old rect but it requires
more thoughts and we need some quick fix for this nasty issue.

BUG=421380

Review URL: https://codereview.chromium.org/659983002

git-svn-id: svn://svn.chromium.org/blink/trunk@183890 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d23194f9
...@@ -382,6 +382,8 @@ crbug.com/396945 ietestcenter/css3/namespaces/syntax-021.xml [ ImageOnlyFailure ...@@ -382,6 +382,8 @@ crbug.com/396945 ietestcenter/css3/namespaces/syntax-021.xml [ ImageOnlyFailure
crbug.com/378610 [ Win7 ] svg/transforms/transformed-text-fill-gradient.html [ ImageOnlyFailure ] crbug.com/378610 [ Win7 ] svg/transforms/transformed-text-fill-gradient.html [ ImageOnlyFailure ]
crbug.com/378610 [ Win7 ] svg/custom/focus-ring-text.svg [ ImageOnlyFailure ] crbug.com/378610 [ Win7 ] svg/custom/focus-ring-text.svg [ ImageOnlyFailure ]
crbug.com/421380 fast/repaint/selection-partial-invalidation-between-blocks.html [ NeedsRebaseline ]
crbug.com/371725 http/tests/webfont/slow-loading.html [ Pass ImageOnlyFailure Timeout ] crbug.com/371725 http/tests/webfont/slow-loading.html [ Pass ImageOnlyFailure Timeout ]
# Issues on the mac-antialiased fonts virtual test suite. # Issues on the mac-antialiased fonts virtual test suite.
......
{
"bounds": [800, 600],
"children": [
{
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"repaintRects": [
[11, 35, 70, 19],
[11, 34, 778, 22],
[11, 11, 51, 19],
[11, 11, 51, 19],
[11, 10, 778, 22]
]
}
]
}
<!DOCTYPE html>
<table width="100%">
<tr>
<td id="firstCell">First cell</td>
</tr>
<tr>
<td id="secondCell">Second cell</td>
</tr>
</table>
<script src="../../resources/run-after-display.js" type="text/javascript"></script>
<script src="resources/text-based-repaint.js" type="text/javascript"></script>
<script>
window.testIsAsync = true;
if (window.testRunner)
testRunner.waitUntilDone();
document.execCommand("selectAll");
function repaintTest() {
var selection = window.getSelection();
var firstCell = document.getElementById("firstCell");
selection.setBaseAndExtent(firstCell, 0, firstCell, 1);
finishRepaintTest();
}
runAfterDisplay(runRepaintTest);
</script>
...@@ -655,7 +655,7 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e ...@@ -655,7 +655,7 @@ void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* e
RenderBlockSelectionInfo* newInfo = newSelectedBlocks.get(block); RenderBlockSelectionInfo* newInfo = newSelectedBlocks.get(block);
RenderBlockSelectionInfo* oldInfo = i->value.get(); RenderBlockSelectionInfo* oldInfo = i->value.get();
if (!newInfo || newInfo->hasChangedFrom(*oldInfo)) { if (!newInfo || newInfo->hasChangedFrom(*oldInfo)) {
oldInfo->object()->setShouldInvalidateSelection(); oldInfo->invalidatePaint();
if (newInfo) { if (newInfo) {
newInfo->object()->setShouldInvalidateSelection(); newInfo->object()->setShouldInvalidateSelection();
newSelectedBlocks.remove(block); newSelectedBlocks.remove(block);
......
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