Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1996363003: Avoid calling updateAllLifecyclePhasesExceptPaint in SVGImage if not needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 1320b72676045aa6b71dc5cfc684c7875aa20a62..8888ad5729212b17f73f704eaaaa66b800f63db5 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1460,8 +1460,11 @@ void FrameView::restoreScrollbar()
setScrollbarsSuppressed(false);
}
-void FrameView::processUrlFragment(const KURL& url, UrlFragmentBehavior behavior)
+bool FrameView::processUrlFragment(const KURL& url, UrlFragmentBehavior behavior)
{
+ if (m_currentUrl == url && m_currentUrlFragmentBehavior == behavior)
fs 2016/05/23 21:25:56 Is the general gain great enough to store the url
chrishtr 2016/05/23 21:29:31 Indeed. The last point you made is probably a bug
+ return false;
+ m_currentUrl = url;
// If our URL has no ref, then we have no place we need to jump to.
// OTOH If CSS target was set previously, we want to set it to 0, recalc
// and possibly paint invalidation because :target pseudo class may have been
@@ -1469,16 +1472,15 @@ void FrameView::processUrlFragment(const KURL& url, UrlFragmentBehavior behavior
// Similarly for svg, if we had a previous svgView() then we need to reset
// the initial view if we don't have a fragment.
if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget() && !m_frame->document()->isSVGDocument())
- return;
-
+ return true;
String fragmentIdentifier = url.fragmentIdentifier();
if (processUrlFragmentHelper(fragmentIdentifier, behavior))
- return;
+ return true;
// Try again after decoding the ref, based on the document's encoding.
if (m_frame->document()->encoding().isValid())
processUrlFragmentHelper(decodeURLEscapeSequences(fragmentIdentifier, m_frame->document()->encoding()), behavior);
fs 2016/05/23 21:25:56 if (...) return processUrlFragmentHelp... retur
-
+ return true;
}
bool FrameView::processUrlFragmentHelper(const String& name, UrlFragmentBehavior behavior)

Powered by Google App Engine
This is Rietveld 408576698