Closed
Bug 484935
Opened 15 years ago
Closed 15 years ago
videocontrols should use display:none on hidden items to minimize CPU usage
Categories
(Toolkit :: Video/Audio Controls, defect)
Toolkit
Video/Audio Controls
Tracking
()
VERIFIED
FIXED
mozilla1.9.2a1
People
(Reporter: Dolske, Assigned: Dolske)
References
Details
(Keywords: verified1.9.1)
Attachments
(1 file, 1 obsolete file)
4.14 KB,
patch
|
enndeakin
:
review+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
Spun off from bug 483841, since the patch there partially fixed the problem but in a different, more generic way. On my MBP, a video that's finished buffering and not doing anything causes ~2-3% CPU usage according to Activity Monitor. With this patch, CPU usage drops to 0.5-1%.
Attachment #369039 -
Flags: review?(enndeakin)
Comment 1•15 years ago
|
||
Comment on attachment 369039 [details] [diff] [review] Patch v.1 >-.controlBar { >- visibility: hidden; >- opacity: 0.0; >+.controlBar[hidden] { >+ display: none; Why would the default hidden (from xul.css) not apply? >- // Use .visibility to ignore mouse clicks when hidden. >+ // Trigger CSS suppression of mouse clicks and throbber CPU usage. > if (fader.isVisible) >- fader.element.style.visibility = "visible"; >+ fader.element.removeAttribute("hidden"); > else >- fader.element.style.visibility = "hidden"; >+ fader.element.setAttribute("hidden", "true"); The hidden property is implemented in C++ so doesn't have the xbl and security issues that other properties sometimes have. Thus, the whole block above can be replaced with: fader.element.hidden = !fader.isVisible; >- fader.element.style.visibility = "visible"; >- fader.element.style.opacity = 1.0; >+ fader.element.removeAttribute("hidden"); Similar here
Assignee | ||
Comment 2•15 years ago
|
||
(In reply to comment #1) > >+.controlBar[hidden] { > >+ display: none; > > Why would the default hidden (from xul.css) not apply? Oh, hrm, I wasn't even thinking about XUL having .hidden. Duh.
Assignee | ||
Comment 3•15 years ago
|
||
Turns out I can't set .hidden without triggering the security checks, so I'm still using it as an attribute.
Attachment #369039 -
Attachment is obsolete: true
Attachment #369155 -
Flags: review?(enndeakin)
Attachment #369039 -
Flags: review?(enndeakin)
Comment 4•15 years ago
|
||
Comment on attachment 369155 [details] [diff] [review] Patch v.2 Bah, ok. I guess this will have to do.
Attachment #369155 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 5•15 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/85bdf13ea382
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Attachment #369155 -
Flags: approval1.9.1?
Comment 6•15 years ago
|
||
Comment on attachment 369155 [details] [diff] [review] Patch v.2 a191=beltzner
Attachment #369155 -
Flags: approval1.9.1? → approval1.9.1+
Assignee | ||
Comment 7•15 years ago
|
||
Pushed to 191: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/df2705e294b9
Keywords: fixed1.9.1
Comment 8•15 years ago
|
||
Verified fix on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090507 Shiretoko/3.5b5pre and Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090507 Minefield/3.6a1pre
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
Assignee | ||
Updated•14 years ago
|
Component: Video/Audio → Video/Audio Controls
Product: Core → Toolkit
QA Contact: video.audio → video.audio
Version: Trunk → unspecified
You need to log in
before you can comment on or make changes to this bug.
Description
•