diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index edd835f1fe04..c2cdd084a764 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -141,6 +141,7 @@ #include "mozilla/dom/Location.h" #include "mozilla/dom/MediaDevices.h" #include "mozilla/dom/MediaKeys.h" +#include "mozilla/dom/Navigation.h" #include "mozilla/dom/NavigatorBinding.h" #include "mozilla/dom/Nullable.h" #include "mozilla/dom/PartitionedLocalStorage.h" @@ -1407,6 +1408,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindowInner) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocation) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mHistory) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNavigation) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCustomElements) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSharedWorkers) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocalStorage) @@ -1518,6 +1520,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindowInner) NS_IMPL_CYCLE_COLLECTION_UNLINK(mLocation) NS_IMPL_CYCLE_COLLECTION_UNLINK(mHistory) + NS_IMPL_CYCLE_COLLECTION_UNLINK(mNavigation) NS_IMPL_CYCLE_COLLECTION_UNLINK(mCustomElements) NS_IMPL_CYCLE_COLLECTION_UNLINK(mSharedWorkers) if (tmp->mLocalStorage) { @@ -2419,6 +2422,14 @@ nsHistory* nsGlobalWindowInner::GetHistory(ErrorResult& aError) { return mHistory; } +Navigation* nsGlobalWindowInner::Navigation() { + if (!mNavigation && Navigation::IsAPIEnabled(nullptr, nullptr)) { + mNavigation = new mozilla::dom::Navigation(); + } + + return mNavigation; +} + CustomElementRegistry* nsGlobalWindowInner::CustomElements() { if (!mCustomElements) { mCustomElements = new CustomElementRegistry(this); diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index 410c5e6d9c64..93c807546899 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -118,6 +118,7 @@ class IdleRequestCallback; class InstallTriggerImpl; class IntlUtils; class MediaQueryList; +class Navigation; class OwningExternalOrWindowProxy; class Promise; class PostMessageEvent; @@ -600,6 +601,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget, void SetName(const nsAString& aName, mozilla::ErrorResult& aError); mozilla::dom::Location* Location() override; nsHistory* GetHistory(mozilla::ErrorResult& aError); + mozilla::dom::Navigation* Navigation(); mozilla::dom::CustomElementRegistry* CustomElements() override; mozilla::dom::CustomElementRegistry* GetExistingCustomElements(); mozilla::dom::BarProp* GetLocationbar(mozilla::ErrorResult& aError); @@ -1390,6 +1392,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget, RefPtr mListenerManager; RefPtr mLocation; RefPtr mHistory; + RefPtr mNavigation; RefPtr mCustomElements; nsTObserverArray> mSharedWorkers; diff --git a/dom/events/NavigateEvent.cpp b/dom/events/NavigateEvent.cpp new file mode 100644 index 000000000000..e32e392aedcc --- /dev/null +++ b/dom/events/NavigateEvent.cpp @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "mozilla/dom/NavigateEvent.h" +#include "mozilla/dom/NavigateEventBinding.h" + +namespace mozilla::dom { + +/* static */ +already_AddRefed NavigateEvent::Constructor( + const GlobalObject& aGlobal, const nsAString& aType, + const NavigateEventInit& aEventInitDict) { + return {}; +} + +} // namespace mozilla::dom diff --git a/dom/events/NavigateEvent.h b/dom/events/NavigateEvent.h new file mode 100644 index 000000000000..867b0a9231ab --- /dev/null +++ b/dom/events/NavigateEvent.h @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_NavigateEvent_h___ +#define mozilla_dom_NavigateEvent_h___ + +#include "js/TypeDecls.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "mozilla/dom/Event.h" +#include "mozilla/dom/NavigateEventBinding.h" +#include "mozilla/dom/NavigationBinding.h" + +namespace mozilla::dom { + +class AbortSignal; +class FormData; +class NavigationDestination; +struct NavigationInterceptOptions; + +class NavigateEvent final : public Event { + public: + NS_INLINE_DECL_REFCOUNTING_INHERITED(NavigateEvent, Event) + + static already_AddRefed Constructor( + const GlobalObject& aGlobal, const nsAString& aType, + const NavigateEventInit& aEventInitDict); + + enum NavigationType NavigationType() const { return {}; } + + already_AddRefed Destination() const { return {}; } + + bool CanIntercept() const { return {}; } + + bool UserInitiated() const { return {}; } + + bool HashChange() const { return {}; } + + already_AddRefed Signal() const { return {}; } + + already_AddRefed GetFormData() const { return {}; } + + void GetDownloadRequest(nsString& aRetVal) const {} + + void GetInfo(JSContext* aCx, JS::MutableHandle aRetVal) const {} + + bool HasUAVisualTransition() const { return {}; } + + void Intercept(const NavigationInterceptOptions& aOptions, ErrorResult& aRv) { + } + + void Scroll(ErrorResult& aRv) {} + + bool IsTrusted() const { return {}; } + + private: + ~NavigateEvent() = default; +}; + +} // namespace mozilla::dom + +#endif // mozilla_dom_NavigateEvent_h___ diff --git a/dom/events/moz.build b/dom/events/moz.build index 405bdff8952c..a54d9684460f 100644 --- a/dom/events/moz.build +++ b/dom/events/moz.build @@ -85,6 +85,7 @@ EXPORTS.mozilla.dom += [ "MouseEvent.h", "MouseScrollEvent.h", "MutationEvent.h", + "NavigateEvent.h", "NotifyPaintEvent.h", "PaintRequest.h", "PointerEvent.h", @@ -143,6 +144,7 @@ UNIFIED_SOURCES += [ "MouseEvent.cpp", "MouseScrollEvent.cpp", "MutationEvent.cpp", + "NavigateEvent.cpp", "NotifyPaintEvent.cpp", "PaintRequest.cpp", "PointerEvent.cpp", diff --git a/dom/moz.build b/dom/moz.build index 88fc49cb7365..a155e10ba53d 100644 --- a/dom/moz.build +++ b/dom/moz.build @@ -104,6 +104,7 @@ DIRS += [ "l10n", "origin-trials", "webscheduling", + "navigation", ] diff --git a/dom/navigation/Navigation.cpp b/dom/navigation/Navigation.cpp new file mode 100644 index 000000000000..c1f13114bc10 --- /dev/null +++ b/dom/navigation/Navigation.cpp @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "mozilla/dom/Navigation.h" +#include "mozilla/dom/NavigationBinding.h" + +#include "mozilla/StaticPrefs_dom.h" +#include "nsIXULRuntime.h" + +namespace mozilla::dom { + +NS_IMPL_CYCLE_COLLECTION_INHERITED(Navigation, DOMEventTargetHelper); +NS_IMPL_ADDREF_INHERITED(Navigation, DOMEventTargetHelper) +NS_IMPL_RELEASE_INHERITED(Navigation, DOMEventTargetHelper) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Navigation) +NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper) + +JSObject* Navigation::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { + return Navigation_Binding::Wrap(aCx, this, aGivenProto); +} + +/* static */ +bool Navigation::IsAPIEnabled(JSContext* /* unused */, JSObject* /* unused */) { + return SessionHistoryInParent() && + StaticPrefs::dom_navigation_webidl_enabled_DoNotUseDirectly(); +} + +} // namespace mozilla::dom diff --git a/dom/navigation/Navigation.h b/dom/navigation/Navigation.h new file mode 100644 index 000000000000..0120564529a1 --- /dev/null +++ b/dom/navigation/Navigation.h @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_Navigation_h___ +#define mozilla_dom_Navigation_h___ + +#include "mozilla/DOMEventTargetHelper.h" + +namespace mozilla::dom { + +class NavigationActivation; +class NavigationHistoryEntry; +struct NavigationNavigateOptions; +struct NavigationOptions; +class NavigationTransition; +struct NavigationUpdateCurrentEntryOptions; +struct NavigationReloadOptions; +struct NavigationResult; + +class Navigation final : public DOMEventTargetHelper { + public: + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Navigation, DOMEventTargetHelper) + + void Entries(nsTArray>& aResult) {} + already_AddRefed GetCurrentEntry() { return {}; } + void UpdateCurrentEntry(JSContext* aCx, + const NavigationUpdateCurrentEntryOptions& aOptions, + ErrorResult& aRv) {} + already_AddRefed GetTransition() { return {}; } + already_AddRefed GetActivation() { return {}; } + + bool CanGoBack() { return {}; } + bool CanGoForward() { return {}; } + + void Navigate(JSContext* aCx, const nsAString& aUrl, + const NavigationNavigateOptions& aOptions, + NavigationResult& aResult) {} + void Reload(JSContext* aCx, const NavigationReloadOptions& aOptions, + NavigationResult& aResult) {} + + void TraverseTo(JSContext* aCx, const nsAString& aKey, + const NavigationOptions& aOptions, + NavigationResult& aResult) {} + void Back(JSContext* aCx, const NavigationOptions& aOptions, + NavigationResult& aResult) {} + void Forward(JSContext* aCx, const NavigationOptions& aOptions, + NavigationResult& aResult) {} + + IMPL_EVENT_HANDLER(navigate); + IMPL_EVENT_HANDLER(navigatesuccess); + IMPL_EVENT_HANDLER(navigateerror); + IMPL_EVENT_HANDLER(currententrychange); + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; + + // The Navigation API is only enabled if both SessionHistoryInParent and + // the dom.navigation.webidl.enabled pref are set. + static bool IsAPIEnabled(JSContext* /* unused */, JSObject* /* unused */); + + private: + ~Navigation() = default; +}; + +} // namespace mozilla::dom + +#endif // mozilla_dom_Navigation_h___ diff --git a/dom/navigation/NavigationActivation.cpp b/dom/navigation/NavigationActivation.cpp new file mode 100644 index 000000000000..1c519a1121d7 --- /dev/null +++ b/dom/navigation/NavigationActivation.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "mozilla/dom/NavigationActivation.h" +#include "mozilla/dom/NavigationActivationBinding.h" + +namespace mozilla::dom { + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(NavigationActivation) +NS_IMPL_CYCLE_COLLECTING_ADDREF(NavigationActivation) +NS_IMPL_CYCLE_COLLECTING_RELEASE(NavigationActivation) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(NavigationActivation) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +JSObject* NavigationActivation::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { + return NavigationActivation_Binding::Wrap(aCx, this, aGivenProto); +} + +} // namespace mozilla::dom diff --git a/dom/navigation/NavigationActivation.h b/dom/navigation/NavigationActivation.h new file mode 100644 index 000000000000..13baae22a87c --- /dev/null +++ b/dom/navigation/NavigationActivation.h @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_NavigationActivation_h___ +#define mozilla_dom_NavigationActivation_h___ + +#include "nsWrapperCache.h" + +class nsIGlobalObject; + +namespace mozilla::dom { + +class NavigationHistoryEntry; +enum class NavigationType : uint8_t; + +class NavigationActivation final : public nsISupports, public nsWrapperCache { + public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(NavigationActivation) + + already_AddRefed GetFrom() const { return {}; } + already_AddRefed Entry() const { return {}; } + enum NavigationType NavigationType() const { return {}; } + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; + nsIGlobalObject* GetParentObject() const { return {}; } + + private: + ~NavigationActivation() = default; +}; + +} // namespace mozilla::dom + +#endif // mozilla_dom_NavigationActivation_h___ diff --git a/dom/navigation/NavigationDestination.cpp b/dom/navigation/NavigationDestination.cpp new file mode 100644 index 000000000000..0b673364531d --- /dev/null +++ b/dom/navigation/NavigationDestination.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "mozilla/dom/NavigationDestination.h" +#include "mozilla/dom/NavigationDestinationBinding.h" + +namespace mozilla::dom { + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(NavigationDestination) +NS_IMPL_CYCLE_COLLECTING_ADDREF(NavigationDestination) +NS_IMPL_CYCLE_COLLECTING_RELEASE(NavigationDestination) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(NavigationDestination) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +JSObject* NavigationDestination::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { + return NavigationDestination_Binding::Wrap(aCx, this, aGivenProto); +} + +} // namespace mozilla::dom diff --git a/dom/navigation/NavigationDestination.h b/dom/navigation/NavigationDestination.h new file mode 100644 index 000000000000..0418d2d786c1 --- /dev/null +++ b/dom/navigation/NavigationDestination.h @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_NavigationDestination_h___ +#define mozilla_dom_NavigationDestination_h___ + +#include "mozilla/ErrorResult.h" +#include "nsWrapperCache.h" + +class nsIGlobalObject; + +namespace mozilla::dom { + +class NavigationDestination final : public nsISupports, public nsWrapperCache { + public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(NavigationDestination) + + void GetUrl(nsString& aRetVal) const {} + void GetKey(nsString& aRetVal) const {} + void GetId(nsString& aRetVal) const {} + int64_t Index() const { return {}; } + bool SameDocument() const { return {}; } + + void GetState(JSContext* cx, JS::MutableHandle aRetVal, + ErrorResult& aRv) const {} + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; + nsIGlobalObject* GetParentObject() const { return {}; } + + private: + ~NavigationDestination() = default; +}; + +} // namespace mozilla::dom + +#endif // mozilla_dom_NavigationDestination_h___ diff --git a/dom/navigation/NavigationHistoryEntry.cpp b/dom/navigation/NavigationHistoryEntry.cpp new file mode 100644 index 000000000000..2c6fbeb0367d --- /dev/null +++ b/dom/navigation/NavigationHistoryEntry.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "mozilla/dom/NavigationHistoryEntry.h" +#include "mozilla/dom/NavigationHistoryEntryBinding.h" + +namespace mozilla::dom { + +NS_IMPL_CYCLE_COLLECTION_INHERITED(NavigationHistoryEntry, + DOMEventTargetHelper); +NS_IMPL_ADDREF_INHERITED(NavigationHistoryEntry, DOMEventTargetHelper) +NS_IMPL_RELEASE_INHERITED(NavigationHistoryEntry, DOMEventTargetHelper) + +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(NavigationHistoryEntry) +NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper) + +JSObject* NavigationHistoryEntry::WrapObject( + JSContext* aCx, JS::Handle aGivenProto) { + return NavigationHistoryEntry_Binding::Wrap(aCx, this, aGivenProto); +} + +} // namespace mozilla::dom diff --git a/dom/navigation/NavigationHistoryEntry.h b/dom/navigation/NavigationHistoryEntry.h new file mode 100644 index 000000000000..a8529b52536c --- /dev/null +++ b/dom/navigation/NavigationHistoryEntry.h @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_NavigationHistoryEntry_h___ +#define mozilla_dom_NavigationHistoryEntry_h___ + +#include "mozilla/DOMEventTargetHelper.h" + +namespace mozilla::dom { + +class NavigationHistoryEntry final : public DOMEventTargetHelper { + public: + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(NavigationHistoryEntry, + DOMEventTargetHelper) + + void GetUrl(nsAString& aResult) const {} + void GetKey(nsAString& aResult) const {} + void GetId(nsAString& aResult) const {} + int64_t Index() const { return {}; } + bool SameDocument() const { return {}; } + + void GetState(JSContext* aCx, JS::MutableHandle aResult, + ErrorResult& aRv) {} + + IMPL_EVENT_HANDLER(dispose); + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; + + private: + ~NavigationHistoryEntry() = default; +}; + +} // namespace mozilla::dom + +#endif // mozilla_dom_NavigationHistoryEntry_h___ diff --git a/dom/navigation/NavigationTransition.cpp b/dom/navigation/NavigationTransition.cpp new file mode 100644 index 000000000000..5a517d50874f --- /dev/null +++ b/dom/navigation/NavigationTransition.cpp @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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 "mozilla/dom/NavigationTransition.h" +#include "mozilla/dom/NavigationTransitionBinding.h" + +namespace mozilla::dom { + +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(NavigationTransition) +NS_IMPL_CYCLE_COLLECTING_ADDREF(NavigationTransition) +NS_IMPL_CYCLE_COLLECTING_RELEASE(NavigationTransition) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(NavigationTransition) + NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY + NS_INTERFACE_MAP_ENTRY(nsISupports) +NS_INTERFACE_MAP_END + +JSObject* NavigationTransition::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { + return NavigationTransition_Binding::Wrap(aCx, this, aGivenProto); +} + +} // namespace mozilla::dom diff --git a/dom/navigation/NavigationTransition.h b/dom/navigation/NavigationTransition.h new file mode 100644 index 000000000000..7b75c54549bb --- /dev/null +++ b/dom/navigation/NavigationTransition.h @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +#ifndef mozilla_dom_NavigationTransition_h___ +#define mozilla_dom_NavigationTransition_h___ + +#include "nsWrapperCache.h" + +class nsIGlobalObject; + +namespace mozilla::dom { + +class NavigationHistoryEntry; +enum class NavigationType : uint8_t; + +class NavigationTransition final : public nsISupports, public nsWrapperCache { + public: + NS_DECL_CYCLE_COLLECTING_ISUPPORTS + NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(NavigationTransition) + + enum NavigationType NavigationType() const { return {}; } + already_AddRefed From() const { return {}; } + already_AddRefed Finished() const { return {}; } + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; + nsIGlobalObject* GetParentObject() const { return {}; } + + private: + ~NavigationTransition() = default; +}; + +} // namespace mozilla::dom + +#endif // mozilla_dom_NavigationTransition_h___ diff --git a/dom/navigation/moz.build b/dom/navigation/moz.build new file mode 100644 index 000000000000..88ef8798029e --- /dev/null +++ b/dom/navigation/moz.build @@ -0,0 +1,26 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# 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/. + +with Files("**"): + BUG_COMPONENT = ("Core", "DOM: Navigation") + +EXPORTS.mozilla.dom += [ + "Navigation.h", + "NavigationActivation.h", + "NavigationDestination.h", + "NavigationHistoryEntry.h", + "NavigationTransition.h", +] + +UNIFIED_SOURCES += [ + "Navigation.cpp", + "NavigationActivation.cpp", + "NavigationDestination.cpp", + "NavigationHistoryEntry.cpp", + "NavigationTransition.cpp", +] + +FINAL_LIBRARY = "xul" diff --git a/dom/performance/PerformanceNavigationTiming.cpp b/dom/performance/PerformanceNavigationTiming.cpp index 6bd1cc1fbecf..1f937b9174b9 100644 --- a/dom/performance/PerformanceNavigationTiming.cpp +++ b/dom/performance/PerformanceNavigationTiming.cpp @@ -112,21 +112,21 @@ DOMHighResTimeStamp PerformanceNavigationTiming::LoadEventEnd() const { REDUCE_TIME_PRECISION; } -NavigationType PerformanceNavigationTiming::Type() const { +NavigationTimingType PerformanceNavigationTiming::Type() const { switch (mPerformance->GetDOMTiming()->GetType()) { case nsDOMNavigationTiming::TYPE_NAVIGATE: - return NavigationType::Navigate; + return NavigationTimingType::Navigate; break; case nsDOMNavigationTiming::TYPE_RELOAD: - return NavigationType::Reload; + return NavigationTimingType::Reload; break; case nsDOMNavigationTiming::TYPE_BACK_FORWARD: - return NavigationType::Back_forward; + return NavigationTimingType::Back_forward; break; default: // The type is TYPE_RESERVED or some other value that was later added. // We fallback to the default of Navigate. - return NavigationType::Navigate; + return NavigationTimingType::Navigate; } } diff --git a/dom/performance/PerformanceNavigationTiming.h b/dom/performance/PerformanceNavigationTiming.h index 2a10b345813e..9adc5559a5ef 100644 --- a/dom/performance/PerformanceNavigationTiming.h +++ b/dom/performance/PerformanceNavigationTiming.h @@ -72,7 +72,7 @@ class PerformanceNavigationTiming final : public PerformanceResourceTiming { DOMHighResTimeStamp RedirectEnd( nsIPrincipal& aSubjectPrincipal) const override; - NavigationType Type() const; + NavigationTimingType Type() const; uint16_t RedirectCount() const; void UpdatePropertiesFromHttpChannel(nsIHttpChannel* aHttpChannel, diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js index abd0cabfb391..6b30584cdb89 100644 --- a/dom/tests/mochitest/general/test_interfaces.js +++ b/dom/tests/mochitest/general/test_interfaces.js @@ -905,6 +905,24 @@ let interfaceNamesInGlobalScope = [ // IMPORTANT: Do not change this list without review from a DOM peer! { name: "NamedNodeMap", insecureContext: true }, // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "NavigateEvent", insecureContext: true, disabled: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "Navigation", insecureContext: true, disabled: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "NavigationActivation", insecureContext: true, disabled: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { + name: "NavigationCurrentEntryChangeEvent", + insecureContext: true, + disabled: true, + }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "NavigationDestination", insecureContext: true, disabled: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "NavigationHistoryEntry", insecureContext: true, disabled: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! + { name: "NavigationTransition", insecureContext: true, disabled: true }, + // IMPORTANT: Do not change this list without review from a DOM peer! "NavigationPreloadManager", // IMPORTANT: Do not change this list without review from a DOM peer! { name: "Navigator", insecureContext: true }, diff --git a/dom/webidl/NavigateEvent.webidl b/dom/webidl/NavigateEvent.webidl new file mode 100644 index 000000000000..94fc1a9a36b3 --- /dev/null +++ b/dom/webidl/NavigateEvent.webidl @@ -0,0 +1,58 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigateevent + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface NavigateEvent : Event { + constructor(DOMString type, NavigateEventInit eventInitDict); + + readonly attribute NavigationType navigationType; + readonly attribute NavigationDestination destination; + readonly attribute boolean canIntercept; + readonly attribute boolean userInitiated; + readonly attribute boolean hashChange; + readonly attribute AbortSignal signal; + readonly attribute FormData? formData; + readonly attribute DOMString? downloadRequest; + readonly attribute any info; + readonly attribute boolean hasUAVisualTransition; + + [Throws] undefined intercept(optional NavigationInterceptOptions options = {}); + [Throws] undefined scroll(); +}; + +dictionary NavigateEventInit : EventInit { + NavigationType navigationType = "push"; + required NavigationDestination destination; + boolean canIntercept = false; + boolean userInitiated = false; + boolean hashChange = false; + required AbortSignal signal; + FormData? formData = null; + DOMString? downloadRequest = null; + any info; + boolean hasUAVisualTransition = false; +}; + +dictionary NavigationInterceptOptions { + NavigationInterceptHandler handler; + NavigationFocusReset focusReset; + NavigationScrollBehavior scroll; +}; + +enum NavigationFocusReset { + "after-transition", + "manual" +}; + +enum NavigationScrollBehavior { + "after-transition", + "manual" +}; + +callback NavigationInterceptHandler = Promise (); diff --git a/dom/webidl/Navigation.webidl b/dom/webidl/Navigation.webidl new file mode 100644 index 000000000000..e804970282ba --- /dev/null +++ b/dom/webidl/Navigation.webidl @@ -0,0 +1,68 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigation-interface + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface Navigation : EventTarget { + sequence entries(); + readonly attribute NavigationHistoryEntry? currentEntry; + [Throws] undefined updateCurrentEntry(NavigationUpdateCurrentEntryOptions options); + readonly attribute NavigationTransition? transition; + readonly attribute NavigationActivation? activation; + + readonly attribute boolean canGoBack; + readonly attribute boolean canGoForward; + + NavigationResult navigate(USVString url, optional NavigationNavigateOptions options = {}); + NavigationResult reload(optional NavigationReloadOptions options = {}); + + NavigationResult traverseTo(DOMString key, optional NavigationOptions options = {}); + NavigationResult back(optional NavigationOptions options = {}); + NavigationResult forward(optional NavigationOptions options = {}); + + attribute EventHandler onnavigate; + attribute EventHandler onnavigatesuccess; + attribute EventHandler onnavigateerror; + attribute EventHandler oncurrententrychange; +}; + +dictionary NavigationUpdateCurrentEntryOptions { + required any state; +}; + +dictionary NavigationOptions { + any info; +}; + +dictionary NavigationNavigateOptions : NavigationOptions { + any state; + NavigationHistoryBehavior history = "auto"; +}; + +dictionary NavigationReloadOptions : NavigationOptions { + any state; +}; + +dictionary NavigationResult { + Promise committed; + Promise finished; +}; + +enum NavigationHistoryBehavior { + "auto", + "push", + "replace" +}; + +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationtype +enum NavigationType { + "push", + "replace", + "reload", + "traverse" +}; diff --git a/dom/webidl/NavigationActivation.webidl b/dom/webidl/NavigationActivation.webidl new file mode 100644 index 000000000000..c72127d423dd --- /dev/null +++ b/dom/webidl/NavigationActivation.webidl @@ -0,0 +1,15 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationactivation + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface NavigationActivation { + readonly attribute NavigationHistoryEntry? from; + readonly attribute NavigationHistoryEntry entry; + readonly attribute NavigationType navigationType; +}; diff --git a/dom/webidl/NavigationCurrentEntryChangeEvent.webidl b/dom/webidl/NavigationCurrentEntryChangeEvent.webidl new file mode 100644 index 000000000000..40f08cdf112b --- /dev/null +++ b/dom/webidl/NavigationCurrentEntryChangeEvent.webidl @@ -0,0 +1,21 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-navigationcurrententrychangeevent-interface + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface NavigationCurrentEntryChangeEvent : Event { + constructor(DOMString type, NavigationCurrentEntryChangeEventInit eventInitDict); + + readonly attribute NavigationType? navigationType; + readonly attribute NavigationHistoryEntry from; +}; + +dictionary NavigationCurrentEntryChangeEventInit : EventInit { + NavigationType? navigationType = null; + required NavigationHistoryEntry from; +}; diff --git a/dom/webidl/NavigationDestination.webidl b/dom/webidl/NavigationDestination.webidl new file mode 100644 index 000000000000..8110fd96735b --- /dev/null +++ b/dom/webidl/NavigationDestination.webidl @@ -0,0 +1,19 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationdestination + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface NavigationDestination { + readonly attribute USVString url; + readonly attribute DOMString key; + readonly attribute DOMString id; + readonly attribute long long index; + readonly attribute boolean sameDocument; + + [Throws] any getState(); +}; diff --git a/dom/webidl/NavigationHistoryEntry.webidl b/dom/webidl/NavigationHistoryEntry.webidl new file mode 100644 index 000000000000..b8e8bd369b6f --- /dev/null +++ b/dom/webidl/NavigationHistoryEntry.webidl @@ -0,0 +1,21 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-navigationhistoryentry-interface + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface NavigationHistoryEntry : EventTarget { + readonly attribute USVString? url; + readonly attribute DOMString key; + readonly attribute DOMString id; + readonly attribute long long index; + readonly attribute boolean sameDocument; + + [Throws] any getState(); + + attribute EventHandler ondispose; +}; diff --git a/dom/webidl/NavigationTransition.webidl b/dom/webidl/NavigationTransition.webidl new file mode 100644 index 000000000000..7cf8cd99bf0b --- /dev/null +++ b/dom/webidl/NavigationTransition.webidl @@ -0,0 +1,15 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. + * + * The origin of this IDL file is + * https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationtransition + */ + +[Func="Navigation::IsAPIEnabled", Exposed=Window] +interface NavigationTransition { + readonly attribute NavigationType navigationType; + readonly attribute NavigationHistoryEntry from; + readonly attribute Promise finished; +}; diff --git a/dom/webidl/PerformanceNavigationTiming.webidl b/dom/webidl/PerformanceNavigationTiming.webidl index cf029972304f..ba92042dc285 100644 --- a/dom/webidl/PerformanceNavigationTiming.webidl +++ b/dom/webidl/PerformanceNavigationTiming.webidl @@ -10,7 +10,7 @@ * W3C liability, trademark and document use rules apply. */ -enum NavigationType { +enum NavigationTimingType { "navigate", "reload", "back_forward", @@ -20,16 +20,16 @@ enum NavigationType { [Exposed=Window, Func="mozilla::dom::PerformanceNavigationTiming::Enabled"] interface PerformanceNavigationTiming : PerformanceResourceTiming { - readonly attribute DOMHighResTimeStamp unloadEventStart; - readonly attribute DOMHighResTimeStamp unloadEventEnd; - readonly attribute DOMHighResTimeStamp domInteractive; - readonly attribute DOMHighResTimeStamp domContentLoadedEventStart; - readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd; - readonly attribute DOMHighResTimeStamp domComplete; - readonly attribute DOMHighResTimeStamp loadEventStart; - readonly attribute DOMHighResTimeStamp loadEventEnd; - readonly attribute NavigationType type; - readonly attribute unsigned short redirectCount; + readonly attribute DOMHighResTimeStamp unloadEventStart; + readonly attribute DOMHighResTimeStamp unloadEventEnd; + readonly attribute DOMHighResTimeStamp domInteractive; + readonly attribute DOMHighResTimeStamp domContentLoadedEventStart; + readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd; + readonly attribute DOMHighResTimeStamp domComplete; + readonly attribute DOMHighResTimeStamp loadEventStart; + readonly attribute DOMHighResTimeStamp loadEventEnd; + readonly attribute NavigationTimingType type; + readonly attribute unsigned short redirectCount; [Default] object toJSON(); }; diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl index ea317920bda8..b5cd9b10739e 100644 --- a/dom/webidl/Window.webidl +++ b/dom/webidl/Window.webidl @@ -204,6 +204,7 @@ interface nsIPrintSettings; [PutForwards=href, LegacyUnforgeable, CrossOriginReadable, CrossOriginWritable] readonly attribute Location location; [Throws] readonly attribute History history; + [Func="Navigation::IsAPIEnabled"] readonly attribute Navigation navigation; readonly attribute CustomElementRegistry customElements; [Replaceable, Throws] readonly attribute BarProp locationbar; [Replaceable, Throws] readonly attribute BarProp menubar; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 156ee9543cdf..f058b60ed152 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -762,7 +762,13 @@ WEBIDL_FILES = [ "MutationEvent.webidl", "MutationObserver.webidl", "NamedNodeMap.webidl", + "NavigateEvent.webidl", + "Navigation.webidl", + "NavigationActivation.webidl", + "NavigationDestination.webidl", + "NavigationHistoryEntry.webidl", "NavigationPreloadManager.webidl", + "NavigationTransition.webidl", "Navigator.webidl", "NetErrorInfo.webidl", "NetworkInformation.webidl", @@ -1173,6 +1179,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [ "MediaStreamEvent.webidl", "MediaStreamTrackEvent.webidl", "MIDIConnectionEvent.webidl", + "NavigationCurrentEntryChangeEvent.webidl", "OfflineAudioCompletionEvent.webidl", "PageTransitionEvent.webidl", "PerformanceEntryEvent.webidl", diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 2a28966a28cc..8982f18e7e07 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -3228,6 +3228,13 @@ value: false mirror: always +# Whether the navigation API will be exposed. +- name: dom.navigation.webidl.enabled + type: RelaxedAtomicBool + value: false + mirror: always + do_not_use_directly: true + # Network Information API # This feature is not available on Firefox desktop. It exposes too much # user information. Let's be consistent and disable it on Android. diff --git a/testing/web-platform/meta/html/dom/idlharness.https.html.ini b/testing/web-platform/meta/html/dom/idlharness.https.html.ini index a521f3623feb..98eb500e46b7 100644 --- a/testing/web-platform/meta/html/dom/idlharness.https.html.ini +++ b/testing/web-platform/meta/html/dom/idlharness.https.html.ini @@ -1,4 +1,4 @@ -prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true, dom.iframe_lazy_loading.enabled:true, dom.webcomponents.shadowdom.declarative.enabled:true, network.fetchpriority.enabled:true, dom.element.customstateset.enabled:true] +prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featurePolicy.header.enabled:true, dom.security.featurePolicy.webidl.enabled:true, dom.iframe_lazy_loading.enabled:true, dom.webcomponents.shadowdom.declarative.enabled:true, network.fetchpriority.enabled:true, dom.element.customstateset.enabled:true, dom.navigation.webidl.enabled:true] [idlharness.https.html?exclude=(Document|Window|HTML.*)] [AudioTrack interface: existence and properties of interface prototype object] expected: FAIL @@ -316,247 +316,328 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu expected: FAIL [Navigation interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface object length] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface object name] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation entries()] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute currentEntry] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation updateCurrentEntry(NavigationUpdateCurrentEntryOptions)] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute transition] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute canGoBack] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute canGoForward] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation navigate(USVString, optional NavigationNavigateOptions)] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation reload(optional NavigationReloadOptions)] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation traverseTo(DOMString, optional NavigationOptions)] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation back(optional NavigationOptions)] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: operation forward(optional NavigationOptions)] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute onnavigate] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute onnavigatesuccess] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute onnavigateerror] - expected: FAIL + expected: + if os == "android": FAIL [Navigation interface: attribute oncurrententrychange] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface object length] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface object name] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: attribute url] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: attribute key] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: attribute id] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: attribute index] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: attribute sameDocument] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: operation getState()] - expected: FAIL + expected: + if os == "android": FAIL [NavigationHistoryEntry interface: attribute ondispose] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface object length] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface object name] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: attribute navigationType] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: attribute from] - expected: FAIL + expected: + if os == "android": FAIL [NavigationTransition interface: attribute finished] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface object length] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface object name] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute navigationType] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute destination] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute canIntercept] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute userInitiated] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute hashChange] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute signal] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute formData] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute downloadRequest] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute info] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: attribute hasUAVisualTransition] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: operation intercept(optional NavigationInterceptOptions)] - expected: FAIL + expected: + if os == "android": FAIL [NavigateEvent interface: operation scroll()] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface object length] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface object name] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: attribute url] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: attribute key] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: attribute id] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: attribute index] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: attribute sameDocument] - expected: FAIL + expected: + if os == "android": FAIL [NavigationDestination interface: operation getState()] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface object length] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface object name] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface: attribute navigationType] - expected: FAIL + expected: + if os == "android": FAIL [NavigationCurrentEntryChangeEvent interface: attribute from] - expected: FAIL + expected: + if os == "android": FAIL [PopStateEvent interface: attribute hasUAVisualTransition] expected: FAIL @@ -598,34 +679,44 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu expected: FAIL [Navigation interface: attribute activation] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: existence and properties of interface object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface object length] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface object name] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: existence and properties of interface prototype object] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: existence and properties of interface prototype object's "constructor" property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: existence and properties of interface prototype object's @@unscopables property] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: attribute from] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: attribute entry] - expected: FAIL + expected: + if os == "android": FAIL [NavigationActivation interface: attribute navigationType] - expected: FAIL + expected: + if os == "android": FAIL [PageRevealEvent interface: existence and properties of interface object] expected: FAIL @@ -780,10 +871,12 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu expected: FAIL [Window interface: attribute navigation] - expected: FAIL + expected: + if os == "android": FAIL [Window interface: window must inherit property "navigation" with the proper type] - expected: FAIL + expected: + if os == "android": FAIL [Window interface: attribute clientInformation] expected: FAIL diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py index 9ecd2302d2be..6b019b999b9b 100644 --- a/xpcom/ds/StaticAtoms.py +++ b/xpcom/ds/StaticAtoms.py @@ -801,8 +801,10 @@ STATIC_ATOMS = [ Atom("oncontextrestored", "oncontextrestored"), Atom("oncopy", "oncopy"), Atom("oncut", "oncut"), + Atom("oncurrententrychange", "oncurrententrychange"), Atom("ondblclick", "ondblclick"), Atom("ondischargingtimechange", "ondischargingtimechange"), + Atom("ondispose", "ondispose"), Atom("ondownloading", "ondownloading"), Atom("onDOMActivate", "onDOMActivate"), Atom("onDOMAttrModified", "onDOMAttrModified"), @@ -873,6 +875,9 @@ STATIC_ATOMS = [ Atom("onMozMousePixelScroll", "onMozMousePixelScroll"), Atom("onMozScrolledAreaChanged", "onMozScrolledAreaChanged"), Atom("onmute", "onmute"), + Atom("onnavigate", "onnavigate"), + Atom("onnavigatesuccess", "onnavigatesuccess"), + Atom("onnavigateerror", "onnavigateerror"), Atom("onnotificationclick", "onnotificationclick"), Atom("onnotificationclose", "onnotificationclose"), Atom("onnoupdate", "onnoupdate"),