Changeset 150516 in webkit
- Timestamp:
- May 22, 2013 9:11:55 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150513 r150516 1 2013-05-22 Antoine Quint <graouts@apple.com> 2 3 [Mac] Captions menu isn't internationalized, doesn't use rtl layout for rtl languages 4 https://bugs.webkit.org/show_bug.cgi?id=116605 5 6 Reviewed by Eric Carlson. 7 8 Ensure that rtl languages are properly recognized by the captions menu such that text 9 layout and alignment is natural. 10 11 * css/mediaControls.css: 12 (::-webkit-media-controls): 13 Remove the forced "direction: ltr" property which was forcing all layout to be 14 left-to-right. 15 16 * css/mediaControlsQuickTime.css: 17 (video::-webkit-media-controls-closed-captions-track-list): 18 Remove the forced "text-align: left" property which was forcing all caption 19 titles to be left-aligned. 20 21 (video::-webkit-media-controls-closed-captions-track-list h3): 22 Use "-webkit-margin-start" instead of "padding-left" to position the heading 23 such that it adds the margin on the left for ltr languages and on the right 24 for rtl languages. 25 26 (video::-webkit-media-controls-closed-captions-track-list li): 27 Set "position: relative" such that the ::before pseudo-class can use "position: absolute" 28 to position itself relative to the caption title rather than the list element. 29 30 (video::-webkit-media-controls-closed-captions-track-list li.selected::before): 31 (video::-webkit-media-controls-closed-captions-track-list li.selected:hover::before): 32 Make the checkmarks a ::before pseudo-class rather than a background-image such that 33 we may control its positioning using the internationlization-friendly "-webkit-margin-start" 34 property. 35 36 * html/shadow/MediaControlElements.cpp: 37 (WebCore::MediaControlClosedCaptionsContainerElement::create): 38 Set the "dir" attribute to "auto" such that rtl languages are correctly handled. This 39 means that the first string displayed within the captions container, currently the 40 "Subtitles" <h3> element, defines the direction for the whole container. It is therefore 41 crucial that this string is properly localized in rtl languages as falling back to 42 english would mean the entire caption container is using ltr. 43 1 44 2013-05-22 Hugo Parente Lima <hugo.lima@openbossa.org> 2 45 -
trunk/Source/WebCore/css/mediaControls.css
r150260 r150516 39 39 position: relative; 40 40 display: -webkit-flex; 41 direction: ltr;42 41 -webkit-align-items: flex-start; 43 42 -webkit-justify-content: flex-end; -
trunk/Source/WebCore/css/mediaControlsQuickTime.css
r149942 r150516 266 266 video::-webkit-media-controls-closed-captions-track-list { 267 267 display: block; 268 text-align: left;269 268 font-family: "Helvetica Bold", Helvetica; 270 269 font-size: 10pt; … … 276 275 color: #757575; 277 276 text-shadow: 0 1px 0 black; 278 padding-left: 23px;277 -webkit-margin-start: 23px; 279 278 padding-top: 4px; 280 279 font-weight: bold; … … 290 289 291 290 video::-webkit-media-controls-closed-captions-track-list li { 291 position: relative; 292 292 color: white; 293 293 background-image: none; … … 312 312 } 313 313 314 video::-webkit-media-controls-closed-captions-track-list li.selected { 314 video::-webkit-media-controls-closed-captions-track-list li.selected::before { 315 display: block; 316 content: ""; 317 position: absolute; 318 top: 0.25em; 319 width: 1.1em; 320 height: 1.1em; 321 -webkit-margin-start: -20px; 315 322 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><polygon fill="#a3a3a3" points="252.301,4.477 126.667,194.104 43.358,108.3 6.868,161.408 132.515,290.814 297.732,49.926"/></svg>'); 316 323 background-repeat: no-repeat; 317 background-position: 17px 0.25em; 318 background-size: 1.1em 1.1em; 319 } 320 321 video::-webkit-media-controls-closed-captions-track-list li.selected:hover { 322 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><polygon fill="white" points="252.301,4.477 126.667,194.104 43.358,108.3 6.868,161.408 132.515,290.814 297.732,49.926"/></svg>'), -webkit-gradient(linear, left top, left bottom, color-stop(0, #4f70f6), color-stop(1, #1a44f3)); 323 background-repeat: no-repeat, repeat; 324 background-position: 17px 0.25em, top left; 325 background-size: 1.1em 1.1em, 100% 100%; 326 } 324 } 325 326 video::-webkit-media-controls-closed-captions-track-list li.selected:hover::before { 327 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><polygon fill="white" points="252.301,4.477 126.667,194.104 43.358,108.3 6.868,161.408 132.515,290.814 297.732,49.926"/></svg>'); 328 } -
trunk/Source/WebCore/html/shadow/MediaControlElements.cpp
r149766 r150516 740 740 { 741 741 RefPtr<MediaControlClosedCaptionsContainerElement> element = adoptRef(new MediaControlClosedCaptionsContainerElement(document)); 742 element->setAttribute(dirAttr, "auto"); 742 743 element->hide(); 743 744 return element.release();
Note: See TracChangeset
for help on using the changeset viewer.