Commit 7a7a80fe authored by Manuel Rego Casasnovas's avatar Manuel Rego Casasnovas Committed by Commit Bot

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/+/2134133Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#755943}
parent e622c528
...@@ -729,8 +729,6 @@ class ComputedStyle : public ComputedStyleBase, ...@@ -729,8 +729,6 @@ class ComputedStyle : public ComputedStyleBase,
// outline-offset // outline-offset
int OutlineOffset() const { int OutlineOffset() const {
if (OutlineStyle() == EBorderStyle::kNone)
return 0;
return OutlineOffsetInternal(); return OutlineOffsetInternal();
} }
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
<style> <style>
#target { #target {
font-size: 40px; font-size: 40px;
outline-width: 100px;
outline-style: dotted; /* Avoid outline-width computed style 0 */
} }
</style> </style>
<div id="target"></div> <div id="target"></div>
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 560 tests; 542 PASS, 18 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 560 tests; 544 PASS, 16 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup PASS Setup
PASS align-content (type: discrete) has testAccumulation function PASS align-content (type: discrete) has testAccumulation function
PASS align-content: "flex-end" onto "flex-start" PASS align-content: "flex-end" onto "flex-start"
...@@ -375,8 +375,8 @@ PASS outline-color supports animating as color of #RGBa ...@@ -375,8 +375,8 @@ PASS outline-color supports animating as color of #RGBa
PASS outline-color supports animating as color of rgba() PASS outline-color supports animating as color of rgba()
PASS outline-color supports animating as color of hsla() PASS outline-color supports animating as color of hsla()
PASS outline-offset (type: length) has testAccumulation function PASS outline-offset (type: length) has testAccumulation function
FAIL outline-offset: length assert_equals: The value should be 20px at 0ms expected "20px" but got "0px" PASS outline-offset: length
FAIL outline-offset: length of rem assert_equals: The value should be 20px at 0ms expected "20px" but got "0px" PASS outline-offset: length of rem
PASS outline-style (type: discrete) has testAccumulation function PASS outline-style (type: discrete) has testAccumulation function
PASS outline-style: "dotted" onto "none" PASS outline-style: "dotted" onto "none"
PASS outline-style: "none" onto "dotted" PASS outline-style: "none" onto "dotted"
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 556 tests; 541 PASS, 15 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 556 tests; 543 PASS, 13 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup PASS Setup
PASS align-content (type: discrete) has testAddition function PASS align-content (type: discrete) has testAddition function
PASS align-content: "flex-end" onto "flex-start" PASS align-content: "flex-end" onto "flex-start"
...@@ -375,8 +375,8 @@ PASS outline-color supports animating as color of #RGBa ...@@ -375,8 +375,8 @@ PASS outline-color supports animating as color of #RGBa
PASS outline-color supports animating as color of rgba() PASS outline-color supports animating as color of rgba()
PASS outline-color supports animating as color of hsla() PASS outline-color supports animating as color of hsla()
PASS outline-offset (type: length) has testAddition function PASS outline-offset (type: length) has testAddition function
FAIL outline-offset: length assert_equals: The value should be 20px at 0ms expected "20px" but got "0px" PASS outline-offset: length
FAIL outline-offset: length of rem assert_equals: The value should be 20px at 0ms expected "20px" but got "0px" PASS outline-offset: length of rem
PASS outline-style (type: discrete) has testAddition function PASS outline-style (type: discrete) has testAddition function
PASS outline-style: "dotted" onto "none" PASS outline-style: "dotted" onto "none"
PASS outline-style: "none" onto "dotted" PASS outline-style: "none" onto "dotted"
......
This is a testharness.js-based test. This is a testharness.js-based test.
Found 686 tests; 656 PASS, 30 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 686 tests; 658 PASS, 28 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS Setup PASS Setup
PASS align-content (type: discrete) has testInterpolation function PASS align-content (type: discrete) has testInterpolation function
PASS align-content uses discrete animation when animating between "flex-start" and "flex-end" with linear easing PASS align-content uses discrete animation when animating between "flex-start" and "flex-end" with linear easing
...@@ -458,8 +458,8 @@ PASS outline-color supports animating as color of #RGBa ...@@ -458,8 +458,8 @@ PASS outline-color supports animating as color of #RGBa
PASS outline-color supports animating as color of rgba() PASS outline-color supports animating as color of rgba()
PASS outline-color supports animating as color of hsla() PASS outline-color supports animating as color of hsla()
PASS outline-offset (type: length) has testInterpolation function PASS outline-offset (type: length) has testInterpolation function
FAIL outline-offset supports animating as a length assert_equals: The value should be 30px at 500ms expected "30px" but got "0px" PASS outline-offset supports animating as a length
FAIL outline-offset supports animating as a length of rem assert_equals: The value should be 30px at 500ms expected "30px" but got "0px" PASS outline-offset supports animating as a length of rem
PASS outline-style (type: discrete) has testInterpolation function PASS outline-style (type: discrete) has testInterpolation function
PASS outline-style uses discrete animation when animating between "none" and "dotted" with linear easing PASS outline-style uses discrete animation when animating between "none" and "dotted" with linear easing
PASS outline-style uses discrete animation when animating between "none" and "dotted" with effect easing PASS outline-style uses discrete animation when animating between "none" and "dotted" with effect easing
......
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