Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: Source/core/css/mediaControlsNew.css

Issue 1156993013: New media playback UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed my own broken unit test. They really work! Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /**/ 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2015 Google Inc.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26 /* Chromium default media controls */
27
28 /* WARNING: This css file can only style <audio> and <video> elements */
29
30 audio:not([controls]) {
31 display: none !important;
32 }
33
34 audio {
35 width: 300px;
36 height: 48px;
37 }
38
39 audio::-webkit-media-controls,
40 video::-webkit-media-controls {
41 width: inherit;
42 height: inherit;
43 position: relative;
44 direction: ltr;
45 display: flex;
46 flex-direction: column;
47 justify-content: flex-end;
48 align-items: center;
49 }
50
51 audio::-webkit-media-controls-enclosure, video::-webkit-media-controls-enclosure {
52 width: 100%;
53 height: 48px;
54 flex-shrink: 0;
55 bottom: 0;
56 text-indent: 0;
57 padding: 0;
58 margin: 0;
59 box-sizing: border-box;
60 }
61
62 audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
63 display: flex;
64 flex-direction: row;
65 align-items: center;
66 /* We use flex-start here to ensure that the play button is visible even
67 * if we are too small to show all controls.
68 */
69 justify-content: flex-start;
70 -webkit-user-select: none;
71 position: relative;
72 width: 100%;
73 z-index: 0;
74 overflow: hidden;
75 text-align: right;
76 bottom: auto;
77 height: 48px;
78 min-width: 48px;
79 background-color: #fafafa;
80 /* The duration is also specified in MediaControlElements.cpp and LayoutTest s/media/media-controls.js */
81 transition: opacity 0.3s;
82
83 font-family: Segoe, "Helvetica Neue", Roboto, Arial, Helvetica, sans-serif ;
84 font-size: 14px;
85 font-weight: normal; /* Make sure that we don't inherit non-defaults. */
86 font-style: normal;
87 }
88
89 video:-webkit-full-page-media {
90 margin: auto;
91 position: absolute;
92 top: 0;
93 right: 0;
94 bottom: 0;
95 left: 0;
96 }
97
98 audio:-webkit-full-page-media, video:-webkit-full-page-media {
99 max-height: 100%;
100 max-width: 100%;
101 }
102
103 audio:-webkit-full-page-media::-webkit-media-controls-panel,
104 video:-webkit-full-page-media::-webkit-media-controls-panel {
105 bottom: 0px;
106 }
107
108 audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-bu tton {
109 -webkit-appearance: media-mute-button;
110 display: flex;
111 flex: none;
112 border: none;
113 box-sizing: border-box;
114 width: 48px;
115 height: 48px;
116 line-height: 48px;
117 padding: 12px;
118 background-color: initial;
119 color: inherit;
120 }
121
122 audio::-webkit-media-controls-overlay-enclosure {
123 display: none;
124 }
125
126 video::-webkit-media-controls-overlay-enclosure {
127 display: flex;
128 position: relative;
129 flex-direction: column;
130 justify-content: flex-end;
131 align-items: center;
132 flex: 1 1;
133 min-height: 0;
134 width: 100%;
135 margin-bottom: 10px;
136 text-indent: 0;
137 box-sizing: border-box;
138 overflow: hidden;
139 }
140
141 video::-webkit-media-controls-overlay-play-button {
142 -webkit-appearance: media-overlay-play-button;
143 display: flex;
144 position: absolute;
145 top: 0;
146 left: 0;
147 margin: 0;
148 border: none;
149 box-sizing: border-box;
150 background-color: transparent;
151 width: 100%;
152 height: 100%;
153 padding: 0;
154 }
155
156 video::-internal-media-controls-overlay-cast-button {
157 -webkit-appearance: -internal-media-overlay-cast-off-button;
158 display: flex;
159 position: absolute;
160 top: 5%;
161 left: 5%;
162 margin-left: 0px;
163 margin-top: 0px;
164 border: none;
165 box-sizing: border-box;
166 background-color: transparent;
167 width: 48px;
168 height: 48px;
169 padding: 0;
170 transition: opacity 0.3s;
171 }
172
173 audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-bu tton {
174 -webkit-appearance: media-play-button;
175 display: flex;
176 flex: none;
177 border-sizing: border-box;
178 width: 48px;
179 height: 48px;
180 line-height: 48px;
181 padding: 12px;
182 background-color: initial;
183 color: inherit;
184 }
185
186 audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls- timeline-container {
187 -webkit-appearance: media-controls-background;
188 display: flex;
189 flex-direction: row;
190 align-items: center;
191 justify-content: flex-end;
192 flex: 1 1;
193 -webkit-user-select: none;
194 height: 48px;
195 padding: 0;
196 min-width: 0;
197 }
198
199 audio::-webkit-media-controls-current-time-display, video::-webkit-media-control s-current-time-display {
200 -webkit-appearance: media-current-time-display;
201 -webkit-user-select: none;
202 flex: none;
203 display: flex;
204 border: none;
205 cursor: default;
206
207 height: 48px;
208
209 /* text runs right to the edge of the container */
210 padding: 0;
211
212 line-height: 48px;
213 color: #5a5a5a;
214
215 letter-spacing: normal;
216 word-spacing: normal;
217 text-transform: none;
218 text-indent: 0;
219 text-shadow: none;
220 text-decoration: none;
221 }
222
223 audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-contr ols-time-remaining-display {
224 -webkit-appearance: media-current-time-display;
225 -webkit-user-select: none;
226 flex: none;
227 display: flex;
228 border: none;
229 cursor: default;
230
231 height: 48px;
232
233 /* text runs right to the edge of the container, plus a little on
234 * the left to pad the leading "/" */
235 padding: 0 0 0 4px;
236
237 line-height: 48px;
238 color: #5a5a5a;
239
240 letter-spacing: normal;
241 word-spacing: normal;
242 text-transform: none;
243 text-indent: 0;
244 text-shadow: none;
245 text-decoration: none;
246 }
247
248 audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline {
249 -webkit-appearance: media-slider;
250 display: flex;
251 flex: 1 1 auto;
252 height: 48px;
253
254 /* Leave 6px on either side for the thumb. Use margin so that
255 * the slider doesn't extend into it. We also add 12px border.
256 */
257 padding: 0;
258 margin: 0 18px 0 18px;
259 background-color: transparent;
260 min-width: 25px;
261 border: initial;
262 color: inherit;
263 }
264
265 audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volum e-slider {
266 -webkit-appearance: media-volume-slider;
267 display: flex;
268 /* The 1.9 value was empirically chosen to match old-flexbox behaviour
269 * and be aesthetically pleasing.
270 */
271 flex: 1 1.9 auto;
272 height: 48px;
273 max-width: 70px;
274 /* Leave room for the thumb, which has 6px radius. Use margin rather
275 * than padding so that the slider doesn't extend into it. We also
276 * leave an addition 12px margin.
277 */
278 padding: 0;
279 margin: 0 18px 0 18px;
280 background-color: transparent;
281 min-width: 25px;
282 border: initial;
283 color: inherit;
284 }
285
286 /* FIXME these shouldn't use special pseudoShadowIds, but nicer rules.
287 https://code.google.com/p/chromium/issues/detail?id=112508
288 https://bugs.webkit.org/show_bug.cgi?id=62218
289 */
290 input[type="range" i]::-webkit-media-slider-container {
291 display: flex;
292 align-items: center;
293 flex-direction: row; /* This property is updated by C++ code. */
294 box-sizing: border-box;
295 /** this positions the slider thumb for both time and volume. */
296 height: 48px;
297 width: 100%;
298 background-color: transparent; /* Background drawing is managed by C++ code to draw ranges. */
299 }
300
301 /* The negative right margin causes the track to overflow its container. */
302 input[type="range" i]::-webkit-media-slider-container > div {
303 margin-right: -18px; /* box is 36px wide, get to the middle */
304 margin-left: -18px;
305 }
306
307 input[type="range" i]::-webkit-media-slider-thumb {
308 box-sizing: border-box;
309 width: 48px;
310 height: 48px;
311 padding: 0px;
312 }
313
314 audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-f ullscreen-button {
315 -webkit-appearance: media-enter-fullscreen-button;
316 display: flex;
317 flex: none;
318 overflow: hidden;
319 border: none;
320 box-sizing: border-box;
321 width: 48px;
322 height: 48px;
323 line-height: 48px;
324 background-color: initial;
325 color: inherit;
326 }
327
328 audio::-internal-media-controls-cast-button, video::-internal-media-controls-cas t-button {
329 -webkit-appearance: -internal-media-cast-off-button;
330 display: flex;
331 flex: none;
332 border: none;
333 box-sizing: border-box;
334 width: 48px;
335 height: 48px;
336 line-height: 48px;
337 margin-left: 0px;
338 margin-right: 0px;
339 padding: 12px;
340 background-color: initial;
341 color: inherit;
342 }
343
344 audio::-webkit-media-controls-toggle-closed-captions-button {
345 display: none;
346 }
347
348 video::-webkit-media-controls-toggle-closed-captions-button {
349 -webkit-appearance: media-toggle-closed-captions-button;
350 display: flex;
351 flex: none;
352 border: none;
353 box-sizing: border-box;
354 width: 48px;
355 height: 48px;
356 line-height: 48px;
357 margin-left: 0px;
358 margin-right: 0px;
359 padding: 12px;
360 background-color: initial;
361 color: inherit;
362 }
363
364 audio::-webkit-media-controls-fullscreen-volume-slider, video::-webkit-media-con trols-fullscreen-volume-slider {
365 display: none;
366 }
367
368 audio::-webkit-media-controls-fullscreen-volume-min-button, video::-webkit-media -controls-fullscreen-volume-min-button {
369 display: none;
370 }
371
372 audio::-webkit-media-controls-fullscreen-volume-max-button, video::-webkit-media -controls-fullscreen-volume-max-button {
373 display: none;
374 }
375
376 video::-webkit-media-text-track-container {
377 position: relative;
378 width: inherit;
379 height: inherit;
380 overflow: hidden;
381
382 font: 22px sans-serif;
383 text-align: center;
384 color: rgba(255, 255, 255, 1);
385
386 letter-spacing: normal;
387 word-spacing: normal;
388 text-transform: none;
389 text-indent: 0;
390 text-decoration: none;
391 pointer-events: none;
392 -webkit-user-select: none;
393 word-break: break-word;
394 }
395
396 video::cue {
397 display: inline;
398
399 background-color: rgba(0, 0, 0, 0.8);
400 padding: 2px 2px;
401 }
402
403 video::-webkit-media-text-track-region {
404 position: absolute;
405 line-height: 5.33vh;
406 writing-mode: horizontal-tb;
407 background: rgba(0, 0, 0, 0.8);
408 color: rgba(255, 255, 255, 1);
409 word-wrap: break-word;
410 overflow-wrap: break-word;
411 overflow: hidden;
412 }
413
414 video::-webkit-media-text-track-region-container {
415 position: relative;
416
417 display: flex;
418 flex-flow: column;
419 flex-direction: column;
420 }
421
422 video::-webkit-media-text-track-region-container.scrolling {
423 transition: top 433ms linear;
424 }
425
426
427 video::-webkit-media-text-track-display {
428 position: absolute;
429 overflow: hidden;
430 white-space: pre-wrap;
431 -webkit-box-sizing: border-box;
432 flex: 0 0 auto;
433 }
434
435 video::cue(:future) {
436 color: gray;
437 }
438
439 video::-webkit-media-text-track-container b {
440 font-weight: bold;
441 }
442
443 video::-webkit-media-text-track-container u {
444 text-decoration: underline;
445 }
446
447 video::-webkit-media-text-track-container i {
448 font-style: italic;
449 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698