Bug 1895254 - Prototype the Navigation API WebIDL. r=farre,dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D210088
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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<mozilla::EventListenerManager> mListenerManager;
|
||||
RefPtr<mozilla::dom::Location> mLocation;
|
||||
RefPtr<nsHistory> mHistory;
|
||||
RefPtr<mozilla::dom::Navigation> mNavigation;
|
||||
RefPtr<mozilla::dom::CustomElementRegistry> mCustomElements;
|
||||
|
||||
nsTObserverArray<RefPtr<mozilla::dom::SharedWorker>> mSharedWorkers;
|
||||
|
||||
19
dom/events/NavigateEvent.cpp
Normal file
19
dom/events/NavigateEvent.cpp
Normal file
@@ -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> NavigateEvent::Constructor(
|
||||
const GlobalObject& aGlobal, const nsAString& aType,
|
||||
const NavigateEventInit& aEventInitDict) {
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
64
dom/events/NavigateEvent.h
Normal file
64
dom/events/NavigateEvent.h
Normal file
@@ -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<NavigateEvent> Constructor(
|
||||
const GlobalObject& aGlobal, const nsAString& aType,
|
||||
const NavigateEventInit& aEventInitDict);
|
||||
|
||||
enum NavigationType NavigationType() const { return {}; }
|
||||
|
||||
already_AddRefed<NavigationDestination> Destination() const { return {}; }
|
||||
|
||||
bool CanIntercept() const { return {}; }
|
||||
|
||||
bool UserInitiated() const { return {}; }
|
||||
|
||||
bool HashChange() const { return {}; }
|
||||
|
||||
already_AddRefed<AbortSignal> Signal() const { return {}; }
|
||||
|
||||
already_AddRefed<FormData> GetFormData() const { return {}; }
|
||||
|
||||
void GetDownloadRequest(nsString& aRetVal) const {}
|
||||
|
||||
void GetInfo(JSContext* aCx, JS::MutableHandle<JS::Value> 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___
|
||||
@@ -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",
|
||||
|
||||
@@ -104,6 +104,7 @@ DIRS += [
|
||||
"l10n",
|
||||
"origin-trials",
|
||||
"webscheduling",
|
||||
"navigation",
|
||||
]
|
||||
|
||||
|
||||
|
||||
33
dom/navigation/Navigation.cpp
Normal file
33
dom/navigation/Navigation.cpp
Normal file
@@ -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<JSObject*> 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
|
||||
71
dom/navigation/Navigation.h
Normal file
71
dom/navigation/Navigation.h
Normal file
@@ -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<RefPtr<NavigationHistoryEntry>>& aResult) {}
|
||||
already_AddRefed<NavigationHistoryEntry> GetCurrentEntry() { return {}; }
|
||||
void UpdateCurrentEntry(JSContext* aCx,
|
||||
const NavigationUpdateCurrentEntryOptions& aOptions,
|
||||
ErrorResult& aRv) {}
|
||||
already_AddRefed<NavigationTransition> GetTransition() { return {}; }
|
||||
already_AddRefed<NavigationActivation> 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<JSObject*> 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___
|
||||
25
dom/navigation/NavigationActivation.cpp
Normal file
25
dom/navigation/NavigationActivation.cpp
Normal file
@@ -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<JSObject*> aGivenProto) {
|
||||
return NavigationActivation_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
38
dom/navigation/NavigationActivation.h
Normal file
38
dom/navigation/NavigationActivation.h
Normal file
@@ -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<NavigationHistoryEntry> GetFrom() const { return {}; }
|
||||
already_AddRefed<NavigationHistoryEntry> Entry() const { return {}; }
|
||||
enum NavigationType NavigationType() const { return {}; }
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
nsIGlobalObject* GetParentObject() const { return {}; }
|
||||
|
||||
private:
|
||||
~NavigationActivation() = default;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
#endif // mozilla_dom_NavigationActivation_h___
|
||||
25
dom/navigation/NavigationDestination.cpp
Normal file
25
dom/navigation/NavigationDestination.cpp
Normal file
@@ -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<JSObject*> aGivenProto) {
|
||||
return NavigationDestination_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
41
dom/navigation/NavigationDestination.h
Normal file
41
dom/navigation/NavigationDestination.h
Normal file
@@ -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<JS::Value> aRetVal,
|
||||
ErrorResult& aRv) const {}
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
nsIGlobalObject* GetParentObject() const { return {}; }
|
||||
|
||||
private:
|
||||
~NavigationDestination() = default;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
#endif // mozilla_dom_NavigationDestination_h___
|
||||
25
dom/navigation/NavigationHistoryEntry.cpp
Normal file
25
dom/navigation/NavigationHistoryEntry.cpp
Normal file
@@ -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<JSObject*> aGivenProto) {
|
||||
return NavigationHistoryEntry_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
40
dom/navigation/NavigationHistoryEntry.h
Normal file
40
dom/navigation/NavigationHistoryEntry.h
Normal file
@@ -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<JS::Value> aResult,
|
||||
ErrorResult& aRv) {}
|
||||
|
||||
IMPL_EVENT_HANDLER(dispose);
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
private:
|
||||
~NavigationHistoryEntry() = default;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
#endif // mozilla_dom_NavigationHistoryEntry_h___
|
||||
25
dom/navigation/NavigationTransition.cpp
Normal file
25
dom/navigation/NavigationTransition.cpp
Normal file
@@ -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<JSObject*> aGivenProto) {
|
||||
return NavigationTransition_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
38
dom/navigation/NavigationTransition.h
Normal file
38
dom/navigation/NavigationTransition.h
Normal file
@@ -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<NavigationHistoryEntry> From() const { return {}; }
|
||||
already_AddRefed<Promise> Finished() const { return {}; }
|
||||
|
||||
JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
nsIGlobalObject* GetParentObject() const { return {}; }
|
||||
|
||||
private:
|
||||
~NavigationTransition() = default;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
#endif // mozilla_dom_NavigationTransition_h___
|
||||
26
dom/navigation/moz.build
Normal file
26
dom/navigation/moz.build
Normal file
@@ -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"
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 },
|
||||
|
||||
58
dom/webidl/NavigateEvent.webidl
Normal file
58
dom/webidl/NavigateEvent.webidl
Normal file
@@ -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<undefined> ();
|
||||
68
dom/webidl/Navigation.webidl
Normal file
68
dom/webidl/Navigation.webidl
Normal file
@@ -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<NavigationHistoryEntry> 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<NavigationHistoryEntry> committed;
|
||||
Promise<NavigationHistoryEntry> finished;
|
||||
};
|
||||
|
||||
enum NavigationHistoryBehavior {
|
||||
"auto",
|
||||
"push",
|
||||
"replace"
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationtype
|
||||
enum NavigationType {
|
||||
"push",
|
||||
"replace",
|
||||
"reload",
|
||||
"traverse"
|
||||
};
|
||||
15
dom/webidl/NavigationActivation.webidl
Normal file
15
dom/webidl/NavigationActivation.webidl
Normal file
@@ -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;
|
||||
};
|
||||
21
dom/webidl/NavigationCurrentEntryChangeEvent.webidl
Normal file
21
dom/webidl/NavigationCurrentEntryChangeEvent.webidl
Normal file
@@ -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;
|
||||
};
|
||||
19
dom/webidl/NavigationDestination.webidl
Normal file
19
dom/webidl/NavigationDestination.webidl
Normal file
@@ -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();
|
||||
};
|
||||
21
dom/webidl/NavigationHistoryEntry.webidl
Normal file
21
dom/webidl/NavigationHistoryEntry.webidl
Normal file
@@ -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;
|
||||
};
|
||||
15
dom/webidl/NavigationTransition.webidl
Normal file
15
dom/webidl/NavigationTransition.webidl
Normal file
@@ -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<undefined> finished;
|
||||
};
|
||||
@@ -10,7 +10,7 @@
|
||||
* W3C liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
enum NavigationType {
|
||||
enum NavigationTimingType {
|
||||
"navigate",
|
||||
"reload",
|
||||
"back_forward",
|
||||
@@ -28,7 +28,7 @@ interface PerformanceNavigationTiming : PerformanceResourceTiming {
|
||||
readonly attribute DOMHighResTimeStamp domComplete;
|
||||
readonly attribute DOMHighResTimeStamp loadEventStart;
|
||||
readonly attribute DOMHighResTimeStamp loadEventEnd;
|
||||
readonly attribute NavigationType type;
|
||||
readonly attribute NavigationTimingType type;
|
||||
readonly attribute unsigned short redirectCount;
|
||||
|
||||
[Default] object toJSON();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user