зеркало из https://github.com/mozilla/gecko-dev.git
Bug 930535. Enable image visibility on b2g inside browser elements. r=mats
This commit is contained in:
Родитель
1e24397043
Коммит
2cdfe9a734
|
@ -728,6 +728,7 @@ pref("font.size.inflation.disabledInMasterProcess", true);
|
|||
pref("memory.free_dirty_pages", true);
|
||||
|
||||
pref("layout.imagevisibility.enabled", false);
|
||||
pref("layout.imagevisibility.enabled_for_browser_elements_only", true);
|
||||
pref("layout.imagevisibility.numscrollportwidths", 1);
|
||||
pref("layout.imagevisibility.numscrollportheights", 1);
|
||||
|
||||
|
|
|
@ -5383,16 +5383,22 @@ bool
|
|||
PresShell::AssumeAllImagesVisible()
|
||||
{
|
||||
static bool sImageVisibilityEnabled = true;
|
||||
static bool sImageVisibilityEnabledForBrowserElementsOnly = false;
|
||||
static bool sImageVisibilityPrefCached = false;
|
||||
|
||||
if (!sImageVisibilityPrefCached) {
|
||||
Preferences::AddBoolVarCache(&sImageVisibilityEnabled,
|
||||
"layout.imagevisibility.enabled", true);
|
||||
"layout.imagevisibility.enabled", true);
|
||||
Preferences::AddBoolVarCache(&sImageVisibilityEnabledForBrowserElementsOnly,
|
||||
"layout.imagevisibility.enabled_for_browser_elements_only", false);
|
||||
sImageVisibilityPrefCached = true;
|
||||
}
|
||||
|
||||
if (!sImageVisibilityEnabled || !mPresContext || !mDocument)
|
||||
if ((!sImageVisibilityEnabled &&
|
||||
!sImageVisibilityEnabledForBrowserElementsOnly) ||
|
||||
!mPresContext || !mDocument) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// We assume all images are visible in print, print preview, chrome, xul, and
|
||||
// resource docs and don't keep track of them.
|
||||
|
@ -5404,6 +5410,15 @@ PresShell::AssumeAllImagesVisible()
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!sImageVisibilityEnabled &&
|
||||
sImageVisibilityEnabledForBrowserElementsOnly) {
|
||||
nsCOMPtr<nsISupports> container = mPresContext->GetContainer();
|
||||
nsCOMPtr<nsIDocShell> docshell(do_QueryInterface(container));
|
||||
if (!docshell || !docshell->GetIsInBrowserElement()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -550,7 +550,13 @@ pref("nglayout.debug.paint_flashing_chrome", false);
|
|||
// BasicLayers (other layer managers always update the entire widget area)
|
||||
pref("nglayout.debug.widget_update_flashing", false);
|
||||
|
||||
// Whether image visibility is enabled globally (ie we will try to unlock images
|
||||
// that are not visible).
|
||||
pref("layout.imagevisibility.enabled", true);
|
||||
// Whether image visibility is enabled in documents that are within a browser
|
||||
// element as defined by nsDocShell::FrameType and GetInheritedFrameType. This
|
||||
// pref only has an effect if layout.imagevisibility.enabled is false.
|
||||
pref("layout.imagevisibility.enabled_for_browser_elements_only", false);
|
||||
pref("layout.imagevisibility.numscrollportwidths", 0);
|
||||
pref("layout.imagevisibility.numscrollportheights", 1);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче