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:
Emily McDonough 2023-04-03 17:11:24 +00:00
parent 4a15af1330
commit afd9c3eee4
7 changed files with 4 additions and 51 deletions

View file

@ -352,7 +352,6 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
mAllowAuth(mItemType == typeContent),
mAllowKeywordFixup(false),
mDisableMetaRefreshWhenInactive(false),
mDeviceSizeIsPageSize(false),
mWindowDraggingAllowed(false),
mInFrameSwap(false),
mFiredUnloadEvent(false),
@ -442,9 +441,6 @@ bool nsDocShell::Initialize() {
Preferences::GetBool("browser.meta_refresh_when_inactive.disabled",
mDisableMetaRefreshWhenInactive);
mDeviceSizeIsPageSize = Preferences::GetBool(
"docshell.device_size_is_page_size", mDeviceSizeIsPageSize);
if (nsCOMPtr<nsIObserverService> serv = services::GetObserverService()) {
const char* msg = mItemType == typeContent ? NS_WEBNAVIGATION_CREATE
: NS_CHROME_WEBNAVIGATION_CREATE;
@ -3196,26 +3192,6 @@ nsDocShell::GetIsNavigating(bool* aOut) {
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) {
MOZ_ASSERT(!mozilla::SessionHistoryInParent());
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();

View file

@ -1316,7 +1316,6 @@ class nsDocShell final : public nsDocLoader,
bool mAllowKeywordFixup : 1;
bool mDisableMetaRefreshWhenInactive : 1;
bool mIsAppTab : 1;
bool mDeviceSizeIsPageSize : 1;
bool mWindowDraggingAllowed : 1;
bool mInFrameSwap : 1;

View file

@ -622,18 +622,6 @@ interface nsIDocShell : nsIDocShellTreeItem
[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
* that execution has stopped. This only occurs when the Timeline devtool

View file

@ -2815,11 +2815,6 @@ nscoord nsPresContext::PhysicalMillimetersToAppUnits(float aMM) const {
inches * float(DeviceContext()->AppUnitsPerPhysicalInch()));
}
bool nsPresContext::IsDeviceSizePageSize() {
nsIDocShell* docShell = GetDocShell();
return docShell && docShell->GetDeviceSizeIsPageSize();
}
uint64_t nsPresContext::GetRestyleGeneration() const {
if (!mRestyleManager) {
return 0;

View file

@ -1055,8 +1055,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
bool HasEverBuiltInvisibleText() const { return mHasEverBuiltInvisibleText; }
void SetBuiltInvisibleText() { mHasEverBuiltInvisibleText = true; }
bool IsDeviceSizePageSize();
bool HasWarnedAboutTooLargeDashedOrDottedRadius() const {
return mHasWarnedAboutTooLargeDashedOrDottedRadius;
}

View file

@ -16,7 +16,7 @@
namespace mozilla {
enum class MediaFeatureChangeReason : uint16_t {
enum class MediaFeatureChangeReason : uint8_t {
// The viewport size the document has used has changed.
//
// 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
// features that expose the presence of a system metric directly.
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
// may have changed.
DisplayModeChange = 1 << 7,
DisplayModeChange = 1 << 6,
// A preference that affects media query results has changed. For
// example, changes to document_color_use will affect
// prefers-contrast.
PreferenceChange = 1 << 8,
PreferenceChange = 1 << 7,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(MediaFeatureChangeReason)

View file

@ -29,7 +29,7 @@
#include "nsSize.h"
namespace mozilla {
enum class MediaFeatureChangeReason : uint16_t;
enum class MediaFeatureChangeReason : uint8_t;
enum class StylePageSizeOrientation : uint8_t;
enum class StyleRuleChangeKind : uint32_t;