Skip to content
Browse files

merge mozilla-central with devtools

  • Loading branch information...
2 parents 7541653 + 440eb14 commit 68fcb7b9f2444fb78ce8d99ab346f28a6186f0af Rob Campbell committed Mar 30, 2011
Showing with 4,220 additions and 4,174 deletions.
  1. +0 −10 accessible/src/base/nsAccUtils.h
  2. +2 −1 accessible/src/base/nsAccessibilityService.cpp
  3. +31 −39 accessible/src/base/nsAccessible.cpp
  4. +15 −8 accessible/src/base/nsAccessible.h
  5. +3 −14 accessible/src/base/nsApplicationAccessible.cpp
  6. +2 −2 accessible/src/base/nsApplicationAccessible.h
  7. +3 −5 accessible/src/base/nsBaseWidgetAccessible.cpp
  8. +2 −3 accessible/src/base/nsBaseWidgetAccessible.h
  9. +5 −7 accessible/src/base/nsDocAccessible.cpp
  10. +9 −16 accessible/src/base/nsOuterDocAccessible.cpp
  11. +2 −3 accessible/src/base/nsOuterDocAccessible.h
  12. +3 −5 accessible/src/html/nsHTMLImageMapAccessible.cpp
  13. +2 −3 accessible/src/html/nsHTMLImageMapAccessible.h
  14. +1 −4 accessible/src/html/nsHyperTextAccessible.cpp
  15. +2 −6 accessible/src/msaa/nsAccessibleWrap.cpp
  16. +7 −9 accessible/src/xul/nsXULTreeAccessible.cpp
  17. +2 −3 accessible/src/xul/nsXULTreeAccessible.h
  18. +6 −8 accessible/src/xul/nsXULTreeGridAccessible.cpp
  19. +2 −3 accessible/src/xul/nsXULTreeGridAccessible.h
  20. +1 −3 browser/base/content/test/Makefile.in
  21. +1 −1 browser/base/content/test/browser_popupUI.js
  22. +0 −7 browser/components/preferences/advanced.xul
  23. +15 −0 browser/components/preferences/privacy.xul
  24. +1 −1 browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
  25. +16 −2 browser/components/search/content/search.xml
  26. +0 −2 browser/locales/en-US/chrome/browser/preferences/advanced.dtd
  27. +5 −1 browser/locales/en-US/chrome/browser/preferences/privacy.dtd
  28. +2 −2 caps/src/nsNullPrincipal.cpp
  29. +2 −2 caps/src/nsPrincipal.cpp
  30. +2 −2 caps/src/nsSystemPrincipal.cpp
  31. +4 −0 config/autoconf.mk.in
  32. +335 −0 config/find_OOM_errors.py
  33. +69 −0 configure.in
  34. +1 −1 content/base/public/nsContentUtils.h
  35. +11 −11 content/base/public/nsIContent.h
  36. +11 −7 content/base/public/nsIContentSerializer.h
  37. +5 −7 content/base/public/nsIDocument.h
  38. +13 −23 content/base/public/nsIDocumentObserver.h
  39. +2 −2 content/base/src/Link.cpp
  40. +14 −0 content/base/src/Makefile.in
  41. +5 −4 content/base/src/mozSanitizingSerializer.cpp
  42. +6 −5 content/base/src/mozSanitizingSerializer.h
  43. +0 −18 content/base/src/nsContentUtils.cpp
  44. +2 −14 content/base/src/nsDOMFileReader.cpp
  45. +3 −4 content/base/src/nsDocument.cpp
  46. +2 −3 content/base/src/nsDocument.h
  47. +1 −1 content/base/src/nsDocumentEncoder.cpp
  48. +4 −10 content/base/src/nsFrameMessageManager.cpp
  49. +3 −4 content/base/src/nsGenericDOMDataNode.cpp
  50. +1 −1 content/base/src/nsGenericDOMDataNode.h
  51. +41 −144 content/base/src/nsGenericElement.cpp
  52. +1 −1 content/base/src/nsGenericElement.h
  53. +6 −3 content/base/src/nsHTMLContentSerializer.cpp
  54. +4 −4 content/base/src/nsHTMLContentSerializer.h
  55. +1 −1 content/base/src/nsImageLoadingContent.cpp
  56. +1 −1 content/base/src/nsObjectLoadingContent.cpp
  57. +6 −3 content/base/src/nsPlainTextSerializer.cpp
  58. +10 −4 content/base/src/nsPlainTextSerializer.h
  59. +66 −20 content/base/src/nsTextFragment.cpp
  60. +72 −0 content/base/src/nsTextFragmentSSE2.cpp
  61. +6 −3 content/base/src/nsXMLContentSerializer.cpp
  62. +4 −4 content/base/src/nsXMLContentSerializer.h
  63. +2 −0 content/base/test/Makefile.in
  64. +51 −0 content/base/test/test_DOMException.html
  65. +39 −0 content/base/test/test_bug585978.html
  66. +0 −16 content/base/test/test_fileapi.html
  67. +3 −5 content/canvas/public/nsICanvasRenderingContextInternal.h
  68. +12 −39 content/canvas/src/WebGLContext.cpp
  69. +2 −3 content/canvas/src/WebGLContext.h
  70. +16 −39 content/canvas/src/nsCanvasRenderingContext2D.cpp
  71. +7 −7 content/canvas/test/test_canvas.html
  72. +6 −3 content/events/public/nsIEventStateManager.h
  73. +101 −177 content/events/src/nsEventStateManager.cpp
  74. +4 −4 content/html/content/public/nsHTMLCanvasElement.h
  75. +2 −3 content/html/content/src/nsFormSubmission.cpp
  76. +7 −7 content/html/content/src/nsGenericHTMLElement.cpp
  77. +1 −1 content/html/content/src/nsHTMLButtonElement.cpp
  78. +12 −16 content/html/content/src/nsHTMLCanvasElement.cpp
  79. +23 −24 content/html/content/src/nsHTMLFormElement.cpp
  80. +25 −24 content/html/content/src/nsHTMLInputElement.cpp
  81. +1 −1 content/html/content/src/nsHTMLOptionElement.cpp
  82. +4 −4 content/html/content/src/nsHTMLOutputElement.cpp
  83. +21 −21 content/html/content/src/nsHTMLSelectElement.cpp
  84. +8 −8 content/html/content/src/nsHTMLTextAreaElement.cpp
  85. +7 −5 content/html/content/src/nsImageMapUtils.cpp
  86. +10 −23 content/html/document/src/nsHTMLDocument.cpp
  87. +1 −2 content/html/document/src/nsHTMLDocument.h
  88. +17 −16 content/html/document/src/nsIHTMLDocument.h
  89. +1 −2 content/mathml/content/src/nsMathMLElement.cpp
  90. +4 −1 content/media/nsBuiltinDecoder.h
  91. +2 −0 content/media/nsBuiltinDecoderReader.h
  92. +1 −1 content/media/nsBuiltinDecoderStateMachine.cpp
  93. +2 −2 content/media/nsMediaDecoder.cpp
  94. +4 −0 content/media/test/Makefile.in
  95. +1 −1 content/media/test/test_autoplay_contentEditable.html
  96. +53 −0 content/media/test/test_wave_data_s16.html
  97. +53 −0 content/media/test/test_wave_data_u8.html
  98. BIN content/media/test/wavedata_s16.wav
  99. BIN content/media/test/wavedata_u8.wav
  100. +1 −0 content/media/wave/Makefile.in
  101. +6 −1,721 content/media/wave/nsWaveDecoder.cpp
  102. +17 −263 content/media/wave/nsWaveDecoder.h
  103. +551 −0 content/media/wave/nsWaveReader.cpp
  104. +120 −0 content/media/wave/nsWaveReader.h
  105. +7 −12 content/smil/nsSMILCSSProperty.cpp
  106. +6 −5 content/smil/nsSMILCSSValueType.cpp
  107. +9 −2 content/smil/nsSMILCSSValueType.h
  108. +6 −0 content/svg/content/src/DOMSVGAnimatedLengthList.cpp
  109. +6 −0 content/svg/content/src/DOMSVGAnimatedNumberList.cpp
  110. +10 −1 content/svg/content/src/DOMSVGLengthList.cpp
  111. +10 −1 content/svg/content/src/DOMSVGNumberList.cpp
  112. +10 −1 content/svg/content/src/DOMSVGPathSegList.cpp
  113. +10 −1 content/svg/content/src/DOMSVGPointList.cpp
  114. +1 −0 content/svg/content/src/Makefile.in
  115. +7 −14 content/svg/content/src/nsSVGAnimationElement.cpp
  116. +158 −0 content/svg/content/src/nsSVGClass.cpp
  117. +124 −0 content/svg/content/src/nsSVGClass.h
  118. +204 −209 content/svg/content/src/nsSVGElement.cpp
  119. +3 −0 content/svg/content/src/nsSVGElement.h
  120. +2 −1 content/svg/content/src/nsSVGGraphicElement.cpp
  121. +14 −19 content/svg/content/src/nsSVGSVGElement.cpp
  122. +10 −4 content/svg/content/src/nsSVGSVGElement.h
  123. +21 −76 content/svg/content/src/nsSVGStylableElement.cpp
  124. +7 −35 content/svg/content/src/nsSVGStylableElement.h
  125. +4 −4 content/svg/content/src/nsSVGTransformList.cpp
  126. +2 −2 content/xbl/src/nsBindingManager.cpp
  127. +8 −8 content/xbl/src/nsXBLBinding.cpp
  128. +2 −4 content/xml/document/src/nsXMLFragmentContentSink.cpp
  129. +1 −1 content/xtf/src/nsXTFElementWrapper.cpp
  130. +1 −1 content/xul/content/src/nsXULElement.cpp
  131. +1 −1 content/xul/document/src/nsXULCommandDispatcher.cpp
  132. +8 −4 dom/base/nsDOMWindowUtils.cpp
  133. +23 −16 dom/base/nsFocusManager.cpp
  134. +6 −9 dom/base/nsGlobalWindow.cpp
  135. +8 −26 dom/base/nsJSEnvironment.cpp
  136. +3 −5 dom/base/nsJSTimeoutHandler.cpp
  137. +1 −1 dom/indexedDB/IDBDatabase.cpp
  138. +2 −2 dom/indexedDB/IndexedDatabaseManager.cpp
  139. +1 −1 dom/indexedDB/LazyIdleThread.cpp
  140. +1 −0 dom/interfaces/core/nsIDOMDOMException.idl
  141. +1 −1 dom/interfaces/core/nsIDOMXMLDocument.idl
  142. +1 −1 dom/interfaces/html/nsIDOMHTMLDocument.idl
  143. +0 −10 dom/interfaces/load-save/Makefile.in
  144. +0 −59 dom/interfaces/load-save/nsIDOMDOMImplementationLS.idl
  145. +0 −48 dom/interfaces/load-save/nsIDOMLSException.idl
  146. +0 −56 dom/interfaces/load-save/nsIDOMLSInput.idl
  147. +0 −48 dom/interfaces/load-save/nsIDOMLSLoadEvent.idl
  148. +0 −52 dom/interfaces/load-save/nsIDOMLSOutput.idl
  149. +0 −73 dom/interfaces/load-save/nsIDOMLSParser.idl
  150. +0 −53 dom/interfaces/load-save/nsIDOMLSParserFilter.idl
  151. +0 −51 dom/interfaces/load-save/nsIDOMLSResourceResolver.idl
  152. +0 −61 dom/interfaces/load-save/nsIDOMLSSerializer.idl
  153. +0 −45 dom/interfaces/load-save/nsIDOMLSSerializerFilter.idl
  154. +1 −1 dom/interfaces/svg/nsIDOMSVGDocument.idl
  155. +1 −4 dom/locales/en-US/chrome/charsetTitles.properties
  156. +11 −11 dom/plugins/PluginModuleChild.cpp
  157. +2 −16 dom/src/json/nsJSON.cpp
  158. +0 −14 dom/src/json/test/unit/test_encode.js
  159. +0 −2 dom/src/json/test/unit/test_wrappers.js
  160. +6 −8 dom/src/threads/nsDOMWorkerScriptLoader.cpp
  161. +2 −2 dom/src/threads/nsDOMWorkerTimeout.cpp
  162. +1 −1 dom/src/threads/test/regExpStatics_worker.js
  163. +3 −2 embedding/components/printingui/src/win/nsPrintProgress.cpp
  164. +2 −2 embedding/components/windowwatcher/src/nsWindowWatcher.cpp
  165. +2 −2 extensions/java/xpcom/src/nsJavaXPCOMBindingUtils.cpp
  166. +3 −17 extensions/universalchardet/src/base/nsUniversalDetector.cpp
  167. +7 −0 gfx/cairo/libpixman/src/Makefile.in
  168. +97 −0 gfx/cairo/libpixman/src/pixman-access.c
  169. +145 −9 gfx/cairo/libpixman/src/pixman-arm-common.h
  170. +861 −118 gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
  171. +225 −13 gfx/cairo/libpixman/src/pixman-arm-neon-asm.h
  172. +100 −14 gfx/cairo/libpixman/src/pixman-arm-neon.c
