Bug 1052866 - Expose IAccessibleText on tables, rows, etc., r=tbsaunde. Bustage fix by MarcoZ.
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 26 Oct 2018 11:07:27 +0200
changeset 443122 946c2698ea05835f2c60f458e0352e043cdc1ab6
parent 443121 12411457f567c4e85139a75dea4624067fb19884
child 443123 ccd7763762301cbed11a7d1cdd975763e3812df2
push id34940
push usernerli@mozilla.com
push dateFri, 26 Oct 2018 15:48:47 +0000
treeherdermozilla-central@a79126bab347 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1052866
milestone65.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 1052866 - Expose IAccessibleText on tables, rows, etc., r=tbsaunde. Bustage fix by MarcoZ.
accessible/generic/ARIAGridAccessible.cpp
accessible/generic/ARIAGridAccessible.h
accessible/html/HTMLTableAccessible.h
accessible/tests/mochitest/elm/test_HTMLSpec.html
accessible/tests/mochitest/textrange/test_selection.html
accessible/xpcom/xpcAccessibleTable.cpp
accessible/xpcom/xpcAccessibleTable.h
--- a/accessible/generic/ARIAGridAccessible.cpp
+++ b/accessible/generic/ARIAGridAccessible.cpp
@@ -23,17 +23,17 @@ using namespace mozilla::a11y;
 ////////////////////////////////////////////////////////////////////////////////
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor
 
 ARIAGridAccessible::
   ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  AccessibleWrap(aContent, aDoc)
+  HyperTextAccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eTable;
 }
 
 role
 ARIAGridAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
@@ -529,17 +529,17 @@ ARIAGridAccessible::SetARIASelected(Acce
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // ARIARowAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 ARIARowAccessible::
   ARIARowAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-  AccessibleWrap(aContent, aDoc)
+  HyperTextAccessibleWrap(aContent, aDoc)
 {
   mGenericTypes |= eTableRow;
 }
 
 role
 ARIARowAccessible::NativeRole() const
 {
   a11y::role r = GetAccService()->MarkupRole(mContent);
--- a/accessible/generic/ARIAGridAccessible.h
+++ b/accessible/generic/ARIAGridAccessible.h
@@ -11,23 +11,23 @@
 #include "TableCellAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * Accessible for ARIA grid and treegrid.
  */
-class ARIAGridAccessible : public AccessibleWrap,
+class ARIAGridAccessible : public HyperTextAccessibleWrap,
                            public TableAccessible
 {
 public:
   ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIAGridAccessible, AccessibleWrap)
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIAGridAccessible, HyperTextAccessibleWrap)
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual already_AddRefed<nsIPersistentProperties> NativeAttributes() override;
   virtual TableAccessible* AsTable() override { return this; }
 
   // TableAccessible
   virtual uint32_t ColCount() const override;
@@ -63,22 +63,22 @@ protected:
   nsresult SetARIASelected(Accessible* aAccessible, bool aIsSelected,
                            bool aNotify = true);
 };
 
 
 /**
  * Accessible for ARIA row.
  */
-class ARIARowAccessible : public AccessibleWrap
+class ARIARowAccessible : public HyperTextAccessibleWrap
 {
 public:
   ARIARowAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
-  NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIARowAccessible, AccessibleWrap)
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIARowAccessible, HyperTextAccessibleWrap)
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual mozilla::a11y::GroupPos GroupPosition() override;
 
 protected:
   virtual ~ARIARowAccessible() {}
 };
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -81,27 +81,27 @@ public:
   // Accessible
   virtual a11y::role NativeRole() const override;
 };
 
 
 /**
  * HTML table row accessible (html:tr).
  */
-class HTMLTableRowAccessible : public AccessibleWrap
+class HTMLTableRowAccessible : public HyperTextAccessibleWrap
 {
 public:
   HTMLTableRowAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-    AccessibleWrap(aContent, aDoc)
+    HyperTextAccessibleWrap(aContent, aDoc)
   {
     mType = eHTMLTableRowType;
     mGenericTypes |= eTableRow;
   }
 
-  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableRowAccessible, AccessibleWrap)
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableRowAccessible, HyperTextAccessibleWrap)
 
   // Accessible
   virtual a11y::role NativeRole() const override;
   virtual mozilla::a11y::GroupPos GroupPosition() override;
 
 protected:
   virtual ~HTMLTableRowAccessible() { }
 };
@@ -111,28 +111,28 @@ protected:
  * HTML table accessible (html:table).
  */
 
 // To turn on table debugging descriptions define SHOW_LAYOUT_HEURISTIC
 // This allow release trunk builds to be used by testers to refine the
 // data vs. layout heuristic
 // #define SHOW_LAYOUT_HEURISTIC
 
