Bug 1258228 - create special child accessibles in owner's constructor, part2, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 31 Mar 2016 21:22:50 -0400
changeset 291170 ed20f4a35b9a213167c869e93a30fc85ee9d78f4
parent 291169 d32bcd5bd2cf9a0e504d6ad78583c7f95bc1ccf3
child 291171 cc5e38a943bb74b37182f5650bd12e2cfc0bac26
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz
bugs1258228
milestone48.0a1
Bug 1258228 - create special child accessibles in owner's constructor, part2, r=marcoz
accessible/html/HTMLImageMapAccessible.cpp
accessible/html/HTMLImageMapAccessible.h
--- a/accessible/html/HTMLImageMapAccessible.cpp
+++ b/accessible/html/HTMLImageMapAccessible.cpp
@@ -25,16 +25,18 @@ using namespace mozilla::a11y;
 // HTMLImageMapAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLImageMapAccessible::
   HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   ImageAccessibleWrap(aContent, aDoc)
 {
   mType = eImageMapType;
+
+  UpdateChildAreas(false);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLImageMapAccessible: nsISupports
 
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLImageMapAccessible, ImageAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -146,26 +148,16 @@ HTMLImageMapAccessible::GetChildAccessib
     if (area->GetContent() == aNode)
       return area;
   }
 
   return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// HTMLImageMapAccessible: Accessible protected
-
-void
-HTMLImageMapAccessible::CacheChildren()
-{
-  UpdateChildAreas(false);
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
 // HTMLAreaAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLAreaAccessible::
   HTMLAreaAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   HTMLLinkAccessible(aContent, aDoc)
 {
   // Make HTML area DOM element not accessible. HTML image map accessible
@@ -226,25 +218,16 @@ HTMLAreaAccessible::StartOffset()
 }
 
 uint32_t
 HTMLAreaAccessible::EndOffset()
 {
   return IndexInParent() + 1;
 }
 
-////////////////////////////////////////////////////////////////////////////////
-// HTMLAreaAccessible: Accessible protected
-
-void
-HTMLAreaAccessible::CacheChildren()
-{
-  // No children for aria accessible.
-}
-
 nsRect
 HTMLAreaAccessible::RelativeBounds(nsIFrame** aBoundingFrame) const
 {
   nsIFrame* frame = GetFrame();
   if (!frame)
     return nsRect();
 
   nsImageFrame* imageFrame = do_QueryFrame(frame);
--- a/accessible/html/HTMLImageMapAccessible.h
+++ b/accessible/html/HTMLImageMapAccessible.h
@@ -39,19 +39,16 @@ public:
 
   /**
    * Return accessible of child node.
    */
   Accessible* GetChildAccessibleFor(const nsINode* aNode) const;
 
 protected:
   virtual ~HTMLImageMapAccessible() { }
-
-  // Accessible
-  virtual void CacheChildren() override;
 };
 
 /**
  * Accessible for image map areas - must be child of image.
  */
 class HTMLAreaAccessible final : public HTMLLinkAccessible
 {
 public:
@@ -63,20 +60,22 @@ public:
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
   virtual nsRect RelativeBounds(nsIFrame** aBoundingFrame) const override;
 
   // HyperLinkAccessible
   virtual uint32_t StartOffset() override;
   virtual uint32_t EndOffset() override;
 
+  virtual bool IsAcceptableChild(nsIContent* aEl) const override
+    { return false; }
+
 protected:
   // Accessible
   virtual ENameValueFlag NativeName(nsString& aName) override;
-  virtual void CacheChildren() override;
 };
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible downcasting method
 
 inline HTMLImageMapAccessible*
 Accessible::AsImageMap()