Bug 1451576 - Add dir=auto to subtitle menu items in video control draft
authorTimothy Guan-tin Chien <timdream@gmail.com>
Tue, 17 Apr 2018 18:14:47 +0800
changeset 788715 0b8b0ce48f01c3ae9441b916f37f318cf1cba068
parent 788714 0c976fba4a512b9bdd449fda6ab04e9fd7772b78
child 788716 add00180dd706f345af19d4f48f08323ed3a6c55
push id108070
push usertimdream@gmail.com
push dateThu, 26 Apr 2018 21:39:41 +0000
bugs1451576
milestone61.0a1
Bug 1451576 - Add dir=auto to subtitle menu items in video control 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);
         }
       },