Summary: | Web Inspector: Styles -> Computed -> Box Model shows NaN x NaN for invisible elements | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> | ||||||||
Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bburg, commit-queue, hi, joepeck, mattbaker, nvasilyev, saam, timothy, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | EasyFix, GoodFirstBug, InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Attachments: |
|
Created attachment 286583 [details]
Patch
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). (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. ಠ_ಠ Created attachment 286661 [details]
Patch
Comment on attachment 286661 [details]
Patch
r=me
Comment on attachment 286661 [details] Patch Clearing flags on attachment: 286661 Committed r204759: <http://trac.webkit.org/changeset/204759> All reviewed patches have been landed. Closing bug. |
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.