Commit 0472829d authored by Yoichi Osato's avatar Yoichi Osato Committed by Commit Bot

[LayoutNG] Fix paint/invalidation/selection/selection-change-in-iframe-with-relative-parent.html

This patch cancels selection painting if the NGPaintFragment has no selection
rect.
This happens when we select the last line break but it is not painted whether
it is selected or not anyway.
The test was virtually passed image expectation
but PaintUnderInvalidationChecking has made crash for above reason.

Bug: 708452
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia1939c02aa6327f3dd7620920ec6b60a6b74b790
Reviewed-on: https://chromium-review.googlesource.com/1096592
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566790}
parent d510510f
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"drawsContent": false,
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "NGPaintFragment",
"rect": [18, 238, 40, 10],
"reason": "selection"
},
{
"object": "NGPaintFragment",
"rect": [18, 218, 30, 10],
"reason": "selection"
},
{
"object": "NGPaintFragment",
"rect": [18, 198, 30, 10],
"reason": "selection"
},
{
"object": "NGPaintFragment",
"rect": [58, 238, 10, 10],
"reason": "appeared"
},
{
"object": "NGPaintFragment",
"rect": [48, 218, 10, 10],
"reason": "appeared"
},
{
"object": "NGPaintFragment",
"rect": [48, 198, 10, 10],
"reason": "appeared"
},
{
"object": "NGPaintFragment",
"rect": [18, 228, 10, 10],
"reason": "appeared"
},
{
"object": "NGPaintFragment",
"rect": [18, 208, 10, 10],
"reason": "appeared"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
},
{
"object": "NGPaintFragment",
"reason": "selection"
}
]
}
...@@ -203,6 +203,8 @@ static void PaintSelection(GraphicsContext& context, ...@@ -203,6 +203,8 @@ static void PaintSelection(GraphicsContext& context,
const NGPhysicalOffsetRect selection_rect = const NGPhysicalOffsetRect selection_rect =
paint_fragment.ComputeLocalSelectionRect(selection_status); paint_fragment.ComputeLocalSelectionRect(selection_status);
if (selection_rect.size.IsEmpty())
return;
const NGPhysicalOffsetRect global_rect( const NGPhysicalOffsetRect global_rect(
selection_rect.offset + NGPhysicalOffset(box_rect.Location()), selection_rect.offset + NGPhysicalOffset(box_rect.Location()),
selection_rect.size); selection_rect.size);
......
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