Automatic update from web-platform-tests css/selectors: Automate a part of legacy selectors tests (120 to 139) Change-Id: I1c7bbb9a3287c068c6cd711e481f137d2914db1e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8022122 Auto-Submit: Kent Tamura <tkent@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com> Reviewed-by: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1655098} -- wpt-commits: 58970eced72cb32f9ecb6aac8475afdd44424a98 wpt-pr: 60992
19 lines
857 B
JavaScript
19 lines
857 B
JavaScript
const LIME = 'rgb(0, 255, 0)';
|
|
const GREEN = 'rgb(0, 128, 0)';
|
|
const RED = 'rgb(255, 0, 0)';
|
|
|
|
function assert_background_color(elementOrId, colorString, comment) {
|
|
const element = typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId;
|
|
assert_equals(getComputedStyle(element).backgroundColor, colorString, comment);
|
|
}
|
|
|
|
function assert_not_background_color(elementOrId, colorString, comment) {
|
|
const element = typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId;
|
|
assert_not_equals(getComputedStyle(element).backgroundColor, colorString, comment);
|
|
}
|
|
|
|
function assert_color(elementOrId, colorString, comment) {
|
|
const element = typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId;
|
|
assert_equals(getComputedStyle(element).color, colorString, comment);
|
|
}
|