Sorry, we could not display the entire diff because too many files (796) changed.
View
10 accessible/src/base/nsAccUtils.h
@@ -375,16 +375,6 @@ class nsAccUtils
}
/**
- * Return true if the given accessible hasn't children.
- */
- static inline PRBool IsLeaf(nsIAccessible *aAcc)
- {
- PRInt32 numChildren = 0;
- aAcc->GetChildCount(&numChildren);
- return numChildren == 0;
- }
-
- /**
* Return true if the given accessible can't have children. Used when exposing
* to platform accessibility APIs, should the children be pruned off?
*/
View
3 accessible/src/base/nsAccessibilityService.cpp
@@ -100,6 +100,7 @@
#endif
#include "mozilla/FunctionTimer.h"
+#include "mozilla/dom/Element.h"
////////////////////////////////////////////////////////////////////////////////
// nsAccessibilityService
@@ -275,7 +276,7 @@ nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
if (!mapElmName.IsEmpty()) {
if (mapElmName.CharAt(0) == '#')
mapElmName.Cut(0,1);
- mapElm = htmlDoc->GetImageMap(mapElmName);
+ mapElm = do_QueryInterface(htmlDoc->GetImageMap(mapElmName));
}
}
View
70 accessible/src/base/nsAccessible.cpp
@@ -765,24 +765,22 @@ nsAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
}
// nsAccessible::GetChildAtPoint()
-nsresult
-nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild,
- nsIAccessible **aChild)
+nsAccessible*
+nsAccessible::GetChildAtPoint(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.
PRInt32 x = 0, y = 0, width = 0, height = 0;
nsresult rv = GetBounds(&x, &y, &width, &height);
- NS_ENSURE_SUCCESS(rv, rv);
+ NS_ENSURE_SUCCESS(rv, nsnull);
- nsCOMPtr<nsIAccessible> fallbackAnswer;
+ nsAccessible* fallbackAnswer = nsnull;
if (aX >= x && aX < x + width && aY >= y && aY < y + height)
fallbackAnswer = this;
- if (nsAccUtils::MustPrune(this)) { // Do not dig any further
- NS_IF_ADDREF(*aChild = fallbackAnswer);
- return NS_OK;
- }
+ if (nsAccUtils::MustPrune(this)) // Do not dig any further
+ return fallbackAnswer;
// Search an accessible at the given point starting from accessible document
// because containing block (see CSS2) for out of flow element (for example,
@@ -791,10 +789,10 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild,
// for DOM parent but GetFrameForPoint() should be called for containing block
// to get an out of flow element.
nsDocAccessible *accDocument = GetDocAccessible();
- NS_ENSURE_TRUE(accDocument, NS_ERROR_FAILURE);
+ NS_ENSURE_TRUE(accDocument, nsnull);
nsIFrame *frame = accDocument->GetFrame();
- NS_ENSURE_STATE(frame);
+ NS_ENSURE_TRUE(frame, nsnull);
nsPresContext *presContext = frame->PresContext();
@@ -806,19 +804,15 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild,
nsIFrame *foundFrame = presShell->GetFrameForPoint(frame, offset);
nsIContent* content = nsnull;
- if (!foundFrame || !(content = foundFrame->GetContent())) {
- NS_IF_ADDREF(*aChild = fallbackAnswer);
- return NS_OK;
- }
+ if (!foundFrame || !(content = foundFrame->GetContent()))
+ return fallbackAnswer;
// Get accessible for the node with the point or the first accessible in
// the DOM parent chain.
nsAccessible* accessible =
GetAccService()->GetAccessibleOrContainer(content, mWeakShell);
- if (!accessible) {
- NS_IF_ADDREF(*aChild = fallbackAnswer);
- return NS_OK;
- }
+ if (!accessible)
+ return fallbackAnswer;
if (accessible == this) {
// Manually walk through accessible children and see if the are within this
@@ -836,40 +830,36 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY, PRBool aDeepestChild,
aY >= childY && aY < childY + childHeight &&
(nsAccUtils::State(child) & nsIAccessibleStates::STATE_INVISIBLE) == 0) {
- if (aDeepestChild)
- return child->GetDeepestChildAtPoint(aX, aY, aChild);
+ if (aWhichChild == eDeepestChild)
+ return child->GetChildAtPoint(aX, aY, eDeepestChild);
- NS_IF_ADDREF(*aChild = child);
- return NS_OK;
+ return child;
}
}
// The point is in this accessible but not in a child. We are allowed to
// return |this| as the answer.
- NS_IF_ADDREF(*aChild = accessible);
- return NS_OK;
+ return accessible;
}
// Since DOM node of obtained accessible may be out of flow then we should
// ensure obtained accessible is a child of this accessible.
- nsCOMPtr<nsIAccessible> parent, child(accessible);
- while (PR_TRUE) {
- child->GetParent(getter_AddRefs(parent));
+ nsAccessible* child = accessible;
+ while (true) {
+ nsAccessible* parent = child->GetParent();
if (!parent) {
// Reached the top of the hierarchy. These bounds were inside an
// accessible that is not a descendant of this one.
- NS_IF_ADDREF(*aChild = fallbackAnswer);
- return NS_OK;
+ return fallbackAnswer;
}
- if (parent == this) {
- NS_ADDREF(*aChild = (aDeepestChild ? accessible : child));
- return NS_OK;
- }
- child.swap(parent);
+ if (parent == this)
+ return aWhichChild == eDeepestChild ? accessible : child;
+
+ child = parent;
}
- return NS_OK;
+ return nsnull;
}
// nsIAccessible getChildAtPoint(in long x, in long y)
@@ -883,7 +873,8 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
if (IsDefunct())
return NS_ERROR_FAILURE;
- return GetChildAtPoint(aX, aY, PR_FALSE, aAccessible);
+ NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDirectChild));
+ return NS_OK;
}
// nsIAccessible getDeepestChildAtPoint(in long x, in long y)
@@ -897,7 +888,8 @@ nsAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
if (IsDefunct())
return NS_ERROR_FAILURE;
- return GetChildAtPoint(aX, aY, PR_TRUE, aAccessible);
+ NS_IF_ADDREF(*aAccessible = GetChildAtPoint(aX, aY, eDeepestChild));
+ return NS_OK;
}
void nsAccessible::GetBoundsRect(nsRect& aTotalBounds, nsIFrame** aBoundingFrame)
@@ -2716,7 +2708,7 @@ nsAccessible::BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent)
if (mParent) {
if (mParent != aParent) {
NS_ERROR("Adopting child!");
- mParent->InvalidateChildren();
+ mParent->RemoveChild(this);
} else {
NS_ERROR("Binding to the same parent!");
return;
View
23 accessible/src/base/nsAccessible.h
@@ -190,16 +190,23 @@ class nsAccessible : public nsAccessNodeWrap,
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
/**
+ * Used by GetChildAtPoint() method to get direct or deepest child at point.
+ */
+ enum EWhichChildAtPoint {
+ eDirectChild,
+ eDeepestChild
+ };
+
+ /**
* Return direct or deepest child at the given point.
*
- * @param aX [in] x coordinate relative screen
- * @param aY [in] y coordinate relative screen
- * @param aDeepestChild [in] flag points if deep child should be returned
- * @param aChild [out] found child
- */
- virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild);
+ * @param aX [in] x coordinate relative screen
+ * @param aY [in] y coordinate relative screen
+ * @param aWhichChild [in] flag points if deepest or direct child
+ * should be returned
+ */
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
/**
* Return calculated group level based on accessible hierarchy.
View
17 accessible/src/base/nsApplicationAccessible.cpp
@@ -170,22 +170,11 @@ nsApplicationAccessible::GroupPosition(PRInt32 *aGroupLevel,
return NS_OK;
}
-NS_IMETHODIMP
+nsAccessible*
nsApplicationAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- nsIAccessible **aChild)
+ EWhichChildAtPoint aWhichChild)
{
- NS_ENSURE_ARG_POINTER(aChild);
- *aChild = nsnull;
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsApplicationAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
- nsIAccessible **aChild)
-{
- NS_ENSURE_ARG_POINTER(aChild);
- *aChild = nsnull;
- return NS_ERROR_NOT_IMPLEMENTED;
+ return nsnull;
}
NS_IMETHODIMP
View
4 accessible/src/base/nsApplicationAccessible.h
@@ -98,8 +98,6 @@ class nsApplicationAccessible: public nsAccessibleWrap,
NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
NS_IMETHOD GroupPosition(PRInt32 *aGroupLevel, PRInt32 *aSimilarItemsInGroup,
PRInt32 *aPositionInGroup);
- NS_IMETHOD GetChildAtPoint(PRInt32 aX, PRInt32 aY, nsIAccessible **aChild);
- NS_IMETHOD GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY, nsIAccessible **aChild);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
NS_IMETHOD GetRelationsCount(PRUint32 *aRelationsCount);
@@ -128,6 +126,8 @@ class nsApplicationAccessible: public nsAccessibleWrap,
virtual nsresult GetARIAState(PRUint32 *aState, PRUint32 *aExtraState);
virtual PRUint32 NativeRole();
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual void InvalidateChildren();
View
8 accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -67,14 +67,12 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsLeafAccessible, nsAccessible)
////////////////////////////////////////////////////////////////////////////////
// nsLeafAccessible: nsAccessible public
-nsresult
+nsAccessible*
nsLeafAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild)
+ EWhichChildAtPoint aWhichChild)
{
// Don't walk into leaf accessibles.
- NS_ADDREF(*aChild = this);
- return NS_OK;
+ return this;
}
////////////////////////////////////////////////////////////////////////////////
View
5 accessible/src/base/nsBaseWidgetAccessible.h
@@ -63,9 +63,8 @@ class nsLeafAccessible : public nsAccessibleWrap
NS_DECL_ISUPPORTS_INHERITED
// nsAccessible
- virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild);
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
protected:
View
12 accessible/src/base/nsDocAccessible.cpp
@@ -1231,19 +1231,17 @@ void nsDocAccessible::ContentAppended(nsIDocument *aDocument,
{
}
-void nsDocAccessible::ContentStatesChanged(nsIDocument* aDocument,
- nsIContent* aContent1,
- nsIContent* aContent2,
- nsEventStates aStateMask)
+void nsDocAccessible::ContentStateChanged(nsIDocument* aDocument,
+ nsIContent* aContent,
+ nsEventStates aStateMask)
{
if (aStateMask.HasState(NS_EVENT_STATE_CHECKED)) {
- nsHTMLSelectOptionAccessible::SelectionChangedIfOption(aContent1);
- nsHTMLSelectOptionAccessible::SelectionChangedIfOption(aContent2);
+ nsHTMLSelectOptionAccessible::SelectionChangedIfOption(aContent);
}
if (aStateMask.HasState(NS_EVENT_STATE_INVALID)) {
nsRefPtr<AccEvent> event =
- new AccStateChangeEvent(aContent1, nsIAccessibleStates::STATE_INVALID,
+ new AccStateChangeEvent(aContent, nsIAccessibleStates::STATE_INVALID,
PR_FALSE, PR_TRUE);
FireDelayedAccessibleEvent(event);
}
View
25 accessible/src/base/nsOuterDocAccessible.cpp
@@ -76,32 +76,25 @@ nsOuterDocAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
return NS_OK;
}
-nsresult
+nsAccessible*
nsOuterDocAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild)
+ EWhichChildAtPoint aWhichChild)
{
PRInt32 docX = 0, docY = 0, docWidth = 0, docHeight = 0;
nsresult rv = GetBounds(&docX, &docY, &docWidth, &docHeight);
- NS_ENSURE_SUCCESS(rv, rv);
+ NS_ENSURE_SUCCESS(rv, nsnull);
if (aX < docX || aX >= docX + docWidth || aY < docY || aY >= docY + docHeight)
- return NS_OK;
+ return nsnull;
// Always return the inner doc as direct child accessible unless bounds
// outside of it.
- nsCOMPtr<nsIAccessible> childAcc;
- rv = GetFirstChild(getter_AddRefs(childAcc));
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (!childAcc)
- return NS_OK;
-
- if (aDeepestChild)
- return childAcc->GetDeepestChildAtPoint(aX, aY, aChild);
+ nsAccessible* child = GetChildAt(0);
+ NS_ENSURE_TRUE(child, nsnull);
- NS_ADDREF(*aChild = childAcc);
- return NS_OK;
+ if (aWhichChild = eDeepestChild)
+ return child->GetChildAtPoint(aX, aY, eDeepestChild);
+ return child;
}
nsresult
View
5 accessible/src/base/nsOuterDocAccessible.h
@@ -70,9 +70,8 @@ class nsOuterDocAccessible : public nsAccessibleWrap
virtual PRUint32 NativeRole();
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
- virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild);
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual void InvalidateChildren();
virtual PRBool AppendChild(nsAccessible *aAccessible);
View
8 accessible/src/html/nsHTMLImageMapAccessible.cpp
@@ -246,14 +246,12 @@ nsHTMLAreaAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
return nsHTMLLinkAccessible::GetStateInternal(aState, aExtraState);
}
-nsresult
+nsAccessible*
nsHTMLAreaAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild)
+ EWhichChildAtPoint aWhichChild)
{
// Don't walk into area accessibles.
- NS_ADDREF(*aChild = this);
- return NS_OK;
+ return this;
}
////////////////////////////////////////////////////////////////////////////////
View
5 accessible/src/html/nsHTMLImageMapAccessible.h
@@ -94,9 +94,8 @@ class nsHTMLAreaAccessible : public nsHTMLLinkAccessible
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
- virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild);
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
// HyperLinkAccessible
virtual PRUint32 StartOffset();
View
5 accessible/src/html/nsHyperTextAccessible.cpp
@@ -195,11 +195,8 @@ nsHyperTextAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
*aState |= nsIAccessibleStates::STATE_READONLY;
}
- PRInt32 childCount;
- GetChildCount(&childCount);
- if (childCount > 0) {
+ if (GetChildCount() > 0)
*aExtraState |= nsIAccessibleStates::EXT_STATE_SELECTABLE_TEXT;
- }
return NS_OK;
}
View
8 accessible/src/msaa/nsAccessibleWrap.cpp
@@ -236,9 +236,7 @@ __try {
if (nsAccUtils::MustPrune(this))
return NS_OK;
- PRInt32 numChildren;
- GetChildCount(&numChildren);
- *pcountChildren = numChildren;
+ *pcountChildren = GetChildCount();
} __except(FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
return S_OK;
@@ -1014,9 +1012,7 @@ __try {
mEnumVARIANTPosition += aNumElements;
- PRInt32 numChildren;
- GetChildCount(&numChildren);
-
+ PRInt32 numChildren = GetChildCount();
if (mEnumVARIANTPosition > numChildren)
{
mEnumVARIANTPosition = numChildren;
View
16 accessible/src/xul/nsXULTreeAccessible.cpp
@@ -228,20 +228,19 @@ nsXULTreeAccessible::GetFocusedChild(nsIAccessible **aFocusedChild)
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeAccessible: nsAccessible implementation (DON'T put methods here)
-nsresult
+nsAccessible*
nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild)
+ EWhichChildAtPoint aWhichChild)
{
nsIFrame *frame = GetFrame();
if (!frame)
- return NS_ERROR_FAILURE;
+ return nsnull;
nsPresContext *presContext = frame->PresContext();
nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
nsIFrame *rootFrame = presShell->GetRootFrame();
- NS_ENSURE_STATE(rootFrame);
+ NS_ENSURE_TRUE(rootFrame, nsnull);
nsIntRect rootRect = rootFrame->GetScreenRectExternal();
@@ -257,10 +256,10 @@ 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, aDeepestChild, aChild);
+ return nsAccessibleWrap::GetChildAtPoint(aX, aY, aWhichChild);
nsAccessible *child = GetTreeItemAccessible(row);
- if (aDeepestChild && child) {
+ if (aWhichChild == eDeepestChild && child) {
// Look for accessible cell for the found item accessible.
nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
@@ -269,8 +268,7 @@ nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
child = cell;
}
- NS_IF_ADDREF(*aChild = child);
- return NS_OK;
+ return child;
}
////////////////////////////////////////////////////////////////////////////////
View
5 accessible/src/xul/nsXULTreeAccessible.h
@@ -86,9 +86,8 @@ class nsXULTreeAccessible : public nsAccessibleWrap
// nsAccessible
virtual PRUint32 NativeRole();
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
- virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild);
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
virtual PRInt32 GetChildCount();
View
14 accessible/src/xul/nsXULTreeGridAccessible.cpp
@@ -664,20 +664,19 @@ nsXULTreeGridRowAccessible::NativeRole()
return nsIAccessibleRole::ROLE_ROW;
}
-nsresult
+nsAccessible*
nsXULTreeGridRowAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild)
+ EWhichChildAtPoint aWhichChild)
{
nsIFrame *frame = GetFrame();
if (!frame)
- return NS_ERROR_FAILURE;
+ return nsnull;
nsPresContext *presContext = frame->PresContext();
nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
nsIFrame *rootFrame = presShell->GetRootFrame();
- NS_ENSURE_STATE(rootFrame);
+ NS_ENSURE_TRUE(rootFrame, nsnull);
nsIntRect rootRect = rootFrame->GetScreenRectExternal();
@@ -692,10 +691,9 @@ nsXULTreeGridRowAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
// Return if we failed to find tree cell in the row for the given point.
if (row != mRow || !column)
- return NS_OK;
+ return nsnull;
- NS_IF_ADDREF(*aChild = GetCellAccessible(column));
- return NS_OK;
+ return GetCellAccessible(column);
}
nsAccessible*
View
5 accessible/src/xul/nsXULTreeGridAccessible.h
@@ -93,9 +93,8 @@ class nsXULTreeGridRowAccessible : public nsXULTreeItemAccessibleBase
// nsAccessible
virtual PRUint32 NativeRole();
- virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
- PRBool aDeepestChild,
- nsIAccessible **aChild);
+ virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+ EWhichChildAtPoint aWhichChild);
virtual nsAccessible* GetChildAt(PRUint32 aIndex);
virtual PRInt32 GetChildCount();
View
4 browser/base/content/test/Makefile.in
@@ -205,6 +205,7 @@ _BROWSER_FILES = \
browser_clearplugindata.js \
browser_clearplugindata.html \
browser_clearplugindata_noage.html \
+ browser_popupUI.js \
browser_sanitizeDialog.js \
browser_scope.js \
browser_selectTabAtIndex.js \
@@ -249,9 +250,6 @@ _BROWSER_FILES = \
test_bug628179.html \
$(NULL)
-# compartment-disabled
-# browser_popupUI.js \
-
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
_BROWSER_FILES += \
browser_bug462289.js \
View
2 browser/base/content/test/browser_popupUI.js
@@ -21,7 +21,7 @@ function findPopup() {
while (enumerator.hasMoreElements()) {
let win = enumerator.getNext();
- if (win.content == content.wrappedJSObject.popup) {
+ if (win.content.wrappedJSObject == content.wrappedJSObject.popup) {
testPopupUI(win);
return;
}
View
7 browser/components/preferences/advanced.xul
@@ -127,9 +127,6 @@
<preference id="security.disable_button.openDeviceManager"
name="security.disable_button.openDeviceManager"
type="bool"/>
- <preference id="privacy.donottrackheader.enabled"
- name="privacy.donottrackheader.enabled"
- type="bool"/>
</preferences>
#ifdef HAVE_SHELL_SERVICE
@@ -194,10 +191,6 @@
onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
preference="layout.spellcheckDefault"/>
- <checkbox id="privacyDoNotTrackPrefs"
- label="&doNotTrack.label;"
- accesskey="&doNotTrack.accesskey;"
- preference="privacy.donottrackheader.enabled"/>
</groupbox>
#ifdef HAVE_SHELL_SERVICE
View
15 browser/components/preferences/privacy.xul
@@ -57,6 +57,11 @@
helpTopic="prefs-privacy">
<preferences id="privacyPreferences">
+
+ <!-- Tracking -->
+ <preference id="privacy.donottrackheader.enabled"
+ name="privacy.donottrackheader.enabled"
+ type="bool"/>
<!-- XXX button prefs -->
<preference id="pref.privacy.disable_button.cookie_exceptions"
@@ -116,6 +121,16 @@
<script type="application/javascript" src="chrome://browser/content/preferences/privacy.js"/>
+ <!-- Tracking -->
+ <groupbox id="trackingGroup">
+ <caption label="&tracking.label;"/>
+
+ <checkbox id="privacyDoNotTrackPrefs"
+ label="&doNotTrack.label;"
+ accesskey="&doNotTrack.accesskey;"
+ preference="privacy.donottrackheader.enabled"/>
+ </groupbox>
+
<!-- History -->
<groupbox id="historyGroup">
<caption label="&history.label;"/>
View
2 browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
@@ -467,7 +467,7 @@ PrivateBrowsingService.prototype = {
handle: function PBS_handle(aCmdLine) {
if (aCmdLine.handleFlag("private", false))
- ; // It has already been handled
+ aCmdLine.preventDefault = true; // It has already been handled
else if (aCmdLine.handleFlag("private-toggle", false)) {
if (this._autoStarted) {
throw Cr.NS_ERROR_ABORT;
View
18 browser/components/search/content/search.xml
@@ -640,6 +640,12 @@
]]></body>
</method>
+ <!--
+ This method overrides the autocomplete binding's openPopup (essentially
+ duplicating the logic from the autocomplete popup binding's
+ openAutocompletePopup method), modifying it so that the popup is aligned with
+ the inner textbox, but sized to not extend beyond the search bar border.
+ -->
<method name="openPopup">
<body><![CDATA[
var popup = this.popup;
@@ -662,18 +668,26 @@
document.popupNode = null;
+ const isRTL = getComputedStyle(this, "").direction == "rtl";
+
var outerRect = this.getBoundingClientRect();
var innerRect = this.inputField.getBoundingClientRect();
- var width = outerRect.right - innerRect.left;
+ if (isRTL) {
+ var width = innerRect.right - outerRect.left;
+ } else {
+ var width = outerRect.right - innerRect.left;
+ }
popup.setAttribute("width", width > 100 ? width : 100);
+ var yOffset = outerRect.bottom - innerRect.bottom;
+
// setConsumeRollupEvent() before we call openPopup(),
// see bug #404438 for more details
popup.popupBoxObject.setConsumeRollupEvent(
this.consumeRollupEvent ?
Ci.nsIPopupBoxObject.ROLLUP_CONSUME :
Ci.nsIPopupBoxObject.ROLLUP_NO_CONSUME);
- popup.openPopup(null, "", innerRect.left, outerRect.bottom, false, false);
+ popup.openPopup(this.inputField, "after_start", 0, yOffset, false, false);
}
]]></body>
</method>
View
2 browser/locales/en-US/chrome/browser/preferences/advanced.dtd
@@ -21,8 +21,6 @@
<!ENTITY allowHWAccel.accesskey "h">
<!ENTITY checkSpelling.label "Check my spelling as I type">
<!ENTITY checkSpelling.accesskey "t">
-<!ENTITY doNotTrack.label "Tell web sites I do not want to be tracked">
-<!ENTITY doNotTrack.accesskey "d">
<!ENTITY systemDefaults.label "System Defaults">
<!ENTITY alwaysCheckDefault.label "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
View
6 browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -1,3 +1,8 @@
+<!ENTITY tracking.label "Tracking">
+
+<!ENTITY doNotTrack.label "Tell web sites I do not want to be tracked">
+<!ENTITY doNotTrack.accesskey "d">
+
<!ENTITY history.label "History">
<!ENTITY locationBar.label "Location Bar">
@@ -30,7 +35,6 @@
<!ENTITY showCookies.label "Show Cookies…">
<!ENTITY showCookies.accesskey "S">
-
<!ENTITY historyHeader.pre.label "&brandShortName; will:">
<!ENTITY historyHeader.pre.accesskey "w">
<!ENTITY historyHeader.remember.label "Remember history">
View
4 caps/src/nsNullPrincipal.cpp
@@ -66,7 +66,7 @@ NS_IMETHODIMP_(nsrefcnt)
nsNullPrincipal::AddRef()
{
NS_PRECONDITION(PRInt32(mJSPrincipals.refcount) >= 0, "illegal refcnt");
- nsrefcnt count = PR_AtomicIncrement((PRInt32 *)&mJSPrincipals.refcount);
+ nsrefcnt count = PR_ATOMIC_INCREMENT(&mJSPrincipals.refcount);
NS_LOG_ADDREF(this, count, "nsNullPrincipal", sizeof(*this));
return count;
}
@@ -75,7 +75,7 @@ NS_IMETHODIMP_(nsrefcnt)
nsNullPrincipal::Release()
{
NS_PRECONDITION(0 != mJSPrincipals.refcount, "dup release");
- nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mJSPrincipals.refcount);
+ nsrefcnt count = PR_ATOMIC_DECREMENT(&mJSPrincipals.refcount);
NS_LOG_RELEASE(this, count, "nsNullPrincipal");
if (count == 0) {
delete this;
View
4 caps/src/nsPrincipal.cpp
@@ -154,7 +154,7 @@ nsPrincipal::AddRef()
{
NS_PRECONDITION(PRInt32(mJSPrincipals.refcount) >= 0, "illegal refcnt");
// XXXcaa does this need to be threadsafe? See bug 143559.
- nsrefcnt count = PR_AtomicIncrement((PRInt32 *)&mJSPrincipals.refcount);
+ nsrefcnt count = PR_ATOMIC_INCREMENT(&mJSPrincipals.refcount);
NS_LOG_ADDREF(this, count, "nsPrincipal", sizeof(*this));
return count;
}
@@ -163,7 +163,7 @@ NS_IMETHODIMP_(nsrefcnt)
nsPrincipal::Release()
{
NS_PRECONDITION(0 != mJSPrincipals.refcount, "dup release");
- nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mJSPrincipals.refcount);
+ nsrefcnt count = PR_ATOMIC_DECREMENT(&mJSPrincipals.refcount);
NS_LOG_RELEASE(this, count, "nsPrincipal");
if (count == 0) {
delete this;
View
4 caps/src/nsSystemPrincipal.cpp
@@ -63,7 +63,7 @@ NS_IMETHODIMP_(nsrefcnt)
nsSystemPrincipal::AddRef()
{
NS_PRECONDITION(PRInt32(mJSPrincipals.refcount) >= 0, "illegal refcnt");
- nsrefcnt count = PR_AtomicIncrement((PRInt32 *)&mJSPrincipals.refcount);
+ nsrefcnt count = PR_ATOMIC_INCREMENT(&mJSPrincipals.refcount);
NS_LOG_ADDREF(this, count, "nsSystemPrincipal", sizeof(*this));
return count;
}
@@ -72,7 +72,7 @@ NS_IMETHODIMP_(nsrefcnt)
nsSystemPrincipal::Release()
{
NS_PRECONDITION(0 != mJSPrincipals.refcount, "dup release");
- nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mJSPrincipals.refcount);
+ nsrefcnt count = PR_ATOMIC_DECREMENT(&mJSPrincipals.refcount);
NS_LOG_RELEASE(this, count, "nsSystemPrincipal");
if (count == 0) {
delete this;
View
4 config/autoconf.mk.in
@@ -168,6 +168,10 @@ VPX_AS_CONVERSION = @VPX_AS_CONVERSION@
VPX_ASM_SUFFIX = @VPX_ASM_SUFFIX@
VPX_X86_ASM = @VPX_X86_ASM@
VPX_ARM_ASM = @VPX_ARM_ASM@
+LIBJPEG_TURBO_AS = @LIBJPEG_TURBO_AS@
+LIBJPEG_TURBO_ASFLAGS = @LIBJPEG_TURBO_ASFLAGS@
+LIBJPEG_TURBO_X86_ASM = @LIBJPEG_TURBO_X86_ASM@
+LIBJPEG_TURBO_X64_ASM = @LIBJPEG_TURBO_X64_ASM@
NS_PRINTING = @NS_PRINTING@
MOZ_PDF_PRINTING = @MOZ_PDF_PRINTING@
MOZ_CRASHREPORTER = @MOZ_CRASHREPORTER@
View
335 config/find_OOM_errors.py
@@ -0,0 +1,335 @@
+#!/usr/bin/env python
+
+usage = """%prog: A test for OOM conditions in the shell.
+
+%prog finds segfaults and other errors caused by incorrect handling of
+allocation during OOM (out-of-memory) conditions.
+"""
+
+help = """Check for regressions only. This runs a set of files with a known
+number of OOM errors (specified by REGRESSION_COUNT), and exits with a non-zero
+result if more or less errors are found. See js/src/Makefile.in for invocation.
+"""
+
+
+import hashlib
+import re
+import shlex
+import subprocess
+import sys
+import threading
+import time
+
+from optparse import OptionParser
+
+#####################################################################
+# Utility functions
+#####################################################################
+def run(args, stdin=None):
+ class ThreadWorker(threading.Thread):
+ def __init__(self, pipe):
+ super(ThreadWorker, self).__init__()
+ self.all = ""
+ self.pipe = pipe
+ self.setDaemon(True)
+
+ def run(self):
+ while True:
+ line = self.pipe.readline()
+ if line == '': break
+ else:
+ self.all += line
+
+ try:
+ if type(args) == str:
+ args = shlex.split(args)
+
+ args = [str(a) for a in args] # convert to strs
+
+ stdin_pipe = subprocess.PIPE if stdin else None
+ proc = subprocess.Popen(args, stdin=stdin_pipe, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ if stdin_pipe:
+ proc.stdin.write(stdin)
+ proc.stdin.close()
+
+ stdout_worker = ThreadWorker(proc.stdout)
+ stderr_worker = ThreadWorker(proc.stderr)
+ stdout_worker.start()
+ stderr_worker.start()
+
+ proc.wait()
+ stdout_worker.join()
+ stderr_worker.join()
+
+ except KeyboardInterrupt, e:
+ sys.exit(-1)
+
+ stdout, stderr = stdout_worker.all, stderr_worker.all
+ result = (stdout, stderr, proc.returncode)
+ return result
+
+def get_js_files():
+ (out, err, exit) = run('find ../jit-test/tests -name "*.js"')
+ if (err, exit) == ("", 0):
+ sys.exit("Wrong directory, run from an objdir")
+ return out.split()
+
+
+
+#####################################################################
+# Blacklisting
+#####################################################################
+def in_blacklist(sig):
+ return sig in blacklist
+
+def add_to_blacklist(sig):
+ blacklist[sig] = blacklist.get(sig, 0)
+ blacklist[sig] += 1
+
+# How often is a particular lines important for this.
+def count_lines():
+ """Keep track of the amount of times individual lines occur, in order to
+ prioritize the errors which occur most frequently."""
+ counts = {}
+ for string,count in blacklist.items():
+ for line in string.split("\n"):
+ counts[line] = counts.get(line, 0) + count
+
+ lines = []
+ for k,v in counts.items():
+ lines.append("%6d: %s" % (v,k))
+
+ lines.sort()
+
+ countlog = file("../OOM_count_log", "w")
+ countlog.write("\n".join(lines))
+ countlog.flush()
+ countlog.close()
+
+
+#####################################################################
+# Output cleaning
+#####################################################################
+def clean_voutput(err):
+ # Skip what we can't reproduce
+ err = re.sub(r"^--\d+-- run: /usr/bin/dsymutil \"shell/js\"$", "", err, flags=re.MULTILINE)
+ err = re.sub(r"^==\d+==", "", err, flags=re.MULTILINE)
+ err = re.sub(r"^\*\*\d+\*\*", "", err, flags=re.MULTILINE)
+ err = re.sub(r"^\s+by 0x[0-9A-Fa-f]+: ", "by: ", err, flags=re.MULTILINE)
+ err = re.sub(r"^\s+at 0x[0-9A-Fa-f]+: ", "at: ", err, flags=re.MULTILINE)
+ err = re.sub(r"(^\s+Address 0x)[0-9A-Fa-f]+( is not stack'd)", r"\1\2", err, flags=re.MULTILINE)
+ err = re.sub(r"(^\s+Invalid write of size )\d+", r"\1x", err, flags=re.MULTILINE)
+ err = re.sub(r"(^\s+Invalid read of size )\d+", r"\1x", err, flags=re.MULTILINE)
+ err = re.sub(r"(^\s+Address 0x)[0-9A-Fa-f]+( is )\d+( bytes inside a block of size )[0-9,]+( free'd)", r"\1\2\3\4", err, flags=re.MULTILINE)
+
+ # Skip the repeating bit due to the segfault
+ lines = []
+ for l in err.split('\n'):
+ if l == " Process terminating with default action of signal 11 (SIGSEGV)":
+ break
+ lines.append(l)
+ err = '\n'.join(lines)
+
+ return err
+
+def remove_failed_allocation_backtraces(err):
+ lines = []
+
+ add = True
+ for l in err.split('\n'):
+
+ # Set start and end conditions for including text
+ if l == " The site of the failed allocation is:":
+ add = False
+ elif l[:2] not in ['by: ', 'at:']:
+ add = True
+
+ if add:
+ lines.append(l)
+
+
+ err = '\n'.join(lines)
+
+ return err
+
+
+def clean_output(err):
+ err = re.sub(r"^js\(\d+,0x[0-9a-f]+\) malloc: \*\*\* error for object 0x[0-9a-f]+: pointer being freed was not allocated\n\*\*\* set a breakppoint in malloc_error_break to debug\n$", "pointer being freed was not allocated", err, flags=re.MULTILINE)
+
+ return err
+
+
+#####################################################################
+# Consts, etc
+#####################################################################
+
+command_template = 'shell/js' \
+ + ' -m -j -p' \
+ + ' -e "const platform=\'darwin\'; const libdir=\'../jit-test/lib/\';"' \
+ + ' -f ../jit-test/lib/prolog.js' \
+ + ' -f %s'
+
+
+# Blacklists are things we don't want to see in our logs again (though we do
+# want to count them when they happen). Whitelists we do want to see in our
+# logs again, principally because the information we have isn't enough.
+
+blacklist = {}
+add_to_blacklist(r"('', '', 1)") # 1 means OOM if the shell hasn't launched yet.
+add_to_blacklist(r"('', 'out of memory\n', 1)")
+
+whitelist = set()
+whitelist.add(r"('', 'out of memory\n', -11)") # -11 means OOM
+whitelist.add(r"('', 'out of memory\nout of memory\n', -11)")
+
+
+
+#####################################################################
+# Program
+#####################################################################
+
+# Options
+parser = OptionParser(usage=usage)
+parser.add_option("-r", "--regression", action="store", metavar="REGRESSION_COUNT", help=help,
+ type="int", dest="regression", default=0) # TODO: support a value of zero, eventually
+
+(OPTIONS, args) = parser.parse_args()
+
+
+if OPTIONS.regression:
+ # TODO: This should be expanded as we get a better hang of the OOM problems.
+ # For now, we'll just check that the number of OOMs in one short file does not
+ # increase.
+ files = ["../jit-test/tests/arguments/args-createontrace.js"]
+else:
+ files = get_js_files()
+
+ # Use a command-line arg to reduce the set of files
+ if len (args):
+ files = [f for f in files if f.find(args[0]) != -1]
+
+
+if OPTIONS.regression:
+ # Don't use a logfile, this is automated for tinderbox.
+ log = file("../OOM_log", "w")
+
+
+num_failures = 0
+for f in files:
+
+ # Run it once to establish boundaries
+ command = (command_template + ' -O') % (f)
+ out, err, exit = run(command)
+ max = re.match(".*OOM max count: (\d+).*", out, flags=re.DOTALL).groups()[0]
+ max = int(max)
+
+ # OOMs don't recover well for the first 20 allocations or so.
+ # TODO: revisit this.
+ for i in range(20, max):
+
+ if OPTIONS.regression == None:
+ print "Testing allocation %d/%d in %s" % (i,max,f)
+
+ command = (command_template + ' -A %d') % (f, i)
+ out, err, exit = run(command)
+
+ # Success (5 is SM's exit code for controlled errors)
+ if exit == 5 and err.find("out of memory") != -1:
+ continue
+
+ # Failure
+ else:
+
+ if OPTIONS.regression:
+ # Just count them
+ num_failures += 1
+ continue
+
+ #########################################################################
+ # The regression tests ends above. The rest of this is for running the
+ # script manually.
+ #########################################################################
+
+ problem = str((out, err, exit))
+ if in_blacklist(problem) and problem not in whitelist:
+ add_to_blacklist(problem)
+ continue
+
+ add_to_blacklist(problem)
+
+
+ # Get valgrind output for a good stack trace
+ vcommand = "valgrind --dsymutil=yes -q --log-file=OOM_valgrind_log_file " + command
+ run(vcommand)
+ vout = file("OOM_valgrind_log_file").read()
+ vout = clean_voutput(vout)
+ sans_alloc_sites = remove_failed_allocation_backtraces(vout)
+
+ # Don't print duplicate information
+ if in_blacklist(sans_alloc_sites):
+ add_to_blacklist(sans_alloc_sites)
+ continue
+
+ add_to_blacklist(sans_alloc_sites)
+
+ log.write ("\n")
+ log.write ("\n")
+ log.write ("=========================================================================")
+ log.write ("\n")
+ log.write ("An allocation failure at\n\tallocation %d/%d in %s\n\tcauses problems (detected using bug 624094)" % (i, max, f))
+ log.write ("\n")
+ log.write ("\n")
+
+ log.write ("Command (from obj directory, using patch from bug 624094):\n " + command)
+ log.write ("\n")
+ log.write ("\n")
+ log.write ("stdout, stderr, exitcode:\n " + problem)
+ log.write ("\n")
+ log.write ("\n")
+
+ double_free = err.find("pointer being freed was not allocated") != -1
+ oom_detected = err.find("out of memory") != -1
+ multiple_oom_detected = err.find("out of memory\nout of memory") != -1
+ segfault_detected = exit == -11
+
+ log.write ("Diagnosis: ")
+ log.write ("\n")
+ if multiple_oom_detected:
+ log.write (" - Multiple OOMs reported")
+ log.write ("\n")
+ if segfault_detected:
+ log.write (" - segfault")
+ log.write ("\n")
+ if not oom_detected:
+ log.write (" - No OOM checking")
+ log.write ("\n")
+ if double_free:
+ log.write (" - Double free")
+ log.write ("\n")
+
+ log.write ("\n")
+
+ log.write ("Valgrind info:\n" + vout)
+ log.write ("\n")
+ log.write ("\n")
+ log.flush()
+
+ if not OPTIONS.regression == None:
+ count_lines()
+
+
+# Do the actual regression check
+if OPTIONS.regression:
+ expected_num_failures = OPTIONS.regression
+
+ if num_failures != expected_num_failures:
+
+ print "TEST-UNEXPECTED-FAIL |",
+ if num_failures > expected_num_failures:
+ print "More out-of-memory errors were found (%s) than expected (%d). This probably means an allocation site has been added without a NULL-check. If this is unavoidable, you can account for it by updating Makefile.in." % (num_failures, expected_num_failures),
+ else:
+ print "Congratulations, you have removed %d out-of-memory error(s) (%d remain)! Please account for it by updating Makefile.in." % (expected_num_failures - num_failures, num_failures),
+ sys.exit(-1)
+ else:
+ print 'TEST-PASS | find_OOM_errors | Found the expected number of OOM errors (%d)' % (expected_num_failures)
+
View
69 configure.in
@@ -4971,6 +4971,10 @@ VPX_AS_CONVERSION=
VPX_ASM_SUFFIX=
VPX_X86_ASM=
VPX_ARM_ASM=
+LIBJPEG_TURBO_AS=
+LIBJPEG_TURBO_ASFLAGS=
+LIBJPEG_TURBO_X86_ASM=
+LIBJPEG_TURBO_X64_ASM=
MOZ_PANGO=1
MOZ_PERMISSIONS=1
MOZ_PLACES=1
@@ -6442,6 +6446,67 @@ fi
AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
dnl ========================================================
+dnl = libjpeg-turbo configuration
+dnl ========================================================
+
+dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
+dnl files.
+AC_MSG_CHECKING([for YASM assembler])
+AC_CHECK_PROGS(LIBJPEG_TURBO_AS, yasm, "")
+
+dnl XXX jlebar -- need a yasm version check here.
+
+if test -n "LIBJPEG_TURBO_AS"; then
+
+ LIBJPEG_TURBO_AS="yasm"
+
+ dnl We have YASM; see if we support it on this platform.
+ case "$OS_ARCH:$OS_TEST" in
+ Linux:x86|Linux:i?86)
+ LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
+ LIBJPEG_TURBO_X86_ASM=1
+ ;;
+ Linux:x86_64)
+ LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
+ LIBJPEG_TURBO_X64_ASM=1
+ ;;
+ SunOS:i?86)
+ LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
+ LIBJPEG_TURBO_X86_ASM=1
+ ;;
+ SunOS:x86_64)
+ LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
+ LIBJPEG_TURBO_X64_ASM=1
+ ;;
+ Darwin:i?86)
+ LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
+ LIBJPEG_TURBO_X86_ASM=1
+ ;;
+ Darwin:x86_64)
+ LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
+ LIBJPEG_TURBO_X64_ASM=1
+ ;;
+ WINNT:x86|WINNT:i?86)
+ LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
+ LIBJPEG_TURBO_X86_ASM=1
+ ;;
+ WINNT:x86_64)
+ LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64"
+ LIBJPEG_TURBO_X64_ASM=1
+ ;;
+ esac
+
+fi # end have YASM
+
+if test -n "$LIBJPEG_TURBO_X86_ASM"; then
+ AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
+elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
+ AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
+else
+ AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.])
+fi
+
+dnl ========================================================
dnl = Enable compilation of specific extension modules
dnl ========================================================
@@ -9209,6 +9274,10 @@ AC_SUBST(VPX_AS_CONVERSION)
AC_SUBST(VPX_ASM_SUFFIX)
AC_SUBST(VPX_X86_ASM)
AC_SUBST(VPX_ARM_ASM)
+AC_SUBST(LIBJPEG_TURBO_AS)
+AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
+AC_SUBST(LIBJPEG_TURBO_X86_ASM)
+AC_SUBST(LIBJPEG_TURBO_X64_ASM)
if test "$USING_HCC"; then
CC='${topsrcdir}/build/hcc'
View
2 content/base/public/nsContentUtils.h
@@ -545,7 +545,7 @@ class nsContentUtils
/**
* Determine whether a buffer begins with a BOM for UTF-8, UTF-16LE,
- * UTF-16BE, UTF-32LE, UTF-32BE.
+ * UTF-16BE
*
* @param aBuffer the buffer to check
* @param aLength the length of the buffer
View
22 content/base/public/nsIContent.h
@@ -76,8 +76,8 @@ enum nsLinkState {
// IID for the nsIContent interface
#define NS_ICONTENT_IID \
-{ 0x8331ca9f, 0x8717, 0x4ab4, \
- { 0xad, 0x17, 0xb4, 0x9d, 0xdc, 0xe8, 0xb6, 0x77 } }
+{ 0x5788c9eb, 0x646a, 0x4285, \
+ { 0xa2, 0x8c, 0xde, 0x0d, 0x43, 0x6b, 0x47, 0x72 } }
/**
* A node of content in a document's content model. This interface
@@ -906,15 +906,15 @@ class nsIContent : public nsINode {
*/
virtual nsISMILAttr* GetAnimatedAttr(PRInt32 aNamespaceID, nsIAtom* aName) = 0;
- /**
- * Get the SMIL override style for this content node. This is a style
- * declaration that is applied *after* the inline style, and it can be used
- * e.g. to store animated style values.
- *
- * Note: This method is analogous to the 'GetStyle' method in
- * nsGenericHTMLElement and nsStyledElement.
- */
- virtual nsresult GetSMILOverrideStyle(nsIDOMCSSStyleDeclaration** aStyle) = 0;
+ /**
+ * Get the SMIL override style for this content node. This is a style
+ * declaration that is applied *after* the inline style, and it can be used
+ * e.g. to store animated style values.
+ *
+ * Note: This method is analogous to the 'GetStyle' method in
+ * nsGenericHTMLElement and nsStyledElement.
+ */
+ virtual nsIDOMCSSStyleDeclaration* GetSMILOverrideStyle() = 0;
/**
* Get the SMIL override style rule for this content node. If the rule
View
18 content/base/public/nsIContentSerializer.h
@@ -35,16 +35,20 @@
*
* ***** END LICENSE BLOCK ***** */
-#ifndef _nsIContentSerializer_h__
-#define _nsIContentSerializer_h__
+#ifndef nsIContentSerializer_h
+#define nsIContentSerializer_h
#include "nsISupports.h"
class nsIContent;
class nsIDocument;
class nsAString;
-/* starting interface: nsIContentSerializer */
+namespace mozilla {
+namespace dom {
+class Element;
+} // namespace dom
+} // namespace mozilla
#define NS_ICONTENTSERIALIZER_IID \
{ 0xb1ee32f2, 0xb8c4, 0x49b9, \
@@ -77,11 +81,11 @@ class nsIContentSerializer : public nsISupports {
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
nsAString& aStr) = 0;
- NS_IMETHOD AppendElementStart(nsIContent *aElement,
- nsIContent *aOriginalElement,
+ NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
+ mozilla::dom::Element* aOriginalElement,
nsAString& aStr) = 0;
- NS_IMETHOD AppendElementEnd(nsIContent *aElement,
+ NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
nsAString& aStr) = 0;
NS_IMETHOD Flush(nsAString& aStr) = 0;
@@ -100,4 +104,4 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID)
#define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \
"@mozilla.org/layout/contentserializer;1?mimetype="
-#endif /* __gen_nsIContentSerializer_h__ */
+#endif /* nsIContentSerializer_h */
View
12 content/base/public/nsIDocument.h
@@ -123,8 +123,8 @@ class Element;
#define NS_IDOCUMENT_IID \
-{ 0xc38a7935, 0xc854, 0x4df7, \
- { 0x8f, 0xd4, 0xa2, 0x6f, 0x0d, 0x27, 0x9f, 0x31 } }
+{ 0x2c6ad63f, 0xb7b9, 0x42f8, \
+ { 0xbd, 0xde, 0x76, 0x0a, 0x83, 0xe3, 0xb0, 0x49 } }
// Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@@ -757,11 +757,9 @@ class nsIDocument : public nsINode
virtual void SetReadyStateInternal(ReadyState rs) = 0;
virtual ReadyState GetReadyStateEnum() = 0;
- // notify that one or two content nodes changed state
- // either may be nsnull, but not both
- virtual void ContentStatesChanged(nsIContent* aContent1,
- nsIContent* aContent2,
- nsEventStates aStateMask) = 0;
+ // notify that a content node changed state
+ virtual void ContentStateChanged(nsIContent* aContent,
+ nsEventStates aStateMask) = 0;
// Notify that a document state has changed.
// This should only be called by callers whose state is also reflected in the
View
36 content/base/public/nsIDocumentObserver.h
@@ -49,8 +49,8 @@ class nsString;
class nsIDocument;
#define NS_IDOCUMENT_OBSERVER_IID \
-{ 0x3d005225, 0x210f, 0x4b07, \
- { 0xb1, 0xd9, 0x96, 0x02, 0x05, 0x74, 0xc4, 0x37 } }
+{ 0x900bc4bc, 0x8b6c, 0x4cba, \
+ { 0x82, 0xfa, 0x56, 0x8a, 0x80, 0xff, 0xfd, 0x3e } }
typedef PRUint32 nsUpdateType;
@@ -103,20 +103,12 @@ class nsIDocumentObserver : public nsIMutationObserver
* added/removed from the document or the content itself changed
* (the other notifications are used for that).
*
- * The optional second content node is to allow optimization
- * of the case where state moves from one node to another
- * (as is likely for :focus and :hover)
- *
- * Either content node may be nsnull, but not both
- *
* @param aDocument The document being observed
- * @param aContent1 the piece of content that changed
- * @param aContent2 optional second piece of content that changed
+ * @param aContent the piece of content that changed
*/
- virtual void ContentStatesChanged(nsIDocument* aDocument,
- nsIContent* aContent1,
- nsIContent* aContent2,
- nsEventStates aStateMask) = 0;
+ virtual void ContentStateChanged(nsIDocument* aDocument,
+ nsIContent* aContent,
+ nsEventStates aStateMask) = 0;
/**
* Notification that the state of the document has changed.
@@ -247,11 +239,10 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
#define NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD \
virtual void EndLoad(nsIDocument* aDocument);
-#define NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATESCHANGED \
- virtual void ContentStatesChanged(nsIDocument* aDocument, \
- nsIContent* aContent1, \
- nsIContent* aContent2, \
- nsEventStates aStateMask);
+#define NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED \
+ virtual void ContentStateChanged(nsIDocument* aDocument, \
+ nsIContent* aContent, \
+ nsEventStates aStateMask);
#define NS_DECL_NSIDOCUMENTOBSERVER_DOCUMENTSTATESCHANGED \
virtual void DocumentStatesChanged(nsIDocument* aDocument, \
@@ -293,7 +284,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE \
NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD \
NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD \
- NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATESCHANGED \
+ NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED \
NS_DECL_NSIDOCUMENTOBSERVER_DOCUMENTSTATESCHANGED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED \
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED \
@@ -327,9 +318,8 @@ _class::EndLoad(nsIDocument* aDocument) \
#define NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(_class) \
void \
-_class::ContentStatesChanged(nsIDocument* aDocument, \
- nsIContent* aContent1, \
- nsIContent* aContent2, \
+_class::ContentStateChanged(nsIDocument* aDocument, \
+ nsIContent* aContent, \
nsEventStates aStateMask) \
{ \
} \
View
4 content/base/src/Link.cpp
@@ -102,7 +102,7 @@ Link::SetLinkState(nsLinkState aState)
newLinkState == NS_EVENT_STATE_UNVISITED,
"Unexpected state obtained from LinkState()!");
mozAutoDocUpdate update(doc, UPDATE_CONTENT_STATE, PR_TRUE);
- doc->ContentStatesChanged(content, nsnull, oldLinkState ^ newLinkState);
+ doc->ContentStateChanged(content, oldLinkState ^ newLinkState);
}
nsEventStates
@@ -493,7 +493,7 @@ Link::ResetLinkState(bool aNotify)
if (aNotify && doc) {
nsEventStates changedState = NS_EVENT_STATE_VISITED ^ NS_EVENT_STATE_UNVISITED;
MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, aNotify);
- doc->ContentStatesChanged(content, nsnull, changedState);
+ doc->ContentStateChanged(content, changedState);
}
}
View
14 content/base/src/Makefile.in
@@ -151,6 +151,20 @@ CPPSRCS = \
ThirdPartyUtil.cpp \
$(NULL)
+# Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for
+# nsTextFragment.cpp
+ifneq (,$(INTEL_ARCHITECTURE))
+
+CPPSRCS += nsTextFragmentSSE2.cpp
+
+# gcc requires -msse2 for this file since it uses SSE2 intrinsics. (See bug
+# 585538 comment 12.)
+ifdef GNU_CC
+nsTextFragmentSSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
+endif
+
+endif
+
GQI_SRCS = contentbase.gqi
# we don't want the shared lib, but we want to force the creation of a
View
9 content/base/src/mozSanitizingSerializer.cpp
@@ -63,8 +63,9 @@
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsEscape.h"
+#include "mozilla/dom/Element.h"
-//#define DEBUG_BenB
+using namespace mozilla::dom;
static inline PRUnichar* escape(const nsString& source)
{
@@ -241,8 +242,8 @@ mozSanitizingHTMLSerializer::AppendText(nsIContent* aText,
}
NS_IMETHODIMP
-mozSanitizingHTMLSerializer::AppendElementStart(nsIContent *aElement,
- nsIContent *aOriginalElement,
+mozSanitizingHTMLSerializer::AppendElementStart(Element* aElement,
+ Element* aOriginalElement,
nsAString& aStr)
{
NS_ENSURE_ARG(aElement);
@@ -270,7 +271,7 @@ mozSanitizingHTMLSerializer::AppendElementStart(nsIContent *aElement,
}
NS_IMETHODIMP
-mozSanitizingHTMLSerializer::AppendElementEnd(nsIContent *aElement,
+mozSanitizingHTMLSerializer::AppendElementEnd(Element* aElement,
nsAString& aStr)
{
NS_ENSURE_ARG(aElement);
View
11 content/base/src/mozSanitizingSerializer.h
@@ -89,10 +89,11 @@ class mozSanitizingHTMLSerializer : public nsIContentSerializer,
{ return NS_OK; }
NS_IMETHOD AppendDoctype(nsIContent *aDoctype, nsAString& aStr)
{ return NS_OK; }
- NS_IMETHOD AppendElementStart(nsIContent *aElement,
- nsIContent *aOriginalElement,
- nsAString& aStr);
- NS_IMETHOD AppendElementEnd(nsIContent *aElement, nsAString& aStr);
+ NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
+ mozilla::dom::Element* aOriginalElement,
+ nsAString& aStr);
+ NS_IMETHOD AppendElementEnd(mozilla::dom::Element* aElement,
+ nsAString& aStr);
NS_IMETHOD Flush(nsAString& aStr);
NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
@@ -150,7 +151,7 @@ class mozSanitizingHTMLSerializer : public nsIContentSerializer,
PRUint32 mSkipLevel;
nsHashtable mAllowedTags;
- nsCOMPtr<nsIContent> mContent;
+ nsRefPtr<mozilla::dom::Element> mContent;
nsAString* mOutputString;
nsIParserNode* mParserNode;
nsCOMPtr<nsIParserService> mParserService;
View
18 content/base/src/nsContentUtils.cpp
@@ -3534,24 +3534,6 @@ nsContentUtils::CheckForBOM(const unsigned char* aBuffer, PRUint32 aLength,
aBuffer[2] == 0xBF) {
aCharset = "UTF-8";
}
- else if (aLength >= 4 &&
- aBuffer[0] == 0x00 &&
- aBuffer[1] == 0x00 &&
- aBuffer[2] == 0xFE &&
- aBuffer[3] == 0xFF) {
- aCharset = "UTF-32";
- if (bigEndian)
- *bigEndian = PR_TRUE;
- }
- else if (aLength >= 4 &&
- aBuffer[0] == 0xFF &&
- aBuffer[1] == 0xFE &&
- aBuffer[2] == 0x00 &&
- aBuffer[3] == 0x00) {
- aCharset = "UTF-32";
- if (bigEndian)
- *bigEndian = PR_FALSE;
- }
else if (aLength >= 2 &&
aBuffer[0] == 0xFE && aBuffer[1] == 0xFF) {
aCharset = "UTF-16";
View
16 content/base/src/nsDOMFileReader.cpp
@@ -713,23 +713,11 @@ nsDOMFileReader::GuessCharset(const char *aFileData,
aCharset = mCharset;
} else {
// no charset detector available, check the BOM
- unsigned char sniffBuf[4];
+ unsigned char sniffBuf[3];
PRUint32 numRead = (aDataLen >= sizeof(sniffBuf) ? sizeof(sniffBuf) : aDataLen);
memcpy(sniffBuf, aFileData, numRead);
- if (numRead >= 4 &&
- sniffBuf[0] == 0x00 &&
- sniffBuf[1] == 0x00 &&
- sniffBuf[2] == 0xfe &&
- sniffBuf[3] == 0xff) {
- aCharset = "UTF-32BE";
- } else if (numRead >= 4 &&
- sniffBuf[0] == 0xff &&
- sniffBuf[1] == 0xfe &&
- sniffBuf[2] == 0x00 &&
- sniffBuf[3] == 0x00) {
- aCharset = "UTF-32LE";
- } else if (numRead >= 2 &&
+ if (numRead >= 2 &&
sniffBuf[0] == 0xfe &&
sniffBuf[1] == 0xff) {
aCharset = "UTF-16BE";
View
7 content/base/src/nsDocument.cpp
@@ -4266,11 +4266,10 @@ nsDocument::EndLoad()
}
void
-nsDocument::ContentStatesChanged(nsIContent* aContent1, nsIContent* aContent2,
- nsEventStates aStateMask)
+nsDocument::ContentStateChanged(nsIContent* aContent, nsEventStates aStateMask)
{
- NS_DOCUMENT_NOTIFY_OBSERVERS(ContentStatesChanged,
- (this, aContent1, aContent2, aStateMask));
+ NS_DOCUMENT_NOTIFY_OBSERVERS(ContentStateChanged,
+ (this, aContent, aStateMask));
}
void
View
5 content/base/src/nsDocument.h
@@ -706,9 +706,8 @@ class nsDocument : public nsIDocument,
virtual void SetReadyStateInternal(ReadyState rs);
virtual ReadyState GetReadyStateEnum();
- virtual void ContentStatesChanged(nsIContent* aContent1,
- nsIContent* aContent2,
- nsEventStates aStateMask);
+ virtual void ContentStateChanged(nsIContent* aContent,
+ nsEventStates aStateMask);
virtual void DocumentStatesChanged(nsEventStates aStateMask);