RESOLVED FIXED 161038
Web Inspector: Styles -> Computed -> Box Model shows NaN x NaN for invisible elements
https://bugs.webkit.org/show_bug.cgi?id=161038
Summary Web Inspector: Styles -> Computed -> Box Model shows NaN x NaN for invisible ...
Nikita Vasilyev
Reported 2016-08-21 14:44:44 PDT
Created attachment 286574 [details] [Image] Bug Steps: 1. Inspect <head> 2. Open Styles -> Computed -> Box Model Actual: NaN x NaN in the middle of the box. Expected: Nothing or an em-dash in the middle of the box.
Attachments
[Image] Bug (113.27 KB, image/png)
2016-08-21 14:44 PDT, Nikita Vasilyev
no flags
Patch (4.73 KB, patch)
2016-08-21 21:00 PDT, Devin Rousso
no flags
Patch (4.61 KB, patch)
2016-08-22 20:37 PDT, Devin Rousso
no flags
Radar WebKit Bug Importer
Comment 1 2016-08-21 14:44:57 PDT
Devin Rousso
Comment 2 2016-08-21 21:00:32 PDT
Joseph Pecoraro
Comment 3 2016-08-22 14:44:07 PDT
Comment on attachment 286583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=286583&action=review r- for the const issue, but the patch looks good otherwise. If you can confirm, or move back to var, r=me > Source/WebInspectorUI/UserInterface/Base/Utilities.js:29 > -var emDash = "\u2014"; > -var enDash = "\u2013"; > -var ellipsis = "\u2026"; > +const emDash = "\u2014"; > +const enDash = "\u2013"; > +const figureDash = "\u2012"; > +const ellipsis = "\u2026"; Wow! I didn't know about "Figure Dash". Crazy! I am pretty sure these need to be `var` and cannot be `const`. Based on what I learned from r187012 which made "WebInspector" in WebInspector.js non-const: > Source/WebInspectorUI: > > "const" variables do not live on the global object and are only > accessible within the "Program" they're defined in. Therefore, > the WebInspector global must be defined as "var" and not "const". > > * UserInterface/Base/WebInspector.js: My understanding is that by using let/const these variables are scoped to this file and this file only. So when other files attempt to use these "global variables" they won't work. With script: var globalVar; let globalLet; const globalConst; You can think of this as: GlobalScope (globalVar) GlobalLexicalEnvironment (globalLet, globalConst) And each file (program) shares the GlobalScope but has its own GlobalLexicalEnvironment. While this might work in Production builds where we combine all resources, I think it wouldn't work in local builds where Utilities.js is included separately as its own file. Can you verify that? If not, then we may have an ES6 issue (/cc Saam).
Devin Rousso
Comment 4 2016-08-22 14:53:04 PDT
(In reply to comment #3) > Can you verify that? If not, then we may have an ES6 issue (/cc Saam). When I tested this on my computer, it seemed to work just fine. ಠ_ಠ
Devin Rousso
Comment 5 2016-08-22 20:37:41 PDT
Joseph Pecoraro
Comment 6 2016-08-22 21:31:28 PDT
Comment on attachment 286661 [details] Patch r=me
WebKit Commit Bot
Comment 7 2016-08-22 23:11:16 PDT
Comment on attachment 286661 [details] Patch Clearing flags on attachment: 286661 Committed r204759: <http://trac.webkit.org/changeset/204759>
WebKit Commit Bot
Comment 8 2016-08-22 23:11:21 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.