Bug 935572 - remove nsIAccessibleHyperLink::selected, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Wed, 06 Nov 2013 21:07:10 -0500
changeset 154242 cfb113ac2db34b16424d824af00668f79b1dd112
parent 154241 2561e1996e01fa7c6f11e80b8a8d8af781dc3911
child 154243 a33a437da98390db33d899d13c15ca50b80321f0
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerstbsaunde
bugs935572
milestone28.0a1
Bug 935572 - remove nsIAccessibleHyperLink::selected, r=tbsaunde
accessible/public/nsIAccessibleHyperLink.idl
accessible/src/generic/Accessible.cpp
accessible/src/generic/Accessible.h
accessible/tests/mochitest/hyperlink/hyperlink.js
--- a/accessible/public/nsIAccessibleHyperLink.idl
+++ b/accessible/public/nsIAccessibleHyperLink.idl
@@ -8,17 +8,17 @@
 
 interface nsIURI;
 interface nsIAccessible;
 
 /**
  * A cross-platform interface that supports hyperlink-specific properties and
  * methods.  Anchors, image maps, xul:labels with class="text-link" implement this interface.
  */
-[scriptable, uuid(38c60bfa-6040-4bfe-93f2-acd6a909bb60)]
+[scriptable, uuid(883643d4-93a5-4f32-922c-6f06e01363c1)]
 interface nsIAccessibleHyperLink : nsISupports
 {
   /**
    * Returns the offset of the link within the parent accessible.
    */
   readonly attribute long startIndex;
 
   /**
@@ -34,26 +34,16 @@ interface nsIAccessibleHyperLink : nsISu
    *
    * @note  XXX Currently only used with ARIA links, and the author has to
    * specify that the link is invalid via the aria-invalid="true" attribute.
    * In all other cases, TRUE is returned.
    */
   readonly attribute boolean valid;
 
   /**
-   * Determines whether the element currently has the focus, e. g. after
-   * returning from the destination page.
-   *
-   * @note  ARIA links can only be focused if they have the tabindex
-   * attribute set.  Also, state_focused should then be set on the accessible
-   * for this link.
-   */
-  readonly attribute boolean selected;
-
-  /**
    * The numbber of anchors within this Hyperlink. Is normally 1 for anchors.
    * This anchor is, for example, the visible output of the html:a tag.
    * With an Image Map, reflects the actual areas within the map.
    */
   readonly attribute long anchorCount;
 
   /**
    * Returns the URI at the given index.
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -2420,31 +2420,16 @@ Accessible::GetValid(bool *aValid)
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aValid = IsLinkValid();
   return NS_OK;
 }
 
-// readonly attribute boolean nsIAccessibleHyperLink::selected
-NS_IMETHODIMP
-Accessible::GetSelected(bool *aSelected)
-{
-  NS_ENSURE_ARG_POINTER(aSelected);
-  *aSelected = false;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
-  *aSelected = IsLinkSelected();
-  return NS_OK;
-
-}
-
 void
 Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
                          uint32_t aLength)
 {
   // Return text representation of non-text accessible within hypertext
   // accessible. Text accessible overrides this method to return enclosed text.
   if (aStartOffset != 0 || aLength == 0)
     return;
@@ -2774,24 +2759,16 @@ uint32_t
 Accessible::EndOffset()
 {
   NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!");
 
   HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nullptr;
   return hyperText ? (hyperText->GetChildOffset(this) + 1) : 0;
 }
 
-bool
-Accessible::IsLinkSelected()
-{
-  NS_PRECONDITION(IsLink(),
-                  "IsLinkSelected() called on something that is not a hyper link!");
-  return FocusMgr()->IsFocused(this);
-}
-
 uint32_t
 Accessible::AnchorCount()
 {
   NS_PRECONDITION(IsLink(), "AnchorCount is called on not hyper link!");
   return 1;
 }
 
 Accessible*
--- a/accessible/src/generic/Accessible.h
+++ b/accessible/src/generic/Accessible.h
@@ -625,21 +625,16 @@ public:
     // XXX In order to implement this we would need to follow every link
     // Perhaps we can get information about invalid links from the cache
     // In the mean time authors can use role="link" aria-invalid="true"
     // to force it for links they internally know to be invalid
     return (0 == (State() & mozilla::a11y::states::INVALID));
   }
 
   /**
-   * Return true if the link currently has the focus.
-   */
-  bool IsLinkSelected();
-
-  /**
    * Return the number of anchors within the link.
    */
   virtual uint32_t AnchorCount();
 
   /**
    * Returns an anchor accessible at the given index.
    */
   virtual Accessible* AnchorAt(uint32_t aAnchorIndex);
--- a/accessible/tests/mochitest/hyperlink/hyperlink.js
+++ b/accessible/tests/mochitest/hyperlink/hyperlink.js
@@ -16,31 +16,25 @@ function focusLink(aID, aSelectedAfter)
   var checker = new invokerChecker(EVENT_FOCUS, this.accessible);
   if (aSelectedAfter)
     this.eventSeq.push(checker);
   else
     this.unexpectedEventSeq.push(checker);
 
   this.invoke = function focusLink_invoke()
   {
-    is(this.accessible.selected, false,
-       "Wrong selected state before focus for ID " + prettyName(aID) + "!");
-
     var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE : 0);
     var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED;
     testStates(aID, expectedStates, 0, unexpectedStates, 0);
 
     this.node.focus();
   }
 
   this.finalCheck = function focusLink_finalCheck()
   {
-    is(this.accessible.selected, aSelectedAfter,
-       "Wrong seleccted state after focus for ID " + prettyName(aID) + "!");
-
     var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0);
     var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0);
     testStates(aID, expectedStates, 0, unexpectedStates, 0);
   }
 
   this.getID = function focusLink_getID()
   {
     return "focus hyperlink " + prettyName(aID);