Bug 209913 - Computed style for "outline-offset" is wrong when "outline-style" is "none"
Summary: Computed style for "outline-offset" is wrong when "outline-style" is "none"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-02 09:45 PDT by Manuel Rego Casasnovas
Modified: 2020-04-05 21:15 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.97 KB, patch)
2020-04-02 22:05 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (17.79 KB, patch)
2020-04-03 02:27 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (17.79 KB, patch)
2020-04-03 02:55 PDT, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Rego Casasnovas 2020-04-02 09:45:10 PDT
This is easy to reproduce with the following example:
  <style>#foo { outline-offset: 10px; }</style>
  <div id="foo"></div>
  <script>console.log(getComputedStyle(foo).outlineOffset);</script>

It should log 10px but it actually logs 0px.

This is probably a mistake as "outline-width" is special on the spec (https://drafts.csswg.org/css-ui/#outline-props).
For "outline-width" the computed value says: "absolute length; 0 if the outline style is none."
But for "outline-offset" it says: "absolute length"

There's a check causing this behavior at RenderStyle::outlineOffset().
Comment 1 Manuel Rego Casasnovas 2020-04-02 22:05:41 PDT
Created attachment 395346 [details]
Patch
Comment 2 Manuel Rego Casasnovas 2020-04-03 02:27:54 PDT
Created attachment 395359 [details]
Patch
Comment 3 Manuel Rego Casasnovas 2020-04-03 02:55:59 PDT
Created attachment 395363 [details]
Patch
Comment 4 Daniel Bates 2020-04-04 12:20:12 PDT
Comment on attachment 395363 [details]
Patch

Looks reasonable.
Comment 5 EWS 2020-04-05 21:14:24 PDT
Committed r259562: <https://trac.webkit.org/changeset/259562>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395363 [details].
Comment 6 Radar WebKit Bug Importer 2020-04-05 21:15:17 PDT
<rdar://problem/61328192>