Skip to content
Browse files

Revert inbound to 3d5d1daa2505 to stop OS X M5 failures (backout not …

…clean/could have been a bad merge) on a CLOSED TREE
  • Loading branch information...
1 parent 5ea14fd commit 6251d811a730203646b5d9b18fb34e3d22ce1b8d @edmorley edmorley committed
Showing with 2,191 additions and 5,664 deletions.
  1. +14 −4 accessible/src/generic/RootAccessible.cpp
  2. +1 −0 b2g/app/b2g.js
  3. +8 −8 browser/base/content/test/browser_gestureSupport.js
  4. +16 −9 browser/components/sessionstore/src/Makefile.in
  5. +4 −7 config/rules.mk
  6. +0 −38 content/base/public/nsContentUtils.h
  7. +33 −13 content/base/src/nsAttrAndChildArray.cpp
  8. +4 −5 content/base/src/nsAttrAndChildArray.h
  9. +8 −5 content/base/src/nsContentAreaDragDrop.cpp
  10. +2 −2 content/base/src/nsContentAreaDragDrop.h
  11. +4 −24 content/base/src/nsContentUtils.cpp
  12. +55 −46 content/base/src/nsDocument.cpp
  13. +1 −6 content/base/src/nsDocument.h
  14. +2 −3 content/base/src/nsINode.cpp
  15. +3 −1 content/base/src/nsMappedAttributes.cpp
  16. +1 −1 content/base/src/nsMappedAttributes.h
  17. +1 −1 content/base/src/nsRange.cpp
  18. +97 −53 content/base/src/nsScriptLoader.cpp
  19. +3 −1 content/base/src/nsTreeSanitizer.cpp
  20. +14 −17 content/base/src/nsXMLHttpRequest.cpp
  21. +8 −5 content/base/src/nsXMLHttpRequest.h
  22. +2 −1 content/events/src/nsDOMEvent.cpp
  23. +5 −6 content/events/src/nsDOMEvent.h
  24. +2 −0 content/events/src/nsDOMUIEvent.h
  25. +5 −3 content/events/src/nsEventDispatcher.cpp
  26. +1 −0 content/events/src/nsEventListenerManager.cpp
  27. +1 −1 content/events/src/nsEventStateManager.cpp
  28. +3 −1 content/events/src/nsIMEStateManager.cpp
  29. +1 −2 content/events/test/Makefile.in
  30. +1 −1 content/events/test/test_bug238987.html
  31. +2 −2 content/events/test/test_bug409604.html
  32. +1 −1 content/events/test/test_bug617528.xul
  33. +0 −28 content/events/test/test_bug716822.html
  34. +1 −0 content/html/content/src/nsGenericHTMLElement.cpp
  35. +1 −0 content/html/content/src/nsHTMLButtonElement.cpp
  36. +1 −0 content/html/content/src/nsHTMLInputElement.cpp
  37. +4 −1 content/xbl/src/nsXBLEventHandler.cpp
  38. +16 −9 content/xbl/src/nsXBLPrototypeHandler.cpp
  39. +8 −4 content/xbl/src/nsXBLWindowKeyHandler.cpp
  40. +9 −7 content/xul/content/src/nsXULElement.cpp
  41. +10 −1 content/xul/content/src/nsXULPopupListener.cpp
  42. +37 −6 content/xul/document/src/nsXULContentSink.cpp
  43. +5 −3 docshell/base/nsDocShell.cpp
  44. +3 −3 dom/activities/src/ActivitiesService.jsm
  45. +28 −5 dom/base/nsDOMClassInfo.cpp
  46. +1 −1 dom/base/nsDOMWindowUtils.cpp
  47. +16 −14 dom/base/nsGlobalWindow.cpp
  48. +9 −2 dom/base/nsIScriptRuntime.h
  49. +23 −0 dom/base/nsJSEnvironment.cpp
  50. +2 −0 dom/base/nsJSEnvironment.h
  51. +0 −14 dom/base/nsPIDOMWindow.h
  52. +7 −1 dom/bindings/BindingUtils.cpp
  53. +2 −0 dom/bindings/BindingUtils.h
  54. +5 −8 dom/bindings/Codegen.py
  55. +0 −1 dom/bindings/Errors.msg
  56. +3 −4 dom/bindings/Makefile.in
  57. +1 −2 dom/bindings/test/Makefile.in
  58. +0 −11 dom/bindings/test/test_bug773326.html
  59. +1 −1 dom/bluetooth/nsIDOMBluetoothDeviceEvent.idl
  60. +1 −1 dom/bluetooth/nsIDOMBluetoothPropertyEvent.idl
  61. +0 −1 dom/imptests/Makefile.in
  62. +873 −329 dom/imptests/failures/webapps/DOMCore/tests/approved/test_Range-compareBoundaryPoints.html.json
  63. +0 −43 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/Makefile.in
  64. +0 −11 ...failures/webapps/DOMCore/tests/submissions/Ms2ger/test_DOMImplementation-createDocument.html.json
  65. +0 −3 ...mptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createElementNS.html.json
  66. +0 −4 ...ts/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-getElementsByTagName.html.json
  67. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-children.html.json
  68. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-constructors.html.json
  69. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-defaultPrevented.html.json
  70. +0 −3 ...ptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_EventTarget-dispatchEvent.html.json
  71. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-appendChild.html.json
  72. +0 −4 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-constants.html.json
  73. +0 −7 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-insertBefore.html.json
  74. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-isEqualNode.xhtml.json
  75. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-removeChild.html.json
  76. +0 −4 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-replaceChild.html.json
  77. +0 −4 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_NodeFilter-constants.html.json
  78. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-attributes.html.json
  79. +0 −3 ...ts/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-commonAncestorContainer.html.json
  80. +0 −4 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-comparePoint.html.json
  81. +0 −3 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-detach.html.json
  82. +0 −5 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-intersectsNode.html.json
  83. +0 −6 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_attributes.html.json
  84. +0 −7 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_case.html.json
  85. +0 −18 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_historical.html.json
  86. +0 −6 dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_interfaces.html.json
  87. +1 −0 dom/imptests/failures/webapps/XMLHttpRequest/tests/submissions/Ms2ger/Makefile.in
  88. +54 −0 .../webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_setrequestheader-invalid-arguments.htm.json
  89. +5 −5 dom/imptests/idlharness.js
  90. +1 −1 dom/imptests/testharness.css
  91. +2 −56 dom/imptests/testharness.js
  92. +0 −1 dom/imptests/webapps.mk
  93. +0 −1 dom/imptests/webapps.txt
  94. +0 −39 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/Document-createProcessingInstruction.js
  95. +0 −115 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/Makefile.in
  96. +0 −14 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/attributes.js
  97. +0 −178 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/case.js
  98. +0 −10 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/constants.js
  99. +0 −5 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/creators.js
  100. +0 −3 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/productions.js
  101. +0 −18 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_CharacterData-appendData.html
  102. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_CharacterData-deleteData.html
  103. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_CharacterData-insertData.html
  104. +0 −24 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_CharacterData-replaceData.html
  105. +0 −41 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_DOMException-constants.html
  106. +0 −155 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_DOMImplementation-createDocument.html
  107. +0 −54 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_DOMImplementation-createDocumentType.html
  108. +0 −31 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_DOMImplementation-createHTMLDocument.html
  109. +0 −138 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_DOMImplementation-hasFeature.html
  110. +0 −46 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-adoptNode.html
  111. +0 −23 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createComment.html
  112. +0 −59 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createElement.html
  113. +0 −46 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createElementNS.html
  114. +0 −32 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createEvent.html
  115. +0 −16 ...ebapps/DOMCore/tests/submissions/Ms2ger/test_Document-createProcessingInstruction-literal-1.xhtml
  116. +0 −19 ...ebapps/DOMCore/tests/submissions/Ms2ger/test_Document-createProcessingInstruction-literal-2.xhtml
  117. +0 −6 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createProcessingInstruction.html
  118. +0 −11 ...imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-createProcessingInstruction.xhtml
  119. +0 −13 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-getElementById.html
  120. +0 −45 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-getElementsByTagName.html
  121. +0 −16 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-getElementsByTagNameNS.html
  122. +0 −44 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Document-importNode.html
  123. +0 −15 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElement-null.html
  124. +0 −20 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElement-null.svg
  125. +0 −20 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElement-null.xhtml
  126. +0 −17 ...imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-dynamic-add.html
  127. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-dynamic-add.svg
  128. +0 −22 ...mptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-dynamic-add.xhtml
  129. +0 −17 ...tests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-dynamic-remove.html
  130. +0 −22 ...ptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-dynamic-remove.svg
  131. +0 −22 ...ests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-dynamic-remove.xhtml
  132. +0 −14 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-nochild.html
  133. +0 −19 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-nochild.svg
  134. +0 −19 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount-nochild.xhtml
  135. +0 −20 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount.html
  136. +0 −25 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount.svg
  137. +0 −25 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-childElementCount.xhtml
  138. +0 −25 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-children.html
  139. +0 −26 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild-entity.svg
  140. +0 −27 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild-entity.xhtml
  141. +0 −21 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild-namespace.html
  142. +0 −26 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild-namespace.svg
  143. +0 −28 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild-namespace.xhtml
  144. +0 −18 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild.html
  145. +0 −23 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild.svg
  146. +0 −23 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-firstElementChild.xhtml
  147. +0 −21 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-getElementsByClassName.html
  148. +0 −17 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-lastElementChild.html
  149. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-lastElementChild.svg
  150. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-lastElementChild.xhtml
  151. +0 −18 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-nextElementSibling.html
  152. +0 −23 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-nextElementSibling.svg
  153. +0 −23 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-nextElementSibling.xhtml
  154. +0 −23 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-previousElementSibling.html
  155. +0 −28 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-previousElementSibling.svg
  156. +0 −28 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-previousElementSibling.xhtml
  157. +0 −18 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-removeAttributeNS.html
  158. +0 −16 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-siblingElement-null.html
  159. +0 −20 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-siblingElement-null.svg
  160. +0 −20 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-siblingElement-null.xhtml
  161. +0 −26 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Element-tagName.html
  162. +0 −20 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-constants.html
  163. +0 −59 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-constructors.html
  164. +0 −42 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-defaultPrevented.html
  165. +0 −30 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-initEvent.html
  166. +0 −49 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_EventTarget-dispatchEvent.html
  167. +0 −37 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-appendChild.html
  168. +0 −25 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-cloneNode.html
  169. +0 −36 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-constants.html
  170. +0 −307 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-insertBefore.html
  171. +0 −59 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-isEqualNode.xhtml
  172. +0 −31 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-lookupPrefix.xhtml
  173. +0 −32 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-nodeName.html
  174. +0 −42 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-nodeName.xhtml
  175. +0 −35 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-normalize.html
  176. +0 −83 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-parentElement.html
  177. +0 −33 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-parentNode.html
  178. +0 −37 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-removeChild.html
  179. +0 −322 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Node-replaceChild.html
  180. +0 −32 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_NodeFilter-constants.html
  181. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-attributes.html
  182. +0 −35 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-commonAncestorContainer.html
  183. +0 −22 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-comparePoint.html
  184. +0 −13 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-detach.html
  185. +0 −29 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_Range-intersectsNode.html
  186. +0 −353 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_attributes.html
  187. +0 −6 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_case.html
  188. +0 −140 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_historical.html
  189. +0 −46 dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger/test_interfaces.html
  190. +1 −1 dom/indexedDB/nsIIDBVersionChangeEvent.idl
  191. +1 −1 dom/interfaces/apps/nsIDOMMozApplicationEvent.idl
  192. +1 −1 dom/interfaces/contacts/nsIDOMMozContactChangeEvent.idl
  193. +1 −1 dom/interfaces/devicestorage/nsIDOMDeviceStorageChangeEvent.idl
  194. +1 −1 dom/interfaces/events/nsIDOMAnimationEvent.idl
  195. +1 −1 dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl
  196. +1 −1 dom/interfaces/events/nsIDOMCloseEvent.idl
  197. +1 −1 dom/interfaces/events/nsIDOMCommandEvent.idl
  198. +1 −1 dom/interfaces/events/nsIDOMCompositionEvent.idl
  199. +1 −1 dom/interfaces/events/nsIDOMCustomEvent.idl
  200. +1 −1 dom/interfaces/events/nsIDOMDataContainerEvent.idl
  201. +1 −1 dom/interfaces/events/nsIDOMDeviceLightEvent.idl
  202. +1 −1 dom/interfaces/events/nsIDOMDeviceMotionEvent.idl
  203. +1 −1 dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl
  204. +1 −1 dom/interfaces/events/nsIDOMDeviceProximityEvent.idl
  205. +1 −1 dom/interfaces/events/nsIDOMDragEvent.idl
  206. +1 −74 dom/interfaces/events/nsIDOMEvent.idl
  207. +1 −1 dom/interfaces/events/nsIDOMHashChangeEvent.idl
  208. +1 −1 dom/interfaces/events/nsIDOMKeyEvent.idl
  209. +1 −1 dom/interfaces/events/nsIDOMMessageEvent.idl
  210. +1 −1 dom/interfaces/events/nsIDOMMouseEvent.idl
  211. +1 −1 dom/interfaces/events/nsIDOMMouseScrollEvent.idl
  212. +1 −1 dom/interfaces/events/nsIDOMMozTouchEvent.idl
  213. +1 −1 dom/interfaces/events/nsIDOMMutationEvent.idl
  214. +29 −1 dom/interfaces/events/nsIDOMNSEvent.idl
  215. +1 −1 dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl
  216. +1 −1 dom/interfaces/events/nsIDOMNotifyPaintEvent.idl
  217. +1 −1 dom/interfaces/events/nsIDOMPageTransitionEvent.idl
  218. +1 −1 dom/interfaces/events/nsIDOMPopStateEvent.idl
  219. +1 −1 dom/interfaces/events/nsIDOMPopupBlockedEvent.idl
  220. +1 −1 dom/interfaces/events/nsIDOMProgressEvent.idl
  221. +1 −1 dom/interfaces/events/nsIDOMScrollAreaEvent.idl
  222. +1 −1 dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
  223. +1 −1 dom/interfaces/events/nsIDOMSmartCardEvent.idl
  224. +1 −1 dom/interfaces/events/nsIDOMTouchEvent.idl
  225. +1 −1 dom/interfaces/events/nsIDOMTransitionEvent.idl
  226. +1 −1 dom/interfaces/events/nsIDOMUIEvent.idl
  227. +1 −1 dom/interfaces/events/nsIDOMUserProximityEvent.idl
  228. +1 −1 dom/interfaces/load-save/nsIDOMLSProgressEvent.idl
  229. +1 −1 dom/interfaces/settings/nsIDOMMozSettingsEvent.idl
  230. +1 −1 dom/interfaces/smil/nsIDOMTimeEvent.idl
  231. +1 −1 dom/interfaces/storage/nsIDOMStorageEvent.idl
  232. +1 −1 dom/interfaces/svg/nsIDOMSVGEvent.idl
  233. +1 −1 dom/interfaces/svg/nsIDOMSVGZoomEvent.idl
  234. +1 −1 dom/interfaces/xul/nsIDOMXULCommandEvent.idl
  235. +1 −1 dom/network/interfaces/nsIDOMUSSDReceivedEvent.idl
  236. +1 −1 dom/sms/interfaces/nsIDOMSmsEvent.idl
  237. +1 −1 dom/telephony/nsIDOMCallEvent.idl
  238. +1 −1 dom/telephony/nsIDOMVoicemailEvent.idl
  239. +2 −2 dom/wifi/nsIWifi.idl
  240. +5 −3 editor/libeditor/base/nsEditor.cpp
  241. +2 −1 editor/libeditor/base/nsEditor.h
  242. +7 −3 editor/libeditor/base/nsEditorEventListener.cpp
  243. +3 −1 editor/libeditor/html/nsHTMLEditorEventListener.cpp
  244. +19 −8 embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
  245. +8 −4 extensions/widgetutils/src/nsWidgetUtils.cpp
  246. +4 −7 js/src/config/rules.mk
  247. +9 −21 js/src/jsapi.cpp
  248. +34 −39 js/src/jsstr.cpp
  249. +0 −7 js/src/jswrapper.cpp
  250. +0 −3 js/src/jswrapper.h
  251. +331 −299 js/xpconnect/src/XPCConvert.cpp
  252. +2 −0 js/xpconnect/src/dom_quickstubs.qsconf
  253. +26 −20 layout/base/nsPresShell.cpp
  254. +7 −3 layout/forms/nsFileControlFrame.cpp
  255. +1 −0 layout/forms/nsListControlFrame.cpp
  256. +1 −0 layout/forms/nsTextControlFrame.cpp
  257. +3 −3 layout/forms/test/test_bug348236.html
  258. +1 −0 layout/generic/nsObjectFrame.cpp
  259. +4 −3 layout/printing/nsPrintPreviewListener.cpp
  260. +0 −3 layout/style/AnimationCommon.cpp
  261. +4 −3 layout/style/Loader.cpp
  262. +21 −3 layout/style/nsCSSStyleSheet.cpp
  263. +4 −0 layout/style/nsCSSStyleSheet.h
  264. +67 −8 layout/style/nsHTMLStyleSheet.cpp
  265. +11 −1 layout/style/nsHTMLStyleSheet.h
  266. +35 −48 layout/tables/BasicTableLayoutStrategy.cpp
  267. +17 −11 layout/xul/base/src/nsMenuBarListener.cpp
  268. +6 −1 layout/xul/base/src/nsMenuBoxObject.cpp
  269. +5 −3 layout/xul/base/src/nsXULPopupManager.cpp
  270. +4 −4 mobile/xul/chrome/content/Util.js
  271. +5 −5 mobile/xul/chrome/content/content.js
  272. +22 −13 security/manager/ssl/src/nsSmartCardEvent.cpp
  273. +6 −2 security/manager/ssl/src/nsSmartCardEvent.h
  274. +1 −1 toolkit/components/passwordmgr/test/test_basic_form_autocomplete.html
  275. +1 −0 toolkit/components/satchel/nsFormFillController.cpp
  276. +1 −1 toolkit/components/satchel/test/test_form_autocomplete.html
  277. +1 −1 toolkit/components/satchel/test/test_form_autocomplete_with_list.html
  278. +1 −0 toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
