Fix displayport bounds not being computed from the correct origin. (bug 1109949, r=tn)

This commit is contained in:
David Anderson 2014-12-11 21:13:10 -08:00
Родитель 31b61e551f
Коммит b3dce254a5
2 изменённых файлов: 6 добавлений и 11 удалений

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

@ -234,8 +234,8 @@ public:
// The following metrics are all in widget space/device pixels. // The following metrics are all in widget space/device pixels.
// //
// This is the area within the widget that we're compositing to. It is relative // This is the area within the widget that we're compositing to. It is in the
// to the layer tree origin. // same coordinate space as the reference frame for the scrolled frame.
// //
// This is useful because, on mobile, the viewport and composition dimensions // This is useful because, on mobile, the viewport and composition dimensions
// are not always the same. In this case, we calculate the displayport using // are not always the same. In this case, we calculate the displayport using
@ -256,11 +256,8 @@ public:
// space, so each is explained separately. // space, so each is explained separately.
// //
// The area of a frame's contents that has been painted, relative to the // The area of a frame's contents that has been painted, relative to
// viewport. It is in the same coordinate space as |mViewport|. For example, // mCompositionBounds.
// if it is at 0,0, then it's at the same place at the viewport, which is at
// the top-left in the layer, and at the same place as the scroll offset of
// the document.
// //
// Note that this is structured in such a way that it doesn't depend on the // Note that this is structured in such a way that it doesn't depend on the
// method layout uses to scroll content. // method layout uses to scroll content.

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

@ -164,8 +164,7 @@ APZCCallbackHelper::UpdateRootFrame(nsIDOMWindowUtils* aUtils,
margins.bottom, margins.bottom,
element, 0); element, 0);
CSSRect baseCSS = aMetrics.CalculateCompositedRectInCssPixels(); CSSRect baseCSS = aMetrics.CalculateCompositedRectInCssPixels();
nsRect base(baseCSS.x * nsPresContext::AppUnitsPerCSSPixel(), nsRect base(0, 0,
baseCSS.y * nsPresContext::AppUnitsPerCSSPixel(),
baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(), baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(),
baseCSS.height * nsPresContext::AppUnitsPerCSSPixel()); baseCSS.height * nsPresContext::AppUnitsPerCSSPixel());
nsLayoutUtils::SetDisplayPortBaseIfNotSet(content, base); nsLayoutUtils::SetDisplayPortBaseIfNotSet(content, base);
@ -208,8 +207,7 @@ APZCCallbackHelper::UpdateSubFrame(nsIContent* aContent,
margins.bottom, margins.bottom,
element, 0); element, 0);
CSSRect baseCSS = aMetrics.CalculateCompositedRectInCssPixels(); CSSRect baseCSS = aMetrics.CalculateCompositedRectInCssPixels();
nsRect base(baseCSS.x * nsPresContext::AppUnitsPerCSSPixel(), nsRect base(0, 0,
baseCSS.y * nsPresContext::AppUnitsPerCSSPixel(),
baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(), baseCSS.width * nsPresContext::AppUnitsPerCSSPixel(),
baseCSS.height * nsPresContext::AppUnitsPerCSSPixel()); baseCSS.height * nsPresContext::AppUnitsPerCSSPixel());
nsLayoutUtils::SetDisplayPortBaseIfNotSet(aContent, base); nsLayoutUtils::SetDisplayPortBaseIfNotSet(aContent, base);