diff --git a/accessible/src/atk/AccessibleWrap.cpp b/accessible/src/atk/AccessibleWrap.cpp index 8fed8d615d1..6bb19fac695 100644 --- a/accessible/src/atk/AccessibleWrap.cpp +++ b/accessible/src/atk/AccessibleWrap.cpp @@ -27,6 +27,7 @@ #include "mozilla/Util.h" #include "nsXPCOMStrings.h" #include "nsComponentManagerUtils.h" +#include "nsIPersistentProperties2.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/atk/nsMaiInterfaceImage.cpp b/accessible/src/atk/nsMaiInterfaceImage.cpp index f0946181184..38f23462118 100644 --- a/accessible/src/atk/nsMaiInterfaceImage.cpp +++ b/accessible/src/atk/nsMaiInterfaceImage.cpp @@ -10,6 +10,7 @@ #include "ImageAccessible.h" #include "mozilla/Likely.h" #include "nsMai.h" +#include "nsIAccessibleTypes.h" #include "nsIURI.h" using namespace mozilla; diff --git a/accessible/src/atk/nsMaiInterfaceText.cpp b/accessible/src/atk/nsMaiInterfaceText.cpp index 52dc485bcc2..df41df04799 100644 --- a/accessible/src/atk/nsMaiInterfaceText.cpp +++ b/accessible/src/atk/nsMaiInterfaceText.cpp @@ -10,6 +10,7 @@ #include "HyperTextAccessible.h" #include "nsMai.h" +#include "nsIAccessibleTypes.h" #include "nsIPersistentProperties2.h" #include "mozilla/Likely.h" diff --git a/accessible/src/base/ARIAMap.cpp b/accessible/src/base/ARIAMap.cpp index f43fe29dd1b..ed344e9abe7 100644 --- a/accessible/src/base/ARIAMap.cpp +++ b/accessible/src/base/ARIAMap.cpp @@ -7,7 +7,6 @@ #include "ARIAMap.h" -#include "Accessible.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "Role.h" diff --git a/accessible/src/base/AccEvent.cpp b/accessible/src/base/AccEvent.cpp index 92256804ba4..4b2e97e1404 100644 --- a/accessible/src/base/AccEvent.cpp +++ b/accessible/src/base/AccEvent.cpp @@ -6,19 +6,12 @@ #include "AccEvent.h" -#include "ApplicationAccessibleWrap.h" -#include "nsAccessibilityService.h" #include "nsAccUtils.h" #include "DocAccessible.h" -#include "nsIAccessibleText.h" #include "xpcAccEvents.h" #include "States.h" #include "nsEventStateManager.h" -#include "nsIServiceManager.h" -#ifdef MOZ_XUL -#include "nsIDOMXULMultSelectCntrlEl.h" -#endif using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/AccGroupInfo.cpp b/accessible/src/base/AccGroupInfo.cpp index 001c0d9a373..6790a788398 100644 --- a/accessible/src/base/AccGroupInfo.cpp +++ b/accessible/src/base/AccGroupInfo.cpp @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "AccGroupInfo.h" +#include "nsAccUtils.h" #include "Role.h" #include "States.h" diff --git a/accessible/src/base/AccGroupInfo.h b/accessible/src/base/AccGroupInfo.h index fab4af1b837..1d32337136e 100644 --- a/accessible/src/base/AccGroupInfo.h +++ b/accessible/src/base/AccGroupInfo.h @@ -6,7 +6,6 @@ #define AccGroupInfo_h_ #include "Accessible-inl.h" -#include "nsAccUtils.h" namespace mozilla { namespace a11y { diff --git a/accessible/src/base/AccIterator.cpp b/accessible/src/base/AccIterator.cpp index c249482565f..bdf4b7ca3a5 100644 --- a/accessible/src/base/AccIterator.cpp +++ b/accessible/src/base/AccIterator.cpp @@ -4,15 +4,12 @@ #include "AccIterator.h" -#include "nsAccessibilityService.h" #include "AccGroupInfo.h" -#include "Accessible-inl.h" #ifdef MOZ_XUL #include "XULTreeAccessible.h" #endif #include "mozilla/dom/Element.h" -#include "nsBindingManager.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/AccIterator.h b/accessible/src/base/AccIterator.h index 85d8016d792..79d3deebffc 100644 --- a/accessible/src/base/AccIterator.h +++ b/accessible/src/base/AccIterator.h @@ -9,7 +9,8 @@ #include "DocAccessible.h" #include "Filters.h" -#include "nsAccessibilityService.h" + +class nsITreeView; namespace mozilla { namespace a11y { diff --git a/accessible/src/base/AccTypes.h b/accessible/src/base/AccTypes.h index e11bd0555a1..7edcf6f649d 100644 --- a/accessible/src/base/AccTypes.h +++ b/accessible/src/base/AccTypes.h @@ -29,7 +29,6 @@ enum AccType { eHTMLGroupboxType, eHTMLHRType, eHTMLImageMapType, - eHTMLLabelType, eHTMLLiType, eHTMLSelectListType, eHTMLMediaType, diff --git a/accessible/src/base/DocManager.cpp b/accessible/src/base/DocManager.cpp index 0911e79f6f6..f3b4e83b946 100644 --- a/accessible/src/base/DocManager.cpp +++ b/accessible/src/base/DocManager.cpp @@ -5,14 +5,11 @@ #include "DocManager.h" -#include "Accessible-inl.h" #include "ApplicationAccessible.h" #include "ARIAMap.h" #include "DocAccessible-inl.h" #include "nsAccessibilityService.h" -#include "nsAccUtils.h" #include "RootAccessibleWrap.h" -#include "States.h" #ifdef A11Y_LOG #include "Logging.h" @@ -22,13 +19,14 @@ #include "nsDocShellLoadTypes.h" #include "nsDOMEvent.h" #include "nsIChannel.h" -#include "nsIContentViewer.h" #include "nsIDOMDocument.h" #include "nsEventListenerManager.h" #include "nsIDOMWindow.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIWebNavigation.h" #include "nsServiceManagerUtils.h" +#include "nsIWebProgress.h" +#include "nsCoreUtils.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/DocManager.h b/accessible/src/base/DocManager.h index a41779b1165..58045673436 100644 --- a/accessible/src/base/DocManager.h +++ b/accessible/src/base/DocManager.h @@ -8,7 +8,6 @@ #include "nsIDocument.h" #include "nsIDOMEventListener.h" #include "nsRefPtrHashtable.h" -#include "nsIWebProgress.h" #include "nsIWebProgressListener.h" #include "nsWeakReference.h" #include "nsIPresShell.h" diff --git a/accessible/src/base/EventQueue.cpp b/accessible/src/base/EventQueue.cpp index c9235f2c8af..9fabc16c5d2 100644 --- a/accessible/src/base/EventQueue.cpp +++ b/accessible/src/base/EventQueue.cpp @@ -6,8 +6,12 @@ #include "EventQueue.h" #include "Accessible-inl.h" -#include "DocAccessible-inl.h" #include "nsEventShell.h" +#include "DocAccessible.h" +#include "nsAccessibilityService.h" +#ifdef A11Y_LOG +#include "Logging.h" +#endif using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/EventQueue.h b/accessible/src/base/EventQueue.h index 8cc00a716fe..a5457d5b0a5 100644 --- a/accessible/src/base/EventQueue.h +++ b/accessible/src/base/EventQueue.h @@ -8,8 +8,6 @@ #include "AccEvent.h" -class nsIContent; - namespace mozilla { namespace a11y { diff --git a/accessible/src/base/FocusManager.cpp b/accessible/src/base/FocusManager.cpp index e4550cc0b73..1ec9358874e 100644 --- a/accessible/src/base/FocusManager.cpp +++ b/accessible/src/base/FocusManager.cpp @@ -10,10 +10,10 @@ #include "nsAccUtils.h" #include "nsEventShell.h" #include "Role.h" -#include "RootAccessible.h" #include "nsEventStateManager.h" #include "nsFocusManager.h" +#include "mozilla/dom/Element.h" namespace dom = mozilla::dom; using namespace mozilla::a11y; diff --git a/accessible/src/base/FocusManager.h b/accessible/src/base/FocusManager.h index 1955a84193c..ccbbd9e9ee3 100644 --- a/accessible/src/base/FocusManager.h +++ b/accessible/src/base/FocusManager.h @@ -6,7 +6,10 @@ #define mozilla_a11y_FocusManager_h_ #include "nsAutoPtr.h" -#include "mozilla/dom/Element.h" + +class nsINode; +class nsIDocument; +class nsISupports; namespace mozilla { namespace a11y { diff --git a/accessible/src/base/Logging.cpp b/accessible/src/base/Logging.cpp index 3ab8a3ffae3..4e2e321ce8c 100644 --- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -22,6 +22,7 @@ #include "prenv.h" #include "nsIDocShellTreeItem.h" #include "nsIURI.h" +#include "mozilla/dom/Element.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/Logging.h b/accessible/src/base/Logging.h index 288d8bc394a..35705bd9071 100644 --- a/accessible/src/base/Logging.h +++ b/accessible/src/base/Logging.h @@ -8,12 +8,13 @@ #define mozilla_a11y_logs_h__ #include "nscore.h" -#include "nsAString.h" +#include "nsStringFwd.h" class nsIDocument; class nsINode; class nsIRequest; class nsISelection; +class nsISupports; class nsIWebProgress; namespace mozilla { diff --git a/accessible/src/base/NotificationController.cpp b/accessible/src/base/NotificationController.cpp index bfebf9f6abc..8c9f8e7fa1a 100644 --- a/accessible/src/base/NotificationController.cpp +++ b/accessible/src/base/NotificationController.cpp @@ -5,7 +5,6 @@ #include "NotificationController.h" -#include "Accessible-inl.h" #include "DocAccessible-inl.h" #include "TextLeafAccessible.h" #include "TextUpdater.h" diff --git a/accessible/src/base/NotificationController.h b/accessible/src/base/NotificationController.h index 4b7dfbb7fb9..24ac4bfe72e 100644 --- a/accessible/src/base/NotificationController.h +++ b/accessible/src/base/NotificationController.h @@ -15,12 +15,9 @@ #include "Logging.h" #endif -class nsIContent; - namespace mozilla { namespace a11y { -class Accessible; class DocAccessible; /** diff --git a/accessible/src/base/RoleAsserts.cpp b/accessible/src/base/RoleAsserts.cpp index 4477bc9202c..34a9a203941 100644 --- a/accessible/src/base/RoleAsserts.cpp +++ b/accessible/src/base/RoleAsserts.cpp @@ -7,8 +7,6 @@ #include "nsIAccessibleRole.h" #include "Role.h" -#include "mozilla/Assertions.h" - using namespace mozilla::a11y; #define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \ diff --git a/accessible/src/base/SelectionManager.cpp b/accessible/src/base/SelectionManager.cpp index 96678d522e9..c6f1ea183ea 100644 --- a/accessible/src/base/SelectionManager.cpp +++ b/accessible/src/base/SelectionManager.cpp @@ -10,17 +10,15 @@ #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "nsIAccessibleEvent.h" -#include "RootAccessible.h" #include "nsCaret.h" +#include "nsIAccessibleTypes.h" #include "nsIDOMDocument.h" -#include "nsIDOMHTMLAnchorElement.h" -#include "nsIDOMHTMLTextAreaElement.h" #include "nsIFrame.h" #include "nsIPresShell.h" #include "nsISelectionPrivate.h" -#include "nsServiceManagerUtils.h" #include "mozilla/Selection.h" +#include "mozilla/dom/Element.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/TextAttrs.cpp b/accessible/src/base/TextAttrs.cpp index 0efb08d4879..76d51ec4864 100644 --- a/accessible/src/base/TextAttrs.cpp +++ b/accessible/src/base/TextAttrs.cpp @@ -6,15 +6,14 @@ #include "TextAttrs.h" #include "Accessible-inl.h" -#include "HyperTextAccessibleWrap.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "StyleInfo.h" #include "gfxFont.h" -#include "gfxUserFontSet.h" #include "nsFontMetrics.h" #include "nsLayoutUtils.h" +#include "HyperTextAccessible.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/TreeWalker.h b/accessible/src/base/TreeWalker.h index aa5647d4f5e..4fa02eb87d6 100644 --- a/accessible/src/base/TreeWalker.h +++ b/accessible/src/base/TreeWalker.h @@ -6,7 +6,7 @@ #ifndef mozilla_a11y_TreeWalker_h_ #define mozilla_a11y_TreeWalker_h_ -#include "nsAutoPtr.h" +#include class nsIContent; diff --git a/accessible/src/base/nsAccUtils.cpp b/accessible/src/base/nsAccUtils.cpp index 0cd188cfd66..3be7c530e8c 100644 --- a/accessible/src/base/nsAccUtils.cpp +++ b/accessible/src/base/nsAccUtils.cpp @@ -15,13 +15,10 @@ #include "Role.h" #include "States.h" #include "TextLeafAccessible.h" -#include "nsIMutableArray.h" #include "nsIDOMXULContainerElement.h" -#include "nsIDOMXULSelectCntrlEl.h" -#include "nsIDOMXULSelectCntrlItemEl.h" -#include "nsWhitespaceTokenizer.h" -#include "nsComponentManagerUtils.h" +#include "nsIPersistentProperties2.h" +#include "mozilla/dom/Element.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/base/nsAccUtils.h b/accessible/src/base/nsAccUtils.h index aad5b8826db..d43c99f1264 100644 --- a/accessible/src/base/nsAccUtils.h +++ b/accessible/src/base/nsAccUtils.h @@ -7,23 +7,21 @@ #define nsAccUtils_h_ #include "mozilla/a11y/Accessible.h" -#include "nsIAccessibleText.h" #include "nsAccessibilityService.h" #include "nsCoreUtils.h" -#include "mozilla/dom/Element.h" #include "nsIDocShell.h" -#include "nsIPersistentProperties2.h" -#include "nsIPresShell.h" #include "nsPoint.h" -struct nsRoleMapEntry; - namespace mozilla { + +namespace dom { +class Element; +} + namespace a11y { -class Accessible; class HyperTextAccessible; class DocAccessible; diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp index 276686f4d2c..c333532340c 100644 --- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -5,20 +5,11 @@ #include "nsAccessNode.h" -#include "nsAccessibilityService.h" #include "nsAccUtils.h" #include "nsCoreUtils.h" #include "RootAccessible.h" #include "nsIDocShell.h" -#include "nsIDOMWindow.h" -#include "nsIFrame.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsIPresShell.h" -#include "nsIServiceManager.h" -#include "nsFocusManager.h" -#include "nsPresContext.h" -#include "mozilla/Services.h" using namespace mozilla::a11y; diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h index beed6774cf7..987da6afaa6 100644 --- a/accessible/src/base/nsAccessNode.h +++ b/accessible/src/base/nsAccessNode.h @@ -10,14 +10,10 @@ #ifndef _nsAccessNode_H_ #define _nsAccessNode_H_ -#include "nsIAccessibleTypes.h" #include "nsINode.h" class nsIContent; -class nsIDocShellTreeItem; class nsIFrame; -class nsIPresShell; -class nsPresContext; namespace mozilla { namespace a11y { diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 0461fd68e12..0093a5b632f 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -6,7 +6,6 @@ #include "nsAccessibilityService.h" // NOTE: alphabetically ordered -#include "Accessible-inl.h" #include "ApplicationAccessibleWrap.h" #include "ARIAGridAccessibleWrap.h" #include "ARIAMap.h" @@ -20,13 +19,18 @@ #include "HTMLSelectAccessible.h" #include "HTMLTableAccessibleWrap.h" #include "HyperTextAccessibleWrap.h" +#include "RootAccessible.h" #include "nsAccessiblePivot.h" #include "nsAccUtils.h" +#include "nsAttrName.h" #include "nsEventShell.h" +#include "nsIURI.h" #include "OuterDocAccessible.h" #include "Platform.h" #include "Role.h" +#ifdef MOZ_ACCESSIBILITY_ATK #include "RootAccessibleWrap.h" +#endif #include "States.h" #include "Statistics.h" #include "TextLeafAccessibleWrap.h" @@ -38,6 +42,7 @@ #ifdef XP_WIN #include "mozilla/a11y/Compatibility.h" #include "HTMLWin32ObjectAccessible.h" +#include "mozilla/StaticPtr.h" #endif #ifdef A11Y_LOG @@ -48,25 +53,18 @@ #include "nsExceptionHandler.h" #endif -#include "nsIDOMDocument.h" -#include "nsIDOMHTMLObjectElement.h" -#include "nsIDOMXULElement.h" #include "nsImageFrame.h" #include "nsIObserverService.h" #include "nsLayoutUtils.h" -#include "nsNPAPIPluginInstance.h" #include "nsObjectFrame.h" #include "nsSVGPathGeometryFrame.h" #include "nsTreeBodyFrame.h" #include "nsTreeColumns.h" #include "nsTreeUtils.h" -#include "nsBindingManager.h" #include "nsXBLPrototypeBinding.h" #include "nsXBLBinding.h" -#include "mozilla/dom/Element.h" #include "mozilla/Preferences.h" #include "mozilla/Services.h" -#include "mozilla/StaticPtr.h" #include "mozilla/Util.h" #include "nsDeckFrame.h" @@ -83,6 +81,10 @@ #include "XULTreeGridAccessibleWrap.h" #endif +#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK) +#include "nsNPAPIPluginInstance.h" +#endif + using namespace mozilla; using namespace mozilla::a11y; @@ -1433,6 +1435,12 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, return accessible.forget(); } + if (tag == nsGkAtoms::label) { + nsRefPtr accessible = + new HTMLLabelAccessible(aContent, document); + return accessible.forget(); + } + if (tag == nsGkAtoms::output) { nsRefPtr accessible = new HTMLOutputAccessible(aContent, document); @@ -1492,9 +1500,6 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame, case eHTMLImageMapType: newAcc = new HTMLImageMapAccessible(aContent, document); break; - case eHTMLLabelType: - newAcc = new HTMLLabelAccessible(aContent, document); - break; case eHTMLLiType: if (aContext->IsList() && aContext->GetContent() == aContent->GetParent()) { diff --git a/accessible/src/base/nsAccessiblePivot.cpp b/accessible/src/base/nsAccessiblePivot.cpp index 61d3a4703d9..43e1b6efb99 100644 --- a/accessible/src/base/nsAccessiblePivot.cpp +++ b/accessible/src/base/nsAccessiblePivot.cpp @@ -6,15 +6,10 @@ #include "nsAccessiblePivot.h" -#include "DocAccessible.h" #include "HyperTextAccessible.h" #include "nsAccUtils.h" #include "States.h" -#include "nsArrayUtils.h" -#include "nsComponentManagerUtils.h" -#include "nsISupportsPrimitives.h" - using namespace mozilla::a11y; diff --git a/accessible/src/base/nsAccessiblePivot.h b/accessible/src/base/nsAccessiblePivot.h index 476650a5d9d..0c578c72a42 100644 --- a/accessible/src/base/nsAccessiblePivot.h +++ b/accessible/src/base/nsAccessiblePivot.h @@ -15,7 +15,6 @@ #include "nsCycleCollectionParticipant.h" #include "mozilla/Attributes.h" -class nsIAccessibleTraversalRule; class RuleCache; /** diff --git a/accessible/src/base/nsCoreUtils.cpp b/accessible/src/base/nsCoreUtils.cpp index cc8fb478f8b..e1b212455e6 100644 --- a/accessible/src/base/nsCoreUtils.cpp +++ b/accessible/src/base/nsCoreUtils.cpp @@ -7,8 +7,6 @@ #include "nsIAccessibleTypes.h" -#include "nsAccessNode.h" - #include "nsIBaseWindow.h" #include "nsIDocShellTreeOwner.h" #include "nsIDocument.h" @@ -16,10 +14,9 @@ #include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLElement.h" #include "nsRange.h" -#include "nsIDOMWindow.h" +#include "nsIBoxObject.h" #include "nsIDOMXULElement.h" #include "nsIDocShell.h" -#include "nsIContentViewer.h" #include "nsEventListenerManager.h" #include "nsIPresShell.h" #include "nsPresContext.h" @@ -27,16 +24,12 @@ #include "nsEventStateManager.h" #include "nsISelectionPrivate.h" #include "nsISelectionController.h" -#include "nsPIDOMWindow.h" #include "nsGUIEvent.h" #include "nsView.h" -#include "nsLayoutUtils.h" #include "nsGkAtoms.h" #include "nsDOMTouchEvent.h" #include "nsComponentManagerUtils.h" -#include "nsIInterfaceRequestorUtils.h" -#include "mozilla/dom/Element.h" #include "nsITreeBoxObject.h" #include "nsITreeColumns.h" diff --git a/accessible/src/base/nsCoreUtils.h b/accessible/src/base/nsCoreUtils.h index 110434389fb..5107d4a58cc 100644 --- a/accessible/src/base/nsCoreUtils.h +++ b/accessible/src/base/nsCoreUtils.h @@ -7,7 +7,6 @@ #define nsCoreUtils_h_ #include "nsIContent.h" -#include "nsIBoxObject.h" #include "nsIPresShell.h" #include "nsIDOMDOMStringList.h" @@ -15,6 +14,7 @@ #include "nsTArray.h" class nsRange; +class nsIBoxObject; class nsIFrame; class nsIDocShell; class nsITreeColumn; diff --git a/accessible/src/base/nsTextEquivUtils.cpp b/accessible/src/base/nsTextEquivUtils.cpp index 2d77c2d2488..b486fa015c0 100644 --- a/accessible/src/base/nsTextEquivUtils.cpp +++ b/accessible/src/base/nsTextEquivUtils.cpp @@ -9,14 +9,9 @@ #include "Accessible-inl.h" #include "AccIterator.h" -#include "nsAccessibilityService.h" -#include "nsAccUtils.h" -#include "nsStyleStructInlines.h" - +#include "nsCoreUtils.h" #include "nsIDOMXULLabeledControlEl.h" -#include "nsArrayUtils.h" - using namespace mozilla::a11y; /** diff --git a/accessible/src/base/nsTextEquivUtils.h b/accessible/src/base/nsTextEquivUtils.h index 0615e20b433..77ed2d39043 100644 --- a/accessible/src/base/nsTextEquivUtils.h +++ b/accessible/src/base/nsTextEquivUtils.h @@ -9,7 +9,6 @@ #define _nsTextEquivUtils_H_ #include "Accessible.h" -#include "nsIStringBundle.h" #include "Role.h" class nsIContent; diff --git a/accessible/src/generic/ARIAGridAccessible.cpp b/accessible/src/generic/ARIAGridAccessible.cpp index 5250fa3d294..2be1b3e2aef 100644 --- a/accessible/src/generic/ARIAGridAccessible.cpp +++ b/accessible/src/generic/ARIAGridAccessible.cpp @@ -12,6 +12,7 @@ #include "States.h" #include "nsIMutableArray.h" +#include "nsIPersistentProperties2.h" #include "nsComponentManagerUtils.h" using namespace mozilla; diff --git a/accessible/src/generic/DocAccessible-inl.h b/accessible/src/generic/DocAccessible-inl.h index dbeeca49504..6e884863ca7 100644 --- a/accessible/src/generic/DocAccessible-inl.h +++ b/accessible/src/generic/DocAccessible-inl.h @@ -11,6 +11,7 @@ #include "nsAccessibilityService.h" #include "NotificationController.h" #include "States.h" +#include "nsIScrollableFrame.h" #ifdef A11Y_LOG #include "Logging.h" diff --git a/accessible/src/generic/DocAccessible.cpp b/accessible/src/generic/DocAccessible.cpp index 0cb1c8c76fd..082c575525b 100644 --- a/accessible/src/generic/DocAccessible.cpp +++ b/accessible/src/generic/DocAccessible.cpp @@ -32,6 +32,7 @@ #include "nsIFrame.h" #include "nsIInterfaceRequestorUtils.h" #include "nsINameSpaceManager.h" +#include "nsIPersistentProperties2.h" #include "nsIPresShell.h" #include "nsIServiceManager.h" #include "nsViewManager.h" diff --git a/accessible/src/generic/HyperTextAccessible.cpp b/accessible/src/generic/HyperTextAccessible.cpp index 28c871f8a79..eea26770480 100644 --- a/accessible/src/generic/HyperTextAccessible.cpp +++ b/accessible/src/generic/HyperTextAccessible.cpp @@ -25,6 +25,7 @@ #include "nsFrameSelection.h" #include "nsILineIterator.h" #include "nsIInterfaceRequestorUtils.h" +#include "nsIPersistentProperties2.h" #include "nsIPlaintextEditor.h" #include "nsIScrollableFrame.h" #include "nsIServiceManager.h" diff --git a/accessible/src/generic/ImageAccessible.cpp b/accessible/src/generic/ImageAccessible.cpp index 2d4cb0676ea..341f0630e46 100644 --- a/accessible/src/generic/ImageAccessible.cpp +++ b/accessible/src/generic/ImageAccessible.cpp @@ -18,6 +18,7 @@ #include "nsIPresShell.h" #include "nsIServiceManager.h" #include "nsIDOMHTMLImageElement.h" +#include "nsIPersistentProperties2.h" #include "nsPIDOMWindow.h" #include "nsIURI.h" diff --git a/accessible/src/html/HTMLElementAccessibles.cpp b/accessible/src/html/HTMLElementAccessibles.cpp index 2a2f53d4202..e64286c05c6 100644 --- a/accessible/src/html/HTMLElementAccessibles.cpp +++ b/accessible/src/html/HTMLElementAccessibles.cpp @@ -8,6 +8,7 @@ #include "DocAccessible.h" #include "nsAccUtils.h" #include "nsIAccessibleRelation.h" +#include "nsIPersistentProperties2.h" #include "nsTextEquivUtils.h" #include "Relation.h" #include "Role.h" diff --git a/accessible/src/html/HTMLFormControlAccessible.cpp b/accessible/src/html/HTMLFormControlAccessible.cpp index 0309b77545a..97437cf9c52 100644 --- a/accessible/src/html/HTMLFormControlAccessible.cpp +++ b/accessible/src/html/HTMLFormControlAccessible.cpp @@ -23,6 +23,7 @@ #include "nsIEditor.h" #include "nsIFormControl.h" #include "nsINameSpaceManager.h" +#include "nsIPersistentProperties2.h" #include "nsISelectionController.h" #include "jsapi.h" #include "nsIServiceManager.h" diff --git a/accessible/src/html/HTMLTableAccessible.cpp b/accessible/src/html/HTMLTableAccessible.cpp index 70e3e04b2b3..4d78d6b778d 100644 --- a/accessible/src/html/HTMLTableAccessible.cpp +++ b/accessible/src/html/HTMLTableAccessible.cpp @@ -28,6 +28,7 @@ #include "nsIDOMHTMLCollection.h" #include "nsIDocument.h" #include "nsIMutableArray.h" +#include "nsIPersistentProperties2.h" #include "nsIPresShell.h" #include "nsITableCellLayout.h" #include "nsFrameSelection.h" diff --git a/accessible/src/mac/mozAccessible.mm b/accessible/src/mac/mozAccessible.mm index 119a1ae0d36..97d19e1dc3c 100644 --- a/accessible/src/mac/mozAccessible.mm +++ b/accessible/src/mac/mozAccessible.mm @@ -13,6 +13,7 @@ #include "nsIAccessibleRelation.h" #include "nsIAccessibleText.h" #include "nsIAccessibleEditableText.h" +#include "nsIPersistentProperties2.h" #include "Relation.h" #include "Role.h" #include "RootAccessible.h" diff --git a/accessible/src/mac/mozTextAccessible.mm b/accessible/src/mac/mozTextAccessible.mm index f88c3490878..05d426e7c98 100644 --- a/accessible/src/mac/mozTextAccessible.mm +++ b/accessible/src/mac/mozTextAccessible.mm @@ -6,6 +6,7 @@ #include "Accessible-inl.h" #include "AccessibleWrap.h" #include "TextLeafAccessible.h" +#include "nsIAccessibleTypes.h" #include "nsCocoaUtils.h" #include "nsObjCExceptions.h" diff --git a/accessible/src/windows/ia2/ia2AccessibleText.cpp b/accessible/src/windows/ia2/ia2AccessibleText.cpp index 3b9d9663dc1..5d3b8b9347e 100644 --- a/accessible/src/windows/ia2/ia2AccessibleText.cpp +++ b/accessible/src/windows/ia2/ia2AccessibleText.cpp @@ -13,6 +13,7 @@ #include "HyperTextAccessibleWrap.h" #include "nsIPersistentProperties2.h" +#include "nsIAccessibleTypes.h" using namespace mozilla::a11y; diff --git a/accessible/src/windows/msaa/AccessibleWrap.cpp b/accessible/src/windows/msaa/AccessibleWrap.cpp index 7c08afe15db..737f37c09ff 100644 --- a/accessible/src/windows/msaa/AccessibleWrap.cpp +++ b/accessible/src/windows/msaa/AccessibleWrap.cpp @@ -42,6 +42,8 @@ #include "AccessibleRole.h" #include "AccessibleStates.h" #include "oleacc.h" +#include "nsIAccessibleTypes.h" +#include "nsIPersistentProperties2.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/src/windows/sdn/sdnAccessible.cpp b/accessible/src/windows/sdn/sdnAccessible.cpp index 2ecd9c61115..96357af88e9 100644 --- a/accessible/src/windows/sdn/sdnAccessible.cpp +++ b/accessible/src/windows/sdn/sdnAccessible.cpp @@ -11,6 +11,7 @@ #include "nsAttrName.h" #include "nsCoreUtils.h" +#include "nsIAccessibleTypes.h" #include "nsIDOMHTMLElement.h" #include "nsIDOMCSSStyleDeclaration.h" #include "nsServiceManagerUtils.h" diff --git a/accessible/src/windows/sdn/sdnTextAccessible.cpp b/accessible/src/windows/sdn/sdnTextAccessible.cpp index b8b71c6afe4..30b8d092b47 100644 --- a/accessible/src/windows/sdn/sdnTextAccessible.cpp +++ b/accessible/src/windows/sdn/sdnTextAccessible.cpp @@ -16,6 +16,7 @@ #include "nsPresContext.h" #include "nsLayoutUtils.h" #include "gfxFont.h" +#include "nsIAccessibleTypes.h" using namespace mozilla::a11y; diff --git a/accessible/src/xul/XULFormControlAccessible.cpp b/accessible/src/xul/XULFormControlAccessible.cpp index d6981e44942..d0f5fa7fd2c 100644 --- a/accessible/src/xul/XULFormControlAccessible.cpp +++ b/accessible/src/xul/XULFormControlAccessible.cpp @@ -28,6 +28,7 @@ #include "nsINameSpaceManager.h" #include "nsITextControlFrame.h" #include "nsMenuPopupFrame.h" +#include "mozilla/dom/Element.h" using namespace mozilla::a11y; diff --git a/accessible/src/xul/XULListboxAccessible.cpp b/accessible/src/xul/XULListboxAccessible.cpp index 6863646c219..8ad8f85a1be 100644 --- a/accessible/src/xul/XULListboxAccessible.cpp +++ b/accessible/src/xul/XULListboxAccessible.cpp @@ -21,6 +21,7 @@ #include "nsIDOMXULPopupElement.h" #include "nsIDOMXULSelectCntrlItemEl.h" #include "nsIMutableArray.h" +#include "nsIPersistentProperties2.h" using namespace mozilla::a11y; diff --git a/accessible/src/xul/XULSliderAccessible.cpp b/accessible/src/xul/XULSliderAccessible.cpp index 96e5f1c7032..ec8f1028bb9 100644 --- a/accessible/src/xul/XULSliderAccessible.cpp +++ b/accessible/src/xul/XULSliderAccessible.cpp @@ -10,6 +10,7 @@ #include "States.h" #include "nsIFrame.h" +#include "mozilla/dom/Element.h" using namespace mozilla::a11y; diff --git a/accessible/src/xul/XULTreeAccessible.cpp b/accessible/src/xul/XULTreeAccessible.cpp index 019adacee4c..e134a79a123 100644 --- a/accessible/src/xul/XULTreeAccessible.cpp +++ b/accessible/src/xul/XULTreeAccessible.cpp @@ -21,6 +21,7 @@ #include "nsIAccessibleRelation.h" #include "nsIAutoCompleteInput.h" #include "nsIAutoCompletePopup.h" +#include "nsIBoxObject.h" #include "nsIDOMXULElement.h" #include "nsIDOMXULMenuListElement.h" #include "nsIDOMXULMultSelectCntrlEl.h" diff --git a/accessible/src/xul/XULTreeGridAccessible.cpp b/accessible/src/xul/XULTreeGridAccessible.cpp index 8a885a72195..8a578f7ac1c 100644 --- a/accessible/src/xul/XULTreeGridAccessible.cpp +++ b/accessible/src/xul/XULTreeGridAccessible.cpp @@ -14,7 +14,9 @@ #include "Role.h" #include "States.h" +#include "nsIBoxObject.h" #include "nsIMutableArray.h" +#include "nsIPersistentProperties2.h" #include "nsITreeSelection.h" #include "nsComponentManagerUtils.h" diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 0b8ce20d266..554bb9877ed 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -73,7 +73,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("layers.force-tiles", false); +pref("layers.force-tiles", true); /* download manager (don't show the window or alert) */ pref("browser.download.useDownloadDir", true); diff --git a/browser/base/content/test/browser_tabopen_reflows.js b/browser/base/content/test/browser_tabopen_reflows.js index 03ba66b92ef..9f5005ee067 100644 --- a/browser/base/content/test/browser_tabopen_reflows.js +++ b/browser/base/content/test/browser_tabopen_reflows.js @@ -38,8 +38,7 @@ const EXPECTED_REFLOWS = [ "TabItem__reconnect@chrome://browser/content/tabview.js|" + "TabItem@chrome://browser/content/tabview.js|" + "TabItems_link@chrome://browser/content/tabview.js|" + - "@chrome://browser/content/tabview.js|" + - "addTab@chrome://browser/content/tabbrowser.xml|", + "@chrome://browser/content/tabview.js|", // SessionStore.getWindowDimensions() "ssi_getWindowDimension@resource:///modules/sessionstore/SessionStore.jsm|" + @@ -88,6 +87,7 @@ let observer = { let path = (new Error().stack).split("\n").slice(1).map(line => { return line.replace(/:\d+$/, ""); }).join("|"); + let pathWithLineNumbers = (new Error().stack).split("\n").slice(1).join("|"); // Stack trace is empty. Reflow was triggered by native code. if (path === "") { @@ -102,7 +102,7 @@ let observer = { } } - ok(false, "unexpected uninterruptible reflow '" + path + "'"); + ok(false, "unexpected uninterruptible reflow '" + pathWithLineNumbers + "'"); }, reflowInterruptible: function (start, end) { diff --git a/browser/components/feeds/src/WebContentConverter.js b/browser/components/feeds/src/WebContentConverter.js index 0591d6501ff..7c1cca72214 100644 --- a/browser/components/feeds/src/WebContentConverter.js +++ b/browser/components/feeds/src/WebContentConverter.js @@ -369,6 +369,13 @@ WebContentConverterRegistrar.prototype = { function WCCR_registerProtocolHandler(aProtocol, aURIString, aTitle, aContentWindow) { LOG("registerProtocolHandler(" + aProtocol + "," + aURIString + "," + aTitle + ")"); + var uri = this._checkAndGetURI(aURIString, aContentWindow); + + // If the protocol handler is already registered, just return early. + if (this._protocolHandlerRegistered(aProtocol, uri.spec)) { + return; + } + var browserWindow = this._getBrowserWindowForContentWindow(aContentWindow); if (PrivateBrowsingUtils.isWindowPrivate(browserWindow)) { // Inside the private browsing mode, we don't want to alert the user to save @@ -406,25 +413,18 @@ WebContentConverterRegistrar.prototype = { throw("Not allowed to register a protocol handler for " + aProtocol); } - var uri = this._checkAndGetURI(aURIString, aContentWindow); + // Now Ask the user and provide the proper callback + var message = this._getFormattedString("addProtocolHandler", + [aTitle, uri.host, aProtocol]); - var buttons, message; - if (this._protocolHandlerRegistered(aProtocol, uri.spec)) - message = this._getFormattedString("protocolHandlerRegistered", - [aTitle, aProtocol]); - else { - // Now Ask the user and provide the proper callback - message = this._getFormattedString("addProtocolHandler", - [aTitle, uri.host, aProtocol]); + var notificationIcon = uri.prePath + "/favicon.ico"; + var notificationValue = "Protocol Registration: " + aProtocol; + var addButton = { + label: this._getString("addProtocolHandlerAddButton"), + accessKey: this._getString("addHandlerAddButtonAccesskey"), + protocolInfo: { protocol: aProtocol, uri: uri.spec, name: aTitle }, - var notificationIcon = uri.prePath + "/favicon.ico"; - var notificationValue = "Protocol Registration: " + aProtocol; - var addButton = { - label: this._getString("addProtocolHandlerAddButton"), - accessKey: this._getString("addHandlerAddButtonAccesskey"), - protocolInfo: { protocol: aProtocol, uri: uri.spec, name: aTitle }, - - callback: + callback: function WCCR_addProtocolHandlerButtonCallback(aNotification, aButtonInfo) { var protocol = aButtonInfo.protocolInfo.protocol; var uri = aButtonInfo.protocolInfo.uri; @@ -450,11 +450,8 @@ WebContentConverterRegistrar.prototype = { getService(Ci.nsIHandlerService); hs.store(handlerInfo); } - }; - buttons = [addButton]; - } - - + }; + var buttons; var browserElement = this._getBrowserForContentWindow(browserWindow, aContentWindow); var notificationBox = browserWindow.getBrowser().getNotificationBox(browserElement); notificationBox.appendNotification(message, diff --git a/browser/components/sessionstore/test/browser_483330.js b/browser/components/sessionstore/test/browser_483330.js index 50f3a6a194c..cd0048e4c2d 100644 --- a/browser/components/sessionstore/test/browser_483330.js +++ b/browser/components/sessionstore/test/browser_483330.js @@ -28,6 +28,9 @@ function test() { is(newBrowser.contentWindow.scrollY, 1200, "still scrolled vertically"); gBrowser.removeTab(newTab); + // Call stopPropagation on the event so we won't fire the + // tabbrowser's SSTabRestored listeners. + e.stopPropagation(); finish(); }, true); diff --git a/browser/components/sessionstore/test/browser_491168.js b/browser/components/sessionstore/test/browser_491168.js index 01572dc654e..05cc8bddbb3 100644 --- a/browser/components/sessionstore/test/browser_491168.js +++ b/browser/components/sessionstore/test/browser_491168.js @@ -24,17 +24,24 @@ function test() { tabState.entries[0].referrer = REFERRER2; ss.setTabState(tab, JSON.stringify(tabState)); - tab.addEventListener("SSTabRestored", function() { + tab.addEventListener("SSTabRestored", function(e) { tab.removeEventListener("SSTabRestored", arguments.callee, true); is(window.content.document.referrer, REFERRER2, "document.referrer matches referrer set via setTabState."); gBrowser.removeTab(tab); + // Call stopPropagation on the event so we won't fire the + // tabbrowser's SSTabRestored listeners. + e.stopPropagation(); + let newTab = ss.undoCloseTab(window, 0); - newTab.addEventListener("SSTabRestored", function() { + newTab.addEventListener("SSTabRestored", function(e) { newTab.removeEventListener("SSTabRestored", arguments.callee, true); is(window.content.document.referrer, REFERRER2, "document.referrer is still correct after closing and reopening the tab."); gBrowser.removeTab(newTab); + // Call stopPropagation on the event so we won't fire the + // tabbrowser's SSTabRestored listeners. + e.stopPropagation(); finish(); }, true); diff --git a/browser/components/sessionstore/test/browser_662743.js b/browser/components/sessionstore/test/browser_662743.js index 6d49a2fec56..4e783b4138f 100644 --- a/browser/components/sessionstore/test/browser_662743.js +++ b/browser/components/sessionstore/test/browser_662743.js @@ -98,6 +98,9 @@ function testTabRestoreData(aFormData, aExpectedValues, aCallback) { // clean up gBrowser.removeTab(tab); + // Call stopPropagation on the event so we won't fire the + // tabbrowser's SSTabRestored listeners. + aEvent.stopPropagation(); aCallback(); }); diff --git a/browser/locales/en-US/chrome/browser/feeds/subscribe.properties b/browser/locales/en-US/chrome/browser/feeds/subscribe.properties index 27cf505bb76..359a6650412 100644 --- a/browser/locales/en-US/chrome/browser/feeds/subscribe.properties +++ b/browser/locales/en-US/chrome/browser/feeds/subscribe.properties @@ -49,5 +49,3 @@ feedSubscriptionVideoPodcast2=You can subscribe to this video podcast to receive # "Add %appName (%appDomain) as an application for %protocolType links?" addProtocolHandler=Add %S (%S) as an application for %S links? addProtocolHandlerAddButton=Add Application -# "%appName has already been added as an application for %protocolType links." -protocolHandlerRegistered=%S has already been added as an application for %S links. diff --git a/build/pymake/pymake/parser.py b/build/pymake/pymake/parser.py index 49521122d86..fee1b23160b 100644 --- a/build/pymake/pymake/parser.py +++ b/build/pymake/pymake/parser.py @@ -372,6 +372,9 @@ def parsefile(pathname): pathname = os.path.realpath(pathname) return _parsecache.get(pathname) +# colon followed by anything except a slash (Windows path detection) +_depfilesplitter = re.compile(r':(?![\\/])') + def parsedepfile(pathname): """ Parse a filename listing only depencencies into a parserdata.StatementList. @@ -394,7 +397,7 @@ def parsedepfile(pathname): pathname = os.path.realpath(pathname) stmts = parserdata.StatementList() for line in continuation_iter(open(pathname).readlines()): - target, deps = line.split(":", 1) + target, deps = _depfilesplitter.split(line, 1) stmts.append(parserdata.Rule(data.StringExpansion(target, None), data.StringExpansion(deps, None), False)) return stmts diff --git a/config/rules.mk b/config/rules.mk index 3655fc46f25..14f99dd1a89 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -54,11 +54,11 @@ ifndef EXTERNALLY_MANAGED_MAKE_FILE # scenarios. _current_makefile = $(CURDIR)/$(firstword $(MAKEFILE_LIST)) -$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $($(var)),\ +$(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\ $(error Variable $(var) is defined in $(_current_makefile). It should only be defined in moz.build files),\ )) -$(foreach var,$(_DEPRECATED_VARIABLES),$(if $($(var)),\ +$(foreach var,$(_DEPRECATED_VARIABLES),$(if $(filter file override,$(subst $(NULL) ,_,$(origin $(var)))),\ $(error Variable $(var) is defined in $(_current_makefile). This variable has been deprecated. It does nothing. It must be removed in order to build)\ )) diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index 4870ac0d2d0..e05f6e50b66 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -46,6 +46,7 @@ class nsIURI; class nsNodeSupportsWeakRefTearoff; class nsNodeWeakReference; class nsXPCClassInfo; +class nsDOMMutationObserver; namespace mozilla { namespace dom { @@ -1474,6 +1475,8 @@ public: // aObject alive anymore. void UnbindObject(nsISupports* aObject); + void GetBoundMutationObservers(nsTArray >& aResult); + /** * Returns the length of this node, as specified at * diff --git a/content/base/src/nsDOMMutationObserver.cpp b/content/base/src/nsDOMMutationObserver.cpp index f79d1836fd4..a758cb88a91 100644 --- a/content/base/src/nsDOMMutationObserver.cpp +++ b/content/base/src/nsDOMMutationObserver.cpp @@ -66,7 +66,6 @@ NS_IMPL_RELEASE(nsMutationReceiver) NS_INTERFACE_MAP_BEGIN(nsMutationReceiver) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_ENTRY(nsIMutationObserver) - NS_INTERFACE_MAP_ENTRY(nsMutationReceiver) NS_INTERFACE_MAP_END nsMutationReceiver::nsMutationReceiver(nsINode* aTarget, @@ -321,6 +320,7 @@ void nsMutationReceiver::NodeWillBeDestroyed(const nsINode *aNode) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMMutationObserver) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) + NS_INTERFACE_MAP_ENTRY(nsDOMMutationObserver) NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMMutationObserver) @@ -525,6 +525,32 @@ nsDOMMutationObserver::TakeRecords( mPendingMutations.SwapElements(aRetVal); } +void +nsDOMMutationObserver::GetObservingInfo(nsTArray >& aResult) +{ + aResult.SetCapacity(mReceivers.Count()); + for (int32_t i = 0; i < mReceivers.Count(); ++i) { + MutationObservingInfoInitializer& info = aResult.AppendElement()->SetValue(); + nsMutationReceiver* mr = mReceivers[i]; + info.mChildList = mr->ChildList(); + info.mAttributes = mr->Attributes(); + info.mCharacterData = mr->CharacterData(); + info.mSubtree = mr->Subtree(); + info.mAttributeOldValue = mr->AttributeOldValue(); + info.mCharacterDataOldValue = mr->CharacterDataOldValue(); + nsCOMArray& filters = mr->AttributeFilter(); + if (filters.Count()) { + info.mAttributeFilter.Construct(); + mozilla::dom::Sequence& filtersAsStrings = + info.mAttributeFilter.Value(); + for (int32_t j = 0; j < filters.Count(); ++j) { + filtersAsStrings.AppendElement(nsDependentAtomString(filters[j])); + } + } + info.mObservedNode = mr->Target(); + } +} + // static already_AddRefed nsDOMMutationObserver::Constructor(const mozilla::dom::GlobalObject& aGlobal, diff --git a/content/base/src/nsDOMMutationObserver.h b/content/base/src/nsDOMMutationObserver.h index ccfbed1b51d..f12024a1b4c 100644 --- a/content/base/src/nsDOMMutationObserver.h +++ b/content/base/src/nsDOMMutationObserver.h @@ -25,6 +25,7 @@ #include "mozilla/dom/MutationObserverBinding.h" class nsDOMMutationObserver; +using mozilla::dom::MutationObservingInfoInitializer; class nsDOMMutationRecord : public nsISupports, public nsWrapperCache @@ -267,10 +268,6 @@ private: }; -#define NS_MUTATION_OBSERVER_IID \ -{ 0xe628f313, 0x8129, 0x4f90, \ - { 0x8e, 0xc3, 0x85, 0xe8, 0x28, 0x22, 0xe7, 0xab } } - class nsMutationReceiver : public nsMutationReceiverBase { public: @@ -315,7 +312,6 @@ public: void Disconnect(bool aRemoveFromObserver); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMUTATION_OBSERVER_IID) NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW NS_DECL_ISUPPORTS @@ -337,7 +333,9 @@ public: } }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsMutationReceiver, NS_MUTATION_OBSERVER_IID) +#define NS_DOM_MUTATION_OBSERVER_IID \ +{ 0x0c3b91f8, 0xcc3b, 0x4b08, \ + { 0x9e, 0xab, 0x07, 0x47, 0xa9, 0xe4, 0x65, 0xb4 } } class nsDOMMutationObserver : public nsISupports, public nsWrapperCache @@ -352,6 +350,7 @@ public: virtual ~nsDOMMutationObserver(); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationObserver) + NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_MUTATION_OBSERVER_IID) static already_AddRefed Constructor(const mozilla::dom::GlobalObject& aGlobal, @@ -379,6 +378,10 @@ public: void HandleMutation(); + void GetObservingInfo(nsTArray >& aResult); + + mozilla::dom::MutationCallback* MutationCallback() { return mCallback; } + // static methods static void HandleMutations() { @@ -445,6 +448,8 @@ protected: sCurrentlyHandlingObservers; }; +NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMMutationObserver, NS_DOM_MUTATION_OBSERVER_IID) + class nsAutoMutationBatch { public: diff --git a/content/base/src/nsINode.cpp b/content/base/src/nsINode.cpp index 323586daa7a..4149128a9ac 100644 --- a/content/base/src/nsINode.cpp +++ b/content/base/src/nsINode.cpp @@ -103,6 +103,7 @@ #include #include "nsDOMEvent.h" #include "nsGlobalWindow.h" +#include "nsDOMMutationObserver.h" using namespace mozilla; using namespace mozilla::dom; @@ -2144,6 +2145,22 @@ nsINode::UnbindObject(nsISupports* aObject) } } +void +nsINode::GetBoundMutationObservers(nsTArray >& aResult) +{ + nsCOMArray* objects = + static_cast*>(GetProperty(nsGkAtoms::keepobjectsalive)); + if (objects) { + for (int32_t i = 0; i < objects->Count(); ++i) { + nsCOMPtr mo = do_QueryInterface(objects->ObjectAt(i)); + if (mo) { + MOZ_ASSERT(!aResult.Contains(mo)); + aResult.AppendElement(mo.forget()); + } + } + } +} + size_t nsINode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const { diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index e23aab5d2df..20d04f5def4 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -17,6 +17,7 @@ #include "mozilla/dom/Element.h" #include "nsGkAtoms.h" #include "nsNetUtil.h" +#include "nsIJSRuntimeService.h" #include "nsIScriptGlobalObject.h" #include "nsIScriptContext.h" #include "nsIScriptSecurityManager.h" @@ -98,6 +99,7 @@ public: uint32_t mJSVersion; nsCOMPtr mURI; nsCOMPtr mOriginPrincipal; + nsAutoCString mURL; // Keep the URI's filename alive during off thread parsing. int32_t mLineNo; const CORSMode mCORSMode; }; @@ -691,12 +693,122 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement) return ProcessRequest(request) == NS_ERROR_HTMLPARSER_BLOCK; } +namespace { + +class NotifyOffThreadScriptLoadCompletedRunnable : public nsRunnable +{ + nsRefPtr mLoader; + void *mToken; + +public: + NotifyOffThreadScriptLoadCompletedRunnable(already_AddRefed aLoader, + void *aToken) + : mLoader(aLoader), mToken(aToken) + {} + + NS_DECL_NSIRUNNABLE +}; + +} /* anonymous namespace */ + nsresult -nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest) +nsScriptLoader::ProcessOffThreadRequest(void **aOffThreadToken) +{ + nsCOMPtr request = mOffThreadScriptRequest; + mOffThreadScriptRequest = nullptr; + mDocument->UnblockOnload(false); + + return ProcessRequest(request, aOffThreadToken); +} + +NS_IMETHODIMP +NotifyOffThreadScriptLoadCompletedRunnable::Run() +{ + MOZ_ASSERT(NS_IsMainThread()); + + nsresult rv = mLoader->ProcessOffThreadRequest(&mToken); + + if (mToken) { + // The result of the off thread parse was not actually needed to process + // the request (disappearing window, some other error, ...). Finish the + // request to avoid leaks in the JS engine. + nsCOMPtr svc = do_GetService("@mozilla.org/js/xpc/RuntimeService;1"); + NS_ENSURE_TRUE(svc, NS_ERROR_FAILURE); + JSRuntime *rt; + svc->GetRuntime(&rt); + NS_ENSURE_TRUE(rt, NS_ERROR_FAILURE); + JS::FinishOffThreadScript(nullptr, rt, mToken); + } + + return rv; +} + +static void +OffThreadScriptLoaderCallback(void *aToken, void *aCallbackData) +{ + // Be careful not to adjust the refcount on the loader, as this callback + // may be invoked off the main thread. + nsScriptLoader* aLoader = static_cast(aCallbackData); + nsRefPtr notify = + new NotifyOffThreadScriptLoadCompletedRunnable( + already_AddRefed(aLoader), aToken); + NS_DispatchToMainThread(notify); +} + +nsresult +nsScriptLoader::AttemptAsyncScriptParse(nsScriptLoadRequest* aRequest) +{ + if (!aRequest->mElement->GetScriptAsync() || aRequest->mIsInline) { + return NS_ERROR_FAILURE; + } + + if (mOffThreadScriptRequest) { + return NS_ERROR_FAILURE; + } + + JSObject *unrootedGlobal; + nsCOMPtr context = GetScriptContext(&unrootedGlobal); + if (!context) { + return NS_ERROR_FAILURE; + } + AutoPushJSContext cx(context->GetNativeContext()); + JS::Rooted global(cx, unrootedGlobal); + + JS::CompileOptions options(cx); + FillCompileOptionsForRequest(aRequest, &options); + + if (!JS::CanCompileOffThread(cx, options)) { + return NS_ERROR_FAILURE; + } + + mOffThreadScriptRequest = aRequest; + if (!JS::CompileOffThread(cx, global, options, + aRequest->mScriptText.get(), aRequest->mScriptText.Length(), + OffThreadScriptLoaderCallback, + static_cast(this))) { + return NS_ERROR_OUT_OF_MEMORY; + } + + // This reference will be consumed by the NotifyOffThreadScriptLoadCompletedRunnable. + NS_ADDREF(this); + + mDocument->BlockOnload(); + + return NS_OK; +} + +nsresult +nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest, void **aOffThreadToken) { NS_ASSERTION(nsContentUtils::IsSafeToRunScript(), "Processing requests when running scripts is unsafe."); + if (!aOffThreadToken) { + nsresult rv = AttemptAsyncScriptParse(aRequest); + if (rv != NS_ERROR_FAILURE) + return rv; + } + NS_ENSURE_ARG(aRequest); nsAFlatString* script; nsAutoString textData; @@ -751,7 +863,7 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest) doc->BeginEvaluatingExternalScript(); } aRequest->mElement->BeginEvaluating(); - rv = EvaluateScript(aRequest, *script); + rv = EvaluateScript(aRequest, *script, aOffThreadToken); aRequest->mElement->EndEvaluating(); if (doc) { doc->EndEvaluatingExternalScript(); @@ -799,9 +911,44 @@ nsScriptLoader::FireScriptEvaluated(nsresult aResult, aRequest->FireScriptEvaluated(aResult); } +nsIScriptContext * +nsScriptLoader::GetScriptContext(JSObject **aGlobal) +{ + nsPIDOMWindow *pwin = mDocument->GetInnerWindow(); + NS_ASSERTION(pwin, "shouldn't be called with a null inner window"); + + nsCOMPtr globalObject = do_QueryInterface(pwin); + NS_ASSERTION(globalObject, "windows must be global objects"); + + // and make sure we are setup for this type of script. + nsresult rv = globalObject->EnsureScriptEnvironment(); + if (NS_FAILED(rv)) { + return nullptr; + } + + *aGlobal = globalObject->GetGlobalJSObject(); + return globalObject->GetScriptContext(); +} + +void +nsScriptLoader::FillCompileOptionsForRequest(nsScriptLoadRequest *aRequest, + JS::CompileOptions *aOptions) +{ + // It's very important to use aRequest->mURI, not the final URI of the channel + // aRequest ended up getting script data from, as the script filename. + nsContentUtils::GetWrapperSafeScriptFilename(mDocument, aRequest->mURI, aRequest->mURL); + + aOptions->setFileAndLine(aRequest->mURL.get(), aRequest->mLineNo); + aOptions->setVersion(JSVersion(aRequest->mJSVersion)); + if (aRequest->mOriginPrincipal) { + aOptions->setOriginPrincipals(nsJSPrincipals::get(aRequest->mOriginPrincipal)); + } +} + nsresult nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest, - const nsAFlatString& aScript) + const nsAFlatString& aScript, + void** aOffThreadToken) { nsresult rv = NS_OK; @@ -817,28 +964,19 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest, return NS_ERROR_FAILURE; } - nsPIDOMWindow *pwin = mDocument->GetInnerWindow(); - NS_ASSERTION(pwin, "shouldn't be called with a null inner window"); - - nsCOMPtr globalObject = do_QueryInterface(pwin); - NS_ASSERTION(globalObject, "windows must be global objects"); - // Get the script-type to be used by this element. NS_ASSERTION(scriptContent, "no content - what is default script-type?"); - // and make sure we are setup for this type of script. - rv = globalObject->EnsureScriptEnvironment(); - if (NS_FAILED(rv)) - return rv; - // Make sure context is a strong reference since we access it after // we've executed a script, which may cause all other references to // the context to go away. - nsCOMPtr context = globalObject->GetScriptContext(); + JSObject *unrootedGlobal; + nsCOMPtr context = GetScriptContext(&unrootedGlobal); if (!context) { return NS_ERROR_FAILURE; } AutoPushJSContext cx(context->GetNativeContext()); + JS::Rooted global(cx, unrootedGlobal); bool oldProcessingScriptTag = context->GetProcessingScriptTag(); context->SetProcessingScriptTag(true); @@ -847,22 +985,13 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest, nsCOMPtr oldCurrent = mCurrentScript; mCurrentScript = aRequest->mElement; - // It's very important to use aRequest->mURI, not the final URI of the channel - // aRequest ended up getting script data from, as the script filename. - nsAutoCString url; - nsContentUtils::GetWrapperSafeScriptFilename(mDocument, aRequest->mURI, url); - JSVersion version = JSVersion(aRequest->mJSVersion); if (version != JSVERSION_UNKNOWN) { JS::CompileOptions options(cx); - options.setFileAndLine(url.get(), aRequest->mLineNo) - .setVersion(JSVersion(aRequest->mJSVersion)); - if (aRequest->mOriginPrincipal) { - options.setOriginPrincipals(nsJSPrincipals::get(aRequest->mOriginPrincipal)); - } - JS::Rooted global(cx, globalObject->GetGlobalJSObject()); + FillCompileOptionsForRequest(aRequest, &options); rv = context->EvaluateString(aScript, global, - options, /* aCoerceToString = */ false, nullptr); + options, /* aCoerceToString = */ false, nullptr, + aOffThreadToken); } // Put the old script back in case it wants to do anything else. diff --git a/content/base/src/nsScriptLoader.h b/content/base/src/nsScriptLoader.h index 7c8193db321..ab286056071 100644 --- a/content/base/src/nsScriptLoader.h +++ b/content/base/src/nsScriptLoader.h @@ -207,6 +207,12 @@ public: const nsAString &aCrossOrigin, bool aScriptFromHead); + /** + * Process a request that was deferred so that the script could be compiled + * off thread. + */ + nsresult ProcessOffThreadRequest(void **aOffThreadToken); + private: /** * Unblocks the creator parser of the parser-blocking scripts. @@ -261,14 +267,21 @@ private: bool AddPendingChildLoader(nsScriptLoader* aChild) { return mPendingChildLoaders.AppendElement(aChild) != nullptr; } - - nsresult ProcessRequest(nsScriptLoadRequest* aRequest); + + nsresult AttemptAsyncScriptParse(nsScriptLoadRequest* aRequest); + nsresult ProcessRequest(nsScriptLoadRequest* aRequest, + void **aOffThreadToken = nullptr); void FireScriptAvailable(nsresult aResult, nsScriptLoadRequest* aRequest); void FireScriptEvaluated(nsresult aResult, nsScriptLoadRequest* aRequest); nsresult EvaluateScript(nsScriptLoadRequest* aRequest, - const nsAFlatString& aScript); + const nsAFlatString& aScript, + void **aOffThreadToken); + + nsIScriptContext *GetScriptContext(JSObject **aGlobal); + void FillCompileOptionsForRequest(nsScriptLoadRequest *aRequest, + JS::CompileOptions *aOptions); nsresult PrepareLoadedRequest(nsScriptLoadRequest* aRequest, nsIStreamLoader* aLoader, @@ -302,6 +315,7 @@ private: }; nsTArray mPreloads; + nsCOMPtr mOffThreadScriptRequest; nsCOMPtr mCurrentScript; nsCOMPtr mCurrentParserInsertedScript; // XXXbz do we want to cycle-collect these or something? Not sure. diff --git a/content/base/test/test_mutationobservers.html b/content/base/test/test_mutationobservers.html index 88a4e143ec9..11019f48449 100644 --- a/content/base/test/test_mutationobservers.html +++ b/content/base/test/test_mutationobservers.html @@ -153,7 +153,10 @@ function runTest() { then(testThisBind); m = null; }); - m.observe(div, { attributes: true}); + m.observe(div, { attributes: true, attributeFilter: ["foo"] }); + is(SpecialPowers.wrap(div).getBoundMutationObservers()[0].getObservingInfo()[0].attributes, true); + is(SpecialPowers.wrap(div).getBoundMutationObservers()[0].getObservingInfo()[0].attributeFilter.length, 1) + is(SpecialPowers.wrap(div).getBoundMutationObservers()[0].getObservingInfo()[0].attributeFilter[0], "foo") div.setAttribute("foo", "bar"); } @@ -182,6 +185,9 @@ function testThisBind() { m = null; }).bind(window)); m.observe(div, { attributes: true, attributeOldValue: true, subtree: true }); + is(SpecialPowers.wrap(div).getBoundMutationObservers()[0].getObservingInfo()[0].attributes, true) + is(SpecialPowers.wrap(div).getBoundMutationObservers()[0].getObservingInfo()[0].attributeOldValue, true) + is(SpecialPowers.wrap(div).getBoundMutationObservers()[0].getObservingInfo()[0].subtree, true) div.setAttribute("foo", "bar2"); div.removeAttribute("foo"); div.removeChild(child); @@ -225,6 +231,11 @@ function testCharacterData() { m3.observe(div, { characterData: true, subtree: true }); m3.observe(div, { characterData: true, subtree: false }); m4.observe(div.firstChild, { characterData: true, subtree: false }); + + is(SpecialPowers.wrap(div).getBoundMutationObservers().length, 3) + is(SpecialPowers.wrap(div).getBoundMutationObservers()[2].getObservingInfo()[0].characterData, true) + is(SpecialPowers.wrap(div).getBoundMutationObservers()[2].getObservingInfo()[0].subtree, false) + div.firstChild.data = "bar"; } @@ -278,7 +289,7 @@ function testChildList4() { var s1 = div.appendChild(document.createElement("span")); s1.textContent = "foo"; var s2 = div.appendChild(document.createElement("span")); - m = new M(function(records, observer) { + function callback(records, observer) { is(records.length, 3, "Should have got one record for removing nodes from document fragment and one record for adding them to div"); is(records[0].removedNodes.length, 2, "Should have got removedNodes"); is(records[0].removedNodes[0], t1, "Should be the 1st textnode"); @@ -294,9 +305,16 @@ function testChildList4() { observer.disconnect(); then(testChildList5); m = null; - }); + }; + m = new M(callback); m.observe(df, { childList: true, characterData: true, characterDataOldValue: true, subtree: true }); + is(SpecialPowers.wrap(df).getBoundMutationObservers()[0].getObservingInfo()[0].childList, true) + is(SpecialPowers.wrap(df).getBoundMutationObservers()[0].getObservingInfo()[0].characterData, true) + is(SpecialPowers.wrap(df).getBoundMutationObservers()[0].getObservingInfo()[0].characterDataOldValue, true) + is(SpecialPowers.wrap(df).getBoundMutationObservers()[0].getObservingInfo()[0].subtree, true) + ok(SpecialPowers.compare(SpecialPowers.wrap(df).getBoundMutationObservers()[0].mutationCallback, callback)) m.observe(div, { childList: true }); + is(SpecialPowers.wrap(df).getBoundMutationObservers()[0].getObservingInfo().length, 2) // Make sure transient observers aren't leaked. var leakTest = new M(function(){}); @@ -554,6 +572,8 @@ function testTakeRecords() { m = null; }); m.observe(div, { attributes: true, attributeOldValue: true }); + // Note, [0] points to a mutation observer which is there for a leak test! + ok(SpecialPowers.compare(SpecialPowers.wrap(div).getBoundMutationObservers()[1], m)); var mutationEventCount = 0; div.addEventListener("DOMAttrModified", mutationListener); div.setAttribute("foo", "bar"); diff --git a/content/html/content/public/HTMLCanvasElement.h b/content/html/content/public/HTMLCanvasElement.h index 9a650363849..e1e06ba8465 100644 --- a/content/html/content/public/HTMLCanvasElement.h +++ b/content/html/content/public/HTMLCanvasElement.h @@ -31,7 +31,9 @@ class LayerManager; namespace dom { +class FileCallback; class HTMLCanvasPrintState; +class PrintCallback; class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement, public nsICanvasElementExternal, @@ -92,16 +94,10 @@ public: aRv = ToDataURL(aType, params, aCx, aDataURL); } void ToBlob(JSContext* aCx, - nsIFileCallback* aCallback, + FileCallback& aCallback, const nsAString& aType, const Optional >& aParams, - ErrorResult& aRv) - { - JS::Value params = aParams.WasPassed() - ? aParams.Value() - : JS::UndefinedValue(); - aRv = ToBlob(aCallback, aType, params, aCx); - } + ErrorResult& aRv); bool MozOpaque() const { @@ -126,8 +122,8 @@ public: { aRv = MozFetchAsStream(aCallback, aType); } - nsIPrintCallback* GetMozPrintCallback() const; - // Using XPCOM SetMozPrintCallback. + PrintCallback* GetMozPrintCallback() const; + void SetMozPrintCallback(PrintCallback* aCallback); /** * Get the size in pixels of this canvas element @@ -244,9 +240,9 @@ protected: nsString mCurrentContextId; nsRefPtr mOriginalCanvas; - nsCOMPtr mPrintCallback; + nsRefPtr mPrintCallback; nsCOMPtr mCurrentContext; - nsCOMPtr mPrintState; + nsRefPtr mPrintState; public: // Record whether this canvas should be write-only or not. @@ -266,6 +262,41 @@ public: HTMLCanvasElement* GetOriginalCanvas(); }; +class HTMLCanvasPrintState MOZ_FINAL : public nsWrapperCache +{ +public: + HTMLCanvasPrintState(HTMLCanvasElement* aCanvas, + nsICanvasRenderingContextInternal* aContext, + nsITimerCallback* aCallback); + + nsISupports* Context() const; + + void Done(); + + void NotifyDone(); + + bool mIsDone; + + NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLCanvasPrintState) + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLCanvasPrintState) + + virtual JSObject* WrapObject(JSContext *cx, JS::Handle scope) MOZ_OVERRIDE; + + HTMLCanvasElement* GetParentObject() + { + return mCanvas; + } + +private: + ~HTMLCanvasPrintState(); + bool mPendingNotify; + +protected: + nsRefPtr mCanvas; + nsCOMPtr mContext; + nsCOMPtr mCallback; +}; + } // namespace dom } // namespace mozilla diff --git a/content/html/content/src/HTMLCanvasElement.cpp b/content/html/content/src/HTMLCanvasElement.cpp index 67b60a340d9..950bc8a9e59 100644 --- a/content/html/content/src/HTMLCanvasElement.cpp +++ b/content/html/content/src/HTMLCanvasElement.cpp @@ -48,9 +48,9 @@ HTMLImageOrCanvasOrVideoElement; class ToBlobRunnable : public nsRunnable { public: - ToBlobRunnable(nsIFileCallback* aCallback, + ToBlobRunnable(mozilla::dom::FileCallback& aCallback, nsIDOMBlob* aBlob) - : mCallback(aCallback), + : mCallback(&aCallback), mBlob(aBlob) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); @@ -59,11 +59,12 @@ public: NS_IMETHOD Run() { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); - mCallback->Receive(mBlob); - return NS_OK; + mozilla::ErrorResult rv; + mCallback->Call(mBlob, rv); + return rv.ErrorCode(); } private: - nsCOMPtr mCallback; + nsRefPtr mCallback; nsCOMPtr mBlob; }; @@ -72,76 +73,63 @@ private: namespace mozilla { namespace dom { -class HTMLCanvasPrintState : public nsIDOMMozCanvasPrintState +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_3(HTMLCanvasPrintState, mCanvas, + mContext, mCallback) + +NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(HTMLCanvasPrintState, AddRef) +NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(HTMLCanvasPrintState, Release) + +HTMLCanvasPrintState::HTMLCanvasPrintState(HTMLCanvasElement* aCanvas, + nsICanvasRenderingContextInternal* aContext, + nsITimerCallback* aCallback) + : mIsDone(false), mPendingNotify(false), mCanvas(aCanvas), + mContext(aContext), mCallback(aCallback) { -public: - HTMLCanvasPrintState(HTMLCanvasElement* aCanvas, - nsICanvasRenderingContextInternal* aContext, - nsITimerCallback* aCallback) - : mIsDone(false), mPendingNotify(false), mCanvas(aCanvas), - mContext(aContext), mCallback(aCallback) - { - } + SetIsDOMBinding(); +} - NS_IMETHOD GetContext(nsISupports** aContext) - { - NS_ADDREF(*aContext = mContext); - return NS_OK; - } +HTMLCanvasPrintState::~HTMLCanvasPrintState() +{ +} - NS_IMETHOD Done() - { - if (!mPendingNotify && !mIsDone) { - // The canvas needs to be invalidated for printing reftests on linux to - // work. - if (mCanvas) { - mCanvas->InvalidateCanvas(); - } - nsRefPtr > doneEvent = - NS_NewRunnableMethod(this, &HTMLCanvasPrintState::NotifyDone); - if (NS_SUCCEEDED(NS_DispatchToCurrentThread(doneEvent))) { - mPendingNotify = true; - } +/* virtual */ JSObject* +HTMLCanvasPrintState::WrapObject(JSContext* aCx, JS::Handle aScope) +{ + return MozCanvasPrintStateBinding::Wrap(aCx, aScope, this); +} + +nsISupports* +HTMLCanvasPrintState::Context() const +{ + return mContext; +} + +void +HTMLCanvasPrintState::Done() +{ + if (!mPendingNotify && !mIsDone) { + // The canvas needs to be invalidated for printing reftests on linux to + // work. + if (mCanvas) { + mCanvas->InvalidateCanvas(); } - return NS_OK; - } - - void NotifyDone() - { - mIsDone = true; - mPendingNotify = false; - if (mCallback) { - mCallback->Notify(nullptr); + nsRefPtr > doneEvent = + NS_NewRunnableMethod(this, &HTMLCanvasPrintState::NotifyDone); + if (NS_SUCCEEDED(NS_DispatchToCurrentThread(doneEvent))) { + mPendingNotify = true; } } +} - bool mIsDone; - - // CC - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS(HTMLCanvasPrintState) -private: - virtual ~HTMLCanvasPrintState() - { +void +HTMLCanvasPrintState::NotifyDone() +{ + mIsDone = true; + mPendingNotify = false; + if (mCallback) { + mCallback->Notify(nullptr); } - bool mPendingNotify; - -protected: - nsRefPtr mCanvas; - nsCOMPtr mContext; - nsCOMPtr mCallback; -}; - -NS_IMPL_CYCLE_COLLECTING_ADDREF(HTMLCanvasPrintState) -NS_IMPL_CYCLE_COLLECTING_RELEASE(HTMLCanvasPrintState) - -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(HTMLCanvasPrintState) - NS_INTERFACE_MAP_ENTRY(nsISupports) - NS_INTERFACE_MAP_ENTRY(nsIDOMMozCanvasPrintState) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozCanvasPrintState) -NS_INTERFACE_MAP_END - -NS_IMPL_CYCLE_COLLECTION_3(HTMLCanvasPrintState, mCanvas, mContext, mCallback) +} // --------------------------------------------------------------------------- @@ -226,11 +214,9 @@ HTMLCanvasElement::HandlePrintCallback(nsPresContext::nsPresContextType aType) // print preview mode, 2) the canvas has a print callback and 3) the callback // hasn't already been called. For real printing the callback is handled in // nsSimplePageSequenceFrame::PrePrintNextPage. - nsCOMPtr printCallback; if ((aType == nsPresContext::eContext_PageLayout || aType == nsPresContext::eContext_PrintPreview) && - !mPrintState && - NS_SUCCEEDED(GetMozPrintCallback(getter_AddRefs(printCallback))) && printCallback) { + !mPrintState && GetMozPrintCallback()) { DispatchPrintCallback(nullptr); } } @@ -256,9 +242,8 @@ HTMLCanvasElement::DispatchPrintCallback(nsITimerCallback* aCallback) void HTMLCanvasElement::CallPrintCallback() { - nsCOMPtr printCallback; - GetMozPrintCallback(getter_AddRefs(printCallback)); - printCallback->Render(mPrintState); + ErrorResult rv; + GetMozPrintCallback()->Call(*mPrintState, rv); } void @@ -386,14 +371,13 @@ HTMLCanvasElement::MozFetchAsStream(nsIInputStreamCallback *aCallback, return asyncCallback->OnInputStreamReady(asyncData); } -NS_IMETHODIMP -HTMLCanvasElement::SetMozPrintCallback(nsIPrintCallback *aCallback) +void +HTMLCanvasElement::SetMozPrintCallback(PrintCallback* aCallback) { mPrintCallback = aCallback; - return NS_OK; } -nsIPrintCallback* +PrintCallback* HTMLCanvasElement::GetMozPrintCallback() const { if (mOriginalCanvas) { @@ -402,13 +386,6 @@ HTMLCanvasElement::GetMozPrintCallback() const return mPrintCallback; } -NS_IMETHODIMP -HTMLCanvasElement::GetMozPrintCallback(nsIPrintCallback** aCallback) -{ - NS_IF_ADDREF(*aCallback = GetMozPrintCallback()); - return NS_OK; -} - nsresult HTMLCanvasElement::ExtractData(const nsAString& aType, const nsAString& aOptions, @@ -571,59 +548,70 @@ HTMLCanvasElement::ToDataURLImpl(JSContext* aCx, } // XXXkhuey the encoding should be off the main thread, but we're lazy. -NS_IMETHODIMP -HTMLCanvasElement::ToBlob(nsIFileCallback* aCallback, +void +HTMLCanvasElement::ToBlob(JSContext* aCx, + FileCallback& aCallback, const nsAString& aType, - const JS::Value& aEncoderOptions, - JSContext* aCx) + const Optional >& aParams, + ErrorResult& aRv) { // do a trust check if this is a write-only canvas if (mWriteOnly && !nsContentUtils::IsCallerChrome()) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - if (!aCallback) { - return NS_ERROR_UNEXPECTED; + aRv.Throw(NS_ERROR_DOM_SECURITY_ERR); + return; } nsAutoString type; - nsresult rv = nsContentUtils::ASCIIToLower(aType, type); - if (NS_FAILED(rv)) { - return rv; + aRv = nsContentUtils::ASCIIToLower(aType, type); + if (aRv.Failed()) { + return; } + JS::Value encoderOptions = aParams.WasPassed() + ? aParams.Value() + : JS::UndefinedValue(); + nsAutoString params; bool usingCustomParseOptions; - rv = ParseParams(aCx, type, aEncoderOptions, params, &usingCustomParseOptions); - if (NS_FAILED(rv)) { - return rv; + aRv = ParseParams(aCx, type, encoderOptions, params, &usingCustomParseOptions); + if (aRv.Failed()) { + return; } bool fallbackToPNG = false; nsCOMPtr stream; - rv = ExtractData(type, params, getter_AddRefs(stream), fallbackToPNG); + aRv = ExtractData(type, params, getter_AddRefs(stream), fallbackToPNG); // If there are unrecognized custom parse options, we should fall back to // the default values for the encoder without any options at all. - if (rv == NS_ERROR_INVALID_ARG && usingCustomParseOptions) { + if (aRv.ErrorCode() == NS_ERROR_INVALID_ARG && usingCustomParseOptions) { fallbackToPNG = false; - rv = ExtractData(type, EmptyString(), getter_AddRefs(stream), fallbackToPNG); + aRv = ExtractData(type, EmptyString(), getter_AddRefs(stream), fallbackToPNG); } - NS_ENSURE_SUCCESS(rv, rv); + if (aRv.Failed()) { + return; + } if (fallbackToPNG) { type.AssignLiteral("image/png"); } uint64_t imgSize; - rv = stream->Available(&imgSize); - NS_ENSURE_SUCCESS(rv, rv); - NS_ENSURE_TRUE(imgSize <= UINT32_MAX, NS_ERROR_FILE_TOO_BIG); + aRv = stream->Available(&imgSize); + if (aRv.Failed()) { + return; + } + if (imgSize > UINT32_MAX) { + aRv.Throw(NS_ERROR_FILE_TOO_BIG); + return; + } void* imgData = nullptr; - rv = NS_ReadInputStreamToBuffer(stream, &imgData, imgSize); - NS_ENSURE_SUCCESS(rv, rv); + aRv = NS_ReadInputStreamToBuffer(stream, &imgData, imgSize); + if (aRv.Failed()) { + return; + } // The DOMFile takes ownership of the buffer nsRefPtr blob = @@ -635,7 +623,7 @@ HTMLCanvasElement::ToBlob(nsIFileCallback* aCallback, } nsRefPtr runnable = new ToBlobRunnable(aCallback, blob); - return NS_DispatchToCurrentThread(runnable); + aRv = NS_DispatchToCurrentThread(runnable); } already_AddRefed @@ -1052,5 +1040,3 @@ HTMLCanvasElement::RenderContextsExternal(gfxContext *aContext, gfxPattern::Grap } // namespace dom } // namespace mozilla - -DOMCI_DATA(MozCanvasPrintState, mozilla::dom::HTMLCanvasPrintState) diff --git a/content/media/MediaStreamGraph.cpp b/content/media/MediaStreamGraph.cpp index 38a7ea050fd..e1e42a8409c 100644 --- a/content/media/MediaStreamGraph.cpp +++ b/content/media/MediaStreamGraph.cpp @@ -2352,9 +2352,12 @@ void MediaStreamGraph::DestroyNonRealtimeInstance(MediaStreamGraph* aGraph) { NS_ASSERTION(NS_IsMainThread(), "Main thread only"); - MOZ_ASSERT(aGraph != gGraph, "Should not destroy the global graph here"); + MOZ_ASSERT(aGraph->IsNonRealtime(), "Should not destroy the global graph here"); MediaStreamGraphImpl* graph = static_cast(aGraph); + if (graph->mForceShutDown) + return; // already done + if (!graph->mNonRealtimeProcessing) { // Start the graph, but don't produce anything graph->StartNonRealtimeProcessing(0); @@ -2421,6 +2424,12 @@ MediaStreamGraph::CreateAudioNodeStream(AudioNodeEngine* aEngine, return stream; } +bool +MediaStreamGraph::IsNonRealtime() const +{ + return this != gGraph; +} + void MediaStreamGraph::StartNonRealtimeProcessing(uint32_t aTicksToProcess) { diff --git a/content/media/MediaStreamGraph.h b/content/media/MediaStreamGraph.h index fb2d810266b..4a05e493a8c 100644 --- a/content/media/MediaStreamGraph.h +++ b/content/media/MediaStreamGraph.h @@ -975,6 +975,7 @@ public: // Main thread only static MediaStreamGraph* GetInstance(); static MediaStreamGraph* CreateNonRealtimeInstance(); + // Idempotent static void DestroyNonRealtimeInstance(MediaStreamGraph* aGraph); // Control API. @@ -1022,6 +1023,8 @@ public: * in main-thread stream state. */ int64_t GetCurrentGraphUpdateIndex() { return mGraphUpdatesSent; } + + bool IsNonRealtime() const; /** * Start processing non-realtime for a specific number of ticks. */ diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index 1a801d956a0..3521fe1f649 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -89,7 +89,6 @@ MOCHITEST_FILES = \ test_paused_after_ended.html \ test_play_events.html \ test_play_events_2.html \ - $(filter disabled-temporarily--bug-751539, test_played.html) \ test_playback_errors.html \ test_seekable1.html \ test_preload_actions.html \ @@ -165,7 +164,7 @@ endif # Disabled since we don't play Wave files standalone, for now # test_audioDocumentTitle.html -# The below tests are disabled due to frequent timeouts. +# The below tests are disabled on Windows due to frequent timeouts. # Bug 832768 and Bug 864682: # test_buffered.html # test_bug465498.html @@ -175,6 +174,18 @@ endif # test_seek.html # Bug 832768, bug 814533, bug 840742 # test_playback_rate.html +# Bug 751539 +# test_played.html +ifneq ($(OS_ARCH), WINNT) +MOCHITEST_FILES += \ + test_buffered.html \ + test_bug465498.html \ + test_bug493187.html \ + test_seek.html \ + test_playback_rate.html \ + test_played.html \ + $(NULL) +endif # sample files MOCHITEST_FILES += \ diff --git a/content/media/test/test_playback_rate.html b/content/media/test/test_playback_rate.html index 2dd6524a814..d25e50cf58c 100644 --- a/content/media/test/test_playback_rate.html +++ b/content/media/test/test_playback_rate.html @@ -10,6 +10,8 @@
 
diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp
index bfe911a7489..16fe0edd095 100644
--- a/layout/generic/StickyScrollContainer.cpp
+++ b/layout/generic/StickyScrollContainer.cpp
@@ -41,13 +41,17 @@ StickyScrollContainer::~StickyScrollContainer()
 
 // static
 StickyScrollContainer*
-StickyScrollContainer::StickyScrollContainerForFrame(nsIFrame* aFrame)
+StickyScrollContainer::GetStickyScrollContainerForFrame(nsIFrame* aFrame)
 {
   nsIScrollableFrame* scrollFrame =
     nsLayoutUtils::GetNearestScrollableFrame(aFrame->GetParent(),
       nsLayoutUtils::SCROLLABLE_SAME_DOC |
       nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
-  NS_ASSERTION(scrollFrame, "Need a scrolling container");
+  if (!scrollFrame) {
+    // We might not find any, for instance in the case of
+    // 
+    return nullptr;
+  }
   FrameProperties props = static_cast(do_QueryFrame(scrollFrame))->
     Properties();
   StickyScrollContainer* s = static_cast
@@ -90,8 +94,7 @@ StickyScrollContainer::ComputeStickyOffsets(nsIFrame* aFrame)
       nsLayoutUtils::SCROLLABLE_INCLUDE_HIDDEN);
 
   if (!scrollableFrame) {
-    // Not sure how this would happen, but bail if it does.
-    NS_ERROR("Couldn't find a scrollable frame");
+    // Bail.
     return;
   }
 
@@ -113,11 +116,11 @@ StickyScrollContainer::ComputeStickyOffsets(nsIFrame* aFrame)
   // Store the offset
   FrameProperties props = aFrame->Properties();
   nsMargin* offsets = static_cast
-    (props.Get(nsIFrame::ComputedStickyOffsetProperty()));
+    (props.Get(nsIFrame::ComputedOffsetProperty()));
   if (offsets) {
     *offsets = computedOffsets;
   } else {
-    props.Set(nsIFrame::ComputedStickyOffsetProperty(),
+    props.Set(nsIFrame::ComputedOffsetProperty(),
               new nsMargin(computedOffsets));
   }
 }
@@ -130,7 +133,7 @@ StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick,
   aContain->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX);
 
   const nsMargin* computedOffsets = static_cast(
-    aFrame->Properties().Get(nsIFrame::ComputedStickyOffsetProperty()));
+    aFrame->Properties().Get(nsIFrame::ComputedOffsetProperty()));
   if (!computedOffsets) {
     // We haven't reflowed the scroll frame yet, so offsets haven't been
     // computed. Bail.
diff --git a/layout/generic/StickyScrollContainer.h b/layout/generic/StickyScrollContainer.h
index fefe243f5b6..df6b25d4ac9 100644
--- a/layout/generic/StickyScrollContainer.h
+++ b/layout/generic/StickyScrollContainer.h
@@ -26,10 +26,10 @@ class StickyScrollContainer MOZ_FINAL : public nsIScrollPositionListener
 {
 public:
   /**
-   * Find the StickyScrollContainer associated with the scroll container of
-   * the given frame, creating it if necessary.
+   * Find (and create if necessary) the StickyScrollContainer associated with
+   * the scroll container of the given frame, if a scroll container exists.
    */
-  static StickyScrollContainer* StickyScrollContainerForFrame(nsIFrame* aFrame);
+  static StickyScrollContainer* GetStickyScrollContainerForFrame(nsIFrame* aFrame);
 
   /**
    * Find the StickyScrollContainer associated with the given scroll frame,
diff --git a/layout/generic/crashtests/914891.html b/layout/generic/crashtests/914891.html
new file mode 100644
index 00000000000..13d116d0b54
--- /dev/null
+++ b/layout/generic/crashtests/914891.html
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+ + diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index c7d24aa6be0..ce99442b335 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -500,3 +500,4 @@ test-pref(layout.css.flexbox.enabled,true) load 866547-1.html asserts(1-4) test-pref(layout.css.flexbox.enabled,true) load 876074-1.html # bug 876749 load 885009-1.html load 893523.html +test-pref(layout.css.sticky.enabled,true) load 914891.html diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 4b5c5fbb0d5..ec47e9b0daf 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2582,9 +2582,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState, if (aLine->IsBlock()) { if (aDY) { - nsPoint p = kid->GetPosition(); - p.y += aDY; - kid->SetPosition(p); + kid->MovePositionBy(nsPoint(0, aDY)); } // Make sure the frame's view and any child views are updated @@ -2598,9 +2596,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState, int32_t n = aLine->GetChildCount(); while (--n >= 0) { if (aDY) { - nsPoint p = kid->GetPosition(); - p.y += aDY; - kid->SetPosition(p); + kid->MovePositionBy(nsPoint(0, aDY)); } // Make sure the frame's view and any child views are updated ::PlaceFrameView(kid); diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index c572a3eb5f7..daafd017b71 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -386,8 +386,7 @@ nsBlockReflowState::RecoverFloats(nsLineList::iterator aLine, while (fc) { nsIFrame* floatFrame = fc->mFloat; if (aDeltaY != 0) { - nsPoint p = floatFrame->GetPosition(); - floatFrame->SetPosition(nsPoint(p.x, p.y + aDeltaY)); + floatFrame->MovePositionBy(nsPoint(0, aDeltaY)); nsContainerFrame::PositionFrameView(floatFrame); nsContainerFrame::PositionChildViews(floatFrame); } diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 6139f7e094d..be1284b6a23 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1097,26 +1097,6 @@ nsFlexContainerFrame::GetType() const return nsGkAtoms::flexContainerFrame; } -/* virtual */ -int -nsFlexContainerFrame::GetSkipSides(const nsHTMLReflowState* aReflowState) const -{ - // (same as nsBlockFrame's GetSkipSides impl) - if (IS_TRUE_OVERFLOW_CONTAINER(this)) { - return (1 << NS_SIDE_TOP) | (1 << NS_SIDE_BOTTOM); - } - - int skip = 0; - if (GetPrevInFlow()) { - skip |= 1 << NS_SIDE_TOP; - } - nsIFrame* nif = GetNextInFlow(); - if (nif && !IS_TRUE_OVERFLOW_CONTAINER(nif)) { - skip |= 1 << NS_SIDE_BOTTOM; - } - return skip; -} - #ifdef DEBUG NS_IMETHODIMP nsFlexContainerFrame::GetFrameName(nsAString& aResult) const diff --git a/layout/generic/nsFlexContainerFrame.h b/layout/generic/nsFlexContainerFrame.h index 2661b740bc1..aa372f30825 100644 --- a/layout/generic/nsFlexContainerFrame.h +++ b/layout/generic/nsFlexContainerFrame.h @@ -49,7 +49,6 @@ public: GetPrefWidth(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE; virtual nsIAtom* GetType() const MOZ_OVERRIDE; - virtual int GetSkipSides(const nsHTMLReflowState* aReflowState = nullptr) const MOZ_OVERRIDE; #ifdef DEBUG NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; #endif // DEBUG diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 2e471fc941c..0d087536a39 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -512,7 +512,11 @@ nsFrame::Init(nsIContent* aContent, mState |= NS_FRAME_MAY_BE_TRANSFORMED; } if (disp->mPosition == NS_STYLE_POSITION_STICKY) { - StickyScrollContainer::StickyScrollContainerForFrame(this)->AddFrame(this); + StickyScrollContainer* ssc = + StickyScrollContainer::GetStickyScrollContainerForFrame(this); + if (ssc) { + ssc->AddFrame(this); + } } if (nsLayoutUtils::FontSizeInflationEnabled(PresContext()) || !GetParent() @@ -593,8 +597,11 @@ nsFrame::DestroyFrom(nsIFrame* aDestructRoot) nsSVGEffects::InvalidateDirectRenderingObservers(this); if (StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY) { - StickyScrollContainer::StickyScrollContainerForFrame(this)-> - RemoveFrame(this); + StickyScrollContainer* ssc = + StickyScrollContainer::GetStickyScrollContainerForFrame(this); + if (ssc) { + ssc->RemoveFrame(this); + } } // Get the view pointer now before the frame properties disappear @@ -5063,6 +5070,22 @@ ComputeOutlineAndEffectsRect(nsIFrame* aFrame, return r; } +void +nsIFrame::MovePositionBy(const nsPoint& aTranslation) +{ + nsPoint position = GetNormalPosition() + aTranslation; + + const nsMargin* computedOffsets = nullptr; + if (IsRelativelyPositioned()) { + computedOffsets = static_cast + (Properties().Get(nsIFrame::ComputedOffsetProperty())); + } + nsHTMLReflowState::ApplyRelativePositioning(this, computedOffsets ? + *computedOffsets : nsMargin(), + &position); + SetPosition(position); +} + nsPoint nsIFrame::GetNormalPosition() const { diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 07e1fe223e6..93d2040bfec 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -831,6 +831,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(uint8_t aCBDirection, // Computed value for 'bottom' is minus the value of 'top' aComputedOffsets.bottom = -aComputedOffsets.top; } + + // Store the offset + FrameProperties props = aFrame->Properties(); + nsMargin* offsets = static_cast + (props.Get(nsIFrame::ComputedOffsetProperty())); + if (offsets) { + *offsets = aComputedOffsets; + } else { + props.Set(nsIFrame::ComputedOffsetProperty(), + new nsMargin(aComputedOffsets)); + } } /* static */ void @@ -852,8 +863,11 @@ nsHTMLReflowState::ApplyRelativePositioning(nsIFrame* aFrame, if (NS_STYLE_POSITION_RELATIVE == display->mPosition) { *aPosition += nsPoint(aComputedOffsets.left, aComputedOffsets.top); } else if (NS_STYLE_POSITION_STICKY == display->mPosition) { - *aPosition = StickyScrollContainer::StickyScrollContainerForFrame(aFrame)-> - ComputePosition(aFrame); + StickyScrollContainer* ssc = + StickyScrollContainer::GetStickyScrollContainerForFrame(aFrame); + if (ssc) { + *aPosition = ssc->ComputePosition(aFrame); + } } } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 3c332082a93..586eefc43a8 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -866,6 +866,13 @@ public: } void SetPosition(const nsPoint& aPt) { mRect.MoveTo(aPt); } + /** + * Move the frame, accounting for relative positioning. Use this when + * adjusting the frame's position by a known amount, to properly update its + * saved normal position (see GetNormalPosition below). + */ + void MovePositionBy(const nsPoint& aTranslation); + /** * Return frame's position without relative positioning */ @@ -927,7 +934,7 @@ public: NS_DECLARE_FRAME_PROPERTY(IBSplitSpecialPrevSibling, nullptr) NS_DECLARE_FRAME_PROPERTY(NormalPositionProperty, DestroyPoint) - NS_DECLARE_FRAME_PROPERTY(ComputedStickyOffsetProperty, DestroyMargin) + NS_DECLARE_FRAME_PROPERTY(ComputedOffsetProperty, DestroyMargin) NS_DECLARE_FRAME_PROPERTY(OutlineInnerRectProperty, DestroyRect) NS_DECLARE_FRAME_PROPERTY(PreEffectsBBoxProperty, DestroyRect) diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index ef40aba2737..62b86701db8 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -916,8 +916,6 @@ nsInlineFrame::AccessibleType() return a11y::eHTMLButtonType; if (tagAtom == nsGkAtoms::img) // Create accessible for broken return a11y::eHyperTextType; - if (tagAtom == nsGkAtoms::label) // Creat accessible for