Bug 1576298 - Remove DeviceSizeIsPageSize from nsDocShell and nsPresContext. r=emilio
This comes from bug 890195, and it was superseded by bug 1575097. This isn't used for anything anymore, and we can remove the otherwise unused MediaFeatureChangeReason flag as well. Differential Revision: https://phabricator.services.mozilla.com/D174492
This commit is contained in:
@@ -352,7 +352,6 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
|
|||||||
mAllowAuth(mItemType == typeContent),
|
mAllowAuth(mItemType == typeContent),
|
||||||
mAllowKeywordFixup(false),
|
mAllowKeywordFixup(false),
|
||||||
mDisableMetaRefreshWhenInactive(false),
|
mDisableMetaRefreshWhenInactive(false),
|
||||||
mDeviceSizeIsPageSize(false),
|
|
||||||
mWindowDraggingAllowed(false),
|
mWindowDraggingAllowed(false),
|
||||||
mInFrameSwap(false),
|
mInFrameSwap(false),
|
||||||
mFiredUnloadEvent(false),
|
mFiredUnloadEvent(false),
|
||||||
@@ -442,9 +441,6 @@ bool nsDocShell::Initialize() {
|
|||||||
Preferences::GetBool("browser.meta_refresh_when_inactive.disabled",
|
Preferences::GetBool("browser.meta_refresh_when_inactive.disabled",
|
||||||
mDisableMetaRefreshWhenInactive);
|
mDisableMetaRefreshWhenInactive);
|
||||||
|
|
||||||
mDeviceSizeIsPageSize = Preferences::GetBool(
|
|
||||||
"docshell.device_size_is_page_size", mDeviceSizeIsPageSize);
|
|
||||||
|
|
||||||
if (nsCOMPtr<nsIObserverService> serv = services::GetObserverService()) {
|
if (nsCOMPtr<nsIObserverService> serv = services::GetObserverService()) {
|
||||||
const char* msg = mItemType == typeContent ? NS_WEBNAVIGATION_CREATE
|
const char* msg = mItemType == typeContent ? NS_WEBNAVIGATION_CREATE
|
||||||
: NS_CHROME_WEBNAVIGATION_CREATE;
|
: NS_CHROME_WEBNAVIGATION_CREATE;
|
||||||
@@ -3196,26 +3192,6 @@ nsDocShell::GetIsNavigating(bool* aOut) {
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocShell::SetDeviceSizeIsPageSize(bool aValue) {
|
|
||||||
if (mDeviceSizeIsPageSize != aValue) {
|
|
||||||
mDeviceSizeIsPageSize = aValue;
|
|
||||||
RefPtr<nsPresContext> presContext = GetPresContext();
|
|
||||||
if (presContext) {
|
|
||||||
presContext->MediaFeatureValuesChanged(
|
|
||||||
{MediaFeatureChangeReason::DeviceSizeIsPageSizeChange},
|
|
||||||
MediaFeatureChangePropagation::JustThisDocument);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocShell::GetDeviceSizeIsPageSize(bool* aValue) {
|
|
||||||
*aValue = mDeviceSizeIsPageSize;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nsDocShell::ClearFrameHistory(nsISHEntry* aEntry) {
|
void nsDocShell::ClearFrameHistory(nsISHEntry* aEntry) {
|
||||||
MOZ_ASSERT(!mozilla::SessionHistoryInParent());
|
MOZ_ASSERT(!mozilla::SessionHistoryInParent());
|
||||||
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
|
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
|
||||||
|
|||||||
@@ -1316,7 +1316,6 @@ class nsDocShell final : public nsDocLoader,
|
|||||||
bool mAllowKeywordFixup : 1;
|
bool mAllowKeywordFixup : 1;
|
||||||
bool mDisableMetaRefreshWhenInactive : 1;
|
bool mDisableMetaRefreshWhenInactive : 1;
|
||||||
bool mIsAppTab : 1;
|
bool mIsAppTab : 1;
|
||||||
bool mDeviceSizeIsPageSize : 1;
|
|
||||||
bool mWindowDraggingAllowed : 1;
|
bool mWindowDraggingAllowed : 1;
|
||||||
bool mInFrameSwap : 1;
|
bool mInFrameSwap : 1;
|
||||||
|
|
||||||
|
|||||||
@@ -622,18 +622,6 @@ interface nsIDocShell : nsIDocShellTreeItem
|
|||||||
|
|
||||||
[noscript,notxpcom,nostdcall] Document getExtantDocument();
|
[noscript,notxpcom,nostdcall] Document getExtantDocument();
|
||||||
|
|
||||||
/**
|
|
||||||
* If deviceSizeIsPageSize is set to true, device-width/height media queries
|
|
||||||
* will be calculated from the page size, not the device size.
|
|
||||||
*
|
|
||||||
* Used by the Responsive Design Mode and B2G Simulator.
|
|
||||||
*
|
|
||||||
* Default is False.
|
|
||||||
* Default value can be overriden with
|
|
||||||
* docshell.device_size_is_page_size pref.
|
|
||||||
*/
|
|
||||||
[infallible] attribute boolean deviceSizeIsPageSize;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify DocShell when the browser is about to start executing JS, and after
|
* Notify DocShell when the browser is about to start executing JS, and after
|
||||||
* that execution has stopped. This only occurs when the Timeline devtool
|
* that execution has stopped. This only occurs when the Timeline devtool
|
||||||
|
|||||||
@@ -2815,11 +2815,6 @@ nscoord nsPresContext::PhysicalMillimetersToAppUnits(float aMM) const {
|
|||||||
inches * float(DeviceContext()->AppUnitsPerPhysicalInch()));
|
inches * float(DeviceContext()->AppUnitsPerPhysicalInch()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsPresContext::IsDeviceSizePageSize() {
|
|
||||||
nsIDocShell* docShell = GetDocShell();
|
|
||||||
return docShell && docShell->GetDeviceSizeIsPageSize();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t nsPresContext::GetRestyleGeneration() const {
|
uint64_t nsPresContext::GetRestyleGeneration() const {
|
||||||
if (!mRestyleManager) {
|
if (!mRestyleManager) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1055,8 +1055,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
|
|||||||
bool HasEverBuiltInvisibleText() const { return mHasEverBuiltInvisibleText; }
|
bool HasEverBuiltInvisibleText() const { return mHasEverBuiltInvisibleText; }
|
||||||
void SetBuiltInvisibleText() { mHasEverBuiltInvisibleText = true; }
|
void SetBuiltInvisibleText() { mHasEverBuiltInvisibleText = true; }
|
||||||
|
|
||||||
bool IsDeviceSizePageSize();
|
|
||||||
|
|
||||||
bool HasWarnedAboutTooLargeDashedOrDottedRadius() const {
|
bool HasWarnedAboutTooLargeDashedOrDottedRadius() const {
|
||||||
return mHasWarnedAboutTooLargeDashedOrDottedRadius;
|
return mHasWarnedAboutTooLargeDashedOrDottedRadius;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
enum class MediaFeatureChangeReason : uint16_t {
|
enum class MediaFeatureChangeReason : uint8_t {
|
||||||
// The viewport size the document has used has changed.
|
// The viewport size the document has used has changed.
|
||||||
//
|
//
|
||||||
// This affects size media queries like min-width.
|
// This affects size media queries like min-width.
|
||||||
@@ -34,16 +34,13 @@ enum class MediaFeatureChangeReason : uint16_t {
|
|||||||
// A system metric or multiple have changed. This affects all the media
|
// A system metric or multiple have changed. This affects all the media
|
||||||
// features that expose the presence of a system metric directly.
|
// features that expose the presence of a system metric directly.
|
||||||
SystemMetricsChange = 1 << 5,
|
SystemMetricsChange = 1 << 5,
|
||||||
// The fact of whether the device size is the page size has changed, thus
|
|
||||||
// resolution media queries can change.
|
|
||||||
DeviceSizeIsPageSizeChange = 1 << 6,
|
|
||||||
// display-mode changed on the document, thus the display-mode media queries
|
// display-mode changed on the document, thus the display-mode media queries
|
||||||
// may have changed.
|
// may have changed.
|
||||||
DisplayModeChange = 1 << 7,
|
DisplayModeChange = 1 << 6,
|
||||||
// A preference that affects media query results has changed. For
|
// A preference that affects media query results has changed. For
|
||||||
// example, changes to document_color_use will affect
|
// example, changes to document_color_use will affect
|
||||||
// prefers-contrast.
|
// prefers-contrast.
|
||||||
PreferenceChange = 1 << 8,
|
PreferenceChange = 1 << 7,
|
||||||
};
|
};
|
||||||
|
|
||||||
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(MediaFeatureChangeReason)
|
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(MediaFeatureChangeReason)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "nsSize.h"
|
#include "nsSize.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
enum class MediaFeatureChangeReason : uint16_t;
|
enum class MediaFeatureChangeReason : uint8_t;
|
||||||
enum class StylePageSizeOrientation : uint8_t;
|
enum class StylePageSizeOrientation : uint8_t;
|
||||||
enum class StyleRuleChangeKind : uint32_t;
|
enum class StyleRuleChangeKind : uint32_t;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user