View
18 accessible/src/generic/RootAccessible.cpp
@@ -26,11 +26,21 @@
#include "mozilla/dom/Element.h"
#include "nsIAccessibleRelation.h"
+#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
+#include "nsIDocShellTreeNode.h"
#include "nsIDocShellTreeOwner.h"
+#include "nsIDOMElement.h"
+#include "nsIDOMEventListener.h"
#include "nsIDOMEventTarget.h"
+#include "nsIDOMHTMLAnchorElement.h"
+#include "nsIDOMHTMLImageElement.h"
+#include "nsIDOMHTMLInputElement.h"
+#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMDataContainerEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsIDOMXULMultSelectCntrlEl.h"
+#include "nsIDOMXULPopupElement.h"
#include "nsIDocument.h"
#include "nsEventListenerManager.h"
#include "nsIFrame.h"
@@ -252,9 +262,9 @@ RootAccessible::DocumentActivated(DocAccessible* aDocument)
NS_IMETHODIMP
RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
{
- MOZ_ASSERT(aDOMEvent);
+ nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
- aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
+ DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
if (!origTargetNode)
return NS_OK;
@@ -289,9 +299,9 @@ RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
void
RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
{
- MOZ_ASSERT(aDOMEvent);
+ nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
- aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
+ DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
nsAutoString eventType;
View
1 b2g/app/b2g.js
@@ -68,6 +68,7 @@ pref("mozilla.widget.force-24bpp", true);
pref("mozilla.widget.use-buffer-pixmap", true);
pref("mozilla.widget.disable-native-theme", true);
pref("layout.reflow.synthMouseMove", false);
+pref("dom.send_after_paint_to_content", true);
/* download manager (don't show the window or alert) */
pref("browser.download.useDownloadDir", true);
View
16 browser/base/content/test/browser_gestureSupport.js
@@ -67,13 +67,13 @@ function test_gestureListener(evt)
is(evt.delta, test_expectedDelta,
"evt.delta (" + evt.delta + ") does not match expected value");
- is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.SHIFT_MASK) != 0,
+ is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.SHIFT_MASK) != 0,
"evt.shiftKey did not match expected value");
- is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.CONTROL_MASK) != 0,
+ is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.CONTROL_MASK) != 0,
"evt.ctrlKey did not match expected value");
- is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.ALT_MASK) != 0,
+ is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.ALT_MASK) != 0,
"evt.altKey did not match expected value");
- is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.META_MASK) != 0,
+ is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.META_MASK) != 0,
"evt.metaKey did not match expected value");
if (evt.type == "MozTapGesture") {
@@ -158,19 +158,19 @@ function test_TestEventListeners()
e("MozEdgeUIGesture", 0, 0, 0);
// event.shiftKey
- let modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
+ let modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
// event.metaKey
- modifier = Components.interfaces.nsIDOMEvent.META_MASK;
+ modifier = Components.interfaces.nsIDOMNSEvent.META_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
// event.altKey
- modifier = Components.interfaces.nsIDOMEvent.ALT_MASK;
+ modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
// event.ctrlKey
- modifier = Components.interfaces.nsIDOMEvent.CONTROL_MASK;
+ modifier = Components.interfaces.nsIDOMNSEvent.CONTROL_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
}
View
25 browser/components/sessionstore/src/Makefile.in
@@ -8,7 +8,6 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/config/config.mk
EXTRA_COMPONENTS = \
nsSessionStore.manifest \
@@ -19,16 +18,24 @@ EXTRA_PP_COMPONENTS = \
nsSessionStartup.js \
$(NULL)
-JS_MODULES_PATH := $(FINAL_TARGET)/modules/sessionstore
+libs::
+ $(NSINSTALL) $(srcdir)/*.jsm $(FINAL_TARGET)/modules/sessionstore
-EXTRA_JS_MODULES := \
- DocumentUtils.jsm \
- SessionStorage.jsm \
- XPathGenerator.jsm \
- $(NULL)
-
-EXTRA_PP_JS_MODULES := \
+SS_EXTRA_PP_JS_MODULES = \
SessionStore.jsm \
$(NULL)
+ifdef SS_EXTRA_PP_JS_MODULES
+libs:: $(SS_EXTRA_PP_JS_MODULES)
+ifndef NO_DIST_INSTALL
+ $(EXIT_ON_ERROR) \
+ $(NSINSTALL) -D $(FINAL_TARGET)/modules/sessionstore; \
+ for i in $^; do \
+ dest=$(FINAL_TARGET)/modules/sessionstore/`basename $$i`; \
+ $(RM) -f $$dest; \
+ $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
+ done
+endif
+endif
+
include $(topsrcdir)/config/rules.mk
View
11 config/rules.mk
@@ -1384,14 +1384,11 @@ libs::
endif
################################################################################
-# Copy each element of EXTRA_JS_MODULES to JS_MODULES_PATH, or
-# $(FINAL_TARGET)/modules if that isn't defined.
-JS_MODULES_PATH ?= $(FINAL_TARGET)/modules
-
+# Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
ifdef EXTRA_JS_MODULES
libs:: $(EXTRA_JS_MODULES)
ifndef NO_DIST_INSTALL
- $(call install_cmd,$(IFLAGS1) $^ $(JS_MODULES_PATH))
+ $(call install_cmd,$(IFLAGS1) $^ $(FINAL_TARGET)/modules)
endif
endif
@@ -1400,9 +1397,9 @@ ifdef EXTRA_PP_JS_MODULES
libs:: $(EXTRA_PP_JS_MODULES)
ifndef NO_DIST_INSTALL
$(EXIT_ON_ERROR) \
- $(NSINSTALL) -D $(JS_MODULES_PATH); \
+ $(NSINSTALL) -D $(FINAL_TARGET)/modules; \
for i in $^; do \
- dest=$(JS_MODULES_PATH)/`basename $$i`; \
+ dest=$(FINAL_TARGET)/modules/`basename $$i`; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
done
View
38 content/base/public/nsContentUtils.h
@@ -2019,44 +2019,6 @@ class nsContentUtils
*/
static bool IsJavaScriptLanguage(const nsString& aName, PRUint32 *aVerFlags);
- /**
- * Returns the JSVersion for a string of the form '1.n', n = 0, ..., 8, and
- * JSVERSION_UNKNOWN for other strings.
- */
- static JSVersion ParseJavascriptVersion(const nsAString& aVersionStr);
-
- static bool IsJavascriptMIMEType(const nsAString& aMIMEType)
- {
- // Table ordered from most to least likely JS MIME types.
- static const char* jsTypes[] = {
- "text/javascript",
- "text/ecmascript",
- "application/javascript",
- "application/ecmascript",
- "application/x-javascript",
- "application/x-ecmascript",
- "text/javascript1.0",
- "text/javascript1.1",
- "text/javascript1.2",
- "text/javascript1.3",
- "text/javascript1.4",
- "text/javascript1.5",
- "text/jscript",
- "text/livescript",
- "text/x-ecmascript",
- "text/x-javascript",
- nullptr
- };
-
- for (PRUint32 i = 0; jsTypes[i]; ++i) {
- if (aMIMEType.LowerCaseEqualsASCII(jsTypes[i])) {
- return true;
- }
- }
-
- return false;
- }
-
static void SplitMimeType(const nsAString& aValue, nsString& aType,
nsString& aParams);
View
46 content/base/src/nsAttrAndChildArray.cpp
@@ -444,8 +444,10 @@ nsAttrAndChildArray::RemoveAttrAt(PRUint32 aPos, nsAttrValue& aValue)
return NS_OK;
}
- nsRefPtr<nsMappedAttributes> mapped =
- GetModifiableMapped(nullptr, nullptr, false);
+ nsRefPtr<nsMappedAttributes> mapped;
+ nsresult rv = GetModifiableMapped(nullptr, nullptr, false,
+ getter_AddRefs(mapped));
+ NS_ENSURE_SUCCESS(rv, rv);
mapped->RemoveAttrAt(aPos, aValue);
@@ -556,15 +558,18 @@ nsAttrAndChildArray::SetAndTakeMappedAttr(nsIAtom* aLocalName,
nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet)
{
+ nsRefPtr<nsMappedAttributes> mapped;
+
bool willAdd = true;
if (mImpl && mImpl->mMappedAttrs) {
- willAdd = !mImpl->mMappedAttrs->GetAttr(aLocalName);
+ willAdd = mImpl->mMappedAttrs->GetAttr(aLocalName) == nullptr;
}
- nsRefPtr<nsMappedAttributes> mapped =
- GetModifiableMapped(aContent, aSheet, willAdd);
+ nsresult rv = GetModifiableMapped(aContent, aSheet, willAdd,
+ getter_AddRefs(mapped));
+ NS_ENSURE_SUCCESS(rv, rv);
- nsresult rv = mapped->SetAndTakeAttr(aLocalName, aValue);
+ rv = mapped->SetAndTakeAttr(aLocalName, aValue);
NS_ENSURE_SUCCESS(rv, rv);
return MakeMappedUnique(mapped);
@@ -579,8 +584,10 @@ nsAttrAndChildArray::DoSetMappedAttrStyleSheet(nsHTMLStyleSheet* aSheet)
return NS_OK;
}
- nsRefPtr<nsMappedAttributes> mapped =
- GetModifiableMapped(nullptr, nullptr, false);
+ nsRefPtr<nsMappedAttributes> mapped;
+ nsresult rv = GetModifiableMapped(nullptr, nullptr, false,
+ getter_AddRefs(mapped));
+ NS_ENSURE_SUCCESS(rv, rv);
mapped->SetStyleSheet(aSheet);
@@ -690,20 +697,33 @@ nsAttrAndChildArray::MappedAttrCount() const
return mImpl && mImpl->mMappedAttrs ? (PRUint32)mImpl->mMappedAttrs->Count() : 0;
}
-nsMappedAttributes*
+nsresult
nsAttrAndChildArray::GetModifiableMapped(nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet,
- bool aWillAddAttr)
+ bool aWillAddAttr,
+ nsMappedAttributes** aModifiable)
{
+ *aModifiable = nullptr;
+
if (mImpl && mImpl->mMappedAttrs) {
- return mImpl->mMappedAttrs->Clone(aWillAddAttr);
+ *aModifiable = mImpl->mMappedAttrs->Clone(aWillAddAttr);
+ NS_ENSURE_TRUE(*aModifiable, NS_ERROR_OUT_OF_MEMORY);
+
+ NS_ADDREF(*aModifiable);
+
+ return NS_OK;
}
- MOZ_ASSERT(aContent, "Trying to create modifiable without content");
+ NS_ASSERTION(aContent, "Trying to create modifiable without content");
nsMapRuleToAttributesFunc mapRuleFunc =
aContent->GetAttributeMappingFunction();
- return new nsMappedAttributes(aSheet, mapRuleFunc);
+ *aModifiable = new nsMappedAttributes(aSheet, mapRuleFunc);
+ NS_ENSURE_TRUE(*aModifiable, NS_ERROR_OUT_OF_MEMORY);
+
+ NS_ADDREF(*aModifiable);
+
+ return NS_OK;
}
nsresult
View
9 content/base/src/nsAttrAndChildArray.h
@@ -127,11 +127,10 @@ class nsAttrAndChildArray
PRUint32 NonMappedAttrCount() const;
PRUint32 MappedAttrCount() const;
- // Returns a non-null zero-refcount object.
- nsMappedAttributes*
- GetModifiableMapped(nsMappedAttributeElement* aContent,
- nsHTMLStyleSheet* aSheet,
- bool aWillAddAttr);
+ nsresult GetModifiableMapped(nsMappedAttributeElement* aContent,
+ nsHTMLStyleSheet* aSheet,
+ bool aWillAddAttr,
+ nsMappedAttributes** aModifiable);
nsresult MakeMappedUnique(nsMappedAttributes* aAttributes);
PRUint32 AttrSlotsSize() const
View
13 content/base/src/nsContentAreaDragDrop.cpp
@@ -19,6 +19,7 @@
#include "nsIDOMNode.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsIDOMDragEvent.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMDocument.h"
@@ -56,7 +57,7 @@
class NS_STACK_CLASS DragDataProducer
{
public:
- DragDataProducer(nsPIDOMWindow* aWindow,
+ DragDataProducer(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed);
@@ -84,7 +85,7 @@ class NS_STACK_CLASS DragDataProducer
static void GetSelectedLink(nsISelection* inSelection,
nsIContent **outLinkNode);
- nsCOMPtr<nsPIDOMWindow> mWindow;
+ nsCOMPtr<nsIDOMWindow> mWindow;
nsCOMPtr<nsIContent> mTarget;
nsCOMPtr<nsIContent> mSelectionTargetNode;
bool mIsAltKeyPressed;
@@ -104,7 +105,7 @@ class NS_STACK_CLASS DragDataProducer
nsresult
-nsContentAreaDragDrop::GetDragData(nsPIDOMWindow* aWindow,
+nsContentAreaDragDrop::GetDragData(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed,
@@ -238,7 +239,7 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
return rv;
}
-DragDataProducer::DragDataProducer(nsPIDOMWindow* aWindow,
+DragDataProducer::DragDataProducer(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed)
@@ -648,7 +649,9 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
mInfoString.Truncate();
mTitleString.Truncate();
- nsCOMPtr<nsIDocument> doc = mWindow->GetDoc();
+ nsCOMPtr<nsIDOMDocument> domDoc;
+ mWindow->GetDocument(getter_AddRefs(domDoc));
+ nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
// if we have selected text, use it in preference to the node
View
4 content/base/src/nsContentAreaDragDrop.h
@@ -14,7 +14,7 @@
#include "nsITransferable.h"
class nsIDOMNode;
-class nsPIDOMWindow;
+class nsIDOMWindow;
class nsIDOMDragEvent;
class nsISelection;
class nsITransferable;
@@ -49,7 +49,7 @@ class nsContentAreaDragDrop
* aDragNode - [out] the link, image or area being dragged, or null if the
* drag occurred on another element.
*/
- static nsresult GetDragData(nsPIDOMWindow* aWindow,
+ static nsresult GetDragData(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed,
View
28 content/base/src/nsContentUtils.cpp
@@ -88,6 +88,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#include "nsContentErrors.h"
#include "nsUnicharUtilCIID.h"
#include "nsINativeKeyBindings.h"
+#include "nsIDOMNSEvent.h"
#include "nsXULPopupManager.h"
#include "nsIPermissionManager.h"
#include "nsIScriptObjectPrincipal.h"
@@ -844,28 +845,6 @@ nsContentUtils::IsJavaScriptLanguage(const nsString& aName, PRUint32 *aFlags)
return true;
}
-JSVersion
-nsContentUtils::ParseJavascriptVersion(const nsAString& aVersionStr)
-{
- if (aVersionStr.Length() != 3 || aVersionStr[0] != '1' ||
- aVersionStr[1] != '.') {
- return JSVERSION_UNKNOWN;
- }
-
- switch (aVersionStr[2]) {
- case '0': return JSVERSION_1_0;
- case '1': return JSVERSION_1_1;
- case '2': return JSVERSION_1_2;
- case '3': return JSVERSION_1_3;
- case '4': return JSVERSION_1_4;
- case '5': return JSVERSION_1_5;
- case '6': return JSVERSION_1_6;
- case '7': return JSVERSION_1_7;
- case '8': return JSVERSION_1_8;
- default: return JSVERSION_UNKNOWN;
- }
-}
-
void
nsContentUtils::SplitMimeType(const nsAString& aValue, nsString& aType,
nsString& aParams)
@@ -4688,13 +4667,14 @@ nsContentUtils::DOMEventToNativeKeyEvent(nsIDOMKeyEvent* aKeyEvent,
nsNativeKeyEvent* aNativeEvent,
bool aGetCharCode)
{
+ nsCOMPtr<nsIDOMNSEvent> nsevent = do_QueryInterface(aKeyEvent);
bool defaultPrevented;
- aKeyEvent->GetPreventDefault(&defaultPrevented);
+ nsevent->GetPreventDefault(&defaultPrevented);
if (defaultPrevented)
return false;
bool trusted = false;
- aKeyEvent->GetIsTrusted(&trusted);
+ nsevent->GetIsTrusted(&trusted);
if (!trusted)
return false;
View
101 content/base/src/nsDocument.cpp
@@ -2262,6 +2262,7 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
// is probably the right thing to do.
// Now reset our inline style and attribute sheets.
+ nsresult rv = NS_OK;
if (mAttrStyleSheet) {
// Remove this sheet from all style sets
nsCOMPtr<nsIPresShell> shell = GetShell();
@@ -2271,8 +2272,11 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
}
mAttrStyleSheet->Reset(aURI);
} else {
- mAttrStyleSheet = new nsHTMLStyleSheet(aURI, this);
- NS_ADDREF(mAttrStyleSheet);
+ rv = NS_NewHTMLStyleSheet(&mAttrStyleSheet, aURI, this);
+ if (NS_FAILED(rv)) {
+ NS_IF_RELEASE(mAttrStyleSheet);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
}
// Don't use AddStyleSheet, since it'll put the sheet into style
@@ -2289,7 +2293,8 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
mStyleAttrStyleSheet->Reset(aURI);
} else {
mStyleAttrStyleSheet = new nsHTMLCSSStyleSheet();
- nsresult rv = mStyleAttrStyleSheet->Init(aURI, this);
+ NS_ENSURE_TRUE(mStyleAttrStyleSheet, NS_ERROR_OUT_OF_MEMORY);
+ rv = mStyleAttrStyleSheet->Init(aURI, this);
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -2303,7 +2308,7 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
FillStyleSet(shell->StyleSet());
}
- return NS_OK;
+ return rv;
}
void
@@ -6414,44 +6419,15 @@ nsDocument::IsScriptEnabled()
}
nsRadioGroupStruct*
-nsDocument::GetRadioGroupInternal(const nsAString& aName) const
-{
-#ifdef DEBUG
- if (IsHTML()) {
- nsAutoString lcName;
- ToLowerCase(aName, lcName);
- MOZ_ASSERT(aName == lcName);
- }
-#endif
-
- nsRadioGroupStruct* radioGroup;
- if (!mRadioGroups.Get(aName, &radioGroup)) {
- return nullptr;
- }
-
- return radioGroup;
-}
-
-nsRadioGroupStruct*
-nsDocument::GetRadioGroup(const nsAString& aName) const
-{
- nsAutoString tmKey(aName);
- if (IsHTML()) {
- ToLowerCase(tmKey); //should case-insensitive.
- }
-
- return GetRadioGroupInternal(tmKey);
-}
-
-nsRadioGroupStruct*
-nsDocument::GetOrCreateRadioGroup(const nsAString& aName)
+nsDocument::GetRadioGroup(const nsAString& aName)
{
nsAutoString tmKey(aName);
if (IsHTML()) {
ToLowerCase(tmKey); //should case-insensitive.
}
- if (nsRadioGroupStruct* radioGroup = GetRadioGroupInternal(tmKey)) {
+ nsRadioGroupStruct* radioGroup;
+ if (mRadioGroups.Get(tmKey, &radioGroup)) {
return radioGroup;
}
@@ -6465,7 +6441,9 @@ NS_IMETHODIMP
nsDocument::SetCurrentRadioButton(const nsAString& aName,
nsIDOMHTMLInputElement* aRadio)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ NS_ENSURE_TRUE(radioGroup, NS_OK);
+
radioGroup->mSelectedRadioButton = aRadio;
return NS_OK;
}
@@ -6474,7 +6452,9 @@ NS_IMETHODIMP
nsDocument::GetCurrentRadioButton(const nsAString& aName,
nsIDOMHTMLInputElement** aRadio)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ NS_ENSURE_TRUE(radioGroup, NS_OK);
+
*aRadio = radioGroup->mSelectedRadioButton;
NS_IF_ADDREF(*aRadio);
return NS_OK;
@@ -6492,7 +6472,8 @@ nsDocument::GetNextRadioButton(const nsAString& aName,
// opposed to nsHTMLDocument?
*aRadioOut = nullptr;
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ NS_ENSURE_TRUE(radioGroup, NS_ERROR_FAILURE);
// Return the radio button relative to the focused radio button.
// If no radio is focused, get the radio relative to the selected one.
@@ -6537,7 +6518,8 @@ NS_IMETHODIMP
nsDocument::AddToRadioGroup(const nsAString& aName,
nsIFormControl* aRadio)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ NS_ENSURE_TRUE(radioGroup, NS_OK);
radioGroup->mRadioButtons.AppendObject(aRadio);
@@ -6553,7 +6535,8 @@ NS_IMETHODIMP
nsDocument::RemoveFromRadioGroup(const nsAString& aName,
nsIFormControl* aRadio)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ NS_ENSURE_TRUE(radioGroup, NS_OK);
radioGroup->mRadioButtons.RemoveObject(aRadio);
@@ -6572,7 +6555,8 @@ nsDocument::WalkRadioGroup(const nsAString& aName,
nsIRadioVisitor* aVisitor,
bool aFlushContent)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ NS_ENSURE_TRUE(radioGroup, NS_OK);
for (int i = 0; i < radioGroup->mRadioButtons.Count(); i++) {
if (!aVisitor->Visit(radioGroup->mRadioButtons[i])) {
@@ -6586,14 +6570,26 @@ nsDocument::WalkRadioGroup(const nsAString& aName,
PRUint32
nsDocument::GetRequiredRadioCount(const nsAString& aName) const
{
- nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = nullptr;
+ // TODO: we should call GetRadioGroup here (and make it const) but for that
+ // we would need to have an explicit CreateRadioGroup() instead of create
+ // one when GetRadioGroup is called. See bug 636123.
+ nsAutoString tmKey(aName);
+ if (IsHTML())
+ ToLowerCase(tmKey); //should case-insensitive.
+ mRadioGroups.Get(tmKey, &radioGroup);
+
return radioGroup ? radioGroup->mRequiredRadioCount : 0;
}
void
nsDocument::RadioRequiredChanged(const nsAString& aName, nsIFormControl* aRadio)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+
+ if (!radioGroup) {
+ return;
+ }
nsCOMPtr<nsIContent> element = do_QueryInterface(aRadio);
NS_ASSERTION(element, "radio controls have to be content elements");
@@ -6609,14 +6605,27 @@ nsDocument::RadioRequiredChanged(const nsAString& aName, nsIFormControl* aRadio)
bool
nsDocument::GetValueMissingState(const nsAString& aName) const
{
- nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = nullptr;
+ // TODO: we should call GetRadioGroup here (and make it const) but for that
+ // we would need to have an explicit CreateRadioGroup() instead of create
+ // one when GetRadioGroup is called. See bug 636123.
+ nsAutoString tmKey(aName);
+ if (IsHTML())
+ ToLowerCase(tmKey); //should case-insensitive.
+ mRadioGroups.Get(tmKey, &radioGroup);
+
return radioGroup && radioGroup->mGroupSuffersFromValueMissing;
}
void
nsDocument::SetValueMissingState(const nsAString& aName, bool aValue)
{
- nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName);
+ nsRadioGroupStruct* radioGroup = GetRadioGroup(aName);
+
+ if (!radioGroup) {
+ return;
+ }
+
radioGroup->mGroupSuffersFromValueMissing = aValue;
}
View
7 content/base/src/nsDocument.h
@@ -723,13 +723,8 @@ class nsDocument : public nsIDocument,
virtual void SetValueMissingState(const nsAString& aName, bool aValue);
// for radio group
- nsRadioGroupStruct* GetRadioGroup(const nsAString& aName) const;
- nsRadioGroupStruct* GetOrCreateRadioGroup(const nsAString& aName);
+ nsRadioGroupStruct* GetRadioGroup(const nsAString& aName);
-private:
- nsRadioGroupStruct* GetRadioGroupInternal(const nsAString& aName) const;
-
-public:
// nsIDOMNode
NS_DECL_NSIDOMNODE
View
5 content/base/src/nsINode.cpp
@@ -437,11 +437,10 @@ nsINode::RemoveChild(nsINode *aOldChild)
}
if (IsNodeOfType(eDATA_NODE)) {
- // aOldChild can't be one of our children.
- return NS_ERROR_DOM_NOT_FOUND_ERR;
+ return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
}
- if (aOldChild->GetNodeParent() == this) {
+ if (aOldChild && aOldChild->GetNodeParent() == this) {
nsContentUtils::MaybeFireNodeRemoved(aOldChild, this, OwnerDoc());
}
View
4 content/base/src/nsMappedAttributes.cpp
@@ -68,7 +68,9 @@ void* nsMappedAttributes::operator new(size_t aSize, PRUint32 aAttrCount) CPP_TH
aAttrCount * sizeof(InternalAttr));
#ifdef DEBUG
- static_cast<nsMappedAttributes*>(newAttrs)->mBufferSize = aAttrCount;
+ if (newAttrs) {
+ static_cast<nsMappedAttributes*>(newAttrs)->mBufferSize = aAttrCount;
+ }
#endif
return newAttrs;
View
2 content/base/src/nsMappedAttributes.h
@@ -26,8 +26,8 @@ class nsMappedAttributes MOZ_FINAL : public nsIStyleRule
nsMappedAttributes(nsHTMLStyleSheet* aSheet,
nsMapRuleToAttributesFunc aMapRuleFunc);
- // Do not return null.
void* operator new(size_t size, PRUint32 aAttrCount = 1) CPP_THROW_NEW;
+
nsMappedAttributes* Clone(bool aWillAddAttr);
NS_DECL_ISUPPORTS
View
2 content/base/src/nsRange.cpp
@@ -1839,7 +1839,7 @@ nsRange::CompareBoundaryPoints(PRUint16 aHow, nsIDOMRange* aOtherRange,
break;
default:
// We were passed an illegal value
- return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
+ return NS_ERROR_ILLEGAL_VALUE;
}
if (mRoot != otherRange->GetRoot())
View
150 content/base/src/nsScriptLoader.cpp
@@ -352,50 +352,6 @@ class nsScriptRequestProcessor : public nsRunnable
}
};
-static inline bool
-ParseTypeAttribute(const nsAString& aType, JSVersion* aVersion)
-{
- MOZ_ASSERT(!aType.IsEmpty());
- MOZ_ASSERT(aVersion);
- MOZ_ASSERT(*aVersion == JSVERSION_DEFAULT);
-
- nsContentTypeParser parser(aType);
-
- nsAutoString mimeType;
- nsresult rv = parser.GetType(mimeType);
- NS_ENSURE_SUCCESS(rv, false);
-
- if (!nsContentUtils::IsJavascriptMIMEType(mimeType)) {
- return false;
- }
-
- // Get the version string, and ensure the language supports it.
- nsAutoString versionName;
- rv = parser.GetParameter("version", versionName);
-
- if (NS_SUCCEEDED(rv)) {
- *aVersion = nsContentUtils::ParseJavascriptVersion(versionName);
- } else if (rv != NS_ERROR_INVALID_ARG) {
- return false;
- }
-
- nsAutoString value;
- rv = parser.GetParameter("e4x", value);
- if (NS_SUCCEEDED(rv)) {
- if (value.Length() == 1 && value[0] == '1') {
- // This happens in about 2 web pages. Enable E4X no matter what JS
- // version number was selected. We do this by turning on the "moar
- // XML" version bit. This is OK even if version has
- // JSVERSION_UNKNOWN (-1).
- *aVersion = js::VersionSetMoarXML(*aVersion, true);
- }
- } else if (rv != NS_ERROR_INVALID_ARG) {
- return false;
- }
-
- return true;
-}
-
bool
nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
{
@@ -437,38 +393,126 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
return false;
}
- JSVersion version = JSVERSION_DEFAULT;
+ PRUint32 typeID = nsIProgrammingLanguage::JAVASCRIPT;
+ PRUint32 version = 0;
+ nsAutoString language, type, src;
+ nsresult rv = NS_OK;
// Check the type attribute to determine language and version.
// If type exists, it trumps the deprecated 'language='
- nsAutoString type;
aElement->GetScriptType(type);
if (!type.IsEmpty()) {
- NS_ENSURE_TRUE(ParseTypeAttribute(type, &version), false);
+ nsContentTypeParser parser(type);
+
+ nsAutoString mimeType;
+ rv = parser.GetType(mimeType);
+ NS_ENSURE_SUCCESS(rv, false);
+
+ // Javascript keeps the fast path, optimized for most-likely type
+ // Table ordered from most to least likely JS MIME types.
+ // See bug 62485, feel free to add <script type="..."> survey data to it,
+ // or to a new bug once 62485 is closed.
+ static const char *jsTypes[] = {
+ "text/javascript",
+ "text/ecmascript",
+ "application/javascript",
+ "application/ecmascript",
+ "application/x-javascript",
+ nullptr
+ };
+
+ bool isJavaScript = false;
+ for (PRInt32 i = 0; jsTypes[i]; i++) {
+ if (mimeType.LowerCaseEqualsASCII(jsTypes[i])) {
+ isJavaScript = true;
+ break;
+ }
+ }
+
+ if (!isJavaScript) {
+ typeID = nsIProgrammingLanguage::UNKNOWN;
+ }
+
+ if (typeID != nsIProgrammingLanguage::UNKNOWN) {
+ // Get the version string, and ensure the language supports it.
+ nsAutoString versionName;
+ rv = parser.GetParameter("version", versionName);
+ if (NS_FAILED(rv)) {
+ // no version attribute - version remains 0.
+ if (rv != NS_ERROR_INVALID_ARG)
+ return false;
+ } else {
+ nsCOMPtr<nsIScriptRuntime> runtime;
+ rv = NS_GetJSRuntime(getter_AddRefs(runtime));
+ if (NS_FAILED(rv)) {
+ NS_ERROR("Failed to locate the language with this ID");
+ return false;
+ }
+ rv = runtime->ParseVersion(versionName, &version);
+ if (NS_FAILED(rv)) {
+ NS_WARNING("This script language version is not supported - ignored");
+ typeID = nsIProgrammingLanguage::UNKNOWN;
+ }
+ }
+ }
+
+ // Some js specifics yet to be abstracted.
+ if (typeID == nsIProgrammingLanguage::JAVASCRIPT) {
+ nsAutoString value;
+ rv = parser.GetParameter("e4x", value);
+ if (NS_FAILED(rv)) {
+ if (rv != NS_ERROR_INVALID_ARG)
+ return false;
+ } else {
+ if (value.Length() == 1 && value[0] == '1')
+ // This happens in about 2 web pages. Enable E4X no matter what JS
+ // version number was selected. We do this by turning on the "moar
+ // XML" version bit. This is OK even if version has
+ // JSVERSION_UNKNOWN (-1).
+ version = js::VersionSetMoarXML(JSVersion(version), true);
+ }
+ }
} else {
// no 'type=' element
// "language" is a deprecated attribute of HTML, so we check it only for
// HTML script elements.
if (scriptContent->IsHTML()) {
- nsAutoString language;
scriptContent->GetAttr(kNameSpaceID_None, nsGkAtoms::language, language);
if (!language.IsEmpty()) {
+ if (nsContentUtils::IsJavaScriptLanguage(language, &version))
+ typeID = nsIProgrammingLanguage::JAVASCRIPT;
+ else
+ typeID = nsIProgrammingLanguage::UNKNOWN;
// IE, Opera, etc. do not respect language version, so neither should
// we at this late date in the browser wars saga. Note that this change
// affects HTML but not XUL or SVG (but note also that XUL has its own
// code to check nsContentUtils::IsJavaScriptLanguage -- that's probably
// a separate bug, one we may not be able to fix short of XUL2). See
// bug 255895 (https://bugzilla.mozilla.org/show_bug.cgi?id=255895).
- PRUint32 dummy;
- if (!nsContentUtils::IsJavaScriptLanguage(language, &dummy)) {
- return false;
- }
+ NS_ASSERTION(JSVERSION_DEFAULT == 0,
+ "We rely on all languages having 0 as a version default");
+ version = 0;
}
}
}
+ // If we don't know the language, we don't know how to evaluate
+ if (typeID == nsIProgrammingLanguage::UNKNOWN) {
+ return false;
+ }
+ // If not from a chrome document (which is always trusted), we need some way
+ // of checking the language is "safe". Currently the only other language
+ // impl is Python, and that is *not* safe in untrusted code - so fixing
+ // this isn't a priority.!
+ // See also similar code in nsXULContentSink.cpp
+ if (typeID != nsIProgrammingLanguage::JAVASCRIPT &&
+ !nsContentUtils::IsChromeDoc(mDocument)) {
+ NS_WARNING("Untrusted language called from non-chrome - ignored");
+ return false;
+ }
+
// Step 14. in the HTML5 spec
- nsresult rv = NS_OK;
+
nsRefPtr<nsScriptLoadRequest> request;
if (aElement->GetScriptExternal()) {
// external script
View
4 content/base/src/nsTreeSanitizer.cpp
@@ -1120,7 +1120,9 @@ nsTreeSanitizer::SanitizeStyleSheet(const nsAString& aOriginal,
// -moz-binding is blacklisted.
bool didSanitize = false;
// Create a sheet to hold the parsed CSS
- nsRefPtr<nsCSSStyleSheet> sheet = new nsCSSStyleSheet();
+ nsRefPtr<nsCSSStyleSheet> sheet;
+ rv = NS_NewCSSStyleSheet(getter_AddRefs(sheet));
+ NS_ENSURE_SUCCESS(rv, true);
sheet->SetURIs(aDocument->GetDocumentURI(), nullptr, aBaseURI);
sheet->SetPrincipal(aDocument->NodePrincipal());
// Create the CSS parser, and parse the CSS text.
View
31 content/base/src/nsXMLHttpRequest.cpp
@@ -3175,21 +3175,15 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable<RequestBody>& aBody)
}
/* void setRequestHeader (in AUTF8String header, in AUTF8String value); */
-// http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader
NS_IMETHODIMP
nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
const nsACString& value)
{
- // Step 1 and 2
- if (!(mState & XML_HTTP_REQUEST_OPENED)) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
- NS_ASSERTION(mChannel, "mChannel must be valid if we're OPENED.");
+ nsresult rv;
- // Step 3
// Make sure we don't store an invalid header name in mCORSUnsafeHeaders
- if (!IsValidHTTPToken(header)) { // XXX nsHttp::IsValidToken?
- return NS_ERROR_DOM_SYNTAX_ERR;
+ if (!IsValidHTTPToken(header)) {
+ return NS_ERROR_FAILURE;
}
// Check that we haven't already opened the channel. We can't rely on
@@ -3197,7 +3191,7 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
// still be waiting for mCORSPreflightChannel to actually open mChannel
if (mCORSPreflightChannel) {
bool pending;
- nsresult rv = mCORSPreflightChannel->IsPending(&pending);
+ rv = mCORSPreflightChannel->IsPending(&pending);
NS_ENSURE_SUCCESS(rv, rv);
if (pending) {
@@ -3205,10 +3199,13 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
}
}
+ if (!(mState & XML_HTTP_REQUEST_OPENED))
+ return NS_ERROR_IN_PROGRESS;
+
if (!mChannel) // open() initializes mChannel, and open()
return NS_ERROR_FAILURE; // must be called before first setRequestHeader()
- nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
+ nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
if (!httpChannel) {
return NS_OK;
}
@@ -3217,11 +3214,12 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
// the executing script has UniversalXPConnect.
bool privileged;
- if (NS_FAILED(IsCapabilityEnabled("UniversalXPConnect", &privileged)))
+ rv = IsCapabilityEnabled("UniversalXPConnect", &privileged);
+ if (NS_FAILED(rv))
return NS_ERROR_FAILURE;
if (!privileged) {
- // Step 5: Check for dangerous headers.
+ // Check for dangerous headers
const char *kInvalidHeaders[] = {
"accept-charset", "accept-encoding", "access-control-request-headers",
"access-control-request-method", "connection", "content-length",
@@ -3266,10 +3264,7 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
}
// We need to set, not add to, the header.
- nsresult rv = httpChannel->SetRequestHeader(header, value, false);
- if (rv == NS_ERROR_INVALID_ARG) {
- return NS_ERROR_DOM_SYNTAX_ERR;
- }
+ rv = httpChannel->SetRequestHeader(header, value, false);
if (NS_SUCCEEDED(rv)) {
// We'll want to duplicate this header for any replacement channels (eg. on redirect)
RequestHeader reqHeader = {
@@ -3277,6 +3272,7 @@ nsXMLHttpRequest::SetRequestHeader(const nsACString& header,
};
mModifiedRequestHeaders.AppendElement(reqHeader);
}
+
return rv;
}
@@ -4015,6 +4011,7 @@ DOMCI_DATA(XMLHttpProgressEvent, nsXMLHttpProgressEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXMLHttpProgressEvent)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMProgressEvent)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEvent, nsIDOMProgressEvent)
+ NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMProgressEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMLSProgressEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XMLHttpProgressEvent)
View
13 content/base/src/nsXMLHttpRequest.h
@@ -26,6 +26,7 @@
#include "nsTArray.h"
#include "nsIJSNativeInitializer.h"
#include "nsIDOMLSProgressEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsITimer.h"
#include "nsDOMProgressEvent.h"
#include "nsDOMEventTargetHelper.h"
@@ -34,13 +35,13 @@
#include "nsDOMBlobBuilder.h"
#include "nsIPrincipal.h"
#include "nsIScriptObjectPrincipal.h"
-
-#include "mozilla/Assertions.h"
#include "mozilla/dom/BindingUtils.h"
-#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/XMLHttpRequestBinding.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
+#include "mozilla/Assertions.h"
+#include "mozilla/dom/TypedArray.h"
+
class nsILoadGroup;
class AsyncVerifyRedirectCallbackForwarder;
class nsIUnicodeDecoder;
@@ -709,7 +710,8 @@ class nsXMLHttpRequest : public nsXHREventTarget,
// helper class to expose a progress DOM Event
class nsXMLHttpProgressEvent : public nsIDOMProgressEvent,
- public nsIDOMLSProgressEvent
+ public nsIDOMLSProgressEvent,
+ public nsIDOMNSEvent
{
public:
nsXMLHttpProgressEvent(nsIDOMProgressEvent* aInner,
@@ -719,8 +721,9 @@ class nsXMLHttpProgressEvent : public nsIDOMProgressEvent,
virtual ~nsXMLHttpProgressEvent();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpProgressEvent, nsIDOMProgressEvent)
+ NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXMLHttpProgressEvent, nsIDOMNSEvent)
NS_FORWARD_NSIDOMEVENT(mInner->)
+ NS_FORWARD_NSIDOMNSEVENT(mInner->)
NS_FORWARD_NSIDOMPROGRESSEVENT(mInner->)
NS_DECL_NSIDOMLSPROGRESSEVENT
View
3 content/events/src/nsDOMEvent.cpp
@@ -175,6 +175,7 @@ DOMCI_DATA(Event, nsDOMEvent)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEvent)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMEvent)
+ NS_INTERFACE_MAP_ENTRY(nsIDOMNSEvent)
NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Event)
NS_INTERFACE_MAP_END
@@ -535,7 +536,7 @@ NS_IMETHODIMP
nsDOMEvent::InitEvent(const nsAString& aEventTypeArg, bool aCanBubbleArg, bool aCancelableArg)
{
// Make sure this event isn't already being dispatched.
- NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(mEvent), NS_OK);
+ NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(mEvent), NS_ERROR_INVALID_ARG);
if (NS_IS_TRUSTED_EVENT(mEvent)) {
// Ensure the caller is permitted to dispatch trusted DOM events.
View
11 content/events/src/nsDOMEvent.h
@@ -7,6 +7,7 @@
#define nsDOMEvent_h__
#include "nsIDOMEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsISupports.h"
#include "nsCOMPtr.h"
#include "nsIDOMEventTarget.h"
@@ -23,6 +24,7 @@ struct JSContext;
struct JSObject;
class nsDOMEvent : public nsIDOMEvent,
+ public nsIDOMNSEvent,
public nsIJSNativeInitializer
{
public:
@@ -189,6 +191,9 @@ class nsDOMEvent : public nsIDOMEvent,
// nsIDOMEvent Interface
NS_DECL_NSIDOMEVENT
+ // nsIDOMNSEvent Interface
+ NS_DECL_NSIDOMNSEVENT
+
// nsIJSNativeInitializer
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
PRUint32 aArgc, jsval* aArgv);
@@ -246,12 +251,6 @@ class nsDOMEvent : public nsIDOMEvent,
NS_IMETHOD InitEvent(const nsAString & eventTypeArg, bool canBubbleArg, bool cancelableArg) { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
NS_IMETHOD GetDefaultPrevented(bool *aDefaultPrevented) { return _to GetDefaultPrevented(aDefaultPrevented); } \
NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \
- NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \
- NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
- NS_IMETHOD PreventBubble() { return _to PreventBubble(); } \
- NS_IMETHOD PreventCapture() { return _to PreventCapture(); } \
- NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \
- NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \
NS_IMETHOD_(bool) IsDispatchStopped(void) { return _to IsDispatchStopped(); } \
NS_IMETHOD_(nsEvent *) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
View
2 content/events/src/nsDOMUIEvent.h
@@ -29,6 +29,8 @@ class nsDOMUIEvent : public nsDOMEvent,
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter);
+ NS_FORWARD_NSIDOMNSEVENT(nsDOMEvent::)
+
virtual nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, jsval* aVal);
View
8 content/events/src/nsEventDispatcher.cpp
@@ -545,7 +545,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
return NS_ERROR_FAILURE;
}
- // Make sure that nsIDOMEvent::target and nsIDOMEvent::originalTarget
+ // Make sure that nsIDOMEvent::target and nsIDOMNSEvent::originalTarget
// point to the last item in the chain.
if (!aEvent->target) {
// Note, CurrentTarget() points always to the object returned by
@@ -682,8 +682,10 @@ nsEventDispatcher::DispatchDOMEvent(nsISupports* aTarget,
if (innerEvent->flags & NS_EVENT_DISPATCHED) {
innerEvent->target = nullptr;
innerEvent->originalTarget = nullptr;
- } else {
- aDOMEvent->GetIsTrusted(&dontResetTrusted);
+ }
+ else {
+ nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aDOMEvent));
+ nsevent->GetIsTrusted(&dontResetTrusted);
}
if (!dontResetTrusted) {
View
1 content/events/src/nsEventListenerManager.cpp
@@ -14,6 +14,7 @@
#include "nsDOMEvent.h"
#include "nsEventListenerManager.h"
#include "nsCaret.h"
+#include "nsIDOMNSEvent.h"
#include "nsIDOMEventListener.h"
#include "nsITextControlFrame.h"
#include "nsGkAtoms.h"
View
2 content/events/src/nsEventStateManager.cpp
@@ -2292,7 +2292,7 @@ nsEventStateManager::DetermineDragTarget(nsPresContext* aPresContext,
*aTargetNode = nullptr;
nsCOMPtr<nsISupports> container = aPresContext->GetContainer();
- nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(container);
+ nsCOMPtr<nsIDOMWindow> window = do_GetInterface(container);
if (!window)
return;
View
4 content/events/src/nsIMEStateManager.cpp
@@ -17,6 +17,7 @@
#include "nsPresContext.h"
#include "nsIDOMWindow.h"
#include "nsIDOMMouseEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsContentUtils.h"
#include "nsINode.h"
#include "nsIFrame.h"
@@ -201,7 +202,8 @@ nsIMEStateManager::OnClickInEditor(nsPresContext* aPresContext,
NS_ENSURE_TRUE(widget, );
bool isTrusted;
- nsresult rv = aMouseEvent->GetIsTrusted(&isTrusted);
+ nsCOMPtr<nsIDOMNSEvent> NSEvent = do_QueryInterface(aMouseEvent);
+ nsresult rv = NSEvent->GetIsTrusted(&isTrusted);
NS_ENSURE_SUCCESS(rv, );
if (!isTrusted) {
return; // ignore untrusted event.
View
3 content/events/test/Makefile.in
@@ -84,9 +84,8 @@ MOCHITEST_FILES = \
test_bug741666.html \
test_dom_keyboard_event.html \
test_dom_mouse_event.html \
- test_bug603008.html \
- test_bug716822.html \
test_bug742376.html \
+ test_bug603008.html \
$(NULL)
#bug 585630
View
2 content/events/test/test_bug238987.html
@@ -53,7 +53,7 @@
shouldStop = true;
}
} else if (e.target.id == "end") {
- modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
+ modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
} else if (modifier) {
var expected = backwardFocusArray.pop();
ok(expected == e.target.id,
View
4 content/events/test/test_bug409604.html
@@ -19,8 +19,8 @@
/** Test for Bug 409604 **/
- var modifier = Components.interfaces.nsIDOMEvent.ALT_MASK |
- Components.interfaces.nsIDOMEvent.SHIFT_MASK;
+ var modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK |
+ Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
var expectedFocus = "a,c,d,e,f,g,h,i,j,k,l,m,n,p,x,y";
// XXX the "map" test is causing trouble, see bug 433089
var focusArray = expectedFocus.split(",");
View
2 content/events/test/test_bug617528.xul
@@ -81,7 +81,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
browser.removeEventListener("contextmenu", onContextMenu1, false);
browser.addEventListener("contextmenu", onContextMenu2, false);
- var shiftMask = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
+ var shiftMask = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
wu.sendMouseEvent("contextmenu", left, top, 2, 1, shiftMask);
browser.removeEventListener("contextmenu", onContextMenu2, false);
View
28 content/events/test/test_bug716822.html
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=716822
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug 716822</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=716822">Mozilla Bug 716822</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script type="application/javascript">
-/** Test for Bug 716822 **/
-for (var p in window.NSEvent) {
- ok(p in window.Event, p + " should be in Event.");
- is(window.NSEvent[p], window.Event[p], "Value of " + p);
-}
-</script>
-</pre>
-</body>
-</html>
View
1 content/html/content/src/nsGenericHTMLElement.cpp
@@ -58,6 +58,7 @@
#include "nsGkAtoms.h"
#include "nsEventStateManager.h"
#include "nsIDOMEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsDOMCSSDeclaration.h"
#include "nsITextControlFrame.h"
#include "nsIForm.h"
View
1 content/html/content/src/nsHTMLButtonElement.cpp
@@ -19,6 +19,7 @@
#include "nsIFrame.h"
#include "nsIFormControlFrame.h"
#include "nsIDOMEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsIDocument.h"
#include "nsGUIEvent.h"
#include "nsUnicharUtils.h"
View
1 content/html/content/src/nsHTMLInputElement.cpp
@@ -46,6 +46,7 @@
#include "nsPresState.h"
#include "nsLayoutErrors.h"
#include "nsIDOMEvent.h"
+#include "nsIDOMNSEvent.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMHTMLCollection.h"
#include "nsLinebreakConverter.h" //to strip out carriage returns
View
5 content/xbl/src/nsXBLEventHandler.cpp
@@ -10,6 +10,7 @@
#include "nsIDOMKeyEvent.h"
#include "nsIDOMMouseEvent.h"
#include "nsXBLPrototypeHandler.h"
+#include "nsIDOMNSEvent.h"
#include "nsGUIEvent.h"
#include "nsContentUtils.h"
@@ -85,8 +86,10 @@ nsXBLKeyEventHandler::ExecuteMatchedHandlers(nsIDOMKeyEvent* aKeyEvent,
PRUint32 aCharCode,
bool aIgnoreShiftKey)
{
+ nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
bool trustedEvent = false;
- aKeyEvent->GetIsTrusted(&trustedEvent);
+ if (domNSEvent)
+ domNSEvent->GetIsTrusted(&trustedEvent);
nsCOMPtr<nsIDOMEventTarget> target;
aKeyEvent->GetCurrentTarget(getter_AddRefs(target));
View
25 content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -27,6 +27,7 @@
#include "nsEventListenerManager.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMEventListener.h"
+#include "nsIDOMNSEvent.h"
#include "nsPIDOMWindow.h"
#include "nsPIWindowRoot.h"
#include "nsIDOMWindow.h"
@@ -209,8 +210,11 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventTarget* aTarget,
// XUL handlers and commands shouldn't be triggered by non-trusted
// events.
if (isXULKey || isXBLCommand) {
+ nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
bool trustedEvent = false;
- aEvent->GetIsTrusted(&trustedEvent);
+ if (domNSEvent) {
+ domNSEvent->GetIsTrusted(&trustedEvent);
+ }
if (!trustedEvent)
return NS_OK;
@@ -356,17 +360,20 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsIDOMEventTarget* aTarget, nsIDOMEven
// This is a special-case optimization to make command handling fast.
// It isn't really a part of XBL, but it helps speed things up.
+ // See if preventDefault has been set. If so, don't execute.
+ bool preventDefault = false;
+ nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aEvent);
+ if (domNSEvent) {
+ domNSEvent->GetPreventDefault(&preventDefault);
+ }
+
+ if (preventDefault)