зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1000350. Don't overwrite a layout set display port base with an APZC-guessed one. r=kats
APZC set ones are only meant to fill in the gaps, use them only if we have nothing else.
This commit is contained in:
Родитель
799148596a
Коммит
e6fdc0c9f4
|
@ -244,7 +244,7 @@ APZCCallbackHelper::UpdateRootFrame(nsIDOMWindowUtils* aUtils,
|
|||
baseCSS.y * nsPresContext::AppUnitsPerCSSPixel(),
|
||||
baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(),
|
||||
baseCSS.height * nsPresContext::AppUnitsPerCSSPixel());
|
||||
nsLayoutUtils::SetDisplayPortBase(content, base);
|
||||
nsLayoutUtils::SetDisplayPortBaseIfNotSet(content, base);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ APZCCallbackHelper::UpdateSubFrame(nsIContent* aContent,
|
|||
baseCSS.y * nsPresContext::AppUnitsPerCSSPixel(),
|
||||
baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(),
|
||||
baseCSS.height * nsPresContext::AppUnitsPerCSSPixel());
|
||||
nsLayoutUtils::SetDisplayPortBase(aContent, base);
|
||||
nsLayoutUtils::SetDisplayPortBaseIfNotSet(aContent, base);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -829,6 +829,14 @@ nsLayoutUtils::SetDisplayPortBase(nsIContent* aContent, const nsRect& aBase)
|
|||
nsINode::DeleteProperty<nsRect>);
|
||||
}
|
||||
|
||||
void
|
||||
nsLayoutUtils::SetDisplayPortBaseIfNotSet(nsIContent* aContent, const nsRect& aBase)
|
||||
{
|
||||
if (!aContent->GetProperty(nsGkAtoms::DisplayPortBase)) {
|
||||
SetDisplayPortBase(aContent, aBase);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::GetCriticalDisplayPort(nsIContent* aContent, nsRect* aResult)
|
||||
{
|
||||
|
|
|
@ -187,8 +187,11 @@ public:
|
|||
/**
|
||||
* Set the display port base rect for given element to be used with display
|
||||
* port margins.
|
||||
* SetDisplayPortBaseIfNotSet is like SetDisplayPortBase except it only sets
|
||||
* the display port base to aBase if no display port base is currently set.
|
||||
*/
|
||||
static void SetDisplayPortBase(nsIContent* aContent, const nsRect& aBase);
|
||||
static void SetDisplayPortBaseIfNotSet(nsIContent* aContent, const nsRect& aBase);
|
||||
|
||||
/**
|
||||
* Get the critical display port for the given element.
|
||||
|
|
Загрузка…
Ссылка в новой задаче