Bug 1075670 - Cleanup content process widget-chrome behavior. r=smaug

Math for window chrome calculation was off on Linux. Removed redundant, and incorrect, math in favor of other better functions.
This commit is contained in:
David Parks 2015-01-30 15:55:27 -08:00
Родитель d907d3e0f0
Коммит 72b5e35b57
5 изменённых файлов: 7 добавлений и 35 удалений

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

@ -914,8 +914,7 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size,
// Don't show remote iframe if we are waiting for the completion of reflow.
if (!aFrame || !(aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
nsIntPoint chromeDisp = aFrame->GetChromeDisplacement();
mRemoteBrowser->UpdateDimensions(dimensions, size, chromeDisp);
mRemoteBrowser->UpdateDimensions(dimensions, size);
}
}
@ -1960,8 +1959,7 @@ nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame *aIFrame)
nsIntSize size = aIFrame->GetSubdocumentSize();
nsIntRect dimensions;
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
nsIntPoint chromeDisp = aIFrame->GetChromeDisplacement();
mRemoteBrowser->UpdateDimensions(dimensions, size, chromeDisp);
mRemoteBrowser->UpdateDimensions(dimensions, size);
}
return NS_OK;
}

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

@ -907,8 +907,7 @@ TabParent::RecvSetDimensions(const uint32_t& aFlags,
}
void
TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
const nsIntPoint& aChromeDisp)
TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size)
{
if (mIsDestroyed) {
return;
@ -923,9 +922,9 @@ TabParent::UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
mRect = rect;
mDimensions = size;
mOrientation = orientation;
mChromeDisp = aChromeDisp;
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation, mChromeDisp);
nsIntPoint chromeOffset = -GetChildProcessOffset();
unused << SendUpdateDimensions(mRect, mDimensions, mOrientation, chromeOffset);
}
}
@ -2707,7 +2706,7 @@ TabParent::HandleEvent(nsIDOMEvent* aEvent)
}
nsIntRect windowDims;
NS_ENSURE_SUCCESS(frameLoader->GetWindowDimensions(windowDims), NS_ERROR_FAILURE);
UpdateDimensions(windowDims, mDimensions, mChromeDisp);
UpdateDimensions(windowDims, mDimensions);
return NS_OK;
}
return NS_OK;

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

@ -247,8 +247,7 @@ public:
// message-sending functions under a layer of indirection and
// eating the return values
void Show(const nsIntSize& size, bool aParentIsActive);
void UpdateDimensions(const nsIntRect& rect, const nsIntSize& size,
const nsIntPoint& chromeDisp);
void UpdateDimensions(const nsIntRect& rect, const nsIntSize& size);
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
void UIResolutionChanged();
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
@ -445,7 +444,6 @@ protected:
nsIntRect mRect;
nsIntSize mDimensions;
ScreenOrientation mOrientation;
nsIntPoint mChromeDisp;
float mDPI;
CSSToLayoutDeviceScale mDefaultScale;
bool mShown;

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

@ -1274,24 +1274,3 @@ nsSubDocumentFrame::ObtainIntrinsicSizeFrame()
}
return nullptr;
}
nsIntPoint
nsSubDocumentFrame::GetChromeDisplacement()
{
nsIFrame* nextFrame = nsLayoutUtils::GetCrossDocParentFrame(this);
if (!nextFrame) {
NS_WARNING("Couldn't find window chrome to calculate displacement to.");
return nsIntPoint();
}
nsIFrame* rootFrame = nextFrame;
while (nextFrame) {
rootFrame = nextFrame;
nextFrame = nsLayoutUtils::GetCrossDocParentFrame(rootFrame);
}
nsPoint offset = GetOffsetToCrossDoc(rootFrame);
int32_t appUnitsPerDevPixel = rootFrame->PresContext()->AppUnitsPerDevPixel();
return nsIntPoint((int)(offset.x/appUnitsPerDevPixel),
(int)(offset.y/appUnitsPerDevPixel));
}

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

@ -127,8 +127,6 @@ public:
*/
bool PassPointerEventsToChildren();
nsIntPoint GetChromeDisplacement();
protected:
friend class AsyncFrameInit;