Skip to content

Commit

Permalink
[viewport] Don't recalculate viewport until before-first-paint is emi…
Browse files Browse the repository at this point in the history
…tted
  • Loading branch information
rojkov committed Dec 15, 2014
1 parent 25a92e7 commit 9443ea2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion embedding/embedlite/embedthread/EmbedLiteViewThreadChild.cpp
Expand Up @@ -915,8 +915,11 @@ EmbedLiteViewThreadChild::RecvInputDataTouchMoveEvent(const ScrollableLayerGuid&
}

NS_IMETHODIMP
EmbedLiteViewThreadChild::OnLocationChanged(const char* aLocation, bool aCanGoBack, bool aCanGoForward)
EmbedLiteViewThreadChild::OnLocationChanged(const char* aLocation, bool aCanGoBack, bool aCanGoForward, bool aIsSameDocument)
{
if (!aIsSameDocument) {
mHelper->mContentDocumentIsDisplayed = false;
}
return SendOnLocationChanged(nsDependentCString(aLocation), aCanGoBack, aCanGoForward) ? NS_OK : NS_ERROR_FAILURE;
}

Expand Down
4 changes: 3 additions & 1 deletion embedding/embedlite/utils/WebBrowserChrome.cpp
Expand Up @@ -303,7 +303,9 @@ WebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress,
navigation->GetCanGoBack(&canGoBack);
navigation->GetCanGoForward(&canGoForward);

mListener->OnLocationChanged(spec.get(), canGoBack, canGoForward);
bool isSameDocument = aFlags & nsIWebProgressListener::LOCATION_CHANGE_SAME_DOCUMENT;

mListener->OnLocationChanged(spec.get(), canGoBack, canGoForward, isSameDocument);

// Keep track of hash changes
mLocationHasChanged = slocation.Equals(mLastLocation);
Expand Down
3 changes: 2 additions & 1 deletion embedding/embedlite/utils/nsIEmbedBrowserChromeListener.idl
Expand Up @@ -17,7 +17,8 @@
[scriptable, uuid(ff88f95e-48d9-11e2-bca5-6b3dfc3f4672)]
interface nsIEmbedBrowserChromeListener
{
void onLocationChanged(in string aLocation, in boolean aCanGoBack, in boolean aCanGoForward);
void onLocationChanged(in string aLocation, in boolean aCanGoBack,
in boolean aCanGoForward, in boolean aIsSameDocument);
void onLoadStarted(in string aLocation);
void onLoadFinished();
void onLoadRedirect();
Expand Down

0 comments on commit 9443ea2

Please sign in to comment.