After media controls were refactored to use new shadow DOM, they use inline styles to show, hide, and animate. The inline styles are set using strings, which is not super-efficient, since we have to go through CSS parser to do this. Event though it's as good as JavaScript, we can go faster. And we should.
Also, "show()" actually means removal of display:none style, which makes it confusingly named.
Hi, I have tried to optimized media controls code related to setting inline CSS styles, attaching raw patch for discussion. Below are the changes: -Used CSSPropertyNames, CSSValues and CSSPrimitiveValues instead of Strings. -Removed displayString(), webkitTransitionString(), opacityString() functions as they will no longer be needed after this change. -Moved makeOpaque and makeTransparent functionality to MediaControlPanelElement from MediaControlRootElement. This is making it look better and also avoiding styles related code duplication in MediaControlRootElementChromium. If the patch looks good in general, I will work on making all media layout tests work with this change and submit the updated patch for review/commit.
Created attachment 109616 [details] patch for discussion
Adding Eric in cc...
Created attachment 110471 [details] updated patch
Attachment 110471 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 110473 [details] updated patch
I didn't mark this r+ so dglazkov has a chance to check, since the original is his code, but this looks fine to me. Nice optimizations Arun!
Comment on attachment 110473 [details] updated patch awesome.
Thanks Eric and Dimitri for reviewing the patch!
Comment on attachment 110473 [details] updated patch Clearing flags on attachment: 110473 Committed r97157: <http://trac.webkit.org/changeset/97157>
All reviewed patches have been landed. Closing bug.