RESOLVED FIXED 209913
Computed style for "outline-offset" is wrong when "outline-style" is "none"
https://bugs.webkit.org/show_bug.cgi?id=209913
Summary Computed style for "outline-offset" is wrong when "outline-style" is "none"
Manuel Rego Casasnovas
Reported 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().
Attachments
Patch (5.97 KB, patch)
2020-04-02 22:05 PDT, Manuel Rego Casasnovas
no flags
Patch (17.79 KB, patch)
2020-04-03 02:27 PDT, Manuel Rego Casasnovas
no flags
Patch (17.79 KB, patch)
2020-04-03 02:55 PDT, Manuel Rego Casasnovas
no flags
Manuel Rego Casasnovas
Comment 1 2020-04-02 22:05:41 PDT
Manuel Rego Casasnovas
Comment 2 2020-04-03 02:27:54 PDT
Manuel Rego Casasnovas
Comment 3 2020-04-03 02:55:59 PDT
Daniel Bates
Comment 4 2020-04-04 12:20:12 PDT
Comment on attachment 395363 [details] Patch Looks reasonable.
EWS
Comment 5 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].
Radar WebKit Bug Importer
Comment 6 2020-04-05 21:15:17 PDT
Note You need to log in before you can comment on or make changes to this bug.