Backout (wrong username) Bug 868789 - Name computation for SVG is wrong, r=tbsaude
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 05 Dec 2013 11:59:18 -0500
changeset 173655 38798122d6b4d58d5d34aec2c8c6d8864f3c945f
parent 173654 bd7e1da4923ab86512986181d41ee90edb0d9994
child 173656 85c5264ddc0bf59bcaa58b03d308c829c7abe77d
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaude
bugs868789
milestone28.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
Backout (wrong username) Bug 868789 - Name computation for SVG is wrong, r=tbsaude
accessible/src/generic/Accessible.cpp
accessible/tests/mochitest/name/test_svg.html
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -226,17 +226,17 @@ Accessible::Name(nsString& aName)
       aName.CompressWhitespace();
       return eNameFromTooltip;
     }
   } else if (mContent->IsSVG()) {
     // If user agents need to choose among multiple ‘desc’ or ‘title’ elements
     // for processing, the user agent shall choose the first one.
     for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
          childElm = childElm->GetNextSibling()) {
-      if (childElm->IsSVG(nsGkAtoms::desc)) {
+      if (childElm->IsSVG(nsGkAtoms::title)) {
         nsTextEquivUtils::AppendTextEquivFromContent(this, childElm, &aName);
         return eNameFromTooltip;
       }
     }
   }
 
   if (nameFlag != eNoNameOnPurpose)
     aName.SetIsVoid(true);
@@ -289,17 +289,17 @@ Accessible::Description(nsString& aDescr
       // Keep the Name() method logic.
       if (mContent->IsHTML()) {
         mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, aDescription);
       } else if (mContent->IsXUL()) {
         mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext, aDescription);
       } else if (mContent->IsSVG()) {
         for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
              childElm = childElm->GetNextSibling()) {
-          if (childElm->IsSVG(nsGkAtoms::desc)) {
+          if (childElm->IsSVG(nsGkAtoms::title)) {
             nsTextEquivUtils::AppendTextEquivFromContent(this, childElm,
                                                          &aDescription);
             break;
           }
         }
       }
 
       if (!aDescription.IsEmpty()) {
@@ -2484,17 +2484,17 @@ Accessible::NativeName(nsString& aName)
   if (mContent->IsXUL())
     return GetXULName(aName);
 
   if (mContent->IsSVG()) {
     // If user agents need to choose among multiple ‘desc’ or ‘title’ elements
     // for processing, the user agent shall choose the first one.
     for (nsIContent* childElm = mContent->GetFirstChild(); childElm;
          childElm = childElm->GetNextSibling()) {
-      if (childElm->IsSVG(nsGkAtoms::title)) {
+      if (childElm->IsSVG(nsGkAtoms::desc)) {
         nsTextEquivUtils::AppendTextEquivFromContent(this, childElm, &aName);
         return eNameOK;
       }
     }
   }
 
   return eNameOK;
 }
--- a/accessible/tests/mochitest/name/test_svg.html
+++ b/accessible/tests/mochitest/name/test_svg.html
@@ -39,17 +39,17 @@
     Mozilla Bug 459357
   </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg1">
-    <title>A name</title>
-    <desc>A description</title>
+    <title>A description</title>
+    <desc>A name</desc>
   </svg>
 
   <svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg2">
-    <desc>A tooltip</desc>
+    <title>A tooltip</title>
   </svg>
 </body>
 </html>