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:
Timothy Nikkel 2014-04-26 00:13:36 -05:00
Родитель 799148596a
Коммит e6fdc0c9f4
3 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -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.