WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
143433
Web Inspector: wrap style class names in WebInspector.StyleClass helper
https://bugs.webkit.org/show_bug.cgi?id=143433
Summary
Web Inspector: wrap style class names in WebInspector.StyleClass helper
Brian Burg
Reported
2015-04-05 18:16:05 PDT
Since we are moving away from long-winded style properties on view constructors, here's an idea. Given the two following approaches: this.element.classList.add("inline-object-foo") this.element.classList.add(WebInspector.StyleClass("inline-object-foo")) The latter supports tooling to check for bogus style names. * This could be done mostly at compile-time by cross-checking against identifiers in CSS files. * Alternatively, in engineering builds we could collate a "style class whitelist" similar to localizedStrings.js. At runtime we do a lookup into the whitelist and log an error if a bogus style class is used. In production builds, use sed to remove the unnecessary lookup. Thoughts?
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-04-05 18:16:32 PDT
<
rdar://problem/20429964
>
Timothy Hatcher
Comment 2
2015-04-06 06:02:11 PDT
I wonder if we could just runtime replace this.element.classList.add, remove, etc. to do the check?
Brian Burg
Comment 3
2015-04-06 08:21:20 PDT
(In reply to
comment #2
)
> I wonder if we could just runtime replace this.element.classList.add, > remove, etc. to do the check?
Maybe. A benefit of the proposed style which I didn't list: it makes it possible to trivially grep for all style strings in your favorite text editor. It is definitely kind of wordy. I think once ES6 modules land, we can debate whether and how to shorten WebInspector.Everything.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug