зеркало из https://github.com/mozilla/pjs.git
Bug 337356 - Page zoom breaks if content policy accesses frame's document, r+sr=bzbarsky
This commit is contained in:
Родитель
360de6dd63
Коммит
113b25f6aa
|
@ -414,6 +414,8 @@ protected:
|
||||||
|
|
||||||
nsIWidget* mParentWidget; // purposely won't be ref counted
|
nsIWidget* mParentWidget; // purposely won't be ref counted
|
||||||
|
|
||||||
|
float mTextZoom; // Text zoom, defaults to 1.0
|
||||||
|
|
||||||
PRInt16 mNumURLStarts;
|
PRInt16 mNumURLStarts;
|
||||||
PRInt16 mDestroyRefCount; // a second "refcount" for the document viewer's "destroy"
|
PRInt16 mDestroyRefCount; // a second "refcount" for the document viewer's "destroy"
|
||||||
|
|
||||||
|
@ -512,7 +514,8 @@ DocumentViewerImpl::DocumentViewerImpl(nsPresContext* aPresContext)
|
||||||
: mPresContext(aPresContext),
|
: mPresContext(aPresContext),
|
||||||
mIsSticky(PR_TRUE),
|
mIsSticky(PR_TRUE),
|
||||||
mHintCharsetSource(kCharsetUninitialized),
|
mHintCharsetSource(kCharsetUninitialized),
|
||||||
mIsPageMode(PR_FALSE)
|
mIsPageMode(PR_FALSE),
|
||||||
|
mTextZoom(1.0)
|
||||||
{
|
{
|
||||||
PrepareToStartLoad();
|
PrepareToStartLoad();
|
||||||
}
|
}
|
||||||
|
@ -694,6 +697,7 @@ DocumentViewerImpl::InitPresentationStuff(PRBool aDoInitialReflow)
|
||||||
|
|
||||||
mViewManager->DisableRefresh();
|
mViewManager->DisableRefresh();
|
||||||
mViewManager->SetWindowDimensions(width, height);
|
mViewManager->SetWindowDimensions(width, height);
|
||||||
|
mPresContext->SetTextZoom(mTextZoom);
|
||||||
|
|
||||||
// Setup default view manager background color
|
// Setup default view manager background color
|
||||||
|
|
||||||
|
@ -2732,6 +2736,8 @@ SetChildTextZoom(nsIMarkupDocumentViewer* aChild, void* aClosure)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
DocumentViewerImpl::SetTextZoom(float aTextZoom)
|
DocumentViewerImpl::SetTextZoom(float aTextZoom)
|
||||||
{
|
{
|
||||||
|
mTextZoom = aTextZoom;
|
||||||
|
|
||||||
if (mViewManager) {
|
if (mViewManager) {
|
||||||
mViewManager->BeginUpdateViewBatch();
|
mViewManager->BeginUpdateViewBatch();
|
||||||
}
|
}
|
||||||
|
@ -2759,13 +2765,10 @@ NS_IMETHODIMP
|
||||||
DocumentViewerImpl::GetTextZoom(float* aTextZoom)
|
DocumentViewerImpl::GetTextZoom(float* aTextZoom)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aTextZoom);
|
NS_ENSURE_ARG_POINTER(aTextZoom);
|
||||||
|
NS_ASSERTION(!mPresContext || mPresContext->TextZoom() == mTextZoom,
|
||||||
|
"mPresContext->TextZoom() != mTextZoom");
|
||||||
|
|
||||||
if (mPresContext) {
|
*aTextZoom = mTextZoom;
|
||||||
*aTextZoom = mPresContext->TextZoom();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
*aTextZoom = 1.0;
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче