Bug 58341 - Improve media controls state management code by using CSS selectors
Summary: Improve media controls state management code by using CSS selectors
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 58342
Blocks: 58345
  Show dependency treegraph
 
Reported: 2011-04-12 10:13 PDT by Dimitri Glazkov (Google)
Modified: 2014-10-22 10:31 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2011-04-12 10:13:43 PDT
Today, the code in media controls explicitly sets inline styles on specific controls to hide or show them. This can be completely eliminated if we instead manipulate state using DOM attributes. For example, if a network error occurs, we can set "disabled" attribute on the timeline control, and then specify in mediaControls.css:

video::-webkit-media-controls-timeline:disabled { display: none; }

Unfortunately, this is not immediately possible due to a restriction on how CSS selectors can be combined: the pseudo-element selector must always be the last one. Otherwise, the selector is deemed invalid.

Hyatt suggested that we relax this requirement, much the same way we relaxed it to allow scrollbar styling.