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
--- 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);
}
},