Bug 1187605 pt 1 - In vertical writing modes, add an 'orientation' attribute with value='left' or 'right' to the <select> control's dropdown button. r=smontagu
authorJonathan Kew <jkew@mozilla.com>
Mon, 03 Aug 2015 18:45:20 +0100
changeset 287613 3a38462c5703ebb5a2586cb0ad6a8318355265b3
parent 287612 0364858aed562f972ce92d830c88f0ce00d86b01
child 287614 8ad982618f06bad91d4c712b55803359d746863c
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs1187605
milestone42.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 1187605 pt 1 - In vertical writing modes, add an 'orientation' attribute with value='left' or 'right' to the <select> control's dropdown button. r=smontagu
layout/forms/nsComboboxControlFrame.cpp
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1216,16 +1216,24 @@ nsComboboxControlFrame::CreateAnonymousC
                                    false, false);
 
   mButtonContent->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
                           NS_LITERAL_STRING("button"), false);
   // Set tabindex="-1" so that the button is not tabbable
   mButtonContent->SetAttr(kNameSpaceID_None, nsGkAtoms::tabindex,
                           NS_LITERAL_STRING("-1"), false);
 
+  WritingMode wm = GetWritingMode();
+  if (wm.IsVertical()) {
+    mButtonContent->SetAttr(kNameSpaceID_None, nsGkAtoms::orientation,
+                            wm.IsVerticalRL() ? NS_LITERAL_STRING("left")
+                                              : NS_LITERAL_STRING("right"),
+                            false);
+  }
+
   if (!aElements.AppendElement(mButtonContent))
     return NS_ERROR_OUT_OF_MEMORY;
 
   return NS_OK;
 }
 
 void
 nsComboboxControlFrame::AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,