Commit 6017c247 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Trigger paint invalidation for <detail> on 'color' changes

Much like a list marker, the details marker needs be added to the
"color changed" special case/optimization.

Bug: 883711
Change-Id: Ib2237bd13887f4b5ff7fd2270bae6cb8654e0cd3
Reviewed-on: https://chromium-review.googlesource.com/1225875
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591354}
parent c0e3a0bd
<!DOCTYPE html>
<title>&lt;details> marker repaints on 'color' change (reference)</title>
<style>
details {
color: green;
}
</style>
<details>Triangle should be green</details>
<!DOCTYPE html>
<title>&lt;details> marker repaints on 'color' change</title>
<script src="../resources/text-based-repaint.js"></script>
<style>
details {
color: red;
}
.green {
color: green;
}
</style>
<details>Triangle should be green</details>
<script>
function repaintTest() {
document.querySelector('details').className = 'green';
}
onload = runRepaintAndPixelTest;
</script>
{
"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": "InlineTextBox 'Details'",
"rect": [24, 8, 45, 19],
"reason": "style change"
},
{
"object": "LayoutDetailsMarker DIV id='details-marker'",
"rect": [8, 12, 11, 11],
"reason": "style change"
}
]
}
]
}
{
"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": "InlineTextBox 'Details'",
"rect": [24, 8, 47, 18],
"reason": "style change"
},
{
"object": "LayoutDetailsMarker DIV id='details-marker'",
"rect": [8, 11, 11, 11],
"reason": "style change"
}
]
}
]
}
{
"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": "InlineTextBox 'Details'",
"rect": [24, 8, 42, 19],
"reason": "style change"
},
{
"object": "LayoutDetailsMarker DIV id='details-marker'",
"rect": [8, 12, 11, 11],
"reason": "style change"
}
]
}
]
}
...@@ -1867,7 +1867,7 @@ StyleDifference LayoutObject::AdjustStyleDifference( ...@@ -1867,7 +1867,7 @@ StyleDifference LayoutObject::AdjustStyleDifference(
(IsText() && !IsBR() && ToLayoutText(this)->HasTextBoxes()) || (IsText() && !IsBR() && ToLayoutText(this)->HasTextBoxes()) ||
(IsSVG() && StyleRef().SvgStyle().IsFillColorCurrentColor()) || (IsSVG() && StyleRef().SvgStyle().IsFillColorCurrentColor()) ||
(IsSVG() && StyleRef().SvgStyle().IsStrokeColorCurrentColor()) || (IsSVG() && StyleRef().SvgStyle().IsStrokeColorCurrentColor()) ||
IsListMarker()) IsListMarker() || IsDetailsMarker())
diff.SetNeedsPaintInvalidationObject(); diff.SetNeedsPaintInvalidationObject();
} }
......
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