Bug 628649 - remove obsolette xlink support, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Sat, 10 Nov 2012 17:39:44 +0900
changeset 112922 4586e6f3c550879120ebbaaf5760eef520c73845
parent 112921 4da6f3bf0cc3045a1cf8e5f5e13243736fef8dc2
child 112923 f00ea0cb7b505b299a763d2b8dd946b1cfcf95cc
push id23841
push userryanvm@gmail.com
push dateSat, 10 Nov 2012 21:53:54 +0000
treeherdermozilla-central@8dab31701ed1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs628649
milestone19.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 628649 - remove obsolette xlink support, r=tbsaunde
accessible/src/base/nsAccessibilityService.cpp
accessible/src/base/nsCoreUtils.cpp
accessible/src/base/nsCoreUtils.h
accessible/src/generic/Accessible.cpp
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -925,17 +925,17 @@ nsAccessibilityService::GetOrCreateAcces
   // If no accessible, see if we need to create a generic accessible because
   // of some property that makes this object interesting
   // We don't do this for <body>, <html>, <window>, <dialog> etc. which
   // correspond to the doc accessible and will be created in any case
   if (!newAcc && content->Tag() != nsGkAtoms::body && content->GetParent() &&
       (frame->IsFocusable() ||
        (isHTML && nsCoreUtils::HasClickListener(content)) ||
        HasUniversalAriaProperty(content) || roleMapEntry ||
-       HasRelatedContent(content) || nsCoreUtils::IsXLink(content))) {
+       HasRelatedContent(content))) {
     // This content is focusable or has an interesting dynamic content accessibility property.
     // If it's interesting we need it in the accessibility hierarchy so that events or
     // other accessibles can point to it, or so that it can hold a state, etc.
     if (isHTML) {
       // Interesting HTML container which may have selectable text and/or embedded objects
       newAcc = new HyperTextAccessibleWrap(content, aDoc);
     } else {  // XUL, SVG, MathML etc.
       // Interesting generic non-HTML container
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -494,27 +494,16 @@ nsCoreUtils::GetUIntAttr(nsIContent *aCo
       *aUInt = integer;
       return true;
     }
   }
 
   return false;
 }
 
-bool
-nsCoreUtils::IsXLink(nsIContent *aContent)
-{
-  if (!aContent)
-    return false;
-
-  return aContent->AttrValueIs(kNameSpaceID_XLink, nsGkAtoms::type,
-                               nsGkAtoms::simple, eCaseMatters) &&
-    aContent->HasAttr(kNameSpaceID_XLink, nsGkAtoms::href);
-}
-
 void
 nsCoreUtils::GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent,
                             nsAString& aLanguage)
 {
   aLanguage.Truncate();
 
   nsIContent *walkUp = aContent;
   while (walkUp && walkUp != aRootContent &&
--- a/accessible/src/base/nsCoreUtils.h
+++ b/accessible/src/base/nsCoreUtils.h
@@ -220,24 +220,16 @@ public:
   /**
    * Convert attribute value of the given node to positive integer. If no
    * attribute or wrong value then false is returned.
    */
   static bool GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr,
                             int32_t *aUInt);
 
   /**
-   * Check if the given element is XLink.
-   *
-   * @param aContent  the given element
-   * @return          true if the given element is XLink
-   */
-  static bool IsXLink(nsIContent *aContent);
-
-  /**
    * Returns language for the given node.
    *
    * @param aContent     [in] the given node
    * @param aRootContent [in] container of the given node
    * @param aLanguage    [out] language
    */
   static void GetLanguageFor(nsIContent *aContent, nsIContent *aRootContent,
                              nsAString& aLanguage);
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -739,18 +739,17 @@ Accessible::NativeInteractiveState() con
     return states::FOCUSABLE;
 
   return 0;
 }
 
 uint64_t
 Accessible::NativeLinkState() const
 {
-  // Expose linked state for simple xlink.
-  return nsCoreUtils::IsXLink(mContent) ? states::LINKED : 0;
+  return 0;
 }
 
 bool
 Accessible::NativelyUnavailable() const
 {
   if (mContent->IsHTML())
     return mContent->AsElement()->State().HasState(NS_EVENT_STATE_DISABLED);
 
@@ -1609,23 +1608,16 @@ Accessible::Value(nsString& aValue)
     // aria-valuenow is a number, and aria-valuetext is the optional text equivalent
     // For the string value, we will try the optional text equivalent first
     if (!mContent->GetAttr(kNameSpaceID_None,
                            nsGkAtoms::aria_valuetext, aValue)) {
       mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow,
                         aValue);
     }
   }
-
-  if (!aValue.IsEmpty())
-    return;
-
-  // Check if it's a simple xlink.
-  if (nsCoreUtils::IsXLink(mContent))
-    nsContentUtils::GetLinkLocation(mContent->AsElement(), aValue);
 }
 
 // nsIAccessibleValue
 NS_IMETHODIMP
 Accessible::GetMaximumValue(double *aMaximumValue)
 {
   return GetAttrValue(nsGkAtoms::aria_valuemax, aMaximumValue);
 }
@@ -1744,17 +1736,17 @@ Accessible::ARIATransformRole(role aRole
   }
 
   return aRole;
 }
 
 role
 Accessible::NativeRole()
 {
-  return nsCoreUtils::IsXLink(mContent) ? roles::LINK : roles::NOTHING;
+  return roles::NOTHING;
 }
 
 // readonly attribute uint8_t actionCount
 NS_IMETHODIMP
 Accessible::GetActionCount(uint8_t* aActionCount)
 {
   NS_ENSURE_ARG_POINTER(aActionCount);
   *aActionCount = 0;
@@ -2701,34 +2693,16 @@ Accessible::AnchorAt(uint32_t aAnchorInd
   NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!");
   return aAnchorIndex == 0 ? this : nullptr;
 }
 
 already_AddRefed<nsIURI>
 Accessible::AnchorURIAt(uint32_t aAnchorIndex)
 {
   NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!");
-
-  if (aAnchorIndex != 0)
-    return nullptr;
-
-  // Check if it's a simple xlink.
-  if (nsCoreUtils::IsXLink(mContent)) {
-    nsAutoString href;
-    mContent->GetAttr(kNameSpaceID_XLink, nsGkAtoms::href, href);
-
-    nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
-    nsCOMPtr<nsIDocument> document = mContent->OwnerDoc();
-    nsIURI* anchorURI = nullptr;
-    NS_NewURI(&anchorURI, href,
-              document ? document->GetDocumentCharacterSet().get() : nullptr,
-              baseURI);
-    return anchorURI;
-  }
-
   return nullptr;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // SelectAccessible
 
 bool
@@ -3089,20 +3063,16 @@ Accessible::GetAttrValue(nsIAtom *aPrope
 }
 
 uint32_t
 Accessible::GetActionRule()
 {
   if (!HasOwnContent() || (InteractiveState() & states::UNAVAILABLE))
     return eNoAction;
 
-  // Check if it's simple xlink.
-  if (nsCoreUtils::IsXLink(mContent))
-    return eJumpAction;
-
   // Return "click" action on elements that have an attached popup menu.
   if (mContent->IsXUL())
     if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
       return eClickAction;
 
   // Has registered 'click' event handler.
   bool isOnclick = nsCoreUtils::HasClickListener(mContent);