mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1595800 - Part 1: Move screen orientation attributes from Document to BrowsingContext r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D54999 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e0b847846e
commit
38f31dfbce
@ -52,6 +52,17 @@ extern mozilla::LazyLogModule gAutoplayPermissionLog;
|
||||
#define AUTOPLAY_LOG(msg, ...) \
|
||||
MOZ_LOG(gAutoplayPermissionLog, LogLevel::Debug, (msg, ##__VA_ARGS__))
|
||||
|
||||
namespace IPC {
|
||||
// Allow serialization and deserialization of OrientationType over IPC
|
||||
template <>
|
||||
struct ParamTraits<mozilla::dom::OrientationType>
|
||||
: public ContiguousEnumSerializerInclusive<
|
||||
mozilla::dom::OrientationType,
|
||||
mozilla::dom::OrientationType::Portrait_primary,
|
||||
mozilla::dom::OrientationType::Landscape_secondary> {};
|
||||
|
||||
} // namespace IPC
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
|
@ -273,6 +273,18 @@ class BrowsingContext : public nsISupports,
|
||||
|
||||
bool IsLoading();
|
||||
|
||||
// ScreenOrientation related APIs
|
||||
void SetCurrentOrientation(OrientationType aType, float aAngle) {
|
||||
SetCurrentOrientationType(aType);
|
||||
SetCurrentOrientationAngle(aAngle);
|
||||
}
|
||||
|
||||
void SetRDMPaneOrientation(OrientationType aType, float aAngle) {
|
||||
if (mInRDMPane) {
|
||||
SetCurrentOrientation(aType, aAngle);
|
||||
}
|
||||
}
|
||||
|
||||
// Using the rules for choosing a browsing context we try to find
|
||||
// the browsing context with the given name in the set of
|
||||
// transitively reachable browsing contexts. Performs access control
|
||||
|
@ -42,6 +42,11 @@ MOZ_BC_FIELD(FeaturePolicy, RefPtr<mozilla::dom::FeaturePolicy>)
|
||||
// See nsSandboxFlags.h for the possible flags.
|
||||
MOZ_BC_FIELD(SandboxFlags, uint32_t)
|
||||
|
||||
// ScreenOrientation-related APIs
|
||||
MOZ_BC_FIELD(CurrentOrientationAngle, float)
|
||||
|
||||
MOZ_BC_FIELD(CurrentOrientationType, mozilla::dom::OrientationType)
|
||||
|
||||
MOZ_BC_FIELD(HistoryID, nsID)
|
||||
|
||||
MOZ_BC_FIELD(InRDMPane, bool)
|
||||
|
@ -51,6 +51,10 @@ interface BrowsingContext {
|
||||
// The inRDMPane flag indicates whether or not Responsive Design Mode is
|
||||
// active for the browsing context.
|
||||
attribute boolean inRDMPane;
|
||||
|
||||
// Extension to give chrome JS the ability to set the window screen
|
||||
// orientation while in RDM.
|
||||
void setRDMPaneOrientation(OrientationType type, float rotationAngle);
|
||||
};
|
||||
|
||||
[Exposed=Window, ChromeOnly]
|
||||
|
Loading…
Reference in New Issue
Block a user