diff --git a/.cargo/config.in b/.cargo/config.in index eb2831c684..7b2b6b66c0 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -24,7 +24,7 @@ replace-with = "vendored-sources" [source."https://github.com/CraneStation/Cranelift"] git = "https://github.com/CraneStation/Cranelift" -rev = "cc216b46b35a797d03c0f3e8b16a2096f1c6db61" +rev = "182414f15c18538dfebbe040469ec8001e93ecc5" replace-with = "vendored-sources" [source.vendored-sources] diff --git a/.clang-format-ignore b/.clang-format-ignore index 17f6002d91..b1b7ef1b6b 100644 --- a/.clang-format-ignore +++ b/.clang-format-ignore @@ -4,16 +4,16 @@ build/clang-plugin/.* config/gcc-stl-wrapper.template.h config/msvc-stl-wrapper.template.h # Generated code +js/src/builtin/intl/LanguageTagGenerated.cpp js/src/builtin/intl/TimeZoneDataGenerated.h -# Don't want to reformat irregexp. bug 1510128 -js/src/irregexp/.* +# Don't want to reformat irregexp (third-party code) +js/src/irregexp/imported/.* + +# Don't want to reformat zydis (third-party library subject to occasional updates). +js/src/zydis/.* # Generated by js/src/util/make_unicode.py -# Note: the irregexp files are already excluded with the rest of js/src/irregexp -# but we add them here in case that ever changes. -js/src/irregexp/RegExpCharacters-inl.h -js/src/irregexp/RegExpCharacters.cpp js/src/util/Unicode.cpp js/src/util/UnicodeNonBMP.h @@ -136,7 +136,6 @@ media/openmax_dl/.* media/openmax_il/.* media/webrtc/signaling/src/sdp/sipcc/.* media/webrtc/trunk/.* -mfbt/decimal/.* mfbt/double-conversion/double-conversion/.* mfbt/lz4.* mobile/android/geckoview/src/thirdparty/.* @@ -150,6 +149,7 @@ modules/pdfium/.* modules/woff2/.* modules/xz-embedded/.* modules/zlib/.* +mozglue/misc/decimal/.* netwerk/dns/nsIDNKitInterface.h netwerk/sctp/src/.* netwerk/srtp/src/.* diff --git a/.eslintignore b/.eslintignore index 2fc0d61fab..8a9936a0d4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -45,8 +45,14 @@ browser/extensions/pdfjs/content/web** # generated or library files in pocket browser/components/pocket/content/panels/js/tmpl.js browser/components/pocket/content/panels/js/vendor/** -# Activity Stream has incompatible eslintrc. `npm run lint` from its directory -browser/components/newtab/** + +# Ignore newtab files +# Kept in sync with browser/components/newtab/.eslintignore +browser/components/newtab/data/ +browser/components/newtab/logs/ +browser/components/newtab/prerendered/ +browser/components/newtab/vendor/ + # The only file in browser/locales/ is pre-processed. browser/locales/** # imported from chromium @@ -76,7 +82,6 @@ devtools/client/shared/webpack/shims/test/test_clipboard.html devtools/shared/qrcode/tests/mochitest/test_decode.html devtools/shared/tests/mochitest/*.html devtools/shared/webconsole/test/test_*.html -devtools/client/webreplay/mochitest/examples/*.html # Ignore devtools debugger files # Keep in sync with devtools/client/debugger/.eslintignore diff --git a/.eslintrc.js b/.eslintrc.js index 31ccf618ac..760b39b2aa 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -296,7 +296,6 @@ module.exports = { "rules": { "consistent-return": "off", "dot-notation": "off", - "object-shorthand": "off", "mozilla/avoid-removeChild": "off", "mozilla/consistent-if-bracing": "off", "mozilla/no-arbitrary-setTimeout": "off", diff --git a/.flake8 b/.flake8 index 05be05a88a..f658346e7f 100644 --- a/.flake8 +++ b/.flake8 @@ -46,7 +46,7 @@ exclude = toolkit/content/tests/chrome/file_about_networking_wsh.py, toolkit/crashreporter/tools/symbolstore.py, toolkit/crashreporter/tools/unit-symbolstore.py, - toolkit/library/dependentlibs.py, + toolkit/library/build/dependentlibs.py, toolkit/locales/generate_update_locale.py, toolkit/mozapps, toolkit/moz.configure, diff --git a/CLOBBER b/CLOBBER index d4cdfaff33..daca32d69e 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Merge day clobber \ No newline at end of file +Bug 1632434 - Update to ICU 67 requires clobber diff --git a/Makefile.in b/Makefile.in index 6078c0ab86..80df6be748 100644 --- a/Makefile.in +++ b/Makefile.in @@ -38,19 +38,12 @@ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \ .mozconfig.mk ifndef MOZ_PROFILE_USE -# Automation builds should always have a new buildid, but for the sake of not -# re-linking libxul on every incremental build we do not enforce this for -# developer builds. Tests always need a new buildid as well. -ifneq (,$(MOZ_AUTOMATION)$(MOZ_BUILD_DATE)$(TEST_MOZBUILD)) +ifneq (mobile/android,$(MOZ_BUILD_APP)) $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE endif -# Additionally, provide a dummy target during tests, because -# faster/rules.mk will expect these targets to exist. -ifdef TEST_MOZBUILD source-repo.h: $(MDDEPDIR)/source-repo.h.stub buildid.h: $(MDDEPDIR)/buildid.h.stub endif -endif BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS))) @@ -136,7 +129,7 @@ recurse_pre-export:: # process the install manifests as part of export. # For the binaries rule, not all the install manifests matter, so force only # the interesting ones to be done. -ifdef MOZ_PROFILE_USE +ifdef MOZ_1TIER_PGO ifndef NO_PROFILE_GUIDED_OPTIMIZE ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_) recurse_pre-export:: install-manifests @@ -144,7 +137,7 @@ binaries:: @$(MAKE) install-manifests install_manifests=dist/include endif endif -else # !MOZ_PROFILE_USE (normal build) +else # !MOZ_1TIER_PGO (normal build) recurse_pre-export:: install-manifests binaries:: @$(MAKE) install-manifests install_manifests=dist/include @@ -191,7 +184,7 @@ profiledbuild:: $(MAKE) maybe_clobber_profiledbuild $(call BUILDSTATUS,TIER_FINISH pgo_clobber) $(call BUILDSTATUS,TIER_START pgo_profile_use) - $(MAKE) default MOZ_PROFILE_USE=1 $(if $(CLANG_CL),MOZ_PROFILE_ORDER_FILE=$(topobjdir)/cygprofile.txt) + $(MAKE) default MOZ_PROFILE_USE=1 MOZ_1TIER_PGO=1 $(call BUILDSTATUS,TIER_FINISH pgo_profile_use) # Change default target to PGO build if PGO is enabled. diff --git a/README.md b/README.md index 4db4bbc84f..2102949783 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,20 @@ A browser for Windows XP based on Firefox 68. ![image](https://user-images.githubusercontent.com/19492771/152347482-f51058cd-2967-4bc5-80fd-5d269c328774.png) -**The most recent version is 68.13 nightly** - -[Look here for download](https://github.com/Feodor2/Mypal68/issues/160) **WARNING** This browser does not run well on winxp SP2 and lower. If you do not want to install SP3, be ready for crashes and blue screens. -If you are on SP2 and lower, there is no need to post a screenshot from blue_screen_view. And I suggest to apply postready updates of 2019. - - -**IF YOU GOT A CRASH BUT WITHOUT BLUE SCREEN** - -Please post drwatson.log only. It is located inside \Documents and settings\All Users\Application Data\Microsoft\Dr Watson -Do not post any irrelevant things. +If you are on SP2 and lower, there is no need to post a screenshot from blue_screen_view. And i suggest to apply postready updates of 2019. **IF YOU GOT A BLUE SCREEN** Don't post a screenshot of the blue screen, as the screen isn't useful for troubleshooting. -No anymore report needed, either you may research it or wait for a new version where it will be fixed -**YOU MAY DONATE** +Use http://www.nirsoft.net/utils/blue_screen_view.html and post on the attachment data report as on the example below. + +![image](https://user-images.githubusercontent.com/19492771/162557875-7e17c6b9-d84a-4927-90e6-b46e5bbb44f1.png) -But only by crypto [Look here](https://github.com/Feodor2/Mypal68/issues/84) +**IF YOU GOT A CRASH BUT WITHOUT BLUE SCREEN** + +Please post drwatson.log only. Do not post any irrelevent logs. diff --git a/accessible/android/AccessibleWrap.cpp b/accessible/android/AccessibleWrap.cpp index ab3990ab9e..3ed813e3d3 100644 --- a/accessible/android/AccessibleWrap.cpp +++ b/accessible/android/AccessibleWrap.cpp @@ -327,11 +327,11 @@ void AccessibleWrap::GetRoleDescription(role aRole, if (aRole == roles::HEADING && aAttributes) { // The heading level is an attribute, so we need that. - nsString level; - rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("level"), level); + AutoTArray formatString; + rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("level"), + *formatString.AppendElement()); if (NS_SUCCEEDED(rv)) { - const char16_t* formatString[] = {level.get()}; - rv = bundle->FormatStringFromName("headingLevel", formatString, 1, + rv = bundle->FormatStringFromName("headingLevel", formatString, aRoleDescription); if (NS_SUCCEEDED(rv)) { return; @@ -677,7 +677,7 @@ bool AccessibleWrap::HandleLiveRegionEvent(AccEvent* aEvent) { Accessible* atomicAncestor = nullptr; for (Accessible* parent = announcementTarget; parent; parent = parent->Parent()) { - Element* element = parent->Elm(); + dom::Element* element = parent->Elm(); if (element && element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_atomic, nsGkAtoms::_true, eCaseMatters)) { diff --git a/accessible/android/DocAccessibleWrap.cpp b/accessible/android/DocAccessibleWrap.cpp index 0c9716154e..d2b3e4e005 100644 --- a/accessible/android/DocAccessibleWrap.cpp +++ b/accessible/android/DocAccessibleWrap.cpp @@ -27,7 +27,7 @@ DocAccessibleWrap::DocAccessibleWrap(Document* aDocument, PresShell* aPresShell) nsCOMPtr treeItem(aDocument->GetDocShell()); nsCOMPtr parentTreeItem; - treeItem->GetParent(getter_AddRefs(parentTreeItem)); + treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem)); if (treeItem->ItemType() == nsIDocShellTreeItem::typeContent && (!parentTreeItem || diff --git a/accessible/atk/Platform.cpp b/accessible/atk/Platform.cpp index c76304ebe9..17912d4e3f 100644 --- a/accessible/atk/Platform.cpp +++ b/accessible/atk/Platform.cpp @@ -6,7 +6,6 @@ #include "nsIAccessibleEvent.h" #include "nsIGSettingsService.h" -#include "nsIServiceManager.h" #include "nsMai.h" #include "AtkSocketAccessible.h" #include "prenv.h" diff --git a/accessible/atk/nsMaiInterfaceImage.cpp b/accessible/atk/nsMaiInterfaceImage.cpp index 54f390180b..71a1846d1a 100644 --- a/accessible/atk/nsMaiInterfaceImage.cpp +++ b/accessible/atk/nsMaiInterfaceImage.cpp @@ -9,7 +9,6 @@ #include "mozilla/Likely.h" #include "nsMai.h" #include "nsIAccessibleTypes.h" -#include "nsIURI.h" #include "ProxyAccessible.h" using namespace mozilla; diff --git a/accessible/base/ARIAMap.h b/accessible/base/ARIAMap.h index 0c088eb356..93f9b19e2e 100644 --- a/accessible/base/ARIAMap.h +++ b/accessible/base/ARIAMap.h @@ -251,7 +251,7 @@ uint8_t GetIndexFromRoleMap(const nsRoleMapEntry* aRoleMap); * Return accessible state from ARIA universal states applied to the given * element. */ -uint64_t UniversalStatesFor(mozilla::dom::Element* aElement); +uint64_t UniversalStatesFor(dom::Element* aElement); /** * Get the ARIA attribute characteristics for a given ARIA attribute. @@ -274,7 +274,7 @@ bool HasDefinedARIAHidden(nsIContent* aContent); class AttrIterator { public: explicit AttrIterator(nsIContent* aContent) - : mElement(Element::FromNode(aContent)), mAttrIdx(0) { + : mElement(dom::Element::FromNode(aContent)), mAttrIdx(0) { mAttrCount = mElement ? mElement->GetAttrCount() : 0; } diff --git a/accessible/base/AccEvent.cpp b/accessible/base/AccEvent.cpp index 0afd9cfbf6..bca83e8ef5 100644 --- a/accessible/base/AccEvent.cpp +++ b/accessible/base/AccEvent.cpp @@ -8,7 +8,6 @@ #include "DocAccessible.h" #include "xpcAccEvents.h" #include "States.h" -#include "xpcAccessibleDocument.h" #include "mozilla/EventStateManager.h" #include "mozilla/dom/Selection.h" diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp index 784ceeda24..089110afcb 100644 --- a/accessible/base/DocManager.cpp +++ b/accessible/base/DocManager.cpp @@ -12,7 +12,6 @@ #include "nsAccessibilityService.h" #include "Platform.h" #include "RootAccessibleWrap.h" -#include "xpcAccessibleDocument.h" #ifdef A11Y_LOG # include "Logging.h" @@ -447,7 +446,7 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) { if (!isRootDoc) { // XXXaaronl: ideally we would traverse the presshell chain. Since there's // no easy way to do that, we cheat and use the document hierarchy. - parentDocAcc = GetDocAccessible(aDocument->GetParentDocument()); + parentDocAcc = GetDocAccessible(aDocument->GetInProcessParentDocument()); NS_ASSERTION(parentDocAcc, "Can't create an accessible for the document!"); if (!parentDocAcc) return nullptr; } diff --git a/accessible/base/Logging.cpp b/accessible/base/Logging.cpp index d45f89aa91..c39712448a 100644 --- a/accessible/base/Logging.cpp +++ b/accessible/base/Logging.cpp @@ -14,12 +14,10 @@ #include "nsDocShellLoadTypes.h" #include "nsIChannel.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsISelectionController.h" #include "nsTraceRefcnt.h" #include "nsIWebProgress.h" #include "prenv.h" #include "nsIDocShellTreeItem.h" -#include "nsIURI.h" #include "mozilla/PresShell.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/HTMLBodyElement.h" @@ -119,7 +117,7 @@ static void LogDocShellTree(dom::Document* aDocumentNode) { if (aDocumentNode->IsActive()) { nsCOMPtr treeItem(aDocumentNode->GetDocShell()); nsCOMPtr parentTreeItem; - treeItem->GetParent(getter_AddRefs(parentTreeItem)); + treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem)); nsCOMPtr rootTreeItem; treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;", @@ -180,7 +178,7 @@ static void LogDocLoadGroup(dom::Document* aDocumentNode) { } static void LogDocParent(dom::Document* aDocumentNode) { - dom::Document* parentDoc = aDocumentNode->GetParentDocument(); + dom::Document* parentDoc = aDocumentNode->GetInProcessParentDocument(); printf("parent DOM document: %p", static_cast(parentDoc)); if (parentDoc) { printf(", parent acc document: %p", diff --git a/accessible/base/SelectionManager.cpp b/accessible/base/SelectionManager.cpp index cfd5685859..8ee3f54ee6 100644 --- a/accessible/base/SelectionManager.cpp +++ b/accessible/base/SelectionManager.cpp @@ -13,7 +13,6 @@ #include "nsEventShell.h" #include "nsFrameSelection.h" -#include "nsIAccessibleTypes.h" #include "mozilla/PresShell.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/Selection.h" diff --git a/accessible/base/StyleInfo.cpp b/accessible/base/StyleInfo.cpp index 46115e37a5..b46be3cd82 100644 --- a/accessible/base/StyleInfo.cpp +++ b/accessible/base/StyleInfo.cpp @@ -19,10 +19,7 @@ StyleInfo::StyleInfo(dom::Element* aElement) : mElement(aElement) { void StyleInfo::Display(nsAString& aValue) { aValue.Truncate(); - AppendASCIItoUTF16( - nsCSSProps::ValueToKeyword(mComputedStyle->StyleDisplay()->mDisplay, - nsCSSProps::kDisplayKTable), - aValue); + Servo_GetPropertyValue(mComputedStyle, eCSSProperty_display, &aValue); } void StyleInfo::TextAlign(nsAString& aValue) { diff --git a/accessible/base/TextAttrs.cpp b/accessible/base/TextAttrs.cpp index e30c1ff7d6..92b02988d0 100644 --- a/accessible/base/TextAttrs.cpp +++ b/accessible/base/TextAttrs.cpp @@ -262,7 +262,7 @@ bool TextAttrsMgr::InvalidTextAttr::GetValue(nsIContent* aElm, nsIContent* elm = aElm; do { if (nsAccUtils::HasDefinedARIAToken(elm, nsGkAtoms::aria_invalid)) { - static Element::AttrValuesArray tokens[] = { + static dom::Element::AttrValuesArray tokens[] = { nsGkAtoms::_false, nsGkAtoms::grammar, nsGkAtoms::spelling, nullptr}; int32_t idx = elm->AsElement()->FindAttrValueIn( @@ -347,11 +347,11 @@ bool TextAttrsMgr::BGColorTextAttr::GetColor(nsIFrame* aFrame, TextAttrsMgr::ColorTextAttr::ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) : TTextAttr(!aFrame) { - mRootNativeValue = aRootFrame->StyleColor()->mColor.ToColor(); + mRootNativeValue = aRootFrame->StyleText()->mColor.ToColor(); mIsRootDefined = true; if (aFrame) { - mNativeValue = aFrame->StyleColor()->mColor.ToColor(); + mNativeValue = aFrame->StyleText()->mColor.ToColor(); mIsDefined = true; } } @@ -361,7 +361,7 @@ bool TextAttrsMgr::ColorTextAttr::GetValueFor(Accessible* aAccessible, nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent()); if (elm) { if (nsIFrame* frame = elm->GetPrimaryFrame()) { - *aValue = frame->StyleColor()->mColor.ToColor(); + *aValue = frame->StyleText()->mColor.ToColor(); return true; } } diff --git a/accessible/base/nsAccCache.h b/accessible/base/nsAccCache.h index eafdb2dd5c..eb5ea0653f 100644 --- a/accessible/base/nsAccCache.h +++ b/accessible/base/nsAccCache.h @@ -5,8 +5,6 @@ #ifndef _nsAccCache_H_ #define _nsAccCache_H_ -#include "xpcAccessibleDocument.h" - //////////////////////////////////////////////////////////////////////////////// // Accessible cache utils //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/base/nsAccUtils.cpp b/accessible/base/nsAccUtils.cpp index d9a99b43c0..065d27e769 100644 --- a/accessible/base/nsAccUtils.cpp +++ b/accessible/base/nsAccUtils.cpp @@ -95,7 +95,7 @@ int32_t nsAccUtils::GetLevelForXULContainerItem(nsIContent* aContent) { aContent->AsElement()->AsXULContainerItem(); if (!item) return 0; - nsCOMPtr containerElement; + nsCOMPtr containerElement; item->GetParentContainer(getter_AddRefs(containerElement)); nsCOMPtr container = containerElement ? containerElement->AsXULContainer() : nullptr; @@ -173,7 +173,7 @@ bool nsAccUtils::HasDefinedARIAToken(nsIContent* aContent, nsAtom* aAtom) { if (!aContent->IsElement()) return false; - Element* element = aContent->AsElement(); + dom::Element* element = aContent->AsElement(); if (!element->HasAttr(kNameSpaceID_None, aAtom) || element->AttrValueIs(kNameSpaceID_None, aAtom, nsGkAtoms::_empty, eCaseMatters) || @@ -187,7 +187,7 @@ bool nsAccUtils::HasDefinedARIAToken(nsIContent* aContent, nsAtom* aAtom) { nsStaticAtom* nsAccUtils::GetARIAToken(dom::Element* aElement, nsAtom* aAttr) { if (!HasDefinedARIAToken(aElement, aAttr)) return nsGkAtoms::_empty; - static Element::AttrValuesArray tokens[] = { + static dom::Element::AttrValuesArray tokens[] = { nsGkAtoms::_false, nsGkAtoms::_true, nsGkAtoms::mixed, nullptr}; int32_t idx = @@ -204,7 +204,7 @@ nsStaticAtom* nsAccUtils::NormalizeARIAToken(dom::Element* aElement, } if (aAttr == nsGkAtoms::aria_current) { - static Element::AttrValuesArray tokens[] = { + static dom::Element::AttrValuesArray tokens[] = { nsGkAtoms::page, nsGkAtoms::step, nsGkAtoms::location_, nsGkAtoms::date, nsGkAtoms::time, nsGkAtoms::_true, nullptr}; @@ -510,12 +510,13 @@ bool nsAccUtils::IsARIALive(const Accessible* aAccessible) { } nsCOMPtr sameTypeParent; - docShellTreeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent)); + docShellTreeItem->GetInProcessSameTypeParent( + getter_AddRefs(sameTypeParent)); if (!sameTypeParent || sameTypeParent == docShellTreeItem) { break; } - dom::Document* parentDoc = doc->GetParentDocument(); + dom::Document* parentDoc = doc->GetInProcessParentDocument(); if (!parentDoc) { break; } diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index e5ceb77565..9f3d651a9a 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -25,7 +25,6 @@ #include "nsAttrName.h" #include "nsDOMTokenList.h" #include "nsEventShell.h" -#include "nsIURI.h" #include "nsTextFormatter.h" #include "OuterDocAccessible.h" #include "Role.h" @@ -37,7 +36,6 @@ #include "TextLeafAccessibleWrap.h" #include "TreeWalker.h" #include "xpcAccessibleApplication.h" -#include "xpcAccessibleDocument.h" #ifdef MOZ_ACCESSIBILITY_ATK # include "AtkSocketAccessible.h" @@ -1395,12 +1393,13 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame, if (table) { nsIContent* parentContent = - aContent->GetParentOrHostNode()->AsContent(); + aContent->GetParentOrShadowHostNode()->AsContent(); nsIFrame* parentFrame = nullptr; if (parentContent) { parentFrame = parentContent->GetPrimaryFrame(); if (!parentFrame || !parentFrame->IsTableWrapperFrame()) { - parentContent = parentContent->GetParentOrHostNode()->AsContent(); + parentContent = + parentContent->GetParentOrShadowHostNode()->AsContent(); if (parentContent) { parentFrame = parentContent->GetPrimaryFrame(); } diff --git a/accessible/base/nsAccessibilityService.h b/accessible/base/nsAccessibilityService.h index b9a22aba02..5ecd7ab608 100644 --- a/accessible/base/nsAccessibilityService.h +++ b/accessible/base/nsAccessibilityService.h @@ -29,6 +29,7 @@ class PresShell; namespace dom { class DOMStringList; +class Element; } namespace a11y { @@ -52,7 +53,8 @@ SelectionManager* SelectionMgr(); ApplicationAccessible* ApplicationAcc(); xpcAccessibleApplication* XPCApplicationAcc(); -typedef Accessible*(New_Accessible)(Element* aElement, Accessible* aContext); +typedef Accessible*(New_Accessible)(mozilla::dom::Element* aElement, + Accessible* aContext); // These fields are not `nsStaticAtom* const` because MSVC doesn't like it. struct MarkupAttrInfo { diff --git a/accessible/base/nsCoreUtils.cpp b/accessible/base/nsCoreUtils.cpp index c0f48366af..e4d604c15c 100644 --- a/accessible/base/nsCoreUtils.cpp +++ b/accessible/base/nsCoreUtils.cpp @@ -233,7 +233,7 @@ nsresult nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange, selCon->GetSelection(nsISelectionController::SELECTION_ACCESSIBILITY); selection->RemoveAllRanges(IgnoreErrors()); - selection->AddRange(*aRange, IgnoreErrors()); + selection->AddRangeAndSelectFramesAndNotifyListeners(*aRange, IgnoreErrors()); selection->ScrollIntoView(nsISelectionController::SELECTION_ANCHOR_REGION, aVertical, aHorizontal, @@ -341,7 +341,7 @@ bool nsCoreUtils::IsRootDocument(Document* aDocument) { NS_ASSERTION(docShellTreeItem, "No document shell for document!"); nsCOMPtr parentTreeItem; - docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem)); + docShellTreeItem->GetInProcessParent(getter_AddRefs(parentTreeItem)); return !parentTreeItem; } @@ -357,7 +357,7 @@ bool nsCoreUtils::IsTabDocument(Document* aDocumentNode) { nsCOMPtr treeItem(aDocumentNode->GetDocShell()); nsCOMPtr parentTreeItem; - treeItem->GetParent(getter_AddRefs(parentTreeItem)); + treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem)); // Tab document running in own process doesn't have parent. if (XRE_IsContentProcess()) return !parentTreeItem; @@ -371,9 +371,9 @@ bool nsCoreUtils::IsTabDocument(Document* aDocumentNode) { bool nsCoreUtils::IsErrorPage(Document* aDocument) { nsIURI* uri = aDocument->GetDocumentURI(); - bool isAboutScheme = false; - uri->SchemeIs("about", &isAboutScheme); - if (!isAboutScheme) return false; + if (!uri->SchemeIs("about")) { + return false; + } nsAutoCString path; uri->GetPathQueryRef(path); diff --git a/accessible/generic/ARIAGridAccessible.cpp b/accessible/generic/ARIAGridAccessible.cpp index 9cb722075d..e7a4b0d3e6 100644 --- a/accessible/generic/ARIAGridAccessible.cpp +++ b/accessible/generic/ARIAGridAccessible.cpp @@ -10,7 +10,6 @@ #include "Role.h" #include "States.h" -#include "nsIMutableArray.h" #include "nsIPersistentProperties2.h" #include "nsComponentManagerUtils.h" diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index 27ff18b45a..8c25e127e9 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -58,9 +58,6 @@ #include "nsAtom.h" #include "nsIURI.h" #include "nsArrayUtils.h" -#include "nsIMutableArray.h" -#include "nsIObserverService.h" -#include "nsIServiceManager.h" #include "nsWhitespaceTokenizer.h" #include "nsAttrName.h" #include "nsPersistentProperties.h" @@ -119,15 +116,10 @@ Accessible::Accessible(nsIContent* aContent, DocAccessible* aDoc) mHideEventTarget(false) { mBits.groupInfo = nullptr; mInt.mIndexOfEmbeddedChild = -1; - - // Assign an ID to this Accessible for use in UniqueID(). - recordreplay::RegisterThing(this); } Accessible::~Accessible() { NS_ASSERTION(!mDoc, "LastRelease was never called!?!"); - - recordreplay::UnregisterThing(this); } ENameValueFlag Accessible::Name(nsString& aName) const { @@ -741,8 +733,7 @@ void Accessible::TakeFocus() const { nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm) { - AutoHandlingUserInputStatePusher inputStatePusher(true, nullptr, - focusContent->OwnerDoc()); + AutoHandlingUserInputStatePusher inputStatePusher(true); // XXXbz: Can we actually have a non-element content here? RefPtr element = focusContent->IsElement() ? focusContent->AsElement() : nullptr; @@ -1076,10 +1067,11 @@ already_AddRefed Accessible::NativeAttributes() { if (!docShellTreeItem) break; nsCOMPtr sameTypeParent; - docShellTreeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent)); + docShellTreeItem->GetInProcessSameTypeParent( + getter_AddRefs(sameTypeParent)); if (!sameTypeParent || sameTypeParent == docShellTreeItem) break; - dom::Document* parentDoc = doc->GetParentDocument(); + dom::Document* parentDoc = doc->GetInProcessParentDocument(); if (!parentDoc) break; startContent = parentDoc->FindContentForSubDocument(doc); @@ -1789,7 +1781,7 @@ Relation Accessible::RelationByType(RelationType aType) const { // Walk up the parent chain without crossing the boundary at which item // types change, preventing us from walking up out of tab content. nsCOMPtr root; - docShell->GetSameTypeRootTreeItem(getter_AddRefs(root)); + docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root)); if (root) { // If the item type is typeContent, we assume we are in browser tab // content. Note, this includes content such as about:addons, @@ -2453,8 +2445,7 @@ Accessible* Accessible::CurrentItem() const { dom::Document* DOMDoc = mContent->OwnerDoc(); dom::Element* activeDescendantElm = DOMDoc->GetElementById(id); if (activeDescendantElm) { - if (nsContentUtils::ContentIsDescendantOf(mContent, - activeDescendantElm)) { + if (mContent->IsInclusiveDescendantOf(activeDescendantElm)) { // Don't want a cyclical descendant relationship. That would be bad. return nullptr; } diff --git a/accessible/generic/Accessible.h b/accessible/generic/Accessible.h index a41446406c..aab625c32f 100644 --- a/accessible/generic/Accessible.h +++ b/accessible/generic/Accessible.h @@ -171,15 +171,7 @@ class Accessible : public nsISupports { /** * Return the unique identifier of the accessible. */ - void* UniqueID() { - // When recording or replaying, use an ID which will be consistent when - // recording/replaying (pointer values are not consistent), so that IPC - // messages from the parent process can be handled when replaying. - if (recordreplay::IsRecordingOrReplaying()) { - return reinterpret_cast(recordreplay::ThingIndex(this)); - } - return static_cast(this); - } + void* UniqueID() { return static_cast(this); } /** * Return language associated with the accessible. diff --git a/accessible/generic/ApplicationAccessible.cpp b/accessible/generic/ApplicationAccessible.cpp index 7be8f88bb9..e42bd3a40d 100644 --- a/accessible/generic/ApplicationAccessible.cpp +++ b/accessible/generic/ApplicationAccessible.cpp @@ -10,8 +10,6 @@ #include "Role.h" #include "States.h" -#include "nsIComponentManager.h" -#include "nsIWindowMediator.h" #include "nsServiceManagerUtils.h" #include "mozilla/Services.h" #include "nsGlobalWindow.h" diff --git a/accessible/generic/ApplicationAccessible.h b/accessible/generic/ApplicationAccessible.h index 288515900c..c4905f3308 100644 --- a/accessible/generic/ApplicationAccessible.h +++ b/accessible/generic/ApplicationAccessible.h @@ -7,7 +7,6 @@ #include "AccessibleWrap.h" -#include "nsIMutableArray.h" #include "nsIXULAppInfo.h" namespace mozilla { diff --git a/accessible/generic/DocAccessible.cpp b/accessible/generic/DocAccessible.cpp index c37cb10bd0..40eb516839 100644 --- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -19,7 +19,6 @@ #include "nsCommandManager.h" #include "nsContentUtils.h" -#include "nsIMutableArray.h" #include "nsIDocShell.h" #include "mozilla/dom/Document.h" #include "nsPIDOMWindow.h" @@ -28,7 +27,6 @@ #include "nsIInterfaceRequestorUtils.h" #include "nsImageFrame.h" #include "nsIPersistentProperties2.h" -#include "nsIServiceManager.h" #include "nsViewManager.h" #include "nsIScrollableFrame.h" #include "nsUnicharUtils.h" @@ -191,7 +189,7 @@ role DocAccessible::NativeRole() const { nsCOMPtr docShell = nsCoreUtils::GetDocShellFor(mDocumentNode); if (docShell) { nsCOMPtr sameTypeRoot; - docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); + docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); int32_t itemType = docShell->ItemType(); if (sameTypeRoot == docShell) { // Root of content or chrome tree @@ -292,8 +290,7 @@ void DocAccessible::TakeFocus() const { // Focus the document. nsFocusManager* fm = nsFocusManager::GetFocusManager(); RefPtr newFocus; - AutoHandlingUserInputStatePusher inputStatePusher(true, nullptr, - mDocumentNode); + AutoHandlingUserInputStatePusher inputStatePusher(true); fm->MoveFocus(mDocumentNode->GetWindow(), nullptr, nsFocusManager::MOVEFOCUS_ROOT, 0, getter_AddRefs(newFocus)); } @@ -497,7 +494,7 @@ nsRect DocAccessible::RelativeBounds(nsIFrame** aRelativeFrame) const { bounds = scrollPort; } - document = parentDoc = document->GetParentDocument(); + document = parentDoc = document->GetInProcessParentDocument(); } return bounds; @@ -1937,7 +1934,7 @@ void DocAccessible::DoARIAOwnsRelocation(Accessible* aOwner) { // Make an attempt to create an accessible if it wasn't created yet. if (!child) { // An owned child cannot be an ancestor of the owner. - if (nsContentUtils::ContentIsDescendantOf(aOwner->Elm(), childEl)) { + if (aOwner->Elm()->IsInclusiveDescendantOf(childEl)) { continue; } @@ -2275,7 +2272,7 @@ bool DocAccessible::IsLoadEventTarget() const { NS_ASSERTION(treeItem, "No document shell for document!"); nsCOMPtr parentTreeItem; - treeItem->GetParent(getter_AddRefs(parentTreeItem)); + treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem)); // Not a root document. if (parentTreeItem) { diff --git a/accessible/generic/DocAccessible.h b/accessible/generic/DocAccessible.h index 937446d360..f35449664a 100644 --- a/accessible/generic/DocAccessible.h +++ b/accessible/generic/DocAccessible.h @@ -18,7 +18,6 @@ #include "nsIObserver.h" #include "nsIScrollPositionListener.h" #include "nsITimer.h" -#include "nsIWeakReference.h" class nsAccessiblePivot; diff --git a/accessible/generic/HyperTextAccessible-inl.h b/accessible/generic/HyperTextAccessible-inl.h index 6e1c487318..ace4a8d930 100644 --- a/accessible/generic/HyperTextAccessible-inl.h +++ b/accessible/generic/HyperTextAccessible-inl.h @@ -10,7 +10,6 @@ #include "nsAccUtils.h" #include "nsIClipboard.h" -#include "nsIPersistentProperties2.h" #include "nsFrameSelection.h" #include "mozilla/TextEditor.h" diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp index 3cbd6c52cb..efa7f9abcf 100644 --- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -25,18 +25,17 @@ #include "nsIInterfaceRequestorUtils.h" #include "nsPersistentProperties.h" #include "nsIScrollableFrame.h" -#include "nsIServiceManager.h" -#include "nsITextControlElement.h" #include "nsIMathMLFrame.h" #include "nsRange.h" #include "nsTextFragment.h" #include "mozilla/BinarySearch.h" -#include "mozilla/dom/Element.h" #include "mozilla/EventStates.h" -#include "mozilla/dom/Selection.h" #include "mozilla/MathAlgorithms.h" #include "mozilla/PresShell.h" #include "mozilla/TextEditor.h" +#include "mozilla/dom/Element.h" +#include "mozilla/dom/HTMLBRElement.h" +#include "mozilla/dom/Selection.h" #include "gfxSkipChars.h" #include @@ -253,13 +252,10 @@ uint32_t HyperTextAccessible::DOMPointToOffset(nsINode* aNode, // first search) Accessible* descendant = nullptr; if (findNode) { - nsCOMPtr findContent(do_QueryInterface(findNode)); - if (findContent && findContent->IsHTMLElement(nsGkAtoms::br) && - findContent->AsElement()->AttrValueIs(kNameSpaceID_None, - nsGkAtoms::mozeditorbogusnode, - nsGkAtoms::_true, eIgnoreCase)) { - // This
is the hacky "bogus node" used when there is no text in a - // control + dom::HTMLBRElement* brElement = dom::HTMLBRElement::FromNode(findNode); + if (brElement && brElement->IsPaddingForEmptyEditor()) { + // This
is the hacky "padding
element" used when there is no + // text in the editor. return 0; } @@ -317,7 +313,7 @@ uint32_t HyperTextAccessible::TransformOffset(Accessible* aDescendant, * ancestors too. */ static nsIContent* GetElementAsContentOf(nsINode* aNode) { - if (Element* element = Element::FromNode(aNode)) { + if (auto* element = dom::Element::FromNode(aNode)) { return element; } return aNode->GetParentElement(); @@ -1270,7 +1266,8 @@ nsresult HyperTextAccessible::SetSelectionRange(int32_t aStartPos, // Set up the selection. for (int32_t idx = domSel->RangeCount() - 1; idx > 0; idx--) - domSel->RemoveRange(*domSel->GetRangeAt(idx), IgnoreErrors()); + domSel->RemoveRangeAndUnselectFramesAndNotifyListeners( + *domSel->GetRangeAt(idx), IgnoreErrors()); SetSelectionBoundsAt(0, aStartPos, aEndPos); // Make sure it is visible @@ -1527,12 +1524,12 @@ bool HyperTextAccessible::SelectionBoundsAt(int32_t aSelectionNum, endOffset = tempOffset; } - if (!nsContentUtils::ContentIsDescendantOf(startNode, mContent)) + if (!startNode->IsInclusiveDescendantOf(mContent)) *aStartOffset = 0; else *aStartOffset = DOMPointToOffset(startNode, startOffset); - if (!nsContentUtils::ContentIsDescendantOf(endNode, mContent)) + if (!endNode->IsInclusiveDescendantOf(mContent)) *aEndOffset = CharacterCount(); else *aEndOffset = DOMPointToOffset(endNode, endOffset, true); @@ -1569,11 +1566,12 @@ bool HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum, // If this is not a new range, notify selection listeners that the existing // selection range has changed. Otherwise, just add the new range. if (aSelectionNum != static_cast(rangeCount)) { - domSel->RemoveRange(*range, IgnoreErrors()); + domSel->RemoveRangeAndUnselectFramesAndNotifyListeners(*range, + IgnoreErrors()); } IgnoredErrorResult err; - domSel->AddRange(*range, err); + domSel->AddRangeAndSelectFramesAndNotifyListeners(*range, err); if (!err.Failed()) { // Changing the direction of the selection assures that the caret @@ -1593,7 +1591,8 @@ bool HyperTextAccessible::RemoveFromSelection(int32_t aSelectionNum) { aSelectionNum >= static_cast(domSel->RangeCount())) return false; - domSel->RemoveRange(*domSel->GetRangeAt(aSelectionNum), IgnoreErrors()); + domSel->RemoveRangeAndUnselectFramesAndNotifyListeners( + *domSel->GetRangeAt(aSelectionNum), IgnoreErrors()); return true; } diff --git a/accessible/generic/HyperTextAccessible.h b/accessible/generic/HyperTextAccessible.h index 726080b0b5..d2d35b73e1 100644 --- a/accessible/generic/HyperTextAccessible.h +++ b/accessible/generic/HyperTextAccessible.h @@ -12,8 +12,6 @@ #include "WordMovementType.h" #include "nsIFrame.h" -#include "nsISelectionController.h" - class nsFrameSelection; class nsRange; class nsIWidget; @@ -400,8 +398,9 @@ class HyperTextAccessible : public AccessibleWrap { ////////////////////////////////////////////////////////////////////////////// // EditableTextAccessible - void ReplaceText(const nsAString& aText); - void InsertText(const nsAString& aText, int32_t aPosition); + MOZ_CAN_RUN_SCRIPT_BOUNDARY void ReplaceText(const nsAString& aText); + MOZ_CAN_RUN_SCRIPT_BOUNDARY void InsertText(const nsAString& aText, + int32_t aPosition); void CopyText(int32_t aStartPos, int32_t aEndPos); MOZ_CAN_RUN_SCRIPT_BOUNDARY void CutText(int32_t aStartPos, int32_t aEndPos); MOZ_CAN_RUN_SCRIPT_BOUNDARY void DeleteText(int32_t aStartPos, diff --git a/accessible/generic/ImageAccessible.cpp b/accessible/generic/ImageAccessible.cpp index c31ed05c91..8a1968a182 100644 --- a/accessible/generic/ImageAccessible.cpp +++ b/accessible/generic/ImageAccessible.cpp @@ -14,7 +14,6 @@ #include "nsGenericHTMLElement.h" #include "mozilla/dom/Document.h" #include "nsIImageLoadingContent.h" -#include "nsIServiceManager.h" #include "nsIPersistentProperties2.h" #include "nsPIDOMWindow.h" #include "nsIURI.h" @@ -151,10 +150,10 @@ already_AddRefed ImageAccessible::GetLongDescURI() const { longdesc.FindChar('\r') != -1 || longdesc.FindChar('\n') != -1) { return nullptr; } - nsCOMPtr baseURI = mContent->GetBaseURI(); nsCOMPtr uri; nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(uri), longdesc, - mContent->OwnerDoc(), baseURI); + mContent->OwnerDoc(), + mContent->GetBaseURI()); return uri.forget(); } diff --git a/accessible/generic/RootAccessible.cpp b/accessible/generic/RootAccessible.cpp index 3f6c140fec..9a27d957b9 100644 --- a/accessible/generic/RootAccessible.cpp +++ b/accessible/generic/RootAccessible.cpp @@ -27,7 +27,6 @@ #include "mozilla/dom/Element.h" #include "mozilla/dom/ScriptSettings.h" -#include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeOwner.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/EventTarget.h" @@ -35,7 +34,6 @@ #include "mozilla/dom/Document.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIPropertyBag2.h" -#include "nsIServiceManager.h" #include "nsPIDOMWindow.h" #include "nsIWebBrowserChrome.h" #include "nsReadableUtils.h" diff --git a/accessible/html/HTMLElementAccessibles.cpp b/accessible/html/HTMLElementAccessibles.cpp index db62f9bec5..2e7d895441 100644 --- a/accessible/html/HTMLElementAccessibles.cpp +++ b/accessible/html/HTMLElementAccessibles.cpp @@ -6,7 +6,6 @@ #include "DocAccessible.h" #include "nsAccUtils.h" -#include "nsIPersistentProperties2.h" #include "nsTextEquivUtils.h" #include "Relation.h" #include "Role.h" diff --git a/accessible/html/HTMLFormControlAccessible.cpp b/accessible/html/HTMLFormControlAccessible.cpp index 796be62fe6..09584d6e52 100644 --- a/accessible/html/HTMLFormControlAccessible.cpp +++ b/accessible/html/HTMLFormControlAccessible.cpp @@ -15,12 +15,8 @@ #include "nsContentList.h" #include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/HTMLTextAreaElement.h" -#include "nsIEditor.h" #include "nsIFormControl.h" #include "nsIPersistentProperties2.h" -#include "nsISelectionController.h" -#include "nsIServiceManager.h" -#include "nsITextControlElement.h" #include "nsITextControlFrame.h" #include "nsNameSpaceManager.h" #include "mozilla/dom/ScriptSettings.h" @@ -28,6 +24,7 @@ #include "mozilla/EventStates.h" #include "mozilla/FloatingPoint.h" #include "mozilla/Preferences.h" +#include "mozilla/TextControlElement.h" #include "mozilla/TextEditor.h" using namespace mozilla; @@ -337,7 +334,8 @@ uint64_t HTMLTextFieldAccessible::NativeState() const { return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP; // Ordinal XUL textboxes don't support autocomplete. - if (!BindingOrWidgetParent() && Preferences::GetBool("browser.formfill.enable")) { + if (!BindingOrWidgetParent() && + Preferences::GetBool("browser.formfill.enable")) { // Check to see if autocompletion is allowed on this input. We don't expose // it for password fields even though the entire password can be remembered // for a page if the user asks it to be. However, the kind of autocomplete @@ -376,8 +374,8 @@ bool HTMLTextFieldAccessible::DoAction(uint8_t aIndex) const { } already_AddRefed HTMLTextFieldAccessible::GetEditor() const { - nsCOMPtr textControlElement = - do_QueryInterface(mContent); + RefPtr textControlElement = + TextControlElement::FromNodeOrNull(mContent); if (!textControlElement) { return nullptr; } diff --git a/accessible/html/HTMLFormControlAccessible.h b/accessible/html/HTMLFormControlAccessible.h index fa1c0c361b..7a10b88ec0 100644 --- a/accessible/html/HTMLFormControlAccessible.h +++ b/accessible/html/HTMLFormControlAccessible.h @@ -72,7 +72,8 @@ class HTMLTextFieldAccessible final : public HyperTextAccessibleWrap { HyperTextAccessibleWrap) // HyperTextAccessible - virtual already_AddRefed GetEditor() const override; + MOZ_CAN_RUN_SCRIPT_BOUNDARY virtual already_AddRefed GetEditor() + const override; // Accessible virtual void Value(nsString& aValue) const override; @@ -101,7 +102,7 @@ class HTMLTextFieldAccessible final : public HyperTextAccessibleWrap { * HTML:input@type="number". */ nsIContent* BindingOrWidgetParent() const { - nsIContent * el = mContent->GetBindingParent(); + nsIContent* el = mContent->GetBindingParent(); if (el) { return el; } diff --git a/accessible/html/HTMLImageMapAccessible.cpp b/accessible/html/HTMLImageMapAccessible.cpp index df2db88847..de84890997 100644 --- a/accessible/html/HTMLImageMapAccessible.cpp +++ b/accessible/html/HTMLImageMapAccessible.cpp @@ -9,7 +9,6 @@ #include "DocAccessible-inl.h" #include "Role.h" -#include "nsIServiceManager.h" #include "nsIFrame.h" #include "nsImageFrame.h" #include "nsImageMap.h" diff --git a/accessible/html/HTMLListAccessible.cpp b/accessible/html/HTMLListAccessible.cpp index 6a6347b34c..a9db22a5d9 100644 --- a/accessible/html/HTMLListAccessible.cpp +++ b/accessible/html/HTMLListAccessible.cpp @@ -9,8 +9,8 @@ #include "Role.h" #include "States.h" -#include "nsBlockFrame.h" -#include "nsBulletFrame.h" +#include "nsContainerFrame.h" +#include "nsLayoutUtils.h" using namespace mozilla; using namespace mozilla::a11y; @@ -36,8 +36,7 @@ HTMLLIAccessible::HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc), mBullet(nullptr) { mType = eHTMLLiType; - nsBlockFrame* blockFrame = do_QueryFrame(GetFrame()); - if (blockFrame && blockFrame->HasMarker()) { + if (nsLayoutUtils::GetMarkerFrame(aContent)) { mBullet = new HTMLListBulletAccessible(mContent, mDoc); Document()->BindToDocument(mBullet, nullptr); AppendChild(mBullet); @@ -117,17 +116,15 @@ HTMLListBulletAccessible::HTMLListBulletAccessible(nsIContent* aContent, // HTMLListBulletAccessible: Accessible nsIFrame* HTMLListBulletAccessible::GetFrame() const { - nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame()); - return blockFrame ? blockFrame->GetMarker() : nullptr; + return nsLayoutUtils::GetMarkerFrame(mContent); } ENameValueFlag HTMLListBulletAccessible::Name(nsString& aName) const { aName.Truncate(); // Native anonymous content, ARIA can't be used. Get list bullet text. - nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame()); - if (blockFrame) { - blockFrame->GetSpokenMarkerText(aName); + if (nsContainerFrame* frame = do_QueryFrame(mContent->GetPrimaryFrame())) { + frame->GetSpokenMarkerText(aName); } return eNameOK; @@ -143,9 +140,7 @@ void HTMLListBulletAccessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset, uint32_t aLength) { nsAutoString bulletText; - nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame()); - if (blockFrame) blockFrame->GetSpokenMarkerText(bulletText); - + Name(bulletText); aText.Append(Substring(bulletText, aStartOffset, aLength)); } @@ -153,6 +148,9 @@ void HTMLListBulletAccessible::AppendTextTo(nsAString& aText, // HTMLListBulletAccessible: public bool HTMLListBulletAccessible::IsInside() const { - nsBlockFrame* blockFrame = do_QueryFrame(mContent->GetPrimaryFrame()); - return blockFrame ? blockFrame->HasInsideMarker() : false; + if (nsIFrame* frame = mContent->GetPrimaryFrame()) { + return frame->StyleList()->mListStylePosition == + NS_STYLE_LIST_STYLE_POSITION_INSIDE; + } + return false; } diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp index 13047cfc6b..ea70fb6905 100644 --- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -20,7 +20,6 @@ #include "mozilla/dom/HTMLTableElement.h" #include "nsIHTMLCollection.h" #include "mozilla/dom/Document.h" -#include "nsIMutableArray.h" #include "nsIPersistentProperties2.h" #include "nsITableCellLayout.h" #include "nsFrameSelection.h" diff --git a/accessible/ipc/ProxyAccessibleBase.cpp b/accessible/ipc/ProxyAccessibleBase.cpp index 55b4138d29..d2da9d1cf4 100644 --- a/accessible/ipc/ProxyAccessibleBase.cpp +++ b/accessible/ipc/ProxyAccessibleBase.cpp @@ -13,7 +13,6 @@ #include "mozilla/dom/BrowserParent.h" #include "mozilla/Unused.h" #include "RelationType.h" -#include "xpcAccessibleDocument.h" namespace mozilla { namespace a11y { diff --git a/accessible/ipc/other/DocAccessibleChild.cpp b/accessible/ipc/other/DocAccessibleChild.cpp index 9701b4ff3e..a430c5dac8 100644 --- a/accessible/ipc/other/DocAccessibleChild.cpp +++ b/accessible/ipc/other/DocAccessibleChild.cpp @@ -14,7 +14,6 @@ #include "TableAccessible.h" #include "TableCellAccessible.h" #include "nsIPersistentProperties2.h" -#include "nsISimpleEnumerator.h" #include "nsAccUtils.h" #ifdef MOZ_ACCESSIBILITY_ATK # include "AccessibleWrap.h" diff --git a/accessible/ipc/other/ProxyAccessible.cpp b/accessible/ipc/other/ProxyAccessible.cpp index 3d5cccd6f7..b5a5fb3539 100644 --- a/accessible/ipc/other/ProxyAccessible.cpp +++ b/accessible/ipc/other/ProxyAccessible.cpp @@ -12,7 +12,6 @@ #include "mozilla/a11y/Platform.h" #include "RelationType.h" #include "mozilla/a11y/Role.h" -#include "xpcAccessibleDocument.h" namespace mozilla { namespace a11y { diff --git a/accessible/ipc/other/ProxyAccessible.h b/accessible/ipc/other/ProxyAccessible.h index 24b9cd2b0f..c66766c1ae 100644 --- a/accessible/ipc/other/ProxyAccessible.h +++ b/accessible/ipc/other/ProxyAccessible.h @@ -8,8 +8,6 @@ #include "Accessible.h" #include "mozilla/a11y/ProxyAccessibleBase.h" #include "mozilla/a11y/Role.h" -#include "nsIAccessibleText.h" -#include "nsIAccessibleTypes.h" #include "nsString.h" #include "nsTArray.h" #include "nsRect.h" diff --git a/accessible/ipc/win/COMPtrTypes.cpp b/accessible/ipc/win/COMPtrTypes.cpp index df2c9d6c0f..02bb3b2c8b 100644 --- a/accessible/ipc/win/COMPtrTypes.cpp +++ b/accessible/ipc/win/COMPtrTypes.cpp @@ -4,7 +4,6 @@ #include "mozilla/a11y/COMPtrTypes.h" -#include "Accessible2_3.h" #include "MainThreadUtils.h" #include "mozilla/a11y/Accessible.h" #include "mozilla/a11y/Platform.h" diff --git a/accessible/ipc/win/ProxyAccessible.cpp b/accessible/ipc/win/ProxyAccessible.cpp index 78273cdf07..d1dc335993 100644 --- a/accessible/ipc/win/ProxyAccessible.cpp +++ b/accessible/ipc/win/ProxyAccessible.cpp @@ -16,7 +16,6 @@ #include "mozilla/a11y/Platform.h" #include "RelationType.h" #include "mozilla/a11y/Role.h" -#include "xpcAccessibleDocument.h" #include diff --git a/accessible/ipc/win/ProxyAccessible.h b/accessible/ipc/win/ProxyAccessible.h index 36bca9bf81..7a016c10ca 100644 --- a/accessible/ipc/win/ProxyAccessible.h +++ b/accessible/ipc/win/ProxyAccessible.h @@ -8,8 +8,6 @@ #include "Accessible.h" #include "mozilla/a11y/ProxyAccessibleBase.h" #include "mozilla/a11y/Role.h" -#include "nsIAccessibleText.h" -#include "nsIAccessibleTypes.h" #include "nsString.h" #include "nsTArray.h" #include "nsRect.h" diff --git a/accessible/ipc/win/handler/AccessibleHandler.cpp b/accessible/ipc/win/handler/AccessibleHandler.cpp index db7294d84a..467a615bbe 100644 --- a/accessible/ipc/win/handler/AccessibleHandler.cpp +++ b/accessible/ipc/win/handler/AccessibleHandler.cpp @@ -12,7 +12,6 @@ #include "HandlerRelation.h" #include "Factory.h" -#include "HandlerData.h" #include "mozilla/ArrayUtils.h" #include "mozilla/a11y/HandlerDataCleanup.h" #include "mozilla/mscom/Registration.h" diff --git a/accessible/ipc/win/handler/HandlerDataCleanup.h b/accessible/ipc/win/handler/HandlerDataCleanup.h index 4c35622472..79de694f49 100644 --- a/accessible/ipc/win/handler/HandlerDataCleanup.h +++ b/accessible/ipc/win/handler/HandlerDataCleanup.h @@ -6,7 +6,6 @@ #define mozilla_a11y_HandlerDataCleanup_h #include -#include "HandlerData.h" namespace mozilla { namespace a11y { diff --git a/accessible/ipc/win/typelib/moz.build b/accessible/ipc/win/typelib/moz.build index 7eb9e62736..5736a73ce1 100644 --- a/accessible/ipc/win/typelib/moz.build +++ b/accessible/ipc/win/typelib/moz.build @@ -6,6 +6,4 @@ FINAL_TARGET_FILES += [ '!Accessible.tlb', ] -GENERATED_FILES += [ - 'Accessible.tlb', -] +GeneratedFile('Accessible.tlb') diff --git a/accessible/jsat/Utils.jsm b/accessible/jsat/Utils.jsm index 04948f0700..9e003cd73f 100644 --- a/accessible/jsat/Utils.jsm +++ b/accessible/jsat/Utils.jsm @@ -141,7 +141,7 @@ var Utils = { let args = aDetails.args; let count = aDetails.count; if (args) { - str = bundle.formatStringFromName(string, args, args.length); + str = bundle.formatStringFromName(string, args); } else { str = bundle.GetStringFromName(string); } diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 185de12e18..878f7f7e1d 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -9,8 +9,6 @@ #include "Accessible-inl.h" #include "nsAccUtils.h" -#include "nsIAccessibleRelation.h" -#include "nsIAccessibleEditableText.h" #include "nsIPersistentProperties2.h" #include "DocAccessibleParent.h" #include "Relation.h" diff --git a/accessible/tests/browser/e10s/browser_caching_attributes.js b/accessible/tests/browser/e10s/browser_caching_attributes.js index 1fa1c6ac55..fbdd4d2011 100644 --- a/accessible/tests/browser/e10s/browser_caching_attributes.js +++ b/accessible/tests/browser/e10s/browser_caching_attributes.js @@ -19,7 +19,7 @@ const defaultAttributes = { "text-indent": "0px", id: "textbox", tag: "input", - display: "inline", + display: "inline-block", }; /** diff --git a/accessible/tests/mochitest/aom/test_general.html b/accessible/tests/mochitest/aom/test_general.html index 0d2182bf08..dc63fb659b 100644 --- a/accessible/tests/mochitest/aom/test_general.html +++ b/accessible/tests/mochitest/aom/test_general.html @@ -192,7 +192,7 @@ is(anode, node.accessibleNode, "an AccessibleNode is properly cached"); // Adopting node to another document doesn't change .accessibleNode - let anotherDoc = document.implementation.createDocument("", "", null); + let anotherDoc = ifrDoc.implementation.createDocument("", "", null); let adopted_node = anotherDoc.adoptNode(node); is(anode, adopted_node.accessibleNode, "adopting node to another document doesn't change node.accessibleNode"); diff --git a/accessible/tests/mochitest/attributes/test_obj_css.xul b/accessible/tests/mochitest/attributes/test_obj_css.xul index 3976279bf5..f89d318bf1 100644 --- a/accessible/tests/mochitest/attributes/test_obj_css.xul +++ b/accessible/tests/mochitest/attributes/test_obj_css.xul @@ -23,11 +23,9 @@ testCSSAttrs("display_mozbox"); testCSSAttrs("display_mozinlinebox"); testCSSAttrs("display_mozgrid"); - testCSSAttrs("display_mozinlinegrid"); testCSSAttrs("display_mozgridgroup"); testCSSAttrs("display_mozgridline"); testCSSAttrs("display_mozstack"); - testCSSAttrs("display_mozinlinestack"); testCSSAttrs("display_mozdeck"); testCSSAttrs("display_mozpopup"); testCSSAttrs("display_mozgroupbox"); @@ -58,11 +56,9 @@ - - diff --git a/accessible/tests/mochitest/elm/test_HTMLSpec.html b/accessible/tests/mochitest/elm/test_HTMLSpec.html index 6c778b0ea2..4dcf4c5fcb 100644 --- a/accessible/tests/mochitest/elm/test_HTMLSpec.html +++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html @@ -939,23 +939,6 @@ }; testElm("kbd_container", obj); - // //////////////////////////////////////////////////////////////////////// - // HTML:keygen - - obj = { - role: ROLE_COMBOBOX, - states: STATE_COLLAPSED | STATE_HASPOPUP, - extraStates: EXT_STATE_EXPANDABLE, - actions: "open", - children: [ - { COMBOBOX_LIST: [ - { role: ROLE_COMBOBOX_OPTION }, // high grade - { role: ROLE_COMBOBOX_OPTION }, // medium grade - ] }, - ], - }; - testElm("keygen", obj); - // //////////////////////////////////////////////////////////////////////// // HTML:label @@ -1685,7 +1668,6 @@

