Bug 147544 - Web Inspector: Unnamespaced Formatter classes break CSSStyleDeclarationTextEditor
Summary: Web Inspector: Unnamespaced Formatter classes break CSSStyleDeclarationTextEd...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-02 13:20 PDT by Matt Baker
Modified: 2015-08-03 14:32 PDT (History)
9 users (show)

See Also:


Attachments
[Patch] Proposed Fix (4.79 KB, patch)
2015-08-02 13:27 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2015-08-02 13:20:46 PDT
* SUMMARY
Unnamespaced Formatter classes break CSSStyleDeclarationTextEditor.

* STEPS TO REPRODUCE
1. Open Elements tab
2. In details sidebar go to Styles/Rules
3. Details sidebar is empty except for pseudo-class checkboxes
4. Inspect the Inspector, view console log.
  => [Error] Uncaught exception in inspector page while dispatching callback for command CSS.getComputedStyleForNode:  (2)
        ReferenceError: Can't find variable: FormatterContentBuilder
        _formattedContentFromEditor@file://.../Views/CSSStyleDeclarationTextEditor.js:1473:50\

* NOTES
For some reason I can only reproduce this in local builds, but namespacing FormatterContentBuilder and Formatter fixes the issue (and these should be namespaces anyway).
Comment 1 Matt Baker 2015-08-02 13:27:09 PDT
Created attachment 258039 [details]
[Patch] Proposed Fix
Comment 2 Brian Burg 2015-08-02 16:14:22 PDT
Comment on attachment 258039 [details]
[Patch] Proposed Fix

r=me
Comment 3 WebKit Commit Bot 2015-08-02 18:44:15 PDT
Comment on attachment 258039 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 258039

Committed r187732: <http://trac.webkit.org/changeset/187732>
Comment 4 WebKit Commit Bot 2015-08-02 18:44:19 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Joseph Pecoraro 2015-08-03 14:12:10 PDT
Comment on attachment 258039 [details]
[Patch] Proposed Fix

I think this would break PrettyPrinting test harness:

    Source/WebInspectorUI/Tools/PrettyPrinting/*

These classes were not WebInspector prefixed because they didn't rely on anything WebInspector and could be used outside of it. But it should be find to put them into the namespace.

My guess is this broke when converting classes to use block scoping. In that case the class name would likely not be exported.
Comment 6 Matt Baker 2015-08-03 14:32:29 PDT
(In reply to comment #5)
> Comment on attachment 258039 [details]
> [Patch] Proposed Fix
> 
> I think this would break PrettyPrinting test harness:
> 
>     Source/WebInspectorUI/Tools/PrettyPrinting/*

I'll file a follow up to fix it.

> My guess is this broke when converting classes to use block scoping. In that
> case the class name would likely not be exported.

Ah, makes sense.