Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 1f5562d

Browse files
committed
Bug 1603889 - Remove AppWindow::GetContentScrollbarVisibility. r=smaug
There's only one test that can potentially rely on this, and still passes with this patch: toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js More to the point, this doesn't work with e10s whatsoever already, and seems content cannot change the scrollbar visibility anymore, and chrome code doesn't do it either. Depends on D57182 Differential Revision: https://phabricator.services.mozilla.com/D57184 --HG-- extra : moz-landing-system : lando
1 parent 3aeeba2 commit 1f5562d

2 files changed

Lines changed: 2 additions & 30 deletions

File tree

xpfe/appshell/AppWindow.cpp

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,6 @@ NS_IMETHODIMP AppWindow::SetZLevel(uint32_t aLevel) {
432432
NS_IMETHODIMP AppWindow::GetChromeFlags(uint32_t* aChromeFlags) {
433433
NS_ENSURE_ARG_POINTER(aChromeFlags);
434434
*aChromeFlags = mChromeFlags;
435-
/* mChromeFlags is kept up to date, except for scrollbar visibility.
436-
That can be changed directly by the content DOM window, which
437-
doesn't know to update the chrome window. So that we must check
438-
separately. */
439-
440-
// however, it's pointless to ask if the window isn't set up yet
441-
if (!mChromeLoaded) return NS_OK;
442-
443-
if (GetContentScrollbarVisibility())
444-
*aChromeFlags |= nsIWebBrowserChrome::CHROME_SCROLLBARS;
445-
else
446-
*aChromeFlags &= ~nsIWebBrowserChrome::CHROME_SCROLLBARS;
447-
448435
return NS_OK;
449436
}
450437

@@ -2441,20 +2428,6 @@ void AppWindow::SetContentScrollbarVisibility(bool aVisible) {
24412428
nsContentUtils::SetScrollbarsVisibility(contentWin->GetDocShell(), aVisible);
24422429
}
24432430

2444-
bool AppWindow::GetContentScrollbarVisibility() {
2445-
// This code already exists in dom/src/base/nsBarProp.cpp, but we can't safely
2446-
// get to that from here as this function is called while the DOM window is
2447-
// being set up, and we need the DOM window to get to that code.
2448-
//
2449-
// FIXME(emilio): This doesn't work at all for e10s or anything like that,
2450-
// it's likely that nobody is relying on this function.
2451-
if (nsCOMPtr<nsIDocShell> ds = do_QueryInterface(mPrimaryContentShell)) {
2452-
return nsDocShell::Cast(ds)->ScrollbarPreference() != ScrollbarPreference::Never;
2453-
}
2454-
2455-
return true;
2456-
}
2457-
24582431
// during spinup, attributes that haven't been loaded yet can't be dirty
24592432
void AppWindow::PersistentAttributesDirty(uint32_t aDirtyFlags) {
24602433
mPersistentAttributesDirty |= aDirtyFlags & mPersistentAttributesMask;
@@ -2473,8 +2446,8 @@ void AppWindow::ApplyChromeFlags() {
24732446
// So just don't do these until mChromeLoaded is true.
24742447

24752448
// Scrollbars have their own special treatment.
2476-
SetContentScrollbarVisibility(
2477-
mChromeFlags & nsIWebBrowserChrome::CHROME_SCROLLBARS ? true : false);
2449+
SetContentScrollbarVisibility(mChromeFlags &
2450+
nsIWebBrowserChrome::CHROME_SCROLLBARS);
24782451
}
24792452

24802453
/* the other flags are handled together. we have style rules

xpfe/appshell/AppWindow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ class AppWindow final : public nsIBaseWindow,
243243
void PlaceWindowLayersBehind(uint32_t aLowLevel, uint32_t aHighLevel,
244244
nsIAppWindow* aBehind);
245245
void SetContentScrollbarVisibility(bool aVisible);
246-
bool GetContentScrollbarVisibility();
247246
void PersistentAttributesDirty(uint32_t aDirtyFlags);
248247
nsresult GetTabCount(uint32_t* aResult);
249248

0 commit comments

Comments
 (0)