зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1365830 - Don't flush layout for (0, 0) in nsGlobalWindow::ScrollTo(); r=bzbarsky
Accurate layout information for this operation isn't ever needed.
This commit is contained in:
Родитель
ce1514ce6c
Коммит
1a146ac9e1
|
@ -8433,7 +8433,14 @@ nsGlobalWindow::ScrollTo(double aXScroll, double aYScroll)
|
|||
void
|
||||
nsGlobalWindow::ScrollTo(const ScrollToOptions& aOptions)
|
||||
{
|
||||
FlushPendingNotifications(FlushType::Layout);
|
||||
// When scrolling to a non-zero offset, we need to determine whether that
|
||||
// position is within our scrollable range, so we need updated layout
|
||||
// information which requires a layout flush, otherwise all we need is to
|
||||
// flush frames to be able to access our scrollable frame here.
|
||||
FlushType flushType = (aScroll.x || aScroll.y) ?
|
||||
FlushType::Layout :
|
||||
FlushType::Frames;
|
||||
FlushPendingNotifications(flushType);
|
||||
nsIScrollableFrame *sf = GetScrollFrame();
|
||||
|
||||
if (sf) {
|
||||
|
@ -8459,7 +8466,14 @@ void
|
|||
nsGlobalWindow::ScrollTo(const CSSIntPoint& aScroll,
|
||||
const ScrollOptions& aOptions)
|
||||
{
|
||||
FlushPendingNotifications(FlushType::Layout);
|
||||
// When scrolling to a non-zero offset, we need to determine whether that
|
||||
// position is within our scrollable range, so we need updated layout
|
||||
// information which requires a layout flush, otherwise all we need is to
|
||||
// flush frames to be able to access our scrollable frame here.
|
||||
FlushType flushType = (aScroll.x || aScroll.y) ?
|
||||
FlushType::Layout :
|
||||
FlushType::Frames;
|
||||
FlushPendingNotifications(flushType);
|
||||
nsIScrollableFrame *sf = GetScrollFrame();
|
||||
|
||||
if (sf) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче