Bug 1349835 - Create accessibles for <input type=checkbox/radio> with -moz-appearance:none. r=surkov
authorMats Palmgren <mats@mozilla.com>
Wed, 31 May 2017 21:29:49 +0200
changeset 409778 fc6012cad03e870b46ce4ddc2077762c31f8f9b7
parent 409777 b0ebe9dd56aeae5db543e72156886bf2404d90c1
child 409779 422e3c006cf2b56d94f969d4b8e29b0982103437
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1349835
milestone55.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 1349835 - Create accessibles for <input type=checkbox/radio> with -moz-appearance:none. r=surkov MozReview-Commit-ID: Cot3jyZBdpU
accessible/base/MarkupMap.h
accessible/base/nsAccessibilityService.cpp
--- a/accessible/base/MarkupMap.h
+++ b/accessible/base/MarkupMap.h
@@ -90,16 +90,20 @@ MARKUPMAP(h4,
 MARKUPMAP(h5,
           New_HyperText,
           roles::HEADING)
 
 MARKUPMAP(h6,
           New_HyperText,
           roles::HEADING)
 
+MARKUPMAP(input,
+          New_HTMLInput,
+          0)
+
 MARKUPMAP(label,
           New_HTMLLabel,
           roles::LABEL)
 
 MARKUPMAP(legend,
           New_HTMLLegend,
           roles::LABEL)
 
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -190,16 +190,29 @@ New_HTMLDefinition(nsIContent* aContent,
   if (aContext->IsList())
     return new HyperTextAccessibleWrap(aContent, aContext->Document());
   return nullptr;
 }
 
 static Accessible* New_HTMLLabel(nsIContent* aContent, Accessible* aContext)
   { return new HTMLLabelAccessible(aContent, aContext->Document()); }
 
+static Accessible* New_HTMLInput(nsIContent* aContent, Accessible* aContext)
+{
+  if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                            nsGkAtoms::checkbox, eIgnoreCase)) {
+    return new HTMLCheckboxAccessible(aContent, aContext->Document());
+  }
+  if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                            nsGkAtoms::radio, eIgnoreCase)) {
+    return new HTMLRadioButtonAccessible(aContent, aContext->Document());
+  }
+  return nullptr;
+}
+
 static Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext)
   { return new HTMLOutputAccessible(aContent, aContext->Document()); }
 
 static Accessible* New_HTMLProgress(nsIContent* aContent, Accessible* aContext)
   { return new HTMLProgressMeterAccessible(aContent, aContext->Document()); }
 
 static Accessible* New_HTMLSummary(nsIContent* aContent, Accessible* aContext)
   { return new HTMLSummaryAccessible(aContent, aContext->Document()); }