Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge mozilla-central and tracemonkey.

  • Loading branch information...
commit 394c554f418e36f08ab69da4ec743f2432da3c02 2 parents 0b5f6a5 + 037c30c
Chris Leary cdleary authored
Showing with 9,196 additions and 4,386 deletions.
  1. +13 −4 accessible/src/atk/nsAccessibleWrap.cpp
  2. +1 −1  accessible/src/atk/nsApplicationAccessibleWrap.cpp
  3. +9 −11 accessible/src/atk/nsMaiHyperlink.cpp
  4. +2 −3 accessible/src/atk/nsMaiHyperlink.h
  5. +3 −3 accessible/src/atk/nsMaiInterfaceComponent.cpp
  6. +8 −9 accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
  7. +1 −1  accessible/src/base/AccGroupInfo.cpp
  8. +1 −0  accessible/src/base/Makefile.in
  9. +4 −4 accessible/src/base/NotificationController.cpp
  10. +2 −2 accessible/src/base/nsARIAGridAccessible.cpp
  11. +5 −5 accessible/src/base/nsAccDocManager.cpp
  12. +22 −41 accessible/src/base/nsAccessible.cpp
  13. +24 −9 accessible/src/base/nsAccessible.h
  14. +2 −2 accessible/src/base/nsApplicationAccessible.cpp
  15. +2 −3 accessible/src/base/nsApplicationAccessible.h
  16. +6 −6 accessible/src/base/nsBaseWidgetAccessible.cpp
  17. +3 −4 accessible/src/base/nsBaseWidgetAccessible.h
  18. +2 −2 accessible/src/base/nsCoreUtils.cpp
  19. +3 −3 accessible/src/base/nsOuterDocAccessible.cpp
  20. +2 −2 accessible/src/base/nsOuterDocAccessible.h
  21. +3 −4 accessible/src/base/nsRootAccessible.cpp
  22. +1 −1  accessible/src/base/nsTextEquivUtils.cpp
  23. +6 −6 accessible/src/html/nsHTMLImageMapAccessible.cpp
  24. +4 −5 accessible/src/html/nsHTMLImageMapAccessible.h
  25. +2 −2 accessible/src/html/nsHTMLLinkAccessible.cpp
  26. +2 −2 accessible/src/html/nsHTMLLinkAccessible.h
  27. +41 −31 accessible/src/html/nsHTMLTableAccessible.cpp
  28. +8 −0 accessible/src/html/nsHTMLTableAccessible.h
  29. +2 −2 accessible/src/html/nsHyperTextAccessible.cpp
  30. +9 −9 accessible/src/msaa/CAccessibleHyperlink.cpp
  31. +13 −32 accessible/src/msaa/nsAccessibleWrap.cpp
  32. +1 −1  accessible/src/msaa/nsRootAccessibleWrap.cpp
  33. +2 −2 accessible/src/xforms/nsXFormsAccessible.cpp
  34. +1 −1  accessible/src/xforms/nsXFormsAccessible.h
  35. +4 −4 accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
  36. +2 −2 accessible/src/xul/nsXULListboxAccessible.cpp
  37. +6 −6 accessible/src/xul/nsXULTextAccessible.cpp
  38. +2 −2 accessible/src/xul/nsXULTextAccessible.h
  39. +5 −5 accessible/src/xul/nsXULTreeAccessible.cpp
  40. +3 −4 accessible/src/xul/nsXULTreeAccessible.h
  41. +3 −3 accessible/src/xul/nsXULTreeGridAccessible.cpp
  42. +3 −4 accessible/src/xul/nsXULTreeGridAccessible.h
  43. +42 −27 accessible/tests/mochitest/name/markup.js
  44. +65 −21 accessible/tests/mochitest/name/markuprules.xml
  45. +8 −0 accessible/tests/mochitest/name/test_markup.html
  46. +27 −0 accessible/tests/mochitest/test_descr.html
  47. +1 −5 browser/app/Makefile.in
  48. +39 −4 browser/app/nsBrowserApp.cpp
  49. +11 −6 browser/app/profile/firefox.js
  50. +1 −1  browser/base/content/browser-sets.inc
  51. +0 −4 browser/base/content/browser.js
  52. +6 −9 browser/base/content/browser.xul
  53. +63 −0 browser/base/content/highlighter.xhtml
  54. +8 −1 browser/base/content/insideOutBox.js
  55. +400 −184 browser/base/content/inspector.js
  56. +1 −1  browser/base/content/nsContextMenu.js
  57. +49 −0 browser/base/content/scratchpad.js
  58. +1 −2  browser/base/content/syncSetup.js
  59. +1 −1  browser/base/content/tabview/groupitems.js
  60. +26 −1 browser/base/content/tabview/iq.js
  61. +6 −11 browser/base/content/test/Makefile.in
  62. +1 −1  browser/base/content/test/browser_NetworkPrioritizer.js
  63. +3 −2 browser/base/content/test/browser_bug304198.js
  64. +14 −17 browser/base/content/test/browser_bug495058.js
  65. +1 −0  browser/base/content/test/browser_bug556061.js
  66. +14 −1 browser/base/content/test/browser_plainTextLinks.js
  67. +116 −0 browser/base/content/test/browser_scratchpad_bug_660560_tab.js
  68. +65 −23 browser/base/content/test/browser_urlHighlight.js
  69. +81 −0 browser/base/content/test/browser_urlbarTrimURLs.js
  70. +28 −5 dom/locales/en-US/chrome/storage.properties → browser/base/content/test/inspector/Makefile.in
  71. +23 −17 browser/base/content/test/{ → inspector}/browser_inspector_highlighter.js
  72. +35 −30 browser/base/content/test/{ → inspector}/browser_inspector_iframeTest.js
  73. +20 −11 browser/base/content/test/{ → inspector}/browser_inspector_initialization.js
  74. +24 −16 browser/base/content/test/{ → inspector}/browser_inspector_scrolling.js
  75. +1 −1  browser/base/content/test/{ → inspector}/browser_inspector_store.js
  76. +17 −9 browser/base/content/test/{ → inspector}/browser_inspector_tab_switch.js
  77. +3 −3 browser/base/content/test/{ → inspector}/browser_inspector_treePanel_input.html
  78. +11 −7 browser/base/content/test/{ → inspector}/browser_inspector_treePanel_output.js
  79. 0  browser/base/content/test/{ → inspector}/browser_inspector_treePanel_result.html
  80. +17 −12 browser/base/content/test/{ → inspector}/browser_inspector_treeSelection.js
  81. +1 −1  browser/base/content/test/tabview/browser_tabview_bug595020.js
  82. +23 −3 browser/base/content/test/tabview/head.js
  83. +52 −26 browser/base/content/urlbarBindings.xml
  84. +8 −0 browser/base/content/utilityOverlay.js
  85. +1 −0  browser/base/jar.mn
  86. +1 −1  browser/branding/aurora/Makefile.in
  87. BIN  browser/branding/aurora/document.png
  88. +1 −1  browser/branding/nightly/Makefile.in
  89. BIN  browser/branding/nightly/document.png
  90. +1 −1  browser/branding/official/Makefile.in
  91. BIN  browser/branding/official/document.png
  92. +1 −1  browser/branding/unofficial/Makefile.in
  93. BIN  browser/branding/unofficial/document.png
  94. +0 −3  browser/components/nsBrowserContentHandler.js
  95. +72 −14 browser/components/nsBrowserGlue.js
  96. +3 −3 browser/components/preferences/advanced.js
  97. +12 −2 browser/components/preferences/advanced.xul
  98. +61 −9 browser/components/sessionstore/src/nsSessionStore.js
  99. +4 −1 browser/components/sessionstore/test/browser/Makefile.in
  100. +0 −3  browser/components/sessionstore/test/browser/browser_248970_a.js
  101. +0 −4 browser/components/sessionstore/test/browser/browser_248970_b.js
  102. +1 −3 browser/components/sessionstore/test/browser/browser_345898.js
  103. +7 −17 browser/components/sessionstore/test/browser/browser_350525.js
  104. +1 −3 browser/components/sessionstore/test/browser/browser_354894.js
  105. +3 −6 browser/components/sessionstore/test/browser/browser_367052.js
  106. +6 −13 browser/components/sessionstore/test/browser/browser_393716.js
  107. +0 −328 browser/components/sessionstore/test/browser/browser_394759.js
  108. +132 −0 browser/components/sessionstore/test/browser/browser_394759_basic.js
  109. +126 −0 browser/components/sessionstore/test/browser/browser_394759_behavior.js
  110. +1 −18 browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js
  111. +148 −0 browser/components/sessionstore/test/browser/browser_394759_purge.js
  112. +0 −15 browser/components/sessionstore/test/browser/browser_423132.js
  113. +0 −2  browser/components/sessionstore/test/browser/browser_447951.js
  114. +0 −2  browser/components/sessionstore/test/browser/browser_448741.js
  115. +0 −2  browser/components/sessionstore/test/browser/browser_456342.js
  116. +0 −14 browser/components/sessionstore/test/browser/browser_461634.js
  117. +1 −16 browser/components/sessionstore/test/browser/browser_464199.js
  118. +0 −1  browser/components/sessionstore/test/browser/browser_465215.js
  119. +0 −13 browser/components/sessionstore/test/browser/browser_465223.js
  120. +0 −13 browser/components/sessionstore/test/browser/browser_477657.js
  121. +0 −13 browser/components/sessionstore/test/browser/browser_480148.js
  122. +0 −2  browser/components/sessionstore/test/browser/browser_483330.js
  123. +0 −1  browser/components/sessionstore/test/browser/browser_485563.js
  124. +1 −17 browser/components/sessionstore/test/browser/browser_490040.js
  125. +0 −15 browser/components/sessionstore/test/browser/browser_491168.js
  126. +1 −15 browser/components/sessionstore/test/browser/browser_491577.js
  127. +1 −15 browser/components/sessionstore/test/browser/browser_493467.js
  128. +1 −18 browser/components/sessionstore/test/browser/browser_495495.js
  129. +0 −1  browser/components/sessionstore/test/browser/browser_500328.js
  130. +0 −3  browser/components/sessionstore/test/browser/browser_506482.js
  131. +0 −15 browser/components/sessionstore/test/browser/browser_514751.js
  132. +2 −19 browser/components/sessionstore/test/browser/browser_522545.js
  133. +0 −15 browser/components/sessionstore/test/browser/browser_524745.js
  134. +0 −2  browser/components/sessionstore/test/browser/browser_526613.js
  135. +1 −3 browser/components/sessionstore/test/browser/browser_528776.js
  136. +0 −2  browser/components/sessionstore/test/browser/browser_579868.js
  137. +0 −3  browser/components/sessionstore/test/browser/browser_581593.js
  138. +2 −5 browser/components/sessionstore/test/browser/browser_581937.js
  139. +0 −3  browser/components/sessionstore/test/browser/browser_586068-cascaded_restore.js
  140. +0 −1  browser/components/sessionstore/test/browser/browser_586147.js
  141. +0 −3  browser/components/sessionstore/test/browser/browser_589246.js
  142. +0 −3  browser/components/sessionstore/test/browser/browser_590268.js
  143. +0 −3  browser/components/sessionstore/test/browser/browser_590563.js
  144. +0 −3  browser/components/sessionstore/test/browser/browser_595601-restore_hidden.js
  145. +2 −18 browser/components/sessionstore/test/browser/browser_597071.js
  146. +0 −3  browser/components/sessionstore/test/browser/browser_597315.js
  147. +0 −3  browser/components/sessionstore/test/browser/browser_599909.js
  148. +0 −3  browser/components/sessionstore/test/browser/browser_600545.js
  149. +0 −2  browser/components/sessionstore/test/browser/browser_601955.js
  150. +0 −3  browser/components/sessionstore/test/browser/browser_607016.js
  151. +0 −3  browser/components/sessionstore/test/browser/browser_615394-SSWindowState_events.js
  152. +0 −3  browser/components/sessionstore/test/browser/browser_618151.js
  153. +0 −3  browser/components/sessionstore/test/browser/browser_624727.js
  154. +108 −0 browser/components/sessionstore/test/browser/browser_625016.js
  155. +0 −3  browser/components/sessionstore/test/browser/browser_625257.js
  156. +0 −3  browser/components/sessionstore/test/browser/browser_628270.js
  157. +2 −2 browser/components/sessionstore/test/browser/browser_635418.js
  158. +0 −3  browser/components/sessionstore/test/browser/browser_636279.js
  159. +2 −3 browser/components/sessionstore/test/browser/head.js
  160. +1 −0  browser/installer/package-manifest.in
  161. +14 −2 browser/locales/en-US/chrome/browser/browser.properties
  162. +2 −0  browser/locales/en-US/chrome/browser/preferences/advanced.dtd
  163. +1 −2  browser/themes/gnomestripe/browser/browser.css
  164. +104 −0 browser/themes/gnomestripe/browser/highlighter.css
  165. +1 −0  browser/themes/gnomestripe/browser/jar.mn
  166. +4 −0 browser/themes/pinstripe/browser/browser.css
  167. +104 −0 browser/themes/pinstripe/browser/highlighter.css
  168. +1 −0  browser/themes/pinstripe/browser/jar.mn
  169. +0 −1  browser/themes/winstripe/browser/browser.css
  170. +105 −0 browser/themes/winstripe/browser/highlighter.css
  171. +2 −0  browser/themes/winstripe/browser/jar.mn
  172. +1 −1  build/autoconf/libstdcxx.py
  173. +9 −0 build/autoconf/mozconfig-find
  174. +1 −0  build/automationutils.py
  175. +1 −1  build/unix/elfhack/Makefile.in
  176. +7 −0 build/valgrind/i686-redhat-linux-gnu.sup
  177. +0 −10 caps/include/nsScriptSecurityManager.h
  178. +0 −4 caps/src/Makefile.in
  179. +0 −79 caps/src/nsScriptSecurityManager.cpp
  180. +0 −4 config/autoconf.mk.in
  181. +14 −0 config/optimizejars.py
  182. +57 −51 configure.in
  183. +0 −4 content/base/public/nsContentCID.h
  184. +5 −6 content/base/public/nsContentUtils.h
  185. +4 −4 content/base/public/nsDOMEventTargetWrapperCache.h
  186. +3 −1 content/base/public/nsIContent.h
  187. +44 −0 content/base/public/nsIDocument.h
  188. +10 −3 content/base/public/nsINode.h
  189. +2 −2 content/base/public/nsIXMLHttpRequest.idl
  190. +1 −1  content/base/src/Makefile.in
  191. +35 −46 content/base/src/nsContentUtils.cpp
  192. +129 −59 content/base/src/nsDOMAttribute.cpp
  193. +2 −20 content/base/src/nsDOMAttribute.h
  194. +1 −1  content/base/src/nsDOMEventTargetWrapperCache.cpp
  195. +2 −1  content/base/src/nsDOMFileReader.cpp
  196. +0 −1  content/base/src/nsDOMFileReader.h
  197. +4 −2 content/base/src/nsDOMParser.cpp
  198. +12 −2 content/base/src/nsDataDocumentContentPolicy.cpp
  199. +131 −200 content/base/src/nsDocument.cpp
  200. +17 −31 content/base/src/nsDocument.h
  201. +3 −3 content/base/src/nsFrameLoader.cpp
  202. +1 −1  content/base/src/nsFrameLoader.h
  203. +8 −4 content/base/src/nsFrameMessageManager.cpp
  204. +2 −70 content/base/src/nsGenericDOMDataNode.cpp
  205. +1 −18 content/base/src/nsGenericDOMDataNode.h
  206. +265 −397 content/base/src/nsGenericElement.cpp
  207. +4 −107 content/base/src/nsGenericElement.h
  208. +0 −4 content/base/src/nsGkAtomList.h
  209. +1 −1  content/base/src/nsInProcessTabChildGlobal.cpp
  210. +0 −122 content/base/src/nsLoadListenerProxy.cpp
  211. +0 −77 content/base/src/nsLoadListenerProxy.h
  212. +2 −3 content/base/src/nsNodeInfo.cpp
  213. +3 −3 content/base/src/nsNodeUtils.cpp
  214. +0 −1  content/base/src/nsSyncLoadService.cpp
  215. +1 −1  content/base/src/nsTextFragment.cpp
  216. +2 −1  content/base/src/nsTextFragmentSSE2.cpp
  217. +0 −1  content/base/src/nsTextNode.cpp
  218. +0 −1  content/base/src/nsTextNode.h
  219. +3 −18 content/base/src/nsWebSocket.cpp
  220. +3 −8 content/base/src/nsWebSocket.h
  221. +35 −6 content/base/src/nsXMLHttpRequest.cpp
  222. +9 −5 content/base/src/nsXMLHttpRequest.h
  223. +4 −0 content/base/test/Makefile.in
  224. +82 −0 content/base/test/unit/test_bug553888.js
  225. +1 −0  content/base/test/unit/xpcshell.ini
  226. +4 −0 content/base/test/unit_ipc/test_bug553888_wrap.js
  227. +5 −0 content/base/test/unit_ipc/xpcshell.ini
  228. +19 −0 content/canvas/crashtests/0px-size-font-667225.html
  229. +1 −0  content/canvas/crashtests/crashtests.list
  230. +9 −0 content/canvas/public/nsICanvasRenderingContextInternal.h
  231. +2 −2 content/canvas/src/CustomQS_Canvas2D.h
  232. +14 −0 content/canvas/src/CustomQS_WebGL.h
  233. +1 −0  content/canvas/src/Makefile.in
  234. +16 −0 content/canvas/src/WebGLContext.cpp
  235. +3 −0  content/canvas/src/WebGLContext.h
  236. +24 −24 content/canvas/src/WebGLContextGL.cpp
  237. +16 −37 content/canvas/src/WebGLContextValidate.cpp
  238. +4 −1 content/canvas/src/nsCanvasRenderingContext2D.cpp
  239. +4,357 −0 content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
  240. +47 −9 content/canvas/test/test_2d.gradient.radial.cone.top.html
  241. +241 −149 content/canvas/test/test_canvas.html
  242. +0 −2  content/events/public/Makefile.in
  243. +6 −6 content/events/public/nsEventDispatcher.h
  244. +0 −237 content/events/public/nsIEventListenerManager.h
  245. +21 −4 content/events/public/nsIEventListenerService.idl
  246. +0 −2  content/events/public/nsIPrivateDOMEvent.h
  247. +0 −178 content/events/public/nsPIDOMEventTarget.h
  248. +2 −5 content/events/src/Makefile.in
  249. +19 −8 content/events/src/nsDOMDataTransfer.cpp
  250. +1 −1  content/events/src/nsDOMDataTransfer.h
  251. +5 −15 content/events/src/nsDOMEvent.cpp
  252. +1 −4 content/events/src/nsDOMEvent.h
  253. +0 −73 content/events/src/nsDOMEventGroup.cpp
  254. +25 −68 content/events/src/nsDOMEventTargetHelper.cpp
  255. +6 −26 content/events/src/nsDOMEventTargetHelper.h
  256. +18 −22 content/events/src/nsEventDispatcher.cpp
  257. +59 −241 content/events/src/nsEventListenerManager.cpp
  258. +105 −88 content/events/src/nsEventListenerManager.h
  259. +54 −21 content/events/src/nsEventListenerService.cpp
  260. +0 −1  content/events/src/nsEventListenerService.h
  261. +0 −1  content/events/src/nsEventStateManager.cpp
  262. +2 −2 content/html/content/public/nsHTMLCanvasElement.h
  263. +1 −0  content/html/content/public/nsHTMLMediaElement.h
  264. +1 −0  content/html/content/src/Makefile.in
  265. +4 −4 content/html/content/src/nsGenericHTMLElement.cpp
  266. +1 −1  content/html/content/src/nsGenericHTMLElement.h
  267. +27 −1 content/html/content/src/nsHTMLCanvasElement.cpp
  268. +87 −66 content/html/content/src/nsHTMLInputElement.cpp
  269. +2 −2 content/html/content/src/nsHTMLInputElement.h
  270. +0 −1  content/html/content/src/nsHTMLLinkElement.cpp
  271. +1 −1  content/html/content/src/nsHTMLProgressElement.cpp
  272. +63 −99 content/html/content/src/nsTextEditorState.cpp
  273. +1 −10 content/html/content/test/Makefile.in
  274. +10 −0 content/html/content/test/forms/Makefile.in
  275. 0  content/html/content/test/{test_bug566160.html → forms/test_formaction_attribute.html}
  276. 0  content/html/content/test/{test_bug589696.html → forms/test_formnovalidate_attribute.html}
  277. 0  content/html/content/test/{test_bug555559.html → forms/test_input_email.html}
  278. 0  content/html/content/test/{test_bug344615.html → forms/test_input_url.html}
  279. 0  content/html/content/test/{test_bug562932.html → forms/test_label_control_attribute.html}
  280. 0  content/html/content/test/{test_bug565538.html → forms/test_mozistextfield.html}
  281. 0  content/html/content/test/{test_bug556013.html → forms/test_novalidate_attribute.html}
  282. +1 −1  content/html/content/test/{test_bug346485.html → forms/test_output_element.html}
  283. 0  content/html/content/test/{test_bug345512.html → forms/test_pattern_attribute.html}
  284. 0  content/html/content/test/{test_bug345822.html → forms/test_required_attribute.html}
  285. +36 −0 content/html/content/test/test_bug182279.html
  286. +0 −2  content/html/content/test/test_bug389797.html
  287. +10 −13 content/html/content/test/test_bug561634.html
  288. +1 −0  content/html/document/src/Makefile.in
  289. +1 −1  content/html/document/src/nsHTMLDocument.cpp
  290. +2 −4 content/html/document/test/bug448564-echo.sjs
  291. +18 −27 content/html/document/test/test_bug448564.html
  292. +212 −1 content/mathml/content/src/nsMathMLElement.cpp
  293. +32 −3 content/mathml/content/src/nsMathMLElement.h
  294. +20 −0 content/media/VideoUtils.cpp
  295. +14 −0 content/media/VideoUtils.h
  296. +1 −1  content/media/nsAudioStream.cpp
  297. +18 −35 content/media/nsBuiltinDecoderReader.cpp
  298. +16 −20 content/media/nsBuiltinDecoderReader.h
  299. +10 −23 content/media/nsBuiltinDecoderStateMachine.cpp
  300. +1 −2  content/media/nsBuiltinDecoderStateMachine.h
