Bug 1451576 - Add dir=auto to subtitle menu items in video control r=Ehsan
authorTimothy Guan-tin Chien <timdream@gmail.com>
Tue, 17 Apr 2018 18:14:47 +0800
changeset 416076 c576cede0ed12efe1b15d3617e9cd736b79c4111
parent 416075 8e51a02b3d487304ef1e80dc0f87eb51a140e043
child 416077 09f7885a83ce43f44209d938e982316067446e5e
push id63370
push usertimdream@gmail.com
push dateFri, 27 Apr 2018 18:27:12 +0000
treeherderautoland@09f7885a83ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1451576
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1451576 - Add dir=auto to subtitle menu items in video control r=Ehsan The labels of the subtitle track selections come from the web content, from <track label="...">. Given that it will likely be the name of the language in its native writing system, each of the item should have its own directionality, instead of inheriting direction: ltr set on the entire <xul:videocontrol> parent element. I do however wonders if the web content should have the opportunity to affect the directionality of these labels? We would need clarification from the spec to tell if this fix is already adequate. MozReview-Commit-ID: G4I2Wf9gFCu
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -1651,16 +1651,17 @@
         tt.index = this.textTracksCount++;
 
         const label = tt.label || "";
         const ttText = document.createTextNode(label);
         const ttBtn = document.createElement("button");
 
         ttBtn.classList.add("textTrackItem");
         ttBtn.setAttribute("index", tt.index);
+        ttBtn.setAttribute("dir", "auto");
         ttBtn.appendChild(ttText);
 
         this.textTrackList.appendChild(ttBtn);
 
         if (tt.mode === "showing" && tt.index) {
           this.changeTextTrack(tt.index);
         }
       },