element.classList is much faster than the regex-based processing of element.className
Created attachment 84720 [details] [PATCH] Suggested solution
Created attachment 84724 [details] [PATCH] Trivial solution fix
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.
Created attachment 84759 [details] [PATCH] Removed unneeded methods on the Element.prototype altogether
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.
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).