RESOLVED FIXED 55758
Web Inspector: Make use of element.classList in utilities.js
https://bugs.webkit.org/show_bug.cgi?id=55758
Summary Web Inspector: Make use of element.classList in utilities.js
Alexander Pavlov (apavlov)
Reported 2011-03-04 02:54:52 PST
element.classList is much faster than the regex-based processing of element.className
Attachments
[PATCH] Suggested solution (4.06 KB, patch)
2011-03-04 03:14 PST, Alexander Pavlov (apavlov)
no flags
[PATCH] Trivial solution fix (4.07 KB, patch)
2011-03-04 04:20 PST, Alexander Pavlov (apavlov)
no flags
[PATCH] Removed unneeded methods on the Element.prototype altogether (156.25 KB, patch)
2011-03-04 09:09 PST, Alexander Pavlov (apavlov)
pfeldman: review-
Alexander Pavlov (apavlov)
Comment 1 2011-03-04 03:14:26 PST
Created attachment 84720 [details] [PATCH] Suggested solution
Alexander Pavlov (apavlov)
Comment 2 2011-03-04 04:20:07 PST
Created attachment 84724 [details] [PATCH] Trivial solution fix
Pavel Feldman
Comment 3 2011-03-04 05:03:04 PST
Comment on attachment 84724 [details] [PATCH] Trivial solution fix View in context: https://bugs.webkit.org/attachment.cgi?id=84724&action=review > Source/WebCore/inspector/front-end/utilities.js:169 > +Element.prototype.addStyleClass = function(classNames) I'd get rid of our methods all together.
Alexander Pavlov (apavlov)
Comment 4 2011-03-04 09:09:36 PST
Created attachment 84759 [details] [PATCH] Removed unneeded methods on the Element.prototype altogether
Pavel Feldman
Comment 5 2011-03-06 11:10:19 PST
Comment on attachment 84759 [details] [PATCH] Removed unneeded methods on the Element.prototype altogether Thanks for doing this. It is hard to land this with no regressions. Could you please split this change into two changes: 1) make sure that only single classes are passed into add/remove/hasStyleClass + migrate to using classList in the add/remove/hasStyleClass methods. 2) Inline classList.* in place of add/remove/hasStyleClass.
Alexander Pavlov (apavlov)
Comment 6 2011-03-11 01:27:13 PST
Bug 56096 fixes the first item, and we have agreed with pfeldman that the add/remove/hasStyleClass improve readability, so the classList methods will not be inlined. We have reached our primary goal of getting rid of regex-based operations and the className property modification (which is slow).
Note You need to log in before you can comment on or make changes to this bug.