-class HTMLTableAccessible : public AccessibleWrap,
+class HTMLTableAccessible : public HyperTextAccessibleWrap,
                             public TableAccessible
 {
 public:
   HTMLTableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
-    AccessibleWrap(aContent, aDoc)
+    HyperTextAccessibleWrap(aContent, aDoc)
   {
     mType = eHTMLTableType;
     mGenericTypes |= eTable;
   }
 
-  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableAccessible, AccessibleWrap)
+  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableAccessible, HyperTextAccessibleWrap)
 
   // TableAccessible
   virtual Accessible* Caption() const override;
   virtual void Summary(nsString& aSummary) override;
   virtual uint32_t ColCount() const override;
   virtual uint32_t RowCount() override;
   virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex) override;
   virtual int32_t CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx) override;
--- a/accessible/tests/mochitest/elm/test_HTMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html
@@ -225,27 +225,28 @@
       // ////////////////////////////////////////////////////////////////////////
       // HTML:caption under table
 
       obj = {
         role: ROLE_TABLE,
         relations: {
           RELATION_LABELLED_BY: "caption",
         },
-        interfaces: nsIAccessibleTable,
+        interfaces: [ nsIAccessibleText, nsIAccessibleHyperText, nsIAccessibleTable ],
         children: [
           {
             role: ROLE_CAPTION,
             relations: {
               RELATION_LABEL_FOR: "table",
             },
             interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
           },
           { // td inside thead
             role: ROLE_ROW,
+            interfaces: [ nsIAccessibleText, nsIAccessibleHyperText ],
             children: [
               {
                 role: ROLE_COLUMNHEADER,
                 interfaces: [ nsIAccessibleTableCell, nsIAccessibleText, nsIAccessibleHyperText ],
               },
               { role: ROLE_COLUMNHEADER },
             ],
           },
--- a/accessible/tests/mochitest/textrange/test_selection.html
+++ b/accessible/tests/mochitest/textrange/test_selection.html
@@ -88,17 +88,17 @@
       // crop a range by a table
       range.selectNode(getNode("c2"));
       a11yranges = getAccessible(document, [nsIAccessibleText]).selectionRanges;
       a11yrange = a11yranges.queryElementAt(0, nsIAccessibleTextRange);
 
       testTextRange(a11yrange, "selection range #7", document, 4, document, 5);
 
       ok(a11yrange.crop(getAccessible("table")), "Range failed to crop #7.");
-      testTextRange(a11yrange, "cropped range #7", "c2", 5, "c2", 6);
+      testTextRange(a11yrange, "cropped range #7", "table", 0, "table", 1);
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -16,17 +16,17 @@
 using namespace mozilla::a11y;
 
 static const uint32_t XPC_TABLE_DEFAULT_SIZE = 40;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_ISUPPORTS_INHERITED(xpcAccessibleTable,
-                            xpcAccessibleGeneric,
+                            xpcAccessibleHyperText,
                             nsIAccessibleTable)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleTable
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetCaption(nsIAccessible** aCaption)
 {
--- a/accessible/xpcom/xpcAccessibleTable.h
+++ b/accessible/xpcom/xpcAccessibleTable.h
@@ -3,33 +3,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_xpcAccessibleTable_h_
 #define mozilla_a11y_xpcAccessibleTable_h_
 
 #include "nsIAccessibleTable.h"
-#include "xpcAccessibleGeneric.h"
+#include "xpcAccessibleHyperText.h"
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * XPCOM wrapper around TableAccessible class.
  */
-class xpcAccessibleTable : public xpcAccessibleGeneric,
+class xpcAccessibleTable : public xpcAccessibleHyperText,
                            public nsIAccessibleTable
 {
 public:
   explicit xpcAccessibleTable(Accessible* aIntl) :
-    xpcAccessibleGeneric(aIntl) { }
+    xpcAccessibleHyperText(aIntl) { }
 
   xpcAccessibleTable(ProxyAccessible* aProxy, uint32_t aInterfaces) :
-    xpcAccessibleGeneric(aProxy, aInterfaces) {}
+    xpcAccessibleHyperText(aProxy, aInterfaces) {}
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTable
   NS_IMETHOD GetCaption(nsIAccessible** aCaption) final;
   NS_IMETHOD GetSummary(nsAString& aSummary) final;
   NS_IMETHOD GetColumnCount(int32_t* aColumnCount) final;
   NS_IMETHOD GetRowCount(int32_t* aRowCount) final;