normalInserted

normalcmd

- diff --git a/accessible/tests/mochitest/name/test_list.html b/accessible/tests/mochitest/name/test_list.html index 84aa142d05..86afef66b2 100644 --- a/accessible/tests/mochitest/name/test_list.html +++ b/accessible/tests/mochitest/name/test_list.html @@ -39,7 +39,13 @@ // change list style type var list = getNode("list"); list.setAttribute("style", "list-style-type: disc;"); - getComputedStyle(list, "").color; // make style processing sync + + // Flush both the style change and the resulting layout change. + // Flushing style on its own is not sufficient, because that can + // leave frames marked with NS_FRAME_IS_DIRTY, which will cause + // nsTextFrame::GetRenderedText to report the text of a text + // frame is empty. + list.offsetWidth; // flush layout (which also flushes style) testName("li_start", kDiscBulletText + "list start"); testName("li_end", kDiscBulletText + "list end"); diff --git a/accessible/tests/mochitest/text.js b/accessible/tests/mochitest/text.js index b3c1eb96dd..ccbb6e6aa2 100644 --- a/accessible/tests/mochitest/text.js +++ b/accessible/tests/mochitest/text.js @@ -77,47 +77,6 @@ function testText(aIDs, aStartOffset, aEndOffset, aText, aTodoFlag) { } } -/** - * Test password text between two given offsets - * - * @param aIDs [in] an array of accessible IDs to test - * @param aStartOffset [in] the start offset within the text to test - * @param aEndOffset [in] the end offset up to which the text is tested - * @param aText [in] the expected result from the test - * - * @note All this function does is test that getText doe snot expose the - * password text itself, but something else. - */ -function testPasswordText(aIDs, aStartOffset, aEndOffset, aText) { - for (var i = 0; i < aIDs.length; i++) { - var acc = getAccessible(aIDs[i], nsIAccessibleText); - try { - isnot( - acc.getText(aStartOffset, aEndOffset), - aText, - "getText: plain text between start and end offsets '" + - aStartOffset + - "', '" + - aEndOffset + - " for '" + - prettyName(aIDs[i]) + - "'" - ); - } catch (e) { - ok( - false, - "getText fails between start and end offsets '" + - aStartOffset + - "', '" + - aEndOffset + - " for '" + - prettyName(aIDs[i]) + - "'" - ); - } - } -} - /** * Test getTextAtOffset for BOUNDARY_CHAR over different elements. * diff --git a/accessible/tests/mochitest/text/test_passwords.html b/accessible/tests/mochitest/text/test_passwords.html index 44af732248..fc184f2d45 100644 --- a/accessible/tests/mochitest/text/test_passwords.html +++ b/accessible/tests/mochitest/text/test_passwords.html @@ -29,7 +29,21 @@ IDs = [ "password" ]; testCharacterCount(IDs, 4); - testPasswordText(IDs, 0, 4, "test"); + let password = document.getElementById("password"); + let editor = SpecialPowers.wrap(password).editor; + let passwordMask = editor.passwordMask; + testText(IDs, 0, 4, `${passwordMask}${passwordMask}${passwordMask}${passwordMask}`); + // a11y data is updated at next tick so that we need to refresh here. + editor.unmask(0, 2); + SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(0); + testText(IDs, 0, 4, `te${passwordMask}${passwordMask}`); + editor.unmask(2, 4); + SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(0); + testText(IDs, 0, 4, `${passwordMask}${passwordMask}st`); + editor.unmask(0, 4); + SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(0); + testText(IDs, 0, 4, `test`); + SpecialPowers.DOMWindowUtils.restoreNormalRefresh(); SimpleTest.finish(); } diff --git a/accessible/tests/mochitest/treeupdate/test_ariaowns.html b/accessible/tests/mochitest/treeupdate/test_ariaowns.html index 2402fc9bb4..982e472e77 100644 --- a/accessible/tests/mochitest/treeupdate/test_ariaowns.html +++ b/accessible/tests/mochitest/treeupdate/test_ariaowns.html @@ -597,7 +597,7 @@ this.invoke = () => { // trigger a tree update. let doc = getNode("t9_container").contentDocument; - doc.body.appendChild(document.createElement("p")); + doc.body.appendChild(doc.createElement("p")); }; this.finalCheck = () => { diff --git a/accessible/tests/mochitest/treeview.js b/accessible/tests/mochitest/treeview.js index c67fe2e7ce..a461f84b3b 100644 --- a/accessible/tests/mochitest/treeview.js +++ b/accessible/tests/mochitest/treeview.js @@ -163,9 +163,6 @@ nsTreeView.prototype = { this.mTree.invalidateCell(aRow, aCol); }, - performAction: function performAction(aAction) {}, - performActionOnRow: function performActionOnRow(aAction, aRow) {}, - performActionOnCell: function performActionOnCell(aAction, aRow, aCol) {}, // //////////////////////////////////////////////////////////////////////////// // public implementation diff --git a/accessible/windows/ProxyWrappers.h b/accessible/windows/ProxyWrappers.h index a05de0c618..66f92e5a1f 100644 --- a/accessible/windows/ProxyWrappers.h +++ b/accessible/windows/ProxyWrappers.h @@ -71,7 +71,7 @@ class DocProxyAccessibleWrap : public HyperTextProxyAccessibleWrap { template inline ProxyAccessible* HyperTextProxyFor(T* aWrapper) { - static_assert(mozilla::IsBaseOf::value, + static_assert(std::is_base_of::value, "only IAccessible* should be passed in"); auto wrapper = static_cast(aWrapper); return wrapper->IsProxy() ? wrapper->Proxy() : nullptr; diff --git a/accessible/windows/ia2/ia2AccessibleComponent.cpp b/accessible/windows/ia2/ia2AccessibleComponent.cpp index db04b88638..818582e673 100644 --- a/accessible/windows/ia2/ia2AccessibleComponent.cpp +++ b/accessible/windows/ia2/ia2AccessibleComponent.cpp @@ -76,7 +76,7 @@ ia2AccessibleComponent::get_foreground(IA2Color* aForeground) { if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; nsIFrame* frame = acc->GetFrame(); - if (frame) *aForeground = frame->StyleColor()->mColor.ToColor(); + if (frame) *aForeground = frame->StyleText()->mColor.ToColor(); return S_OK; } diff --git a/accessible/windows/ia2/ia2AccessibleHyperlink.cpp b/accessible/windows/ia2/ia2AccessibleHyperlink.cpp index a3f72a8ae7..3630958111 100644 --- a/accessible/windows/ia2/ia2AccessibleHyperlink.cpp +++ b/accessible/windows/ia2/ia2AccessibleHyperlink.cpp @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "Accessible2.h" #include "AccessibleHyperlink.h" #include "AccessibleHyperlink_i.c" diff --git a/accessible/windows/ia2/ia2AccessibleImage.cpp b/accessible/windows/ia2/ia2AccessibleImage.cpp index 7c0f28fc13..53dcee33c7 100644 --- a/accessible/windows/ia2/ia2AccessibleImage.cpp +++ b/accessible/windows/ia2/ia2AccessibleImage.cpp @@ -11,7 +11,6 @@ #include "nsIAccessibleTypes.h" #include "nsString.h" -#include "nsIURI.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/windows/ia2/ia2AccessibleTableCell.cpp b/accessible/windows/ia2/ia2AccessibleTableCell.cpp index fcb219019e..0c6b9b74e7 100644 --- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp +++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp @@ -4,7 +4,6 @@ #include "ia2AccessibleTableCell.h" -#include "Accessible2.h" #include "AccessibleTable2_i.c" #include "AccessibleTableCell_i.c" diff --git a/accessible/windows/ia2/ia2AccessibleText.cpp b/accessible/windows/ia2/ia2AccessibleText.cpp index 18f29a7cf1..6107011ff3 100644 --- a/accessible/windows/ia2/ia2AccessibleText.cpp +++ b/accessible/windows/ia2/ia2AccessibleText.cpp @@ -4,7 +4,6 @@ #include "ia2AccessibleText.h" -#include "Accessible2.h" #include "AccessibleText_i.c" #include "HyperTextAccessibleWrap.h" diff --git a/accessible/windows/ia2/ia2AccessibleText.h b/accessible/windows/ia2/ia2AccessibleText.h index 80a404bf28..64f9664142 100644 --- a/accessible/windows/ia2/ia2AccessibleText.h +++ b/accessible/windows/ia2/ia2AccessibleText.h @@ -5,8 +5,6 @@ #ifndef _ACCESSIBLE_TEXT_H #define _ACCESSIBLE_TEXT_H -#include "nsIAccessibleText.h" - #include "AccessibleText.h" namespace mozilla { diff --git a/accessible/windows/msaa/AccessibleWrap.cpp b/accessible/windows/msaa/AccessibleWrap.cpp index e820cb4289..828e26c3cd 100644 --- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -29,13 +29,11 @@ # include "Logging.h" #endif -#include "nsIMutableArray.h" #include "nsIFrame.h" #include "nsIScrollableFrame.h" #include "mozilla/PresShell.h" #include "mozilla/dom/NodeInfo.h" #include "mozilla/dom/BrowserParent.h" -#include "nsIServiceManager.h" #include "nsNameSpaceManager.h" #include "nsTextFormatter.h" #include "nsView.h" @@ -44,7 +42,6 @@ #include "nsArrayUtils.h" #include "mozilla/Preferences.h" #include "mozilla/ReverseIterator.h" -#include "nsIXULRuntime.h" #include "mozilla/mscom/AsyncInvoker.h" #include "mozilla/mscom/Interceptor.h" diff --git a/accessible/windows/msaa/AccessibleWrap.h b/accessible/windows/msaa/AccessibleWrap.h index 12b3df1289..f81a30090e 100644 --- a/accessible/windows/msaa/AccessibleWrap.h +++ b/accessible/windows/msaa/AccessibleWrap.h @@ -7,7 +7,6 @@ #include "nsCOMPtr.h" #include "Accessible.h" -#include "Accessible2.h" #include "ia2Accessible.h" #include "ia2AccessibleComponent.h" #include "ia2AccessibleHyperlink.h" diff --git a/accessible/windows/msaa/Compatibility.cpp b/accessible/windows/msaa/Compatibility.cpp index 2a970eaea4..38a60fd8c1 100644 --- a/accessible/windows/msaa/Compatibility.cpp +++ b/accessible/windows/msaa/Compatibility.cpp @@ -6,6 +6,7 @@ #include "mozilla/WindowsVersion.h" #include "nsExceptionHandler.h" +#include "nsIXULRuntime.h" #include "nsPrintfCString.h" #include "nsUnicharUtils.h" #include "nsWindowsDllInterceptor.h" diff --git a/accessible/windows/msaa/ImageAccessibleWrap.cpp b/accessible/windows/msaa/ImageAccessibleWrap.cpp index 8b979667ce..9e85da7955 100644 --- a/accessible/windows/msaa/ImageAccessibleWrap.cpp +++ b/accessible/windows/msaa/ImageAccessibleWrap.cpp @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ImageAccessibleWrap.h" -#include "nsIURI.h" using namespace mozilla; using namespace mozilla::a11y; diff --git a/accessible/windows/msaa/ImageAccessibleWrap.h b/accessible/windows/msaa/ImageAccessibleWrap.h index 4bdb03bfdd..ba2de4cc5a 100644 --- a/accessible/windows/msaa/ImageAccessibleWrap.h +++ b/accessible/windows/msaa/ImageAccessibleWrap.h @@ -6,7 +6,6 @@ #define mozilla_a11y_ImageAccessibleWrap_h__ #include "ImageAccessible.h" -#include "ia2AccessibleImage.h" namespace mozilla { namespace a11y { diff --git a/accessible/windows/msaa/MsaaIdGenerator.cpp b/accessible/windows/msaa/MsaaIdGenerator.cpp index 538e5cc679..fa27beaeb2 100644 --- a/accessible/windows/msaa/MsaaIdGenerator.cpp +++ b/accessible/windows/msaa/MsaaIdGenerator.cpp @@ -12,7 +12,6 @@ #include "mozilla/StaticPtr.h" #include "mozilla/Unused.h" #include "nsDataHashtable.h" -#include "nsIXULRuntime.h" #include "sdnAccessible.h" // These constants may be adjusted to modify the proportion of the Child ID diff --git a/accessible/windows/msaa/Platform.cpp b/accessible/windows/msaa/Platform.cpp index 16ca347b83..03ca232cee 100644 --- a/accessible/windows/msaa/Platform.cpp +++ b/accessible/windows/msaa/Platform.cpp @@ -7,9 +7,7 @@ #include "AccEvent.h" #include "Compatibility.h" #include "HyperTextAccessibleWrap.h" -#include "ia2AccessibleText.h" #include "nsIWindowsRegKey.h" -#include "nsIXULRuntime.h" #include "nsWinUtils.h" #include "mozilla/a11y/ProxyAccessible.h" #include "mozilla/mscom/ActivationContext.h" diff --git a/accessible/windows/msaa/ServiceProvider.cpp b/accessible/windows/msaa/ServiceProvider.cpp index db751f7156..7296725477 100644 --- a/accessible/windows/msaa/ServiceProvider.cpp +++ b/accessible/windows/msaa/ServiceProvider.cpp @@ -12,7 +12,6 @@ #include "uiaRawElmProvider.h" #include "mozilla/Preferences.h" -#include "nsIDocShell.h" #include "ISimpleDOM.h" diff --git a/accessible/windows/msaa/XULListboxAccessibleWrap.h b/accessible/windows/msaa/XULListboxAccessibleWrap.h index 4f51409a1a..7a6e6c3425 100644 --- a/accessible/windows/msaa/XULListboxAccessibleWrap.h +++ b/accessible/windows/msaa/XULListboxAccessibleWrap.h @@ -8,7 +8,6 @@ #include "XULListboxAccessible.h" #include "ia2AccessibleTable.h" -#include "ia2AccessibleTableCell.h" namespace mozilla { namespace a11y { diff --git a/accessible/windows/msaa/nsWinUtils.cpp b/accessible/windows/msaa/nsWinUtils.cpp index acf4a046d6..c5927d46a8 100644 --- a/accessible/windows/msaa/nsWinUtils.cpp +++ b/accessible/windows/msaa/nsWinUtils.cpp @@ -12,10 +12,8 @@ #include "mozilla/a11y/DocAccessibleParent.h" #include "mozilla/Preferences.h" #include "nsArrayUtils.h" -#include "nsIArray.h" #include "nsICSSDeclaration.h" #include "mozilla/dom/Document.h" -#include "nsIDocShellTreeItem.h" #include "mozilla/dom/Element.h" #include "nsXULAppAPI.h" #include "ProxyWrappers.h" diff --git a/accessible/windows/sdn/sdnAccessible.cpp b/accessible/windows/sdn/sdnAccessible.cpp index f9103d2454..327827b8e9 100644 --- a/accessible/windows/sdn/sdnAccessible.cpp +++ b/accessible/windows/sdn/sdnAccessible.cpp @@ -216,7 +216,8 @@ sdnAccessible::get_computedStyle( uint32_t index = 0, realIndex = 0; for (index = realIndex = 0; index < length && realIndex < aMaxStyleProperties; index++) { - nsAutoString property, value; + nsAutoCString property; + nsAutoString value; // Ignore -moz-* properties. cssDecl->Item(index, property); @@ -224,7 +225,8 @@ sdnAccessible::get_computedStyle( cssDecl->GetPropertyValue(property, value); // Get property value if (!value.IsEmpty()) { - aStyleProperties[realIndex] = ::SysAllocString(property.get()); + aStyleProperties[realIndex] = + ::SysAllocString(NS_ConvertUTF8toUTF16(property).get()); aStyleValues[realIndex] = ::SysAllocString(value.get()); ++realIndex; } @@ -253,8 +255,9 @@ sdnAccessible::get_computedStyleForProperties( for (index = 0; index < aNumStyleProperties; index++) { nsAutoString value; if (aStyleProperties[index]) - cssDecl->GetPropertyValue(nsDependentString(aStyleProperties[index]), - value); // Get property value + cssDecl->GetPropertyValue( + NS_ConvertUTF16toUTF8(nsDependentString(aStyleProperties[index])), + value); // Get property value aStyleValues[index] = ::SysAllocString(value.get()); } diff --git a/accessible/xpcom/AccEventGen.py b/accessible/xpcom/AccEventGen.py index 1bcfdd0c8a..e30628f21c 100644 --- a/accessible/xpcom/AccEventGen.py +++ b/accessible/xpcom/AccEventGen.py @@ -4,6 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +from __future__ import absolute_import import sys import os diff --git a/accessible/xpcom/moz.build b/accessible/xpcom/moz.build index 49e527113d..dec183e18a 100644 --- a/accessible/xpcom/moz.build +++ b/accessible/xpcom/moz.build @@ -54,11 +54,15 @@ else: '/accessible/other', ] -GENERATED_FILES += [('xpcAccEvents.h', 'xpcAccEvents.cpp')] -xpc_acc = GENERATED_FILES[('xpcAccEvents.h', 'xpcAccEvents.cpp')] -xpc_acc.script = 'AccEventGen.py:gen_files' -xpc_acc.inputs += ['AccEvents.conf', '!/xpcom/idl-parser/xpidl/xpidllex.py', '!/xpcom/idl-parser/xpidl/xpidlyacc.py'] +GeneratedFile( + 'xpcAccEvents.h', 'xpcAccEvents.cpp', + script='AccEventGen.py', entry_point='gen_files', + inputs=[ + 'AccEvents.conf', + '!/xpcom/idl-parser/xpidl/xpidllex.py', + '!/xpcom/idl-parser/xpidl/xpidlyacc.py', + ]) FINAL_LIBRARY = 'xul' diff --git a/accessible/xpcom/xpcAccessibleHyperLink.cpp b/accessible/xpcom/xpcAccessibleHyperLink.cpp index 64d82abf8c..cc4e5e2e6a 100644 --- a/accessible/xpcom/xpcAccessibleHyperLink.cpp +++ b/accessible/xpcom/xpcAccessibleHyperLink.cpp @@ -3,7 +3,6 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Accessible-inl.h" -#include "xpcAccessibleDocument.h" #include "nsNetUtil.h" using namespace mozilla::a11y; diff --git a/accessible/xpcom/xpcAccessibleHyperText.cpp b/accessible/xpcom/xpcAccessibleHyperText.cpp index 004b6322ec..f7d6381124 100644 --- a/accessible/xpcom/xpcAccessibleHyperText.cpp +++ b/accessible/xpcom/xpcAccessibleHyperText.cpp @@ -7,7 +7,6 @@ #include "Accessible-inl.h" #include "HyperTextAccessible-inl.h" #include "TextRange.h" -#include "xpcAccessibleDocument.h" #include "xpcAccessibleTextRange.h" #include "nsIPersistentProperties2.h" diff --git a/accessible/xpcom/xpcAccessibleSelectable.cpp b/accessible/xpcom/xpcAccessibleSelectable.cpp index bf4fbe4d16..090326fc9b 100644 --- a/accessible/xpcom/xpcAccessibleSelectable.cpp +++ b/accessible/xpcom/xpcAccessibleSelectable.cpp @@ -3,7 +3,6 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Accessible-inl.h" -#include "xpcAccessibleDocument.h" #include "nsIMutableArray.h" diff --git a/accessible/xpcom/xpcAccessibleTable.cpp b/accessible/xpcom/xpcAccessibleTable.cpp index c88fc6e776..5dacdf6ca5 100644 --- a/accessible/xpcom/xpcAccessibleTable.cpp +++ b/accessible/xpcom/xpcAccessibleTable.cpp @@ -6,7 +6,6 @@ #include "Accessible.h" #include "TableAccessible.h" -#include "xpcAccessibleDocument.h" #include "nsIMutableArray.h" #include "nsComponentManagerUtils.h" diff --git a/accessible/xpcom/xpcAccessibleTableCell.cpp b/accessible/xpcom/xpcAccessibleTableCell.cpp index 2331d69be7..10b09bbd99 100644 --- a/accessible/xpcom/xpcAccessibleTableCell.cpp +++ b/accessible/xpcom/xpcAccessibleTableCell.cpp @@ -8,7 +8,6 @@ #include "nsIAccessibleTable.h" #include "TableAccessible.h" #include "TableCellAccessible.h" -#include "xpcAccessibleDocument.h" #include "nsComponentManagerUtils.h" #include "nsIMutableArray.h" diff --git a/accessible/xpcom/xpcAccessibleTextRange.cpp b/accessible/xpcom/xpcAccessibleTextRange.cpp index 49d9b1fd50..2afdeb9f12 100644 --- a/accessible/xpcom/xpcAccessibleTextRange.cpp +++ b/accessible/xpcom/xpcAccessibleTextRange.cpp @@ -5,7 +5,6 @@ #include "xpcAccessibleTextRange.h" #include "TextRange-inl.h" -#include "xpcAccessibleDocument.h" #include "nsIMutableArray.h" #include "nsComponentManagerUtils.h" diff --git a/accessible/xul/XULComboboxAccessible.cpp b/accessible/xul/XULComboboxAccessible.cpp index 55435b3757..c435612b10 100644 --- a/accessible/xul/XULComboboxAccessible.cpp +++ b/accessible/xul/XULComboboxAccessible.cpp @@ -13,7 +13,6 @@ #include "nsIAutoCompleteInput.h" #include "nsIDOMXULMenuListElement.h" -#include "nsIDOMXULSelectCntrlItemEl.h" using namespace mozilla::a11y; @@ -72,7 +71,7 @@ void XULComboboxAccessible::Description(nsString& aDescription) { nsCOMPtr menuListElm = Elm()->AsXULMenuList(); if (!menuListElm) return; - nsCOMPtr focusedOptionItem; + nsCOMPtr focusedOptionItem; menuListElm->GetSelectedItem(getter_AddRefs(focusedOptionItem)); if (focusedOptionItem && mDoc) { Accessible* focusedOptionAcc = mDoc->GetAccessible(focusedOptionItem); diff --git a/accessible/xul/XULElementAccessibles.cpp b/accessible/xul/XULElementAccessibles.cpp index 150d5de65f..c1cd11e653 100644 --- a/accessible/xul/XULElementAccessibles.cpp +++ b/accessible/xul/XULElementAccessibles.cpp @@ -204,12 +204,11 @@ already_AddRefed XULLinkAccessible::AnchorURIAt( nsAutoString href; mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href); - nsCOMPtr baseURI = mContent->GetBaseURI(); dom::Document* document = mContent->OwnerDoc(); nsCOMPtr anchorURI; NS_NewURI(getter_AddRefs(anchorURI), href, - document->GetDocumentCharacterSet(), baseURI); + document->GetDocumentCharacterSet(), mContent->GetBaseURI()); return anchorURI.forget(); } diff --git a/accessible/xul/XULFormControlAccessible.cpp b/accessible/xul/XULFormControlAccessible.cpp index 8d84694ebd..46128d8e43 100644 --- a/accessible/xul/XULFormControlAccessible.cpp +++ b/accessible/xul/XULFormControlAccessible.cpp @@ -8,7 +8,6 @@ #include "HTMLFormControlAccessible.h" #include "nsAccUtils.h" #include "DocAccessible.h" -#include "nsIAccessibleRelation.h" #include "Relation.h" #include "Role.h" #include "States.h" @@ -19,7 +18,6 @@ #include "nsIDOMXULMenuListElement.h" #include "nsIDOMXULRadioGroupElement.h" #include "nsIDOMXULSelectCntrlItemEl.h" -#include "nsIEditor.h" #include "nsIFrame.h" #include "nsITextControlFrame.h" #include "nsMenuPopupFrame.h" @@ -311,7 +309,7 @@ Accessible* XULRadioGroupAccessible::CurrentItem() const { return nullptr; } - RefPtr currentItemElm; + RefPtr currentItemElm; nsCOMPtr group = mSelectControl->AsXULRadioGroup(); if (group) { @@ -333,7 +331,7 @@ void XULRadioGroupAccessible::SetCurrentItem(const Accessible* aItem) { return; } - nsCOMPtr itemElm = aItem->Elm(); + nsCOMPtr itemElm = aItem->Elm(); nsCOMPtr group = mSelectControl->AsXULRadioGroup(); if (group) { diff --git a/accessible/xul/XULListboxAccessible.cpp b/accessible/xul/XULListboxAccessible.cpp index 36f80b4fdc..0a38281e52 100644 --- a/accessible/xul/XULListboxAccessible.cpp +++ b/accessible/xul/XULListboxAccessible.cpp @@ -12,14 +12,11 @@ #include "States.h" #include "nsComponentManagerUtils.h" -#include "nsIAutoCompleteInput.h" #include "nsIAutoCompletePopup.h" #include "nsIDOMXULMenuListElement.h" #include "nsIDOMXULMultSelectCntrlEl.h" #include "nsIDOMXULSelectCntrlItemEl.h" -#include "nsIMutableArray.h" #include "nsINodeList.h" -#include "nsIPersistentProperties2.h" using namespace mozilla::a11y; @@ -107,7 +104,7 @@ void XULListboxAccessible::Value(nsString& aValue) const { nsCOMPtr select = Elm()->AsXULSelectControl(); if (select) { - RefPtr element; + RefPtr element; select->GetSelectedItem(getter_AddRefs(element)); if (element) { @@ -149,7 +146,7 @@ Accessible* XULListboxAccessible::CellAt(uint32_t aRowIndex, nsCOMPtr control = Elm()->AsXULSelectControl(); NS_ENSURE_TRUE(control, nullptr); - RefPtr element; + RefPtr element; control->GetItemAtIndex(aRowIndex, getter_AddRefs(element)); if (!element) return nullptr; @@ -176,7 +173,7 @@ bool XULListboxAccessible::IsRowSelected(uint32_t aRowIdx) { nsCOMPtr control = Elm()->AsXULSelectControl(); NS_ASSERTION(control, "Doesn't implement nsIDOMXULSelectControlElement."); - RefPtr element; + RefPtr element; nsresult rv = control->GetItemAtIndex(aRowIdx, getter_AddRefs(element)); NS_ENSURE_SUCCESS(rv, false); if (!element) { @@ -341,7 +338,7 @@ void XULListboxAccessible::SelectRow(uint32_t aRowIdx) { NS_ASSERTION(control, "Doesn't implement nsIDOMXULMultiSelectControlElement."); - RefPtr item; + RefPtr item; control->GetItemAtIndex(aRowIdx, getter_AddRefs(item)); if (!item) { return; @@ -358,7 +355,7 @@ void XULListboxAccessible::UnselectRow(uint32_t aRowIdx) { NS_ASSERTION(control, "Doesn't implement nsIDOMXULMultiSelectControlElement."); - RefPtr item; + RefPtr item; control->GetItemAtIndex(aRowIdx, getter_AddRefs(item)); if (!item) { return; @@ -451,7 +448,7 @@ Accessible* XULListitemAccessible::GetListAccessible() const { Elm()->AsXULSelectControlItem(); if (!listItem) return nullptr; - RefPtr listElement; + RefPtr listElement; listItem->GetControl(getter_AddRefs(listElement)); if (!listElement) return nullptr; diff --git a/accessible/xul/XULListboxAccessible.h b/accessible/xul/XULListboxAccessible.h index 46b5e6b406..e494e656e4 100644 --- a/accessible/xul/XULListboxAccessible.h +++ b/accessible/xul/XULListboxAccessible.h @@ -8,8 +8,6 @@ #include "BaseAccessibles.h" #include "TableAccessible.h" #include "TableCellAccessible.h" -#include "xpcAccessibleTable.h" -#include "xpcAccessibleTableCell.h" #include "XULMenuAccessible.h" #include "XULSelectControlAccessible.h" diff --git a/accessible/xul/XULMenuAccessible.cpp b/accessible/xul/XULMenuAccessible.cpp index 31150ae07f..695a1d451b 100644 --- a/accessible/xul/XULMenuAccessible.cpp +++ b/accessible/xul/XULMenuAccessible.cpp @@ -12,11 +12,8 @@ #include "States.h" #include "XULFormControlAccessible.h" -#include "nsIMutableArray.h" #include "nsIDOMXULContainerElement.h" #include "nsIDOMXULSelectCntrlItemEl.h" -#include "nsIDOMXULMultSelectCntrlEl.h" -#include "nsIServiceManager.h" #include "nsIContent.h" #include "nsMenuBarFrame.h" #include "nsMenuPopupFrame.h" @@ -52,8 +49,8 @@ uint64_t XULMenuitemAccessible::NativeState() const { } // Checkable/checked? - static Element::AttrValuesArray strings[] = {nsGkAtoms::radio, - nsGkAtoms::checkbox, nullptr}; + static dom::Element::AttrValuesArray strings[] = { + nsGkAtoms::radio, nsGkAtoms::checkbox, nullptr}; if (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings, eCaseMatters) >= 0) { @@ -182,7 +179,7 @@ KeyBinding XULMenuitemAccessible::KeyboardShortcut() const { mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyElmId); if (keyElmId.IsEmpty()) return KeyBinding(); - Element* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId); + dom::Element* keyElm = mContent->OwnerDoc()->GetElementById(keyElmId); if (!keyElm) return KeyBinding(); uint32_t key = 0; diff --git a/accessible/xul/XULMenuAccessible.h b/accessible/xul/XULMenuAccessible.h index 1b888b2626..d443b776b4 100644 --- a/accessible/xul/XULMenuAccessible.h +++ b/accessible/xul/XULMenuAccessible.h @@ -6,7 +6,6 @@ #define mozilla_a11y_XULMenuAccessible_h__ #include "AccessibleWrap.h" -#include "nsIDOMXULSelectCntrlEl.h" #include "XULSelectControlAccessible.h" namespace mozilla { diff --git a/accessible/xul/XULSelectControlAccessible.cpp b/accessible/xul/XULSelectControlAccessible.cpp index a1a9c72ce0..7755876085 100644 --- a/accessible/xul/XULSelectControlAccessible.cpp +++ b/accessible/xul/XULSelectControlAccessible.cpp @@ -9,8 +9,6 @@ #include "nsIDOMXULSelectCntrlItemEl.h" #include "nsIDOMXULMultSelectCntrlEl.h" -#include "nsIMutableArray.h" -#include "nsIServiceManager.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/KeyboardEventBinding.h" @@ -48,7 +46,7 @@ void XULSelectControlAccessible::SelectedItems(nsTArray* aItems) { int32_t length = 0; xulMultiSelect->GetSelectedCount(&length); for (int32_t index = 0; index < length; index++) { - RefPtr element; + RefPtr element; xulMultiSelect->MultiGetSelectedItem(index, getter_AddRefs(element)); Accessible* item = mDoc->GetAccessible(element); if (item) aItems->AppendElement(item); @@ -56,7 +54,7 @@ void XULSelectControlAccessible::SelectedItems(nsTArray* aItems) { } else { // Single select? nsCOMPtr selectControl = mSelectControl->AsXULSelectControl(); - RefPtr element; + RefPtr element; selectControl->GetSelectedItem(getter_AddRefs(element)); if (element) { Accessible* item = mDoc->GetAccessible(element); @@ -69,7 +67,7 @@ Accessible* XULSelectControlAccessible::GetSelectedItem(uint32_t aIndex) { nsCOMPtr multiSelectControl = mSelectControl->AsXULMultiSelectControl(); - RefPtr element; + RefPtr element; if (multiSelectControl) { multiSelectControl->MultiGetSelectedItem(aIndex, getter_AddRefs(element)); } else if (aIndex == 0) { @@ -208,7 +206,7 @@ bool XULSelectControlAccessible::SelectAll() { Accessible* XULSelectControlAccessible::CurrentItem() const { if (!mSelectControl) return nullptr; - RefPtr currentItemElm; + RefPtr currentItemElm; nsCOMPtr multiSelectControl = mSelectControl->AsXULMultiSelectControl(); if (multiSelectControl) { @@ -232,7 +230,7 @@ Accessible* XULSelectControlAccessible::CurrentItem() const { void XULSelectControlAccessible::SetCurrentItem(const Accessible* aItem) { if (!mSelectControl) return; - nsCOMPtr itemElm = aItem->Elm(); + nsCOMPtr itemElm = aItem->Elm(); nsCOMPtr multiSelectControl = itemElm->AsXULMultiSelectControl(); if (multiSelectControl) { diff --git a/accessible/xul/XULSelectControlAccessible.h b/accessible/xul/XULSelectControlAccessible.h index c9d40aa4bd..5647e72b10 100644 --- a/accessible/xul/XULSelectControlAccessible.h +++ b/accessible/xul/XULSelectControlAccessible.h @@ -6,7 +6,6 @@ #define mozilla_a11y_XULSelectControlAccessible_h__ #include "AccessibleWrap.h" -#include "nsIDOMXULSelectCntrlEl.h" namespace mozilla { namespace a11y { @@ -37,7 +36,7 @@ class XULSelectControlAccessible : public AccessibleWrap { virtual void SetCurrentItem(const Accessible* aItem) override; protected: - RefPtr mSelectControl; + RefPtr mSelectControl; }; } // namespace a11y diff --git a/accessible/xul/XULTabAccessible.cpp b/accessible/xul/XULTabAccessible.cpp index e5e4b4b8c3..0dc69d5afd 100644 --- a/accessible/xul/XULTabAccessible.cpp +++ b/accessible/xul/XULTabAccessible.cpp @@ -12,7 +12,6 @@ // NOTE: alphabetically ordered #include "mozilla/dom/Document.h" -#include "nsIDOMXULSelectCntrlEl.h" #include "nsIDOMXULSelectCntrlItemEl.h" #include "nsIDOMXULRelatedElement.h" #include "nsXULElement.h" diff --git a/accessible/xul/XULTreeAccessible.cpp b/accessible/xul/XULTreeAccessible.cpp index 09e2f9b4a7..e79eabad46 100644 --- a/accessible/xul/XULTreeAccessible.cpp +++ b/accessible/xul/XULTreeAccessible.cpp @@ -18,13 +18,9 @@ #include "nsQueryObject.h" #include "nsComponentManagerUtils.h" -#include "nsIAccessibleRelation.h" -#include "nsIAutoCompleteInput.h" #include "nsIAutoCompletePopup.h" #include "nsIDOMXULMenuListElement.h" -#include "nsIDOMXULMultSelectCntrlEl.h" #include "nsITreeSelection.h" -#include "nsIMutableArray.h" #include "nsTreeBodyFrame.h" #include "nsTreeColumns.h" #include "nsTreeUtils.h" diff --git a/accessible/xul/XULTreeGridAccessible.cpp b/accessible/xul/XULTreeGridAccessible.cpp index d2013b768a..e4cdeaef0f 100644 --- a/accessible/xul/XULTreeGridAccessible.cpp +++ b/accessible/xul/XULTreeGridAccessible.cpp @@ -15,7 +15,6 @@ #include "nsQueryObject.h" #include "nsTreeColumns.h" -#include "nsIMutableArray.h" #include "nsPersistentProperties.h" #include "nsITreeSelection.h" #include "nsComponentManagerUtils.h" diff --git a/accessible/xul/XULTreeGridAccessible.h b/accessible/xul/XULTreeGridAccessible.h index 4bab3b6089..8b1e580434 100644 --- a/accessible/xul/XULTreeGridAccessible.h +++ b/accessible/xul/XULTreeGridAccessible.h @@ -8,8 +8,6 @@ #include "XULTreeAccessible.h" #include "TableAccessible.h" #include "TableCellAccessible.h" -#include "xpcAccessibleTable.h" -#include "xpcAccessibleTableCell.h" namespace mozilla { namespace a11y { diff --git a/browser/actors/ClickHandlerChild.jsm b/browser/actors/ClickHandlerChild.jsm index 04f6c49b99..c9542434f7 100644 --- a/browser/actors/ClickHandlerChild.jsm +++ b/browser/actors/ClickHandlerChild.jsm @@ -68,35 +68,19 @@ class ClickHandlerChild extends ActorChild { let [href, node, principal] = this._hrefAndLinkNodeForClickEvent(event); - // get referrer attribute from clicked link and parse it - // if per element referrer is enabled, the element referrer overrules - // the document wide referrer - let referrerPolicy = ownerDoc.referrerPolicy; - if (node) { - let referrerAttrValue = Services.netUtils.parseAttributePolicyString( - node.getAttribute("referrerpolicy") - ); - if (referrerAttrValue !== Ci.nsIHttpChannel.REFERRER_POLICY_UNSET) { - referrerPolicy = referrerAttrValue; - } - } - - // Bug 965637, query the CSP from the doc instead of the Principal - let csp = ownerDoc.nodePrincipal.csp; + let csp = ownerDoc.csp; if (csp) { csp = E10SUtils.serializeCSP(csp); } - let ReferrerInfo = Components.Constructor( - "@mozilla.org/referrer-info;1", - "nsIReferrerInfo", - "init" - ); - let referrerInfo = new ReferrerInfo( - referrerPolicy, - !BrowserUtils.linkHasNoReferrer(node), - ownerDoc.documentURIObject + let referrerInfo = Cc["@mozilla.org/referrer-info;1"].createInstance( + Ci.nsIReferrerInfo ); + if (node) { + referrerInfo.initWithNode(node); + } else { + referrerInfo.initWithDocument(ownerDoc); + } referrerInfo = E10SUtils.serializeReferrerInfo(referrerInfo); let frameOuterWindowID = WebNavigationFrames.getFrameId( ownerDoc.defaultView @@ -153,6 +137,7 @@ class ClickHandlerChild extends ActorChild { } catch (e) {} } json.originPrincipal = ownerDoc.nodePrincipal; + json.originStoragePrincipal = ownerDoc.effectiveStoragePrincipal; json.triggeringPrincipal = ownerDoc.nodePrincipal; // If a link element is clicked with middle button, user wants to open diff --git a/browser/actors/ContextMenuChild.jsm b/browser/actors/ContextMenuChild.jsm index 5e39699723..588fb22722 100644 --- a/browser/actors/ContextMenuChild.jsm +++ b/browser/actors/ContextMenuChild.jsm @@ -35,14 +35,6 @@ XPCOMUtils.defineLazyGetter(this, "PageMenuChild", () => { return new tmp.PageMenuChild(); }); -XPCOMUtils.defineLazyGetter(this, "ReferrerInfo", () => - Components.Constructor( - "@mozilla.org/referrer-info;1", - "nsIReferrerInfo", - "init" - ) -); - const messageListeners = { "ContextMenu:BookmarkFrame": function(aMessage) { let frame = this.getTarget(aMessage).ownerDocument; @@ -529,8 +521,6 @@ class ContextMenuChild extends ActorChild { mozDocumentURIIfNotForErrorPages: docLocation, characterSet: charSet, baseURI, - referrer, - referrerPolicy, } = doc; docLocation = docLocation && docLocation.spec; let frameOuterWindowID = WebNavigationFrames.getFrameId(doc.defaultView); @@ -541,15 +531,6 @@ class ContextMenuChild extends ActorChild { // The same-origin check will be done in nsContextMenu.openLinkInTab. let parentAllowsMixedContent = !!this.docShell.mixedContentChannel; - // Get referrer attribute from clicked link and parse it - let referrerAttrValue = Services.netUtils.parseAttributePolicyString( - aEvent.composedTarget.getAttribute("referrerpolicy") - ); - - if (referrerAttrValue !== Ci.nsIHttpChannel.REFERRER_POLICY_UNSET) { - referrerPolicy = referrerAttrValue; - } - let disableSetDesktopBg = null; // Media related cache info parent needs for saving @@ -602,6 +583,13 @@ class ContextMenuChild extends ActorChild { let principal = null; let customMenuItems = null; + let referrerInfo = Cc["@mozilla.org/referrer-info;1"].createInstance( + Ci.nsIReferrerInfo + ); + referrerInfo.initWithNode( + context.onLink ? context.link : aEvent.composedTarget + ); + let targetAsCPOW = context.target; if (targetAsCPOW) { this._cleanContext(); @@ -641,7 +629,7 @@ class ContextMenuChild extends ActorChild { charSet, baseURI, isRemote, - referrer, + referrerInfo, editFlags, principal, spellInfo, @@ -650,7 +638,6 @@ class ContextMenuChild extends ActorChild { loginFillInfo, selectionInfo, userContextId, - referrerPolicy, customMenuItems, contentDisposition, frameOuterWindowID, @@ -659,12 +646,37 @@ class ContextMenuChild extends ActorChild { parentAllowsMixedContent, }; + if (context.inFrame && !context.inSrcdocFrame) { + data.frameReferrerInfo = E10SUtils.serializeReferrerInfo( + doc.referrerInfo + ); + } + + // In the case "onLink" we may have to send target referrerInfo. This object + // may be used to in saveMedia function. + if (context.onLink) { + let targetReferrerInfo = Cc[ + "@mozilla.org/referrer-info;1" + ].createInstance(Ci.nsIReferrerInfo); + + targetReferrerInfo.initWithNode(aEvent.composedTarget); + data.targetReferrerInfo = E10SUtils.serializeReferrerInfo( + targetReferrerInfo + ); + } + Services.obs.notifyObservers( { wrappedJSObject: data }, "on-prepare-contextmenu" ); if (isRemote) { + data.referrerInfo = E10SUtils.serializeReferrerInfo(data.referrerInfo); + if (data.frameReferrerInfo) { + data.frameReferrerInfo = + E10SUtils.serializeReferrerInfo(data.frameReferrerInfo); + } + this.mm.sendAsyncMessage("contextmenu", data, { targetAsCPOW, }); @@ -677,18 +689,6 @@ class ContextMenuChild extends ActorChild { delete data.disableSetDesktopBg; data.context.targetAsCPOW = targetAsCPOW; - - data.referrerInfo = new ReferrerInfo( - referrerPolicy, - !context.linkHasNoReferrer, - data.documentURIObject - ); - data.frameReferrerInfo = new ReferrerInfo( - referrerPolicy, - !context.linkHasNoReferrer, - referrer ? Services.io.newURI(referrer) : null - ); - mainWin.setContextMenuContentData(data); } } @@ -834,7 +834,6 @@ class ContextMenuChild extends ActorChild { context.link = null; context.linkDownload = ""; - context.linkHasNoReferrer = false; context.linkProtocol = ""; context.linkTextStr = ""; context.linkURL = ""; @@ -865,9 +864,10 @@ class ContextMenuChild extends ActorChild { context.target = node; context.principal = context.target.ownerDocument.nodePrincipal; - // Bug 965637, query the CSP from the doc instead of the Principal + context.storagePrincipal = + context.target.ownerDocument.effectiveStoragePrincipal; context.csp = E10SUtils.serializeCSP( - context.target.ownerDocument.nodePrincipal.csp + context.target.ownerDocument.csp ); context.frameOuterWindowID = WebNavigationFrames.getFrameId( @@ -1105,7 +1105,6 @@ class ContextMenuChild extends ActorChild { context.onMailtoLink = context.linkProtocol == "mailto"; context.onMozExtLink = context.linkProtocol == "moz-extension"; context.onSaveableLink = this._isLinkSaveable(context.link); - context.linkHasNoReferrer = BrowserUtils.linkHasNoReferrer(elem); try { if (elem.download) { diff --git a/browser/actors/NetErrorChild.jsm b/browser/actors/NetErrorChild.jsm index d81457dfff..5fd16e84b7 100644 --- a/browser/actors/NetErrorChild.jsm +++ b/browser/actors/NetErrorChild.jsm @@ -506,8 +506,7 @@ class NetErrorChild extends ActorChild { case MOZILLA_PKIX_ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED: let description = gPipNSSBundle.formatStringFromName( "certErrorSymantecDistrustDescription1", - [doc.location.hostname], - 1 + [doc.location.hostname] ); let descriptionContainer = doc.getElementById("errorShortDescText2"); descriptionContainer.textContent = description; @@ -818,16 +817,14 @@ class NetErrorChild extends ActorChild { } let msg = gPipNSSBundle.formatStringFromName( "SSLConnectionErrorPrefix2", - [hostString, msg2], - 2 + [hostString, msg2] ); if (nss_error_id_str && msg2 != nss_error_id_str) { msg += gPipNSSBundle.formatStringFromName( "certErrorCodePrefix3", - [nss_error_id_str], - 1 + [nss_error_id_str] ) + "\n"; } return msg; diff --git a/browser/actors/OfflineAppsChild.jsm b/browser/actors/OfflineAppsChild.jsm index 9ea27c8682..a74d4b5758 100644 --- a/browser/actors/OfflineAppsChild.jsm +++ b/browser/actors/OfflineAppsChild.jsm @@ -5,10 +5,17 @@ var EXPORTED_SYMBOLS = ["OfflineAppsChild"]; const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); +const { XPCOMUtils } = ChromeUtils.import( + "resource://gre/modules/XPCOMUtils.jsm" +); const { ActorChild } = ChromeUtils.import( "resource://gre/modules/ActorChild.jsm" ); +XPCOMUtils.defineLazyModuleGetters(this, { + E10SUtils: "resource://gre/modules/E10SUtils.jsm", +}); + class OfflineAppsChild extends ActorChild { constructor(dispatcher) { super(dispatcher); @@ -32,7 +39,7 @@ class OfflineAppsChild extends ActorChild { handleEvent(event) { if (event.type == "MozApplicationManifest") { - this.offlineAppRequested(event.originalTarget.defaultView); + this.registerWindow(event.originalTarget.defaultView); } } @@ -57,37 +64,6 @@ class OfflineAppsChild extends ActorChild { } } - offlineAppRequested(aContentWindow) { - this.registerWindow(aContentWindow); - if (!Services.prefs.getBoolPref("browser.offline-apps.notify")) { - return; - } - - let currentURI = aContentWindow.document.documentURIObject; - // don't bother showing UI if the user has already made a decision - if ( - Services.perms.testExactPermission(currentURI, "offline-app") != - Services.perms.UNKNOWN_ACTION - ) { - return; - } - - try { - if (Services.prefs.getBoolPref("offline-apps.allow_by_default")) { - // all pages can use offline capabilities, no need to ask the user - return; - } - } catch (e) { - // this pref isn't set by default, ignore failures - } - let docId = ++this._docId; - this._docIdMap.set(docId, Cu.getWeakReference(aContentWindow.document)); - this.mm.sendAsyncMessage("OfflineApps:RequestPermission", { - uri: currentURI.spec, - docId, - }); - } - _startFetching(aDocument) { if (!aDocument.documentElement) { return; @@ -125,7 +101,10 @@ class OfflineAppsChild extends ActorChild { let cacheUpdate = aSubject.QueryInterface(Ci.nsIOfflineCacheUpdate); let uri = cacheUpdate.manifestURI; if (uri && this._docManifestSet.has(uri.spec)) { - this.mm.sendAsyncMessage("OfflineApps:CheckUsage", { uri: uri.spec }); + this.mm.sendAsyncMessage("OfflineApps:CheckUsage", { + uri: uri.spec, + principal: E10SUtils.serializePrincipal(cacheUpdate.loadingPrincipal), + }); } } } diff --git a/browser/actors/PluginChild.jsm b/browser/actors/PluginChild.jsm index 4d1e802318..1d5dd7d978 100644 --- a/browser/actors/PluginChild.jsm +++ b/browser/actors/PluginChild.jsm @@ -585,8 +585,7 @@ class PluginChild extends ActorChild { let pluginName = this._getPluginInfo(plugin).pluginName; let messageString = gNavigatorBundle.formatStringFromName( "PluginClickToActivate2", - [pluginName], - 1 + [pluginName] ); let overlayText = this.getPluginUI(plugin, "clickToPlay"); overlayText.textContent = messageString; @@ -1068,8 +1067,7 @@ class PluginChild extends ActorChild { NPAPIPluginProcessCrashed({ pluginName, runID, state }) { let message = gNavigatorBundle.formatStringFromName( "crashedpluginsMessage.title", - [pluginName], - 1 + [pluginName] ); let contentWindow = this.content; @@ -1216,8 +1214,7 @@ class PluginChild extends ActorChild { let messageString = gNavigatorBundle.formatStringFromName( "crashedpluginsMessage.title", - [pluginName], - 1 + [pluginName] ); this.mm.sendAsyncMessage("PluginContent:ShowPluginCrashedNotification", { diff --git a/browser/actors/WebRTCChild.jsm b/browser/actors/WebRTCChild.jsm index 00d602542d..d25dcf649c 100644 --- a/browser/actors/WebRTCChild.jsm +++ b/browser/actors/WebRTCChild.jsm @@ -287,7 +287,7 @@ function prompt( let request = { callID: aCallID, windowID: aWindowID, - origin: aContentWindow.origin, + origin: aContentWindow.document.nodePrincipal.origin, documentURI: aContentWindow.document.documentURI, secure: aSecure, isHandlingUserInput: aIsHandlingUserInput, diff --git a/browser/app/macversion.py b/browser/app/macversion.py index 8bb9ed3721..d6c3f0e04a 100644 --- a/browser/app/macversion.py +++ b/browser/app/macversion.py @@ -3,7 +3,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. - +from __future__ import absolute_import, print_function from optparse import OptionParser import sys import re diff --git a/browser/app/moz.build b/browser/app/moz.build index 41f8f98e2d..d4b7921931 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -69,19 +69,19 @@ if CONFIG['OS_ARCH'] == 'WINNT': RCINCLUDE = 'splash.rc' DEFINES['MOZ_PHOENIX'] = True DIRS += [ - 'winlauncher', +# 'winlauncher', ] USE_LIBS += [ - 'winlauncher', +# 'winlauncher', ] LOCAL_INCLUDES += [ - '/browser/app/winlauncher', +# '/browser/app/winlauncher', ] DELAYLOAD_DLLS += [ - 'oleaut32.dll', - 'ole32.dll', - 'rpcrt4.dll', - 'version.dll', +# 'oleaut32.dll', +# 'ole32.dll', +# 'rpcrt4.dll', +# 'version.dll', ] if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'Darwin': diff --git a/browser/app/nsBrowserApp.cpp b/browser/app/nsBrowserApp.cpp index 526d4b6a2d..aac15916bd 100644 --- a/browser/app/nsBrowserApp.cpp +++ b/browser/app/nsBrowserApp.cpp @@ -20,10 +20,9 @@ #include #include "nsCOMPtr.h" -#include "nsIFile.h" #ifdef XP_WIN -# include "LauncherProcessWin.h" +//# include "LauncherProcessWin.h" # define XRE_WANT_ENVIRON # define strcasecmp _stricmp @@ -38,6 +37,7 @@ #include "mozilla/Sprintf.h" #include "mozilla/StartupTimeline.h" #include "mozilla/WindowsDllBlocklist.h" +#include "BaseProfiler.h" #ifdef LIBFUZZER # include "FuzzerDefs.h" @@ -243,6 +243,9 @@ uint32_t gBlocklistInitFlags = eDllBlocklistInitFlagDefault; int main(int argc, char* argv[], char* envp[]) { mozilla::TimeStamp start = mozilla::TimeStamp::Now(); + AUTO_BASE_PROFILER_INIT; + AUTO_BASE_PROFILER_LABEL("nsBrowserApp main", OTHER); + #ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC // We are launching as a content process, delegate to the appropriate // main diff --git a/browser/app/profile/mypal.js b/browser/app/profile/mypal.js index f90e01d0ed..ba8fbd392e 100644 --- a/browser/app/profile/mypal.js +++ b/browser/app/profile/mypal.js @@ -90,11 +90,6 @@ pref("app.update.timerFirstInterval", 30000); // The interval to check for updates (app.update.interval) is defined in // firefox-branding.js -// Alternative windowtype for an application update user interface window. When -// a window with this windowtype is open the application update service won't -// open the normal application update user interface window. -pref("app.update.altwindowtype", "Browser:About"); - // Enables some extra Application Update Logging (can reduce performance) pref("app.update.log", false); // Causes Application Update Logging to be sent to a file in the profile @@ -108,9 +103,6 @@ pref("app.update.log.file", false); // the failure. pref("app.update.backgroundMaxErrors", 10); -// Whether or not to use the doorhanger application update UI. -pref("app.update.doorhanger", false); - // Ids of the links to the "What's new" update documentation pref("app.update.link.updateAvailableWhatsNew", "update-available-whats-new"); pref("app.update.link.updateManualWhatsNew", "update-manual-whats-new"); @@ -123,20 +115,7 @@ pref("app.update.download.promptMaxAttempts", 2); // download a fresh installer. pref("app.update.elevation.promptMaxAttempts", 2); -// If set to true, the Update Service will automatically download updates if the -// user can apply updates. This pref is no longer used on Windows, except as the -// default value to migrate to the new location that this data is now stored -// (which is in a file in the update directory). Because of this, this pref -// should no longer be used directly. Instead, getAppUpdateAutoEnabled and -// getAppUpdateAutoEnabled from UpdateUtils.jsm should be used. -#ifndef XP_WIN -pref("app.update.auto", false); -#endif - -// If set to true, the Update Service will present no UI for any event. -pref("app.update.silent", false); - -// app.update.badgeWaitTime is in branding section +pref("app.update.auto", 0); // If set to true, the Update Service will apply updates in the background // when it finishes downloading them. @@ -147,12 +126,10 @@ pref("app.update.url", ""); // app.update.url.manual is in branding section // app.update.url.details is in branding section +// app.update.badgeWaitTime is in branding section // app.update.interval is in branding section // app.update.promptWaitTime is in branding section -// Show the Update Checking/Ready UI when the user was idle for x seconds -pref("app.update.idletime", 60); - // Whether or not to attempt using the service for updates. #ifdef MOZ_MAINTENANCE_SERVICE pref("app.update.service.enabled", false); @@ -486,6 +463,9 @@ pref("browser.tabs.remote.separatePrivilegedContentProcess", true); #endif #ifdef NIGHTLY_BUILD +// allow_eval_with_system_principal is enabled on Firefox Desktop only at this +// point in time +pref("security.allow_eval_with_system_principal", false); pref("browser.tabs.remote.useHTTPResponseProcessSelection", true); #else // Disabled outside of nightly due to bug 1554217 @@ -653,7 +633,6 @@ pref("mousewheel.with_meta.action", 1); // win key on Win, Super/Hyper on Linux pref("mousewheel.with_control.action",3); pref("mousewheel.with_win.action", 1); -pref("browser.xul.error_pages.enabled", true); pref("browser.xul.error_pages.expert_bad_cert", false); pref("browser.xul.error_pages.show_safe_browsing_details_on_load", false); @@ -932,10 +911,6 @@ pref("places.frecency.unvisitedTypedBonus", 200); // 2 - pre-populate site URL and pre-fetch certificate pref("browser.ssl_override_behavior", 2); -// True if the user should be prompted when a web application supports -// offline apps. -pref("browser.offline-apps.notify", true); - // if true, use full page zoom instead of text zoom pref("browser.zoom.full", true); @@ -982,9 +957,6 @@ pref("security.certerrors.mitm.auto_enable_enterprise_roots", false); // Whether to start the private browsing mode at application startup pref("browser.privatebrowsing.autostart", false); -// Whether to show the new private browsing UI with in-content search box. -pref("browser.privatebrowsing.searchUI", true); - // Whether the bookmark panel should be shown when bookmarking a page. pref("browser.bookmarks.editDialog.showForNewBookmarks", true); @@ -1176,7 +1148,6 @@ pref("services.sync.prefs.sync.addons.ignoreUserEnabledChanges", true); // uncompromised Sync-connected devices. pref("services.sync.prefs.sync.browser.contentblocking.category", true); pref("services.sync.prefs.sync.browser.contentblocking.features.strict", true); -pref("services.sync.prefs.sync.browser.contentblocking.introCount", true); pref("services.sync.prefs.sync.browser.crashReports.unsubmittedCheck.autoSubmit2", true); pref("services.sync.prefs.sync.browser.ctrlTab.recentlyUsedOrder", true); pref("services.sync.prefs.sync.browser.download.useDownloadDir", true); @@ -1286,19 +1257,9 @@ pref("browser.newtabpage.activity-stream.debug", false); pref("browser.library.activity-stream.enabled", false); -// The remote FxA root content URL for the Activity Stream firstrun page. -pref("browser.newtabpage.activity-stream.fxaccounts.endpoint", ""); - // The pref that controls if the search shortcuts experiment is on pref("browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts", false); -// ASRouter provider configuration -pref("browser.newtabpage.activity-stream.asrouter.providers.cfr", ""); -// This url, if changed, MUST continue to point to an https url. Pulling arbitrary content to inject into -// this page over http opens us up to a man-in-the-middle attack that we'd rather not face. If you are a downstream -// repackager of this code using an alternate snippet url, please keep your users safe -pref("browser.newtabpage.activity-stream.asrouter.providers.snippets", ""); - // The pref controls if search hand-off is enabled for Activity Stream. #ifdef NIGHTLY_BUILD pref("browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar", true); @@ -1455,14 +1416,6 @@ pref("identity.fxaccounts.commands.missed.fetch_interval", 86400); pref("ui.key.menuAccessKeyFocuses", true); #endif -#ifdef NIGHTLY_BUILD -pref("media.eme.vp9-in-mp4.enabled", true); -#else -pref("media.eme.vp9-in-mp4.enabled", false); -#endif - -pref("media.eme.hdcp-policy-check.enabled", false); - // Whether we should run a test-pattern through EME GMPs before assuming they'll // decode H.264. pref("media.gmp.trial-create.enabled", true); @@ -1486,7 +1439,7 @@ pref("media.gmp-gmpopenh264.enabled", true); // Switch block autoplay logic to v2, and enable UI. pref("media.autoplay.enabled.user-gestures-needed", true); // Set Firefox to block autoplay, asking for permission by default. -pref("media.autoplay.default", 1); // 0=Allowed, 1=Blocked +pref("media.autoplay.default", 1); // 0=Allowed, 1=Blocked, 5=All Blocked #ifdef NIGHTLY_BUILD // Block WebAudio from playing automatically. @@ -1552,9 +1505,6 @@ pref("privacy.trackingprotection.cryptomining.enabled", true); pref("dom.storage_access.enabled", true); -pref("dom.storage_access.auto_grants", true); -pref("dom.storage_access.max_concurrent_auto_grants", 5); - // Define a set of default features for the Content Blocking UI. pref("browser.contentblocking.trackingprotection.control-center.ui.enabled", true); @@ -1583,6 +1533,7 @@ pref("browser.contentblocking.fingerprinting.preferences.ui.enabled", true); // "cookieBehavior2": cookie behaviour BEHAVIOR_REJECT // "cookieBehavior3": cookie behaviour BEHAVIOR_LIMIT_FOREIGN // "cookieBehavior4": cookie behaviour BEHAVIOR_REJECT_TRACKER +// "cookieBehavior5": cookie behaviour BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN // One value from each section must be included in the browser.contentblocking.features.strict pref. pref("browser.contentblocking.features.strict", "tp,tpPrivate,cookieBehavior4,cm,fp"); @@ -1597,19 +1548,11 @@ pref("browser.contentblocking.rejecttrackers.reportBreakage.enabled", true); pref("browser.contentblocking.reportBreakage.url", "data:text/plain,"); -pref("browser.contentblocking.introCount", 0); - -pref("browser.contentblocking.maxIntroCount", 0); -// 1800 = 30 min in seconds -pref("browser.contentblocking.introDelaySeconds", 1800); - // Enables the new Protections Panel. #ifdef NIGHTLY_BUILD pref("browser.protections_panel.enabled", true); #endif -pref("privacy.trackingprotection.introURL", "data:text/plain,"); - // Always enable newtab segregation using containers pref("privacy.usercontext.about_newtab_segregation.enabled", true); // Enable Contextual Identity Containers @@ -1711,10 +1654,17 @@ pref("browser.migrate.chrome.history.maxAgeInDays", 180); // Enable browser frames for use on desktop. Only exposed to chrome callers. pref("dom.mozBrowserFramesEnabled", true); +pref("signon.generation.available", true); +pref("signon.generation.enabled", true); pref("signon.schemeUpgrades", true); pref("signon.privateBrowsingCapture.enabled", true); pref("signon.showAutoCompleteFooter", true); +#ifdef NIGHTLY_BUILD +pref("signon.management.page.enabled", true); +pref("signon.management.overrideURI", "about:logins?filter=%DOMAIN%"); +#else pref("signon.management.page.enabled", false); +#endif // Enable the "Simplify Page" feature in Print Preview. This feature // is disabled by default in toolkit. @@ -1740,53 +1690,11 @@ pref("browser.crashReports.unsubmittedCheck.enabled", false); pref("browser.crashReports.unsubmittedCheck.chancesUntilSuppress", 4); pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); -// Preferences for the form autofill system extension -// The truthy values of "extensions.formautofill.available" are "on" and "detect", -// any other value means autofill isn't available. -// "detect" means it's enabled if conditions defined in the extension are met. -#ifdef NIGHTLY_BUILD -pref("extensions.formautofill.available", "on"); -#else -pref("extensions.formautofill.available", "detect"); -#endif -pref("extensions.formautofill.creditCards.available", false); -pref("extensions.formautofill.addresses.enabled", true); -pref("extensions.formautofill.creditCards.enabled", true); -// Pref for shield/heartbeat to recognize users who have used Credit Card -// Autofill. The valid values can be: -// 0: none -// 1: submitted a manually-filled credit card form (but didn't see the doorhanger -// because of a duplicate profile in the storage) -// 2: saw the doorhanger -// 3: submitted an autofill'ed credit card form -pref("extensions.formautofill.creditCards.used", 0); -pref("extensions.formautofill.firstTimeUse", true); -pref("extensions.formautofill.heuristics.enabled", true); -// Whether the user enabled the OS re-auth dialog. -pref("extensions.formautofill.reauth.enabled", false); -pref("extensions.formautofill.section.enabled", true); -pref("extensions.formautofill.loglevel", "Warn"); - -#ifdef NIGHTLY_BUILD -// Comma separated list of countries Form Autofill is available in. -pref("extensions.formautofill.supportedCountries", "US,CA,DE"); -pref("extensions.formautofill.supportRTL", true); -#else -pref("extensions.formautofill.supportedCountries", "US"); -pref("extensions.formautofill.supportRTL", false); -#endif - // Whether or not to restore a session with lazy-browser tabs. pref("browser.sessionstore.restore_tabs_lazily", true); pref("browser.suppress_first_window_animation", true); -// Preference that allows individual users to disable Screenshots. -pref("extensions.screenshots.disabled", false); -// Preference that allows individual users to leave Screenshots enabled, but -// disable uploading to the server. -pref("extensions.screenshots.upload-disabled", false); - // URL for Learn More link for browser error logging in preferences pref("browser.chrome.errorReporter.infoURL", "data:text/plain,"); diff --git a/browser/app/winlauncher/ErrorHandler.h b/browser/app/winlauncher/ErrorHandler.h index bb1309d586..dc0f5de2e1 100644 --- a/browser/app/winlauncher/ErrorHandler.h +++ b/browser/app/winlauncher/ErrorHandler.h @@ -26,7 +26,7 @@ inline void HandleLauncherError(const LauncherResult& aResult) { return; } - HandleLauncherError(aResult.unwrapErr()); + HandleLauncherError(aResult.inspectErr()); } // This function is simply a convenience overload that unwraps the provided diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp index 36e21475f6..0b103c714b 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -26,7 +26,7 @@ #include "DllBlocklistWin.h" #include "ErrorHandler.h" #include "LaunchUnelevated.h" -#include "ProcThreadAttributes.h" +//#include "ProcThreadAttributes.h" #if defined(MOZ_LAUNCHER_PROCESS) # include "mozilla/LauncherRegistryInfo.h" @@ -68,13 +68,13 @@ SetProcessMitigationPolicy(PROCESS_MITIGATION_POLICY aMitigationPolicy, * Any mitigation policies that should be set on the browser process should go * here. */ -static void SetMitigationPolicies(mozilla::ProcThreadAttributes& aAttrs, +/*static void SetMitigationPolicies(mozilla::ProcThreadAttributes& aAttrs, const bool aIsSafeMode) { if (mozilla::IsWin10AnniversaryUpdateOrLater()) { aAttrs.AddMitigationPolicy( PROCESS_CREATION_MITIGATION_POLICY_IMAGE_LOAD_PREFER_SYSTEM32_ALWAYS_ON); } -} +}*/ static mozilla::LauncherFlags ProcessCmdLine(int& aArgc, wchar_t* aArgv[]) { mozilla::LauncherFlags result = mozilla::LauncherFlags::eNone; @@ -158,11 +158,11 @@ static mozilla::Maybe RunAsLauncherProcess(int& argc, wchar_t** argv) { bool runAsLauncher = DoLauncherProcessChecks(argc, argv); #if defined(MOZ_LAUNCHER_PROCESS) - bool forceLauncher = runAsLauncher && - mozilla::CheckArg(argc, argv, L"force-launcher", - static_cast(nullptr), - mozilla::CheckArgFlag::RemoveArg) == - mozilla::ARG_FOUND; + bool forceLauncher = + runAsLauncher && + mozilla::CheckArg(argc, argv, L"force-launcher", + static_cast(nullptr), + mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND; mozilla::LauncherRegistryInfo::ProcessType desiredType = runAsLauncher ? mozilla::LauncherRegistryInfo::ProcessType::Launcher @@ -278,40 +278,19 @@ Maybe LauncherMain(int& argc, wchar_t* argv[], return Nothing(); } - ProcThreadAttributes attrs; - SetMitigationPolicies(attrs, isSafeMode.value()); - - HANDLE stdHandles[] = {::GetStdHandle(STD_INPUT_HANDLE), - ::GetStdHandle(STD_OUTPUT_HANDLE), - ::GetStdHandle(STD_ERROR_HANDLE)}; - - attrs.AddInheritableHandles(stdHandles); - DWORD creationFlags = CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT; STARTUPINFOW si; - LauncherResult attrsOk = attrs.AssignTo(si); - if (attrsOk.isErr()) { - HandleLauncherError(attrsOk); - return Nothing(); - } + ZeroMemory(&si, sizeof(STARTUPINFOW)); + si.cb = sizeof(STARTUPINFOW); + si.dwFlags |= STARTF_USESTDHANDLES; + si.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE); + si.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE); + si.hStdError = ::GetStdHandle(STD_ERROR_HANDLE); BOOL inheritHandles = FALSE; - if (attrsOk.unwrap()) { - //creationFlags |= EXTENDED_STARTUPINFO_PRESENT; - - if (attrs.HasInheritableHandles()) { - si.dwFlags |= STARTF_USESTDHANDLES; - si.hStdInput = stdHandles[0]; - si.hStdOutput = stdHandles[1]; - si.hStdError = stdHandles[2]; - - // Since attrsOk == true, we have successfully set the handle inheritance - // whitelist policy, so only the handles added to attrs will be inherited. - inheritHandles = TRUE; - } - } + //inheritHandles = TRUE; PROCESS_INFORMATION pi = {}; BOOL createOk; diff --git a/browser/app/winlauncher/test/TestSameBinary.cpp b/browser/app/winlauncher/test/TestSameBinary.cpp index d926564b11..19fd488d48 100644 --- a/browser/app/winlauncher/test/TestSameBinary.cpp +++ b/browser/app/winlauncher/test/TestSameBinary.cpp @@ -48,7 +48,7 @@ inline void PrintLauncherError(const mozilla::LauncherResult& aResult, const char* aMsg = nullptr) { const char* const kSep = aMsg ? ": " : ""; const char* msg = aMsg ? aMsg : ""; - mozilla::LauncherError err = aResult.unwrapErr(); + const mozilla::LauncherError& err = aResult.inspectErr(); printf("%s%s%s%S (%s:%d)\n", kMsgStart, msg, kSep, err.mError.AsString().get(), err.mFile, err.mLine); } @@ -60,13 +60,13 @@ static int ChildMain(DWORD aExpectedParentPid) { return 1; } - if (parentPid.unwrap() != aExpectedParentPid) { + if (parentPid.inspect() != aExpectedParentPid) { PrintErrorMsg("Unexpected mismatch of parent PIDs"); return 1; } const DWORD kAccess = PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_TERMINATE; - nsAutoHandle parentProcess(::OpenProcess(kAccess, FALSE, parentPid.unwrap())); + nsAutoHandle parentProcess(::OpenProcess(kAccess, FALSE, parentPid.inspect())); if (!parentProcess) { PrintWinError("Unexpectedly failed to call OpenProcess on parent"); return 1; @@ -102,7 +102,7 @@ static int ChildMain(DWORD aExpectedParentPid) { const uint32_t kMaxAttempts = 100; uint32_t curAttempt = 0; while (HANDLE p = ::OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, - parentPid.unwrap())) { + parentPid.inspect())) { ::CloseHandle(p); ::Sleep(100); ++curAttempt; diff --git a/browser/base/content/aboutDialog-appUpdater.js b/browser/base/content/aboutDialog-appUpdater.js index 23e58c5baf..3a761b48e2 100644 --- a/browser/base/content/aboutDialog-appUpdater.js +++ b/browser/base/content/aboutDialog-appUpdater.js @@ -62,18 +62,6 @@ function appUpdater(options = {}) { this.updateDeck = document.getElementById("updateDeck"); this.promiseAutoUpdateSetting = null; - // Hide the update deck when the update window is already open and it's not - // already applied, to avoid syncing issues between them. Applied updates - // don't have any information to sync between the windows as they both just - // show the "Restart to continue"-type button. - if ( - Services.wm.getMostRecentWindow("Update:Wizard") && - !this.isReadyForRestart - ) { - this.updateDeck.hidden = true; - return; - } - this.bundle = Services.strings.createBundle( "chrome://browser/locale/browser.properties" ); @@ -230,8 +218,7 @@ appUpdater.prototype = { } button.label = this.bundle.formatStringFromName( "update.downloadAndInstallButton.label", - [updateVersion], - 1 + [updateVersion] ); button.accessKey = this.bundle.GetStringFromName( "update.downloadAndInstallButton.accesskey" diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js index 78dee70158..0cfc722d7c 100644 --- a/browser/base/content/browser-addons.js +++ b/browser/base/content/browser-addons.js @@ -638,8 +638,8 @@ var gXPInstallObserver = { "xpinstallPromptMessage.neverAllow.accesskey" ), callback: () => { - SitePermissions.set( - browser.currentURI, + SitePermissions.setForPrincipal( + browser.contentPrincipal, "install", SitePermissions.BLOCK ); diff --git a/browser/base/content/browser-contentblocking.js b/browser/base/content/browser-contentblocking.js index 1e7dacc8b3..9e24c0f226 100644 --- a/browser/base/content/browser-contentblocking.js +++ b/browser/base/content/browser-contentblocking.js @@ -596,6 +596,8 @@ var ThirdPartyCookies = { // fall through case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER: return "cookierestrictions"; + case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN: + return "cookierestrictionsforeignpartitioned"; } }, @@ -899,25 +901,16 @@ var ThirdPartyCookies = { }; var ContentBlocking = { - // If the user ignores the doorhanger, we stop showing it after some time. - MAX_INTROS: Services.prefs.getIntPref( - "browser.contentblocking.maxIntroCount" - ), PREF_ANIMATIONS_ENABLED: "toolkit.cosmeticAnimations.enabled", PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.reportBreakage.enabled", PREF_REPORT_BREAKAGE_URL: "browser.contentblocking.reportBreakage.url", - PREF_INTRO_COUNT_CB: "browser.contentblocking.introCount", PREF_CB_CATEGORY: "browser.contentblocking.category", PREF_SHOW_ALLOWED_LABELS: "browser.contentblocking.control-center.ui.showAllowedLabels", PREF_SHOW_BLOCKED_LABELS: "browser.contentblocking.control-center.ui.showBlockedLabels", - get prefIntroCount() { - return this.PREF_INTRO_COUNT_CB; - }, - get content() { delete this.content; return (this.content = document.getElementById( @@ -1389,11 +1382,15 @@ var ContentBlocking = { ); // Check whether the user has added an exception for this site. + let principal = Services.scriptSecurityManager.createCodebasePrincipal( + baseURI, + {} + ); let type = isBrowserPrivate ? "trackingprotection-pb" : "trackingprotection"; let hasException = - Services.perms.testExactPermission(baseURI, type) == + Services.perms.testExactPermissionFromPrincipal(principal, type) == Services.perms.ALLOW_ACTION; // Reset the animation in case the user is switching tabs or if no blockers were detected @@ -1405,27 +1402,6 @@ var ContentBlocking = { // of the shield based on this onSecurityChange be determined afterwards). } else if (anyBlocking && !this.iconBox.hasAttribute("active")) { this.iconBox.setAttribute("animate", "true"); - - if (!isBrowserPrivate) { - let introCount = Services.prefs.getIntPref(this.prefIntroCount); - let installStamp = Services.prefs.getIntPref( - "browser.laterrun.bookkeeping.profileCreationTime", - Date.now() / 1000 - ); - let delayLength = Services.prefs.getIntPref( - "browser.contentblocking.introDelaySeconds" - ); - let delayFulfilled = delayLength < Date.now() / 1000 - installStamp; - if ( - introCount < this.MAX_INTROS && - !this.anyOtherWindowHasTour() && - delayFulfilled - ) { - Services.prefs.setIntPref(this.prefIntroCount, ++introCount); - Services.prefs.savePrefFile(null); - this.showIntroPanel(); - } - } } // We consider the shield state "active" when some kind of blocking activity @@ -1484,16 +1460,6 @@ var ContentBlocking = { } }, - // Check if any existing window has a UItour initiated, both showing and hidden. - anyOtherWindowHasTour() { - for (let win of BrowserWindowTracker.orderedWindows) { - if (win != window && UITour.tourBrowsersByWindow.has(win)) { - return true; - } - } - return false; - }, - disableForCurrentPage() { let baseURI = this._baseURIForChannelClassifier; @@ -1527,83 +1493,4 @@ var ContentBlocking = { this.hideIdentityPopupAndReload(); }, - - dontShowIntroPanelAgain() { - if (!PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser)) { - Services.prefs.setIntPref(this.prefIntroCount, this.MAX_INTROS); - Services.prefs.savePrefFile(null); - } - }, - - async showIntroPanel() { - let brandBundle = document.getElementById("bundle_brand"); - let brandShortName = brandBundle.getString("brandShortName"); - - let introTitle = gNavigatorBundle.getFormattedString( - "contentBlocking.intro.title", - [brandShortName] - ); - let introDescription; - // This will be sent to the onboarding website to let them know which - // UI variation we're showing. - let variation; - // We show a different UI tour variation for users that already have TP - // enabled globally. - if (TrackingProtection.enabledGlobally) { - introDescription = gNavigatorBundle.getString( - "contentBlocking.intro.v2.description" - ); - variation = 2; - } else { - introDescription = gNavigatorBundle.getFormattedString( - "contentBlocking.intro.v1.description", - [brandShortName] - ); - variation = 1; - } - - let openStep2 = () => { - // When the user proceeds in the tour, adjust the counter to indicate that - // the user doesn't need to see the intro anymore. - this.dontShowIntroPanelAgain(); - - let nextURL = - Services.urlFormatter.formatURLPref( - "privacy.trackingprotection.introURL" - ) + `?step=2&newtab=true&variation=${variation}`; - switchToTabHavingURI(nextURL, true, { - // Ignore the fragment in case the intro is shown on the tour page - // (e.g. if the user manually visited the tour or clicked the link from - // about:privatebrowsing) so we can avoid a reload. - ignoreFragment: "whenComparingAndReplace", - triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), - }); - }; - - let buttons = [ - { - label: gNavigatorBundle.getString("trackingProtection.intro.step1of3"), - style: "text", - }, - { - callback: openStep2, - label: gNavigatorBundle.getString( - "trackingProtection.intro.nextButton.label" - ), - style: "primary", - }, - ]; - - let panelTarget = await UITour.getTarget(window, "trackingProtection"); - UITour.initForBrowser(gBrowser.selectedBrowser, window); - UITour.showInfo( - window, - panelTarget, - introTitle, - introDescription, - undefined, - buttons, - { closeButtonCallback: () => this.dontShowIntroPanelAgain() } - ); - }, }; diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc index 147bae16f4..c3d4a921dd 100644 --- a/browser/base/content/browser-context.inc +++ b/browser/base/content/browser-context.inc @@ -426,6 +426,12 @@ label="&noLoginSuggestions.label;" disabled="true" hidden="true"/> + +