Sorry, we could not display the entire diff because too many files (2,260) changed.
17 accessible/src/atk/nsAccessibleWrap.cpp
View
@@ -450,10 +450,9 @@ nsAccessibleWrap::CreateMaiInterfaces(void)
interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
}
- // HyperLinkAccessible
- if (IsHyperLink()) {
- interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
- }
+ // HyperLinkAccessible
+ if (IsLink())
+ interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
if (!nsAccUtils::MustPrune(this)) { // These interfaces require children
//nsIAccessibleHypertext
@@ -1077,6 +1076,16 @@ nsAccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
}
} break;
+ case nsIAccessibleEvent::EVENT_NAME_CHANGE:
+ {
+ nsString newName;
+ accessible->GetName(newName);
+ NS_ConvertUTF16toUTF8 utf8Name(newName);
+ if (!utf8Name.Equals(atkObj->name))
+ atk_object_set_name(atkObj, utf8Name.get());
+
+ break;
+ }
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
{
MAI_LOG_DEBUG(("\n\nReceived: EVENT_VALUE_CHANGE\n"));
2  accessible/src/atk/nsApplicationAccessibleWrap.cpp
View
@@ -705,7 +705,7 @@ nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild)
PRBool
nsApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild)
{
- PRInt32 index = aChild->GetIndexInParent();
+ PRInt32 index = aChild->IndexInParent();
AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild);
atk_object_set_parent(atkAccessible, NULL);
20 accessible/src/atk/nsMaiHyperlink.cpp
View
@@ -135,16 +135,16 @@ MaiHyperlink::~MaiHyperlink()
}
}
-AtkHyperlink *
+AtkHyperlink*
MaiHyperlink::GetAtkHyperlink(void)
{
- NS_ENSURE_TRUE(mHyperlink, nsnull);
+ NS_ENSURE_TRUE(mHyperlink, nsnull);
- if (mMaiAtkHyperlink)
- return mMaiAtkHyperlink;
+ if (mMaiAtkHyperlink)
+ return mMaiAtkHyperlink;
- if (!mHyperlink->IsHyperLink())
- return nsnull;
+ if (!mHyperlink->IsLink())
+ return nsnull;
mMaiAtkHyperlink =
reinterpret_cast<AtkHyperlink *>
@@ -215,9 +215,7 @@ getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, nsnull);
- MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aLink);
-
- nsCOMPtr<nsIURI> uri = hyperlink->GetAnchorURI(aLinkIndex);
+ nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex);
if (!uri)
return nsnull;
@@ -234,7 +232,7 @@ getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, nsnull);
- nsAccessible* anchor = hyperlink->GetAnchor(aLinkIndex);
+ nsAccessible* anchor = hyperlink->AnchorAt(aLinkIndex);
NS_ENSURE_TRUE(anchor, nsnull);
AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(anchor);
@@ -266,7 +264,7 @@ isValidCB(AtkHyperlink *aLink)
nsAccessible* hyperlink = get_accessible_hyperlink(aLink);
NS_ENSURE_TRUE(hyperlink, FALSE);
- return static_cast<gboolean>(hyperlink->IsValid());
+ return static_cast<gboolean>(hyperlink->IsLinkValid());
}
gint
5 accessible/src/atk/nsMaiHyperlink.h
View
@@ -58,9 +58,8 @@ class MaiHyperlink
public:
AtkHyperlink *GetAtkHyperlink(void);
- nsAccessible* GetAccHyperlink(void) {
- return mHyperlink && mHyperlink->IsHyperLink() ? mHyperlink : nsnull;
- }
+ nsAccessible* GetAccHyperlink()
+ { return mHyperlink && mHyperlink->IsLink() ? mHyperlink : nsnull; }
protected:
nsAccessible* mHyperlink;
6 accessible/src/atk/nsMaiInterfaceComponent.cpp
View
@@ -98,7 +98,7 @@ refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY,
if (!aAccWrap || aAccWrap->IsDefunct() || nsAccUtils::MustPrune(aAccWrap))
return nsnull;
- // nsAccessible::GetChildAtPoint(x,y) is in screen pixels.
+ // nsAccessible::ChildAtPoint(x,y) is in screen pixels.
if (aCoordType == ATK_XY_WINDOW) {
nsIntPoint winCoords =
nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode());
@@ -106,8 +106,8 @@ refAccessibleAtPointHelper(nsAccessibleWrap* aAccWrap, gint aX, gint aY,
aY += winCoords.y;
}
- nsAccessible* accAtPoint = aAccWrap->GetChildAtPoint(aX, aY,
- nsAccessible::eDirectChild);
+ nsAccessible* accAtPoint = aAccWrap->ChildAtPoint(aX, aY,
+ nsAccessible::eDirectChild);
if (!accAtPoint)
return nsnull;
17 accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
View
@@ -49,16 +49,15 @@ hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface)
}
AtkHyperlink*
-getHyperlinkCB(AtkHyperlinkImpl *aImpl)
+getHyperlinkCB(AtkHyperlinkImpl* aImpl)
{
- nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
- if (!accWrap)
- return nsnull;
+ nsAccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
+ if (!accWrap)
+ return nsnull;
- NS_ENSURE_TRUE(accWrap->IsHyperLink(), nsnull);
-
- MaiHyperlink *maiHyperlink = accWrap->GetMaiHyperlink();
- NS_ENSURE_TRUE(maiHyperlink, nsnull);
- return maiHyperlink->GetAtkHyperlink();
+ NS_ENSURE_TRUE(accWrap->IsLink(), nsnull);
+ MaiHyperlink* maiHyperlink = accWrap->GetMaiHyperlink();
+ NS_ENSURE_TRUE(maiHyperlink, nsnull);
+ return maiHyperlink->GetAtkHyperlink();
}
2  accessible/src/base/AccGroupInfo.cpp
View
@@ -47,7 +47,7 @@ AccGroupInfo::AccGroupInfo(nsAccessible* aItem, PRUint32 aRole) :
if (!parent)
return;
- PRInt32 indexInParent = aItem->GetIndexInParent();
+ PRInt32 indexInParent = aItem->IndexInParent();
PRInt32 level = nsAccUtils::GetARIAOrDefaultLevel(aItem);
// Compute position in set.
1  accessible/src/base/Makefile.in
View
@@ -87,6 +87,7 @@ EXPORTS = \
nsAccessible.h \
nsAccessNode.h \
nsARIAMap.h \
+ States.h \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.
8 accessible/src/base/NotificationController.cpp
View
@@ -515,14 +515,14 @@ NotificationController::CoalesceTextChangeEventsFor(AccShowEvent* aTailEvent,
if (!textEvent)
return;
- if (aTailEvent->mAccessible->GetIndexInParent() ==
- aThisEvent->mAccessible->GetIndexInParent() + 1) {
+ if (aTailEvent->mAccessible->IndexInParent() ==
+ aThisEvent->mAccessible->IndexInParent() + 1) {
// If tail target was inserted after this target, i.e. tail target is next
// sibling of this target.
aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);
- } else if (aTailEvent->mAccessible->GetIndexInParent() ==
- aThisEvent->mAccessible->GetIndexInParent() -1) {
+ } else if (aTailEvent->mAccessible->IndexInParent() ==
+ aThisEvent->mAccessible->IndexInParent() -1) {
// If tail target was inserted before this target, i.e. tail target is
// previous sibling of this target.
nsAutoString startText;
4 accessible/src/base/nsARIAGridAccessible.cpp
View
@@ -981,7 +981,7 @@ nsARIAGridCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
*aColumnIndex = 0;
- PRInt32 indexInRow = GetIndexInParent();
+ PRInt32 indexInRow = IndexInParent();
for (PRInt32 idx = 0; idx < indexInRow; idx++) {
nsAccessible* cell = row->GetChildAt(idx);
PRUint32 role = cell->Role();
@@ -1013,7 +1013,7 @@ nsARIAGridCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
*aRowIndex = 0;
- PRInt32 indexInTable = row->GetIndexInParent();
+ PRInt32 indexInTable = row->IndexInParent();
for (PRInt32 idx = 0; idx < indexInTable; idx++) {
row = table->GetChildAt(idx);
if (row->Role() == nsIAccessibleRole::ROLE_ROW)
10 accessible/src/base/nsAccDocManager.cpp
View
@@ -50,7 +50,7 @@
#include "nsIChannel.h"
#include "nsIContentViewer.h"
#include "nsIDOMDocument.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMWindow.h"
#include "nsIInterfaceRequestorUtils.h"
@@ -391,16 +391,16 @@ nsAccDocManager::AddListeners(nsIDocument *aDocument,
PRBool aAddDOMContentLoadedListener)
{
nsPIDOMWindow *window = aDocument->GetWindow();
- nsPIDOMEventTarget *target = window->GetChromeEventHandler();
- nsIEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
+ nsIDOMEventTarget *target = window->GetChromeEventHandler();
+ nsEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
- NS_EVENT_FLAG_CAPTURE, nsnull);
+ NS_EVENT_FLAG_CAPTURE);
NS_LOG_ACCDOCCREATE_TEXT(" added 'pagehide' listener")
if (aAddDOMContentLoadedListener) {
elm->AddEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
- NS_EVENT_FLAG_CAPTURE, nsnull);
+ NS_EVENT_FLAG_CAPTURE);
NS_LOG_ACCDOCCREATE_TEXT(" added 'DOMContentLoaded' listener")
}
}
63 accessible/src/base/nsAccessible.cpp
View
@@ -174,7 +174,7 @@ nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
}
if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
- if (IsHyperLink()) {
+ if (IsLink()) {
*aInstancePtr = static_cast<nsIAccessibleHyperLink*>(this);
NS_ADDREF_THIS();
return NS_OK;
@@ -588,7 +588,7 @@ nsAccessible::GetIndexInParent(PRInt32 *aIndexInParent)
{
NS_ENSURE_ARG_POINTER(aIndexInParent);
- *aIndexInParent = GetIndexInParent();
+ *aIndexInParent = IndexInParent();
return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
}
@@ -772,10 +772,10 @@ nsAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
return NS_OK;
}
-// nsAccessible::GetChildAtPoint()
+// nsAccessible::ChildAtPoint()
nsAccessible*
-nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
// If we can't find the point in a child, we will return the fallback answer:
// we return |this| if the point is within it, otherwise nsnull.
@@ -839,7 +839,7 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
(child->State() & states::INVISIBLE) == 0) {
if (aWhichChild == eDeepestChild)
- return child->GetChildAtPoint(aX, aY, eDeepestChild);
+ return child->ChildAtPoint(aX, aY, eDeepestChild);
return child;
}
@@ -881,7 +881,7 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
if (IsDefunct())
return NS_ERROR_FAILURE;
- NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDirectChild));
+ NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDirectChild));
return NS_OK;
}
@@ -896,7 +896,7 @@ nsAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
if (IsDefunct())
return NS_ERROR_FAILURE;
- NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDeepestChild));
+ NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDeepestChild));
return NS_OK;
}
@@ -2581,7 +2581,7 @@ nsAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
return NS_ERROR_INVALID_ARG;
- *aURI = GetAnchorURI(aIndex).get();
+ *aURI = AnchorURIAt(aIndex).get();
return NS_OK;
}
@@ -2598,7 +2598,7 @@ nsAccessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible)
if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
return NS_ERROR_INVALID_ARG;
- NS_IF_ADDREF(*aAccessible = GetAnchor(aIndex));
+ NS_IF_ADDREF(*aAccessible = AnchorAt(aIndex));
return NS_OK;
}
@@ -2612,7 +2612,7 @@ nsAccessible::GetValid(PRBool *aValid)
if (IsDefunct())
return NS_ERROR_FAILURE;
- *aValid = IsValid();
+ *aValid = IsLinkValid();
return NS_OK;
}
@@ -2626,7 +2626,7 @@ nsAccessible::GetSelected(PRBool *aSelected)
if (IsDefunct())
return NS_ERROR_FAILURE;
- *aSelected = IsSelected();
+ *aSelected = IsLinkSelected();
return NS_OK;
}
@@ -2844,11 +2844,11 @@ nsAccessible::GetChildCount()
PRInt32
nsAccessible::GetIndexOf(nsAccessible* aChild)
{
- return (aChild->mParent != this) ? -1 : aChild->GetIndexInParent();
+ return (aChild->mParent != this) ? -1 : aChild->IndexInParent();
}
PRInt32
-nsAccessible::GetIndexInParent() const
+nsAccessible::IndexInParent() const
{
return mIndexInParent;
}
@@ -2895,7 +2895,7 @@ nsAccessible::GetIndexOfEmbeddedChild(nsAccessible* aChild)
// HyperLinkAccessible methods
bool
-nsAccessible::IsHyperLink()
+nsAccessible::IsLink()
{
// Every embedded accessible within hypertext accessible implements
// hyperlink interface.
@@ -2905,7 +2905,7 @@ nsAccessible::IsHyperLink()
PRUint32
nsAccessible::StartOffset()
{
- NS_PRECONDITION(IsHyperLink(), "StartOffset is called not on hyper link!");
+ NS_PRECONDITION(IsLink(), "StartOffset is called not on hyper link!");
nsHyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull;
return hyperText ? hyperText->GetChildOffset(this) : 0;
@@ -2914,49 +2914,30 @@ nsAccessible::StartOffset()
PRUint32
nsAccessible::EndOffset()
{
- NS_PRECONDITION(IsHyperLink(), "EndOffset is called on not hyper link!");
+ NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!");
nsHyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nsnull;
return hyperText ? (hyperText->GetChildOffset(this) + 1) : 0;
}
-bool
-nsAccessible::IsValid()
-{
- NS_PRECONDITION(IsHyperLink(), "IsValid is called on not hyper link!");
-
- return (0 == (State() & states::INVALID));
- // 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
-}
-
-bool
-nsAccessible::IsSelected()
-{
- NS_PRECONDITION(IsHyperLink(), "IsSelected is called on not hyper link!");
- return (gLastFocusedNode == GetNode());
-}
-
PRUint32
nsAccessible::AnchorCount()
{
- NS_PRECONDITION(IsHyperLink(), "AnchorCount is called on not hyper link!");
+ NS_PRECONDITION(IsLink(), "AnchorCount is called on not hyper link!");
return 1;
}
nsAccessible*
-nsAccessible::GetAnchor(PRUint32 aAnchorIndex)
+nsAccessible::AnchorAt(PRUint32 aAnchorIndex)
{
- NS_PRECONDITION(IsHyperLink(), "GetAnchor is called on not hyper link!");
+ NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!");
return aAnchorIndex == 0 ? this : nsnull;
}
already_AddRefed<nsIURI>
-nsAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
- NS_PRECONDITION(IsHyperLink(), "GetAnchorURI is called on not hyper link!");
+ NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!");
if (aAnchorIndex != 0)
return nsnull;
33 accessible/src/base/nsAccessible.h
View
@@ -40,6 +40,7 @@
#define _nsAccessible_H_
#include "nsAccessNodeWrap.h"
+#include "States.h"
#include "nsIAccessible.h"
#include "nsIAccessibleHyperLink.h"
@@ -197,7 +198,7 @@ class nsAccessible : public nsAccessNodeWrap,
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
/**
- * Used by GetChildAtPoint() method to get direct or deepest child at point.
+ * Used by ChildAtPoint() method to get direct or deepest child at point.
*/
enum EWhichChildAtPoint {
eDirectChild,
@@ -212,8 +213,8 @@ class nsAccessible : public nsAccessNodeWrap,
* @param aWhichChild [in] flag points if deepest or direct child
* should be returned
*/
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
/**
* Return calculated group level based on accessible hierarchy.
@@ -297,7 +298,7 @@ class nsAccessible : public nsAccessNodeWrap,
/**
* Return index in parent accessible.
*/
- virtual PRInt32 GetIndexInParent() const;
+ virtual PRInt32 IndexInParent() const;
/**
* Return true if accessible has children;
@@ -406,7 +407,7 @@ class nsAccessible : public nsAccessNodeWrap,
/**
* Return true if the accessible is hyper link accessible.
*/
- virtual bool IsHyperLink();
+ virtual bool IsLink();
/**
* Return the start offset of the link within the parent accessible.
@@ -421,12 +422,26 @@ class nsAccessible : public nsAccessNodeWrap,
/**
* Return true if the link is valid (e. g. points to a valid URL).
*/
- virtual bool IsValid();
+ inline bool IsLinkValid()
+ {
+ NS_PRECONDITION(IsLink(), "IsLinkValid is called on not hyper link!");
+
+ // 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() & states::INVALID));
+ }
/**
* Return true if the link currently has the focus.
*/
- virtual bool IsSelected();
+ inline bool IsLinkSelected()
+ {
+ NS_PRECONDITION(IsLink(),
+ "IsLinkSelected() called on something that is not a hyper link!");
+ return gLastFocusedNode == GetNode();
+ }
/**
* Return the number of anchors within the link.
@@ -436,12 +451,12 @@ class nsAccessible : public nsAccessNodeWrap,
/**
* Returns an anchor accessible at the given index.
*/
- virtual nsAccessible* GetAnchor(PRUint32 aAnchorIndex);
+ virtual nsAccessible* AnchorAt(PRUint32 aAnchorIndex);
/**
* Returns an anchor URI at the given index.
*/
- virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+ virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
//////////////////////////////////////////////////////////////////////////////
// SelectAccessible
4 accessible/src/base/nsApplicationAccessible.cpp
View
@@ -169,8 +169,8 @@ nsApplicationAccessible::GroupPosition(PRInt32 *aGroupLevel,
}
nsAccessible*
-nsApplicationAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
return nsnull;
}
5 accessible/src/base/nsApplicationAccessible.h
View
@@ -63,7 +63,6 @@ class nsApplicationAccessible: public nsAccessibleWrap,
public nsIAccessibleApplication
{
public:
- using nsAccessible::GetChildAtPoint;
nsApplicationAccessible();
@@ -126,8 +125,8 @@ class nsApplicationAccessible: public nsAccessibleWrap,
virtual PRUint32 NativeRole();
virtual PRUint64 State();
virtual PRUint64 NativeState();
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual void InvalidateChildren();
12 accessible/src/base/nsBaseWidgetAccessible.cpp
View
@@ -69,8 +69,8 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, nsAccessible)
// nsLeafAccessible: nsAccessible public
nsAccessible*
-nsLeafAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsLeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
// Don't walk into leaf accessibles.
return this;
@@ -200,14 +200,14 @@ nsLinkableAccessible::Shutdown()
// nsLinkableAccessible: HyperLinkAccessible
already_AddRefed<nsIURI>
-nsLinkableAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsLinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
if (mIsLink) {
- NS_ASSERTION(mActionAcc->IsHyperLink(),
+ NS_ASSERTION(mActionAcc->IsLink(),
"nsIAccessibleHyperLink isn't implemented.");
- if (mActionAcc->IsHyperLink())
- return mActionAcc->GetAnchorURI(aAnchorIndex);
+ if (mActionAcc->IsLink())
+ return mActionAcc->AnchorURIAt(aAnchorIndex);
}
return nsnull;
7 accessible/src/base/nsBaseWidgetAccessible.h
View
@@ -55,7 +55,6 @@
class nsLeafAccessible : public nsAccessibleWrap
{
public:
- using nsAccessible::GetChildAtPoint;
nsLeafAccessible(nsIContent *aContent, nsIWeakReference *aShell);
@@ -63,8 +62,8 @@ class nsLeafAccessible : public nsAccessibleWrap
NS_DECL_ISUPPORTS_INHERITED
// nsAccessible
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
protected:
@@ -102,7 +101,7 @@ class nsLinkableAccessible : public nsAccessibleWrap
virtual PRUint64 NativeState();
// HyperLinkAccessible
- virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+ virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
protected:
// nsAccessible
4 accessible/src/base/nsCoreUtils.cpp
View
@@ -52,7 +52,7 @@
#include "nsIDOMXULElement.h"
#include "nsIDocShell.h"
#include "nsIContentViewer.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIScrollableFrame.h"
@@ -78,7 +78,7 @@ PRBool
nsCoreUtils::HasClickListener(nsIContent *aContent)
{
NS_ENSURE_TRUE(aContent, PR_FALSE);
- nsIEventListenerManager* listenerManager =
+ nsEventListenerManager* listenerManager =
aContent->GetListenerManager(PR_FALSE);
return listenerManager &&
6 accessible/src/base/nsOuterDocAccessible.cpp
View
@@ -74,8 +74,8 @@ nsOuterDocAccessible::NativeState()
}
nsAccessible*
-nsOuterDocAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsOuterDocAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
@@ -90,7 +90,7 @@ nsOuterDocAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
NS_ENSURE_TRUE(child, nsnull);
if (aWhichChild == eDeepestChild)
- return child->GetChildAtPoint(aX, aY, eDeepestChild);
+ return child->ChildAtPoint(aX, aY, eDeepestChild);
return child;
}
4 accessible/src/base/nsOuterDocAccessible.h
View
@@ -70,8 +70,8 @@ class nsOuterDocAccessible : public nsAccessibleWrap
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual void InvalidateChildren();
virtual PRBool AppendChild(nsAccessible *aAccessible);
7 accessible/src/base/nsRootAccessible.cpp
View
@@ -65,7 +65,7 @@
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsIDOMXULPopupElement.h"
#include "nsIDocument.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
#include "nsIFrame.h"
#include "nsIMenuFrame.h"
#include "nsIHTMLDocument.h"
@@ -76,7 +76,6 @@
#include "nsIWebBrowserChrome.h"
#include "nsReadableUtils.h"
#include "nsRootAccessible.h"
-#include "nsIDOMNSEventTarget.h"
#include "nsIPrivateDOMEvent.h"
#include "nsFocusManager.h"
@@ -251,11 +250,11 @@ const char* const docEvents[] = {
nsresult nsRootAccessible::AddEventListeners()
{
- // nsIDOMNSEventTarget interface allows to register event listeners to
+ // nsIDOMEventTarget interface allows to register event listeners to
// receive untrusted events (synthetic events generated by untrusted code).
// For example, XBL bindings implementations for elements that are hosted in
// non chrome document fire untrusted events.
- nsCOMPtr<nsIDOMNSEventTarget> nstarget(do_QueryInterface(mDocument));
+ nsCOMPtr<nsIDOMEventTarget> nstarget(do_QueryInterface(mDocument));
if (nstarget) {
for (const char* const* e = docEvents,
2  accessible/src/base/nsTextEquivUtils.cpp
View
@@ -519,7 +519,7 @@ PRUint32 nsTextEquivUtils::gRoleToNameRulesMap[] =
eNoRule, // ROLE_AUTOCOMPLETE
eNoRule, // ROLE_EDITBAR
eFromValue, // ROLE_ENTRY
- eNoRule, // ROLE_CAPTION
+ eFromSubtreeIfRec, // ROLE_CAPTION
eNoRule, // ROLE_DOCUMENT_FRAME
eFromSubtreeIfRec, // ROLE_HEADING
eNoRule, // ROLE_PAGE
12 accessible/src/html/nsHTMLImageMapAccessible.cpp
View
@@ -85,13 +85,13 @@ nsHTMLImageMapAccessible::AnchorCount()
}
nsAccessible*
-nsHTMLImageMapAccessible::GetAnchor(PRUint32 aAnchorIndex)
+nsHTMLImageMapAccessible::AnchorAt(PRUint32 aAnchorIndex)
{
return GetChildAt(aAnchorIndex);
}
already_AddRefed<nsIURI>
-nsHTMLImageMapAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsHTMLImageMapAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
nsAccessible* area = GetChildAt(aAnchorIndex);
if (!area)
@@ -243,8 +243,8 @@ nsHTMLAreaAccessible::NativeState()
}
nsAccessible*
-nsHTMLAreaAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsHTMLAreaAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
// Don't walk into area accessibles.
return this;
@@ -261,13 +261,13 @@ nsHTMLAreaAccessible::StartOffset()
// We return index in parent because image map contains area links only which
// are embedded objects.
// XXX: image map should be a hypertext accessible.
- return GetIndexInParent();
+ return IndexInParent();
}
PRUint32
nsHTMLAreaAccessible::EndOffset()
{
- return GetIndexInParent() + 1;
+ return IndexInParent() + 1;
}
////////////////////////////////////////////////////////////////////////////////
9 accessible/src/html/nsHTMLImageMapAccessible.h
View
@@ -62,8 +62,8 @@ class nsHTMLImageMapAccessible : public nsHTMLImageAccessibleWrap
// HyperLinkAccessible
virtual PRUint32 AnchorCount();
- virtual nsAccessible* GetAnchor(PRUint32 aAnchorIndex);
- virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+ virtual nsAccessible* AnchorAt(PRUint32 aAnchorIndex);
+ virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
protected:
@@ -82,7 +82,6 @@ class nsHTMLImageMapAccessible : public nsHTMLImageAccessibleWrap
class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
{
public:
- using nsAccessible::GetChildAtPoint;
nsHTMLAreaAccessible(nsIContent *aContent, nsIWeakReference *aShell);
@@ -94,8 +93,8 @@ class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
virtual void Description(nsString& aDescription);
virtual nsresult GetNameInternal(nsAString& aName);
virtual PRUint64 NativeState();
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
// HyperLinkAccessible
virtual PRUint32 StartOffset();
4 accessible/src/html/nsHTMLLinkAccessible.cpp
View
@@ -166,14 +166,14 @@ nsHTMLLinkAccessible::DoAction(PRUint8 aIndex)
// HyperLinkAccessible
bool
-nsHTMLLinkAccessible::IsHyperLink()
+nsHTMLLinkAccessible::IsLink()
{
// Expose HyperLinkAccessible unconditionally.
return true;
}
already_AddRefed<nsIURI>
-nsHTMLLinkAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsHTMLLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
return aAnchorIndex == 0 ? mContent->GetHrefURI() : nsnull;
}
4 accessible/src/html/nsHTMLLinkAccessible.h
View
@@ -61,8 +61,8 @@ class nsHTMLLinkAccessible : public nsHyperTextAccessibleWrap
virtual PRUint64 NativeState();
// HyperLinkAccessible
- virtual bool IsHyperLink();
- virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+ virtual bool IsLink();
+ virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
protected:
enum { eAction_Jump = 0 };
72 accessible/src/html/nsHTMLTableAccessible.cpp
View
@@ -313,19 +313,19 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
nsCOMPtr<nsIMutableArray> headerCells =
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
+ PRUint32 desiredRole = -1;
+ if (aRowOrColumnHeaderCell == nsAccUtils::eRowHeaderCells)
+ desiredRole = nsIAccessibleRole::ROLE_ROWHEADER;
+ else if (aRowOrColumnHeaderCell == nsAccUtils::eColumnHeaderCells)
+ desiredRole = nsIAccessibleRole::ROLE_COLUMNHEADER;
do {
nsAccessible* headerCell =
GetAccService()->GetAccessibleInWeakShell(headerCellElm, mWeakShell);
- if (headerCell &&
- (aRowOrColumnHeaderCell == nsAccUtils::eRowHeaderCells &&
- headerCell->Role() == nsIAccessibleRole::ROLE_ROWHEADER ||
- aRowOrColumnHeaderCell == nsAccUtils::eColumnHeaderCells &&
- headerCell->Role() == nsIAccessibleRole::ROLE_COLUMNHEADER)) {
+ if (headerCell && headerCell->Role() == desiredRole)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
PR_FALSE);
- }
} while ((headerCellElm = iter.NextElem()));
NS_ADDREF(*aHeaderCells = headerCells);
@@ -464,10 +464,22 @@ nsresult
nsHTMLTableAccessible::GetNameInternal(nsAString& aName)
{
nsAccessible::GetNameInternal(aName);
+ if (!aName.IsEmpty())
+ return NS_OK;
- if (aName.IsEmpty())
- mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, aName);
+ // Use table caption as a name.
+ nsAccessible* caption = Caption();
+ if (caption) {
+ nsIContent* captionContent = caption->GetContent();
+ if (captionContent) {
+ nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent, &aName);
+ if (!aName.IsEmpty())
+ return NS_OK;
+ }
+ }
+ // If no caption then use summary as a name.
+ mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, aName);
return NS_OK;
}
@@ -499,11 +511,8 @@ nsHTMLTableAccessible::GetRelationByType(PRUint32 aRelationType,
aRelation);
NS_ENSURE_SUCCESS(rv, rv);
- if (aRelationType == nsIAccessibleRelation::RELATION_DESCRIBED_BY) {
- nsCOMPtr<nsIAccessible> accCaption;
- GetCaption(getter_AddRefs(accCaption));
- return nsRelUtils::AddTarget(aRelationType, aRelation, accCaption);
- }
+ if (aRelationType == nsIAccessibleRelation::RELATION_DESCRIBED_BY)
+ return nsRelUtils::AddTarget(aRelationType, aRelation, Caption());
return NS_OK;
}
@@ -514,10 +523,9 @@ nsHTMLTableAccessible::GetRelationByType(PRUint32 aRelationType,
NS_IMETHODIMP
nsHTMLTableAccessible::GetCaption(nsIAccessible **aCaption)
{
- nsAccessible* firstChild = GetChildAt(0);
- if (firstChild && firstChild->Role() == nsIAccessibleRole::ROLE_CAPTION)
- NS_ADDREF(*aCaption = firstChild);
+ NS_ENSURE_ARG_POINTER(aCaption);
+ NS_IF_ADDREF(*aCaption = Caption());
return NS_OK;
}
@@ -1204,13 +1212,9 @@ nsHTMLTableAccessible::RemoveRowsOrColumnsFromSelection(PRInt32 aIndex,
const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
PRBool doUnselectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
-
- nsresult rv = NS_OK;
PRInt32 count = 0;
- if (doUnselectRow)
- rv = GetColumnCount(&count);
- else
- rv = GetRowCount(&count);
+ nsresult rv = doUnselectRow ? GetColumnCount(&count) : GetRowCount(&count);
+ NS_ENSURE_SUCCESS(rv, rv);
PRInt32 startRowIdx = doUnselectRow ? aIndex : 0;
PRInt32 endRowIdx = doUnselectRow ? aIndex : count - 1;
@@ -1268,17 +1272,23 @@ nsHTMLTableAccessible::Description(nsString& aDescription)
if (!aDescription.IsEmpty())
return;
- nsCOMPtr<nsIAccessible> captionAccessible;
- GetCaption(getter_AddRefs(captionAccessible));
- nsCOMPtr<nsIAccessNode> captionAccessNode = do_QueryInterface(captionAccessible);
- if (captionAccessNode) {
- nsCOMPtr<nsIDOMNode> captionNode;
- captionAccessNode->GetDOMNode(getter_AddRefs(captionNode));
- nsCOMPtr<nsIContent> captionContent = do_QueryInterface(captionNode);
- if (captionContent)
+ // Use summary as description if it weren't used as a name.
+ // XXX: get rid code duplication with NameInternal().
+ nsAccessible* caption = Caption();
+ if (caption) {
+ nsIContent* captionContent = caption->GetContent();
+ if (captionContent) {
+ nsAutoString captionText;
nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent,
- &aDescription);
+ &captionText);
+
+ if (!captionText.IsEmpty()) { // summary isn't used as a name.
+ mContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary,
+ aDescription);
+ }
+ }
}
+
#ifdef SHOW_LAYOUT_HEURISTIC
if (aDescription.IsEmpty()) {
PRBool isProbablyForLayout;
8 accessible/src/html/nsHTMLTableAccessible.h
View
@@ -141,6 +141,14 @@ class nsHTMLTableAccessible : public nsAccessibleWrap,
virtual PRUint64 NativeState();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
+ // TableAccessible
+ inline nsAccessible* Caption() const
+ {
+ nsAccessible* child = mChildren.SafeElementAt(0, nsnull);
+ return child && child->Role() == nsIAccessibleRole::ROLE_CAPTION ?
+ child : nsnull;
+ }
+
// nsHTMLTableAccessible
/**
4 accessible/src/html/nsHyperTextAccessible.cpp
View
@@ -1154,7 +1154,7 @@ nsHyperTextAccessible::GetTextAttributes(PRBool aIncludeDefAttrs,
return NS_ERROR_INVALID_ARG;
}
- PRInt32 accAtOffsetIdx = accAtOffset->GetIndexInParent();
+ PRInt32 accAtOffsetIdx = accAtOffset->IndexInParent();
PRInt32 startOffset = GetChildOffset(accAtOffsetIdx);
PRInt32 endOffset = GetChildOffset(accAtOffsetIdx + 1);
PRInt32 offsetInAcc = aOffset - startOffset;
@@ -2093,7 +2093,7 @@ nsHyperTextAccessible::InvalidateChildren()
PRBool
nsHyperTextAccessible::RemoveChild(nsAccessible* aAccessible)
{
- PRInt32 childIndex = aAccessible->GetIndexInParent();
+ PRInt32 childIndex = aAccessible->IndexInParent();
PRInt32 count = mOffsets.Length() - childIndex;
if (count > 0)
mOffsets.RemoveElementsAt(childIndex, count);
18 accessible/src/msaa/CAccessibleHyperlink.cpp
View
@@ -56,7 +56,7 @@ CAccessibleHyperlink::QueryInterface(REFIID iid, void** ppv)
if (IID_IAccessibleHyperlink == iid) {
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
- if (!thisObj->IsHyperLink())
+ if (!thisObj->IsLink())
return E_NOINTERFACE;
*ppv = static_cast<IAccessibleHyperlink*>(this);
@@ -76,13 +76,13 @@ __try {
VariantInit(aAnchor);
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
- if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+ if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
return E_INVALIDARG;
- nsAccessible* anchor = thisObj->GetAnchor(aIndex);
+ nsAccessible* anchor = thisObj->AnchorAt(aIndex);
if (!anchor)
return S_FALSE;
@@ -111,13 +111,13 @@ __try {
VariantInit(aAnchorTarget);
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
- if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+ if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
if (aIndex < 0 || aIndex >= static_cast<long>(thisObj->AnchorCount()))
return E_INVALIDARG;
- nsCOMPtr<nsIURI> uri = thisObj->GetAnchorURI(aIndex);
+ nsCOMPtr<nsIURI> uri = thisObj->AnchorURIAt(aIndex);
if (!uri)
return S_FALSE;
@@ -151,7 +151,7 @@ __try {
*aIndex = 0;
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
- if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+ if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
*aIndex = thisObj->StartOffset();
@@ -168,7 +168,7 @@ __try {
*aIndex = 0;
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
- if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+ if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
*aIndex = thisObj->EndOffset();
@@ -185,10 +185,10 @@ __try {
*aValid = false;
nsRefPtr<nsAccessible> thisObj = do_QueryObject(this);
- if (thisObj->IsDefunct() || !thisObj->IsHyperLink())
+ if (thisObj->IsDefunct() || !thisObj->IsLink())
return E_FAIL;
- *aValid = thisObj->IsValid();
+ *aValid = thisObj->IsLinkValid();
return S_OK;
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
45 accessible/src/msaa/nsAccessibleWrap.cpp
View
@@ -899,38 +899,20 @@ STDMETHODIMP nsAccessibleWrap::accHitTest(
{
__try {
VariantInit(pvarChild);
+ if (IsDefunct())
+ return E_FAIL;
- // convert to window coords
- nsCOMPtr<nsIAccessible> xpAccessible;
-
- xLeft = xLeft;
- yTop = yTop;
-
- if (nsAccUtils::MustPrune(this)) {
- xpAccessible = this;
- }
- else {
- GetChildAtPoint(xLeft, yTop, getter_AddRefs(xpAccessible));
- }
+ nsAccessible* accessible = ChildAtPoint(xLeft, yTop, eDirectChild);
// if we got a child
- if (xpAccessible) {
+ if (accessible) {
// if the child is us
- if (xpAccessible == static_cast<nsIAccessible*>(this)) {
+ if (accessible == this) {
pvarChild->vt = VT_I4;
pvarChild->lVal = CHILDID_SELF;
} else { // its not create an Accessible for it.
pvarChild->vt = VT_DISPATCH;
- pvarChild->pdispVal = NativeAccessible(xpAccessible);
- nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(xpAccessible));
- NS_ASSERTION(accessNode, "Unable to QI to nsIAccessNode");
- nsCOMPtr<nsIDOMNode> domNode;
- accessNode->GetDOMNode(getter_AddRefs(domNode));
- if (!domNode) {
- // Has already been shut down
- pvarChild->vt = VT_EMPTY;
- return E_FAIL;
- }
+ pvarChild->pdispVal = NativeAccessible(accessible);
}
} else {
// no child at that point
@@ -1382,19 +1364,18 @@ STDMETHODIMP
nsAccessibleWrap::get_indexInParent(long *aIndexInParent)
{
__try {
- *aIndexInParent = -1;
+ if (!aIndexInParent)
+ return E_INVALIDARG;
- PRInt32 index = -1;
- nsresult rv = GetIndexInParent(&index);
- if (NS_FAILED(rv))
- return GetHRESULT(rv);
+ *aIndexInParent = -1;
+ if (IsDefunct())
+ return E_FAIL;
- if (index == -1)
+ *aIndexInParent = IndexInParent();
+ if (*aIndexInParent == -1)
return S_FALSE;
- *aIndexInParent = index;
return S_OK;
-
} __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return E_FAIL;
}
2  accessible/src/msaa/nsRootAccessibleWrap.cpp
View
@@ -41,7 +41,7 @@
#include "nsWinUtils.h"
#include "nsIDOMEventTarget.h"
-#include "nsIEventListenerManager.h"
+#include "nsEventListenerManager.h"
////////////////////////////////////////////////////////////////////////////////
// Constructor/desctructor
4 accessible/src/xforms/nsXFormsAccessible.cpp
View
@@ -562,8 +562,8 @@ nsXFormsSelectableItemAccessible::DoAction(PRUint8 aIndex)
return NS_OK;
}
-PRBool
-nsXFormsSelectableItemAccessible::IsItemSelected()
+bool
+nsXFormsSelectableItemAccessible::IsSelected()
{
nsresult rv;
2  accessible/src/xforms/nsXFormsAccessible.h
View
@@ -194,7 +194,7 @@ class nsXFormsSelectableItemAccessible : public nsXFormsAccessible
NS_IMETHOD DoAction(PRUint8 aIndex);
protected:
- PRBool IsItemSelected();
+ bool IsSelected();
};
#endif
8 accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
View
@@ -502,7 +502,7 @@ nsXFormsItemCheckgroupAccessible::NativeState()
{
PRUint64 state = nsXFormsSelectableItemAccessible::NativeState();
- if (IsItemSelected())
+ if (IsSelected())
state |= states::CHECKED;
return state;
@@ -514,7 +514,7 @@ nsXFormsItemCheckgroupAccessible::GetActionName(PRUint8 aIndex, nsAString& aName
if (aIndex != eAction_Click)
return NS_ERROR_INVALID_ARG;
- if (IsItemSelected())
+ if (IsSelected())
aName.AssignLiteral("uncheck");
else
aName.AssignLiteral("check");
@@ -544,7 +544,7 @@ nsXFormsItemRadiogroupAccessible::NativeState()
{
PRUint64 state = nsXFormsSelectableItemAccessible::NativeState();
- if (IsItemSelected())
+ if (IsSelected())
state |= states::CHECKED;
return state;
@@ -627,7 +627,7 @@ nsXFormsItemComboboxAccessible::NativeState()
return state;
state |= states::SELECTABLE;
- if (IsItemSelected())
+ if (IsSelected())
state |= states::SELECTED;
return state;
4 accessible/src/xul/nsXULListboxAccessible.cpp
View
@@ -1025,7 +1025,7 @@ nsXULListCellAccessible::GetColumnIndex(PRInt32 *aColumnIndex)
*aColumnIndex = 0;
- PRInt32 indexInRow = GetIndexInParent();
+ PRInt32 indexInRow = IndexInParent();
for (PRInt32 idx = 0; idx < indexInRow; idx++) {
nsAccessible* cell = row->GetChildAt(idx);
PRUint32 role = cell->Role();
@@ -1058,7 +1058,7 @@ nsXULListCellAccessible::GetRowIndex(PRInt32 *aRowIndex)
*aRowIndex = 0;
- PRInt32 indexInTable = row->GetIndexInParent();
+ PRInt32 indexInTable = row->IndexInParent();
for (PRInt32 idx = 0; idx < indexInTable; idx++) {
row = table->GetChildAt(idx);
if (row->Role() == nsIAccessibleRole::ROLE_ROW)
12 accessible/src/xul/nsXULTextAccessible.cpp
View
@@ -225,7 +225,7 @@ nsXULLinkAccessible::DoAction(PRUint8 aIndex)
// nsXULLinkAccessible: HyperLinkAccessible
bool
-nsXULLinkAccessible::IsHyperLink()
+nsXULLinkAccessible::IsLink()
{
// Expose HyperLinkAccessible unconditionally.
return true;
@@ -239,21 +239,21 @@ nsXULLinkAccessible::StartOffset()
// a text.
// XXX: accessible parent of XUL link accessible should be a hypertext
// accessible.
- if (nsAccessible::IsHyperLink())
+ if (nsAccessible::IsLink())
return nsAccessible::StartOffset();
- return GetIndexInParent();
+ return IndexInParent();
}
PRUint32
nsXULLinkAccessible::EndOffset()
{
- if (nsAccessible::IsHyperLink())
+ if (nsAccessible::IsLink())
return nsAccessible::EndOffset();
- return GetIndexInParent() + 1;
+ return IndexInParent() + 1;
}
already_AddRefed<nsIURI>
-nsXULLinkAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
+nsXULLinkAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
{
if (aAnchorIndex != 0)
return nsnull;
4 accessible/src/xul/nsXULTextAccessible.h
View
@@ -97,10 +97,10 @@ class nsXULLinkAccessible : public nsHyperTextAccessibleWrap
virtual PRUint64 NativeState();
// HyperLinkAccessible
- virtual bool IsHyperLink();
+ virtual bool IsLink();
virtual PRUint32 StartOffset();
virtual PRUint32 EndOffset();
- virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
+ virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
protected:
enum { eAction_Jump = 0 };
10 accessible/src/xul/nsXULTreeAccessible.cpp
View
@@ -228,8 +228,8 @@ nsXULTreeAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
// nsXULTreeAccessible: nsAccessible implementation (DON'T put methods here)
nsAccessible*
-nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsXULTreeAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
nsIFrame *frame = GetFrame();
if (!frame)
@@ -255,7 +255,7 @@ nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
// If we failed to find tree cell for the given point then it might be
// tree columns.
if (row == -1 || !column)
- return nsAccessibleWrap::GetChildAtPoint(aX, aY, aWhichChild);
+ return nsAccessibleWrap::ChildAtPoint(aX, aY, aWhichChild);
nsAccessible *child = GetTreeItemAccessible(row);
if (aWhichChild == eDeepestChild && child) {
@@ -986,7 +986,7 @@ nsXULTreeItemAccessibleBase::NativeState()
}
PRInt32
-nsXULTreeItemAccessibleBase::GetIndexInParent() const
+nsXULTreeItemAccessibleBase::IndexInParent() const
{
return mParent ? mParent->ContentChildCount() + mRow : -1;
}
@@ -1030,7 +1030,7 @@ nsXULTreeItemAccessibleBase::GetSiblingAtOffset(PRInt32 aOffset,
if (aError)
*aError = NS_OK; // fail peacefully
- return mParent->GetChildAt(GetIndexInParent() + aOffset);
+ return mParent->GetChildAt(IndexInParent() + aOffset);
}
////////////////////////////////////////////////////////////////////////////////
7 accessible/src/xul/nsXULTreeAccessible.h
View
@@ -66,7 +66,6 @@ class nsXULTreeAccessible : public nsAccessibleWrap
public:
using nsAccessible::GetChildCount;
using nsAccessible::GetChildAt;
- using nsAccessible::GetChildAtPoint;
nsXULTreeAccessible(nsIContent *aContent, nsIWeakReference *aShell);
@@ -86,8 +85,8 @@ class nsXULTreeAccessible : public nsAccessibleWrap
// nsAccessible
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
virtual PRInt32 GetChildCount();
@@ -209,7 +208,7 @@ class nsXULTreeItemAccessibleBase : public nsAccessibleWrap
// nsAccessible
virtual PRUint64 NativeState();
- virtual PRInt32 GetIndexInParent() const;
+ virtual PRInt32 IndexInParent() const;
// nsXULTreeItemAccessibleBase
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEITEMBASEACCESSIBLE_IMPL_CID)
6 accessible/src/xul/nsXULTreeGridAccessible.cpp
View
@@ -685,8 +685,8 @@ nsXULTreeGridRowAccessible::GetName(nsAString& aName)
}
nsAccessible*
-nsXULTreeGridRowAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild)
+nsXULTreeGridRowAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild)
{
nsIFrame *frame = GetFrame();
if (!frame)
@@ -1230,7 +1230,7 @@ nsXULTreeGridCellAccessible::NativeState()
}
PRInt32
-nsXULTreeGridCellAccessible::GetIndexInParent() const
+nsXULTreeGridCellAccessible::IndexInParent() const
{
return GetColumnIndex();
}
7 accessible/src/xul/nsXULTreeGridAccessible.h
View
@@ -77,7 +77,6 @@ class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
public:
using nsAccessible::GetChildCount;
using nsAccessible::GetChildAt;
- using nsAccessible::GetChildAtPoint;
nsXULTreeGridRowAccessible(nsIContent *aContent, nsIWeakReference *aShell,
nsAccessible *aParent, nsITreeBoxObject *aTree,
@@ -94,8 +93,8 @@ class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
// nsAccessible
virtual PRUint32 NativeRole();
NS_IMETHOD GetName(nsAString& aName);
- virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- EWhichChildAtPoint aWhichChild);
+ virtual nsAccessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
virtual PRInt32 GetChildCount();
@@ -166,7 +165,7 @@ class nsXULTreeGridCellAccessible : public nsLeafAccessible,
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();
- virtual PRInt32 GetIndexInParent() const;
+ virtual PRInt32 IndexInParent() const;
// nsXULTreeGridCellAccessible
NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEGRIDCELLACCESSIBLE_IMPL_CID)
69 accessible/tests/mochitest/name/markup.js
View
@@ -7,7 +7,6 @@ var gRuleDoc = null;
// Debuggin stuff.
var gDumpToConsole = false;
-gA11yEventDumpToConsole = gDumpToConsole;
/**
* Start name tests. Run through markup elements and test names for test
@@ -149,7 +148,7 @@ function testNameForRule(aElm, aRuleElm)
testNameForAttrRule(aElm, aRuleElm);
- } else if (aRuleElm.hasAttribute("elm") && aRuleElm.hasAttribute("elmattr")) {
+ } else if (aRuleElm.hasAttribute("elm")) {
if (gDumpToConsole) {
dump("\nProcessing rule { elm: " + aRuleElm.getAttribute("elm") +
", elmattr: " + aRuleElm.getAttribute("elmattr") +" }\n");
@@ -178,7 +177,7 @@ function testNameForAttrRule(aElm, aRule)
if (type == "string") {
name = attrValue;
- } else if (type == "ref") {
+ } else if (type == "ref" && attrValue) {
var ids = attrValue.split(/\s+/);
for (var idx = 0; idx < ids.length; idx++) {
var labelElm = getNode(ids[idx]);
@@ -197,37 +196,53 @@ function testNameForAttrRule(aElm, aRule)
}
function testNameForElmRule(aElm, aRule)
-{
- var elm = aRule.getAttribute("elm");
- var elmattr = aRule.getAttribute("elmattr");
-
- var filter = {
- acceptNode: function filter_acceptNode(aNode)
- {
- if (aNode.localName == this.mLocalName &&
- aNode.getAttribute(this.mAttrName) == this.mAttrValue)
- return NodeFilter.FILTER_ACCEPT;
-
- return NodeFilter.FILTER_SKIP;
- },
-
- mLocalName: elm,
- mAttrName: elmattr,
- mAttrValue: aElm.getAttribute("id")
- };
+{
+ var labelElm;
+
+ var tagname = aRule.getAttribute("elm");
+ var attrname = aRule.getAttribute("elmattr");
+ if (attrname) {
+ var filter = {
+ acceptNode: function filter_acceptNode(aNode)
+ {
+ if (aNode.localName == this.mLocalName &&
+ aNode.getAttribute(this.mAttrName) == this.mAttrValue)
+ return NodeFilter.FILTER_ACCEPT;
+
+ return NodeFilter.FILTER_SKIP;
+ },
+
+ mLocalName: tagname,
+ mAttrName: attrname,
+ mAttrValue: aElm.getAttribute("id")
+ };
+
+ var treeWalker = document.createTreeWalker(document.body,
+ NodeFilter.SHOW_ELEMENT,
+ filter, false);
+ labelElm = treeWalker.nextNode();
+
+ } else {
+ // if attrname is empty then look for the element in subtree.
+ labelElm = aElm.getElementsByTagName(tagname)[0];
+ if (!labelElm)
+ labelElm = aElm.getElementsByTagName("html:" + tagname)[0];
+ }
+
+ if (!labelElm) {
+ ok(false, msg + " Failed to find '" + tagname + "' element.");
+ gTestIterator.iterateNext();
+ return;
+ }
- var treeWalker = document.createTreeWalker(document.body,
- NodeFilter.SHOW_ELEMENT,
- filter, false);
- var labelElm = treeWalker.nextNode();
- var msg = "Element '" + elm + "' test.";
+ var msg = "Element '" + tagname + "' test.";
testName(aElm, labelElm.getAttribute("a11yname"), msg);
var parentNode = labelElm.parentNode;
if (gDumpToConsole) {
dump("\nProcessed elm rule. Wait for reorder event on " +
- prettyName(parentNode) + "'\n");
+ prettyName(parentNode) + "\n");
}
waitForEvent(EVENT_REORDER, parentNode,
gTestIterator.iterateNext, gTestIterator);
86 accessible/tests/mochitest/name/markuprules.xml
View
@@ -1,31 +1,50 @@
<?xml version="1.0"?>
<!--
- This XML file is used to create sequence of accessible name tests. It consist of
- two sections. The first section 'ruledfn' declares name computation rules.
- The second section 'rulesample' defines markup samples we need to check name
- computation rules for.
+ This XML file is used to create sequence of accessible name tests. It consist
+ of two sections. The first section 'ruledfn' declares name computation rules.
+ The second section 'rulesample' defines markup samples we need to check name
+ computation rules for.
- Section 'ruledfn' consist of 'ruleset' elements. Every 'ruleset' element is
+ <ruledfn>
+ <ruleset>
+ <rule>
+
+ Section 'ruledfn' contains 'ruleset' elements. Every 'ruleset' element is
presented by 'rule' elements so that sequence of 'rule' elements gives the
sequence of name computations rules. Every 'rule' element can be one of four
types.
- * name is equal to the value of attribute presented on the element. Example,
- 'aria-label' attribute. In this case 'rule' element has 'attr' attribute
- pointing to attribute name and 'type' attribute with 'string' value. For
- example, <rule attr="aria-label" type="string"/>.
- * name is calculated from elements that are pointed to by attribute value on
- the element. Example is 'aria-labelledby'. In this case 'rule' element
- has 'attr' attribute holding the sequence of IDs of elements used to
- compute the name, in addition the 'rule' element has 'type' attribute with
- 'ref' value. For example, <rule attr="aria-labelledby" type="ref"/>.
- * name is calculated from another element. Example, html:label@for element.
- In this case 'rule' element has 'elm' and 'elmattr' attributes. These
- attributes are used to find an element by tagname and attribute with value
- equaled to ID of the element. For example, <rule elm="label" elmattr="for"/>.
- * name is computed from subtree. Example, html:button. In this case 'rule'
- element has 'fromsubtree' attribute with 'true' value. For example,
- <rule fromsubtree="true"/>
+
+ * <rule attr='' type='string'/> used when name is equal to the value of
+ attribute presented on the element.
+
+ Example, 'aria-label' attribute. In this case 'rule' element has 'attr'
+ attribute pointing to attribute name and 'type' attribute with 'string'
+ value. For example, <rule attr="aria-label" type="string"/>.
+
+ * <rule attr='' type='ref'/> used when name is calculated from elements that
+ are pointed to by attribute value on the element.
+
+ Example is 'aria-labelledby'. In this case 'rule' element has 'attr'
+ attribute holding the sequence of IDs of elements used to compute the name,
+ in addition the 'rule' element has 'type' attribute with 'ref' value.
+ For example, <rule attr="aria-labelledby" type="ref"/>.
+
+ * <rule elm='' elmattr=''/> used when name is calculated from another
+ element. These attributes are used to find an element by tagname and
+ attribute with value equaled to ID of the element. If 'elmattr' is missed
+ then element from subtree with the given tagname is used.
+
+ Example, html:label@for element, <rule elm="label" elmattr="for"/>.
+ Example, html:caption element, <rule elm="caption"/>
+
+ * <rule fromsubtree='true'/> used when name is computed from subtree.
+
+ Example, html:button. In this case 'rule' element has 'fromsubtree'
+ attribute with 'true' value.
+
+ <rulesample>
+ <markup ruleset=''>
Section 'rulesample' provides set of markup samples ('markup' elements). Every
'markup' element contains an element that accessible name will be computed for
@@ -120,6 +139,12 @@
<rule attr="title" type="string"/>
</ruleset>
+ <ruleset id="htmltable">
+ <ruleset ref="htmlelm_start"/>
+ <rule elm="caption"/>
+ <rule attr="summary" type="string"/>
+ <ruleset ref="htmlelm_end"/>
+ </ruleset>
</ruledfn>
<rulesample>
@@ -210,6 +235,25 @@
</html:table>
</markup>
+ <markup ref="html:table" ruleset="htmltable"
+ id="markup6test">
+ <html:span id="l1" a11yname="lby_tst6_1">lby_tst6_1</html:span>
+ <html:span id="l2" a11yname="lby_tst6_2">lby_tst6_2</html:span>
+ <html:label for="t" a11yname="label_tst6">label_tst6</html:label>