Bug 993930 - Do not assume TabChild::mInnerSize being (0, 0) means it's never been initialized. r=kats

This commit is contained in:
Botond Ballo 2014-04-25 11:40:23 -04:00
Родитель 0d4074194a
Коммит fe94a83a74
2 изменённых файлов: 13 добавлений и 7 удалений

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

@ -147,12 +147,6 @@ TabChildBase::InitializeRootMetrics()
mLastRootMetrics.SetScrollOffset(CSSPoint(0, 0));
}
bool
TabChildBase::HasValidInnerSize()
{
return (mInnerSize.width != 0) && (mInnerSize.height != 0);
}
void
TabChildBase::SetCSSViewport(const CSSSize& aSize)
{
@ -696,6 +690,7 @@ TabChild::TabChild(ContentChild* aManager, const TabContext& aContext, uint32_t
, mWaitingTouchListeners(false)
, mIgnoreKeyPressEvent(false)
, mActiveElementManager(new ActiveElementManager())
, mHasValidInnerSize(false)
{
if (!sActiveDurationMsSet) {
Preferences::AddIntVarCache(&sActiveDurationMs,
@ -1288,6 +1283,12 @@ TabChild::BrowserFrameProvideWindow(nsIDOMWindow* aOpener,
return NS_OK;
}
bool
TabChild::HasValidInnerSize()
{
return mHasValidInnerSize;
}
#ifdef DEBUG
PContentPermissionRequestChild*
TabChild:: SendPContentPermissionRequestConstructor(PContentPermissionRequestChild* aActor,
@ -1614,6 +1615,9 @@ TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const
bool initialSizing = !HasValidInnerSize()
&& (size.width != 0 && size.height != 0);
if (initialSizing) {
mHasValidInnerSize = true;
}
mOrientation = orientation;
mInnerSize = ScreenIntSize::FromUnknownSize(

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

@ -205,7 +205,6 @@ protected:
nsEventStatus DispatchWidgetEvent(WidgetGUIEvent& event);
bool HasValidInnerSize();
void InitializeRootMetrics();
mozilla::layers::FrameMetrics ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
@ -522,6 +521,8 @@ private:
bool* aWindowIsNew,
nsIDOMWindow** aReturn);
bool HasValidInnerSize();
class CachedFileDescriptorInfo;
class CachedFileDescriptorCallbackRunnable;
@ -560,6 +561,7 @@ private:
bool mIgnoreKeyPressEvent;
nsRefPtr<ActiveElementManager> mActiveElementManager;
bool mHasValidInnerSize;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};