wpt / css / css-backgrounds / parsing / background-valid.html

Status: FAIL | Duration: 98ms | Subtests: 17/46 | Open test on wpt.live | wpt.fyi

Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)

SubtestStatusMessage
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set the property valueFAILassert_not_equals: property should be set got disallowed value ""
e.style['background'] = "none" should set background-attachmentPASS
e.style['background'] = "none" should set background-clipPASS
e.style['background'] = "none" should set background-colorPASS
e.style['background'] = "none" should set background-imagePASS
e.style['background'] = "none" should set background-originPASS
e.style['background'] = "none" should set background-positionPASS
e.style['background'] = "none" should set background-repeatPASS
e.style['background'] = "none" should set background-sizePASS
e.style['background'] = "none" should not set unrelated longhandsPASS
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-attachmentFAILassert_equals: background-attachment should be canonical expected "local, local" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-clipFAILassert_equals: background-clip should be canonical expected "content-box, content-box" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-colorFAILassert_equals: background-color should be canonical expected "rgb(5, 6, 7)" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-imageFAILassert_equals: background-image should be canonical expected "url(\"https://example.com/\"), url(\"https://example.com/\")" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-originFAILassert_equals: background-origin should be canonical expected "padding-box, padding-box" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-positionFAILassert_equals: background-position should be canonical expected "1px 2px, 1px 2px" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-repeatFAILassert_equals: background-repeat should be canonical expected "space round, space round" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should set background-sizeFAILassert_equals: background-size should be canonical expected "3px 4px, 3px 4px" but got ""
e.style['background'] = "url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url(\"https://example.com/\") 1px 2px / 3px 4px space round local padding-box content-box" should not set unrelated longhandsFAILassert_true: expected true got false
e.style['background'] = "border-box content-box" should set background-attachmentPASS
e.style['background'] = "border-box content-box" should set background-clipPASS
e.style['background'] = "border-box content-box" should set background-colorFAILassert_equals: background-color should be canonical expected "transparent" but got "rgba(0, 0, 0, 0)"
e.style['background'] = "border-box content-box" should set background-imagePASS
e.style['background'] = "border-box content-box" should set background-originPASS
e.style['background'] = "border-box content-box" should set background-positionPASS
e.style['background'] = "border-box content-box" should set background-repeatPASS
e.style['background'] = "border-box content-box" should set background-sizePASS
e.style['background'] = "border-box content-box" should not set unrelated longhandsPASS
e.style['background'] = "border-area" should set background-attachmentFAILassert_equals: background-attachment should be canonical expected "scroll" but got ""
e.style['background'] = "border-area" should set background-clipFAILassert_equals: background-clip should be canonical expected "border-area" but got ""
e.style['background'] = "border-area" should set background-colorFAILassert_equals: background-color should be canonical expected "transparent" but got ""
e.style['background'] = "border-area" should set background-imageFAILassert_equals: background-image should be canonical expected "none" but got ""
e.style['background'] = "border-area" should set background-originFAILassert_equals: background-origin should be canonical expected "border-box" but got ""
e.style['background'] = "border-area" should set background-positionFAILassert_equals: background-position should be canonical expected "0% 0%" but got ""
e.style['background'] = "border-area" should set background-repeatFAILassert_equals: background-repeat should be canonical expected "repeat" but got ""
e.style['background'] = "border-area" should set background-sizeFAILassert_equals: background-size should be canonical expected "auto" but got ""
e.style['background'] = "border-area" should not set unrelated longhandsFAILassert_true: expected true got false
e.style['background'] = "border-area text" should set background-attachmentFAILassert_equals: background-attachment should be canonical expected "scroll" but got ""
e.style['background'] = "border-area text" should set background-clipFAILassert_equals: background-clip should be canonical expected "border-area text" but got ""
e.style['background'] = "border-area text" should set background-colorFAILassert_equals: background-color should be canonical expected "transparent" but got ""
e.style['background'] = "border-area text" should set background-imageFAILassert_equals: background-image should be canonical expected "none" but got ""
e.style['background'] = "border-area text" should set background-originFAILassert_equals: background-origin should be canonical expected "border-box" but got ""
e.style['background'] = "border-area text" should set background-positionFAILassert_equals: background-position should be canonical expected "0% 0%" but got ""
e.style['background'] = "border-area text" should set background-repeatFAILassert_equals: background-repeat should be canonical expected "repeat" but got ""
e.style['background'] = "border-area text" should set background-sizeFAILassert_equals: background-size should be canonical expected "auto" but got ""
e.style['background'] = "border-area text" should not set unrelated longhandsFAILassert_true: expected true got false

/css/css-backgrounds/parsing/background-valid.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Backgrounds and Borders Module Level 3: parsing background with valid values</title>
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#background">
<meta name="assert" content="background supports the full grammar '<bg-layer># , <final-bg-layer>'.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script src="/css/support/shorthand-testcommon.js"></script>
</head>
<body>
<script>

// Background serialization varies across browsers. https://github.com/w3c/csswg-drafts/issues/418
test_valid_value("background",
  'url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box', [
  'url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box', // spec, WebKit
  'url("https://example.com/") local space round 1px 2px / 3px 4px padding-box content-box, url("https://example.com/") local space round 1px 2px / 3px 4px padding-box content-box rgb(5, 6, 7)', // Edge
  'url("https://example.com/") space round local 1px 2px / 3px 4px padding-box content-box, rgb(5, 6, 7) url("https://example.com/") space round local 1px 2px / 3px 4px padding-box content-box', // Firefox
  'url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box, url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box rgb(5, 6, 7)' // Blink
]);

test_shorthand_value('background', 'none', {
    'background-image': 'none',
    'background-position': '0% 0%',
    'background-size': 'auto',
    'background-repeat': 'repeat',
    'background-attachment': 'scroll',
    'background-origin': 'padding-box',
    'background-clip': 'border-box',
    'background-color': 'rgba(0, 0, 0, 0)',
})
test_shorthand_value('background', 'url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box, rgb(5, 6, 7) url("https://example.com/") 1px 2px / 3px 4px space round local padding-box content-box', {
    'background-image': 'url("https://example.com/"), url("https://example.com/")',
    'background-position': '1px 2px, 1px 2px',
    'background-size': '3px 4px, 3px 4px',
    'background-repeat': 'space round, space round',
    'background-attachment': 'local, local',
    'background-origin': 'padding-box, padding-box',
    'background-clip': 'content-box, content-box',
    'background-color': 'rgb(5, 6, 7)',
})
test_shorthand_value('background', 'border-box content-box', {
    'background-image': 'none',
    'background-position': '0% 0%',
    'background-size': 'auto',
    'background-repeat': 'repeat',
    'background-attachment': 'scroll',
    'background-origin': 'border-box',
    'background-clip': 'content-box',
    'background-color': 'transparent',
})
test_shorthand_value('background', 'border-area', {
    'background-image': 'none',
    'background-position': '0% 0%',
    'background-size': 'auto',
    'background-repeat': 'repeat',
    'background-attachment': 'scroll',
    'background-origin': 'border-box',
    'background-clip': 'border-area',
    'background-color': 'transparent',
})
test_shorthand_value('background', 'border-area text', {
    'background-image': 'none',
    'background-position': '0% 0%',
    'background-size': 'auto',
    'background-repeat': 'repeat',
    'background-attachment': 'scroll',
    'background-origin': 'border-box',
    'background-clip': 'border-area text',
    'background-color': 'transparent',
})

</script>
</body>
</html>