Bug 1735817 [wpt PR 31242] - Resolve colors for ComputedStyle::Border[Visually]Equal...
commitcabbfdf157c42b7b2ff808d1a6ae0089681c3321
authorAnders Hartvoll Ruud <andruud@chromium.org>
Fri, 15 Oct 2021 10:39:18 +0000 (15 10:39 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 28 Oct 2021 03:19:44 +0000 (28 03:19 +0000)
tree388f422ac438c78160e03e4e41124a2d985c5423
parent96ffee70e2b2e7346cd51274bbc91197843d1f06
Bug 1735817 [wpt PR 31242] - Resolve colors for ComputedStyle::Border[Visually]Equal, a=testonly

Automatic update from web-platform-tests
Resolve colors for ComputedStyle::Border[Visually]Equal

There is currently a bug where we don't sufficiently invalidate
the color of collapsed borders when color-scheme changes.

LayoutNGTable* currently checks for the following conditions to
try to detect border color changes:

 - BorderVisuallyEqual
 - TextDecorationOrColorChanged &&
   HasBorderColorReferencingCurrentColor

However, BorderVisuallyEqual does not do what it says (it does not
resolve computed colors into used colors), and the
TextDecorationOrColorChanged flag is not set for color-scheme changes:
we set the NeedsPaintInvalidation flag instead, and assume that this
will be enough to repaint any colors affected by the color scheme
change. But for tables, using NeedsPaintInvalidation to regenerate
borders is not desirable, since it's an expensive operation, and we
want to avoid doing this when the flag is set for an unrelated reason.

Therefore, this CL addresses the issue by making BorderVisuallyEqual
actually resolve the colors before comparing. This should also work
for system color keywords other than currentColor. (We likely have
bugs for this as well).

 - We no longer need to check for HasBorderColorReferencingCurrentColor
   in any place we check for Border[Visually]Equal, since what we hope
   to achieve with checking that flag is now already included in
   Border[Visually]Equal.
 - LayoutObject::AdjustStyleDifference does not need to check
   HasBorderColorReferencingCurrentColor either, since
   ComputedStyle::AdjustDiffForNeedsPaintInvalidation already
   sets NeedsPaintInvalidation if !BorderVisuallyEqual.

Fixed: 1256758
Change-Id: I61f8ea60d4dd886800ae9533cda90ca80141cbd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3222587
Reviewed-by: Aleks Totic <atotic@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931800}

--

wpt-commits: 6f5768a8a8157be86c5a7624201632646077bd71
wpt-pr: 31242
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-table-border-currentcolor-responsive-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-table-border-currentcolor-responsive.html [new file with mode: 0644]