Bug 1287145 - Support QueryInterfacing proxy accessibles to nsIAccessibleHyperText. r=tbsaunde
authorMichael Li <michael.li11702@gmail.com>
Mon, 18 Jul 2016 08:23:00 +0200
changeset 345807 cd2c57293b7a61f6e18e5c5bb47b9cb32679d5e7
parent 345806 f3a496da670e8040a5ed42bcbc1cbde4415f48d1
child 345808 e44c9f57299f408faa824ef26d1020457181080e
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1287145
milestone50.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 1287145 - Support QueryInterfacing proxy accessibles to nsIAccessibleHyperText. r=tbsaunde
accessible/ipc/ProxyAccessible.h
accessible/xpcom/xpcAccessibleDocument.cpp
--- a/accessible/ipc/ProxyAccessible.h
+++ b/accessible/ipc/ProxyAccessible.h
@@ -41,17 +41,18 @@ class ProxyAccessible
 {
 public:
 
   ProxyAccessible(uint64_t aID, ProxyAccessible* aParent,
                   DocAccessibleParent* aDoc, role aRole, uint32_t aInterfaces) :
      mParent(aParent), mDoc(aDoc), mWrapper(0), mID(aID), mRole(aRole),
      mOuterDoc(false), mIsDoc(false),
      mHasValue(aInterfaces & Interfaces::VALUE),
-     mIsHyperLink(aInterfaces & Interfaces::HYPERLINK)
+     mIsHyperLink(aInterfaces & Interfaces::HYPERLINK),
+     mIsHyperText(aInterfaces & Interfaces::HYPERTEXT)
   {
     MOZ_COUNT_CTOR(ProxyAccessible);
   }
   ~ProxyAccessible()
   {
     MOZ_COUNT_DTOR(ProxyAccessible);
     MOZ_ASSERT(!mWrapper);
   }
@@ -417,36 +418,37 @@ public:
    */
   bool IsDoc() const { return mIsDoc; }
   DocAccessibleParent* AsDoc() const { return IsDoc() ? mDoc : nullptr; }
 
 protected:
   explicit ProxyAccessible(DocAccessibleParent* aThisAsDoc) :
     mParent(nullptr), mDoc(aThisAsDoc), mWrapper(0), mID(0),
     mRole(roles::DOCUMENT), mOuterDoc(false), mIsDoc(true), mHasValue(false),
-    mIsHyperLink(false)
+    mIsHyperLink(false), mIsHyperText(false)
   { MOZ_COUNT_CTOR(ProxyAccessible); }
 
 protected:
   ProxyAccessible* mParent;
 
 private:
   nsTArray<ProxyAccessible*> mChildren;
   DocAccessibleParent* mDoc;
   uintptr_t mWrapper;
   uint64_t mID;
 protected:
   // XXX DocAccessibleParent gets to change this to change the role of
   // documents.
-  role mRole : 28;
+  role mRole : 27;
 private:
   bool mOuterDoc : 1;
 
 public:
   const bool mIsDoc: 1;
   const bool mHasValue: 1;
   const bool mIsHyperLink: 1;
+  const bool mIsHyperText: 1;
 };
 
 }
 }
 
 #endif
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -217,16 +217,24 @@ xpcAccessibleDocument::GetXPCAccessible(
   if (aProxy->mHasValue) {
     interfaces |= eValue;
   }
   
   if (aProxy->mIsHyperLink) {
     interfaces |= eHyperLink;
   }
 
+  if (aProxy->mIsHyperText) {
+    interfaces |= eText;
+    acc = new xpcAccessibleHyperText(aProxy, interfaces);
+    mCache.Put(aProxy, acc);
+
+    return acc;
+  }
+
   acc = new xpcAccessibleGeneric(aProxy, interfaces);
   mCache.Put(aProxy, acc);
 
   return acc;
 }
 
 void
 xpcAccessibleDocument::Shutdown()