gecko-dev/testing/web-platform/tests/css/css-ui/parsing/outline-offset-computed.html
Manuel Rego Casasnovas 93035ce4bd Bug 1627013 [wpt PR 22660] - Fix computed style for outline-offset, a=testonly
Automatic update from web-platform-tests
Fix computed style for outline-offset

Computed style for outline-offset was not returning the proper value
if "outline-style" was "none".
This was due to a check in ComputedSyle::OutlineOffset()
that this patch removes.

This code could be there because this is needed for "outline-width"
as specified in the spec [1], however there's nothing about this
on the "outline-offset" property.

This patch modifies outline-offset-computed.html, as it had
some extra lines (similar to what's needed for "outline-width")
to make it work in Chromium (and WebKit https://webkit.org/b/209913)
due to this bug.

[1] https://drafts.csswg.org/css-ui/#outline-props

Bug: 1005372
Test: css/css-ui/parsing/outline-offset-computed.html
Change-Id: Ief8d4fe22c462ec2bb493b20b1b22b8d0797e1ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134133
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#755943}

--

wpt-commits: 040a0f65ee9633c9f5d7e03957f3118fe626eac5
wpt-pr: 22660
2020-04-09 10:35:19 +00:00

26 lines
809 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS UI Level 3: getComputedStyle().outlineOffset</title>
<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-offset">
<meta name="assert" content="outline-offset computed value is absolute length.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
</head>
<body>
<style>
#target {
font-size: 40px;
}
</style>
<div id="target"></div>
<script>
test_computed_value("outline-offset", "10px");
test_computed_value("outline-offset", "0.5em", "20px");
test_computed_value("outline-offset", "calc(10px + 0.5em)", "30px");
test_computed_value("outline-offset", "calc(10px - 0.5em)", "-10px");
</script>
</body>
</html>