WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
130161
Web Inspector: Classname stuff in WebInspector.displayNameForNode should join DOMTokenList classList instead of using string parsing and concatenation
https://bugs.webkit.org/show_bug.cgi?id=130161
Summary
Web Inspector: Classname stuff in WebInspector.displayNameForNode should join...
James Craig
Reported
2014-03-12 15:38:40 PDT
Web Inspector: Classname stuff in WebInspector.displayNameForNode should join DOMTokenList classList instead of using string parsing and concatenation. Unless I'm missing something, I expect this was just written before DOMTokenList classList was available. var classAttribute = node.getAttribute("class"); if (classAttribute) { var classes = classAttribute.trim().split(/\s+/); var foundClasses = {}; for (var i = 0; i < classes.length; ++i) { var className = classes[i]; if (className && !(className in foundClasses)) { title += "." + className; foundClasses[className] = true; } } }
Attachments
Add attachment
proposed patch, testcase, etc.
Timothy Hatcher
Comment 1
2014-03-12 17:11:28 PDT
node is not a real DOMNode, it is our DOMNode proxy. So we don't have access to classList unless we go to the injected script for it. That is why we do what we do here.
James Craig
Comment 2
2014-03-13 09:25:50 PDT
Gotcha. Makes sense.
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