<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[182805] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/182805">182805</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-04-14 12:22:35 -0700 (Tue, 14 Apr 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>FrameView::m_frame should be a Ref<Frame>
https://bugs.webkit.org/show_bug.cgi?id=143716
Reviewed by Andreas Kling.
FrameView::m_frame should be a Ref<Frame> instead of a RefPtr<Frame> as
it can never be null.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::hasCompositedContentIncludingDescendants):
(WebCore::FrameView::flushCompositingStateIncludingSubframes):
(WebCore::FrameView::updateCanBlitOnScrollRecursively):
(WebCore::FrameView::setIsOverlapped):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
(WebCore::FrameView::renderedCharactersExceed):
(WebCore::FrameView::updateLayerFlushThrottling):
(WebCore::FrameView::serviceScriptedAnimations):
(WebCore::FrameView::updateBackgroundRecursively):
(WebCore::FrameView::adjustScrollStepForFixedContent):
(WebCore::FrameView::paintContentsForSnapshot):
(WebCore::FrameView::notifyWidgetsInAllFrames):
(WebCore::FrameView::setExposedRect):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/FrameView.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182804 => 182805)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-14 19:15:28 UTC (rev 182804)
+++ trunk/Source/WebCore/ChangeLog        2015-04-14 19:22:35 UTC (rev 182805)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-04-14 Chris Dumez <cdumez@apple.com>
+
+ FrameView::m_frame should be a Ref<Frame>
+ https://bugs.webkit.org/show_bug.cgi?id=143716
+
+ Reviewed by Andreas Kling.
+
+ FrameView::m_frame should be a Ref<Frame> instead of a RefPtr<Frame> as
+ it can never be null.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::FrameView):
+ (WebCore::FrameView::flushCompositingStateForThisFrame):
+ (WebCore::FrameView::hasCompositedContentIncludingDescendants):
+ (WebCore::FrameView::flushCompositingStateIncludingSubframes):
+ (WebCore::FrameView::updateCanBlitOnScrollRecursively):
+ (WebCore::FrameView::setIsOverlapped):
+ (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
+ (WebCore::FrameView::renderedCharactersExceed):
+ (WebCore::FrameView::updateLayerFlushThrottling):
+ (WebCore::FrameView::serviceScriptedAnimations):
+ (WebCore::FrameView::updateBackgroundRecursively):
+ (WebCore::FrameView::adjustScrollStepForFixedContent):
+ (WebCore::FrameView::paintContentsForSnapshot):
+ (WebCore::FrameView::notifyWidgetsInAllFrames):
+ (WebCore::FrameView::setExposedRect):
+ (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
+ * page/FrameView.h:
+
</ins><span class="cx"> 2015-04-13 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS WK2] Interactive elements of developer.apple.com are broken
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (182804 => 182805)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-04-14 19:15:28 UTC (rev 182804)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-04-14 19:22:35 UTC (rev 182805)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FrameView::FrameView(Frame& frame)
</span><del>- : m_frame(&frame)
</del><ins>+ : m_frame(frame)
</ins><span class="cx"> , m_canHaveScrollbars(true)
</span><span class="cx"> , m_layoutTimer(*this, &FrameView::layoutTimerFired)
</span><span class="cx"> , m_layoutRoot(nullptr)
</span><span class="lines">@@ -909,7 +909,7 @@
</span><span class="cx"> tileCache->doPendingRepaints();
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- renderView->compositor().flushPendingLayerChanges(rootFrameForFlush == &frame());
</del><ins>+ renderView->compositor().flushPendingLayerChanges(rootFrameForFlush == m_frame.ptr());
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -1014,7 +1014,7 @@
</span><span class="cx">
</span><span class="cx"> bool FrameView::hasCompositedContentIncludingDescendants() const
</span><span class="cx"> {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> RenderView* renderView = frame->contentRenderer();
</span><span class="cx"> if (RenderLayerCompositor* compositor = renderView ? &renderView->compositor() : nullptr) {
</span><span class="cx"> if (compositor->inCompositingMode())
</span><span class="lines">@@ -1063,7 +1063,7 @@
</span><span class="cx"> {
</span><span class="cx"> bool allFramesFlushed = flushCompositingStateForThisFrame(&frame());
</span><span class="cx">
</span><del>- for (Frame* child = frame().tree().firstChild(); child; child = child->tree().traverseNext(&frame())) {
</del><ins>+ for (Frame* child = frame().tree().firstChild(); child; child = child->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> bool flushed = child->view()->flushCompositingStateForThisFrame(&frame());
</span><span class="cx"> allFramesFlushed &= flushed;
</span><span class="cx"> }
</span><span class="lines">@@ -1511,7 +1511,7 @@
</span><span class="cx">
</span><span class="cx"> void FrameView::updateCanBlitOnScrollRecursively()
</span><span class="cx"> {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> if (FrameView* view = frame->view())
</span><span class="cx"> view->setCanBlitOnScroll(!view->useSlowRepaints());
</span><span class="cx"> }
</span><span class="lines">@@ -1915,7 +1915,7 @@
</span><span class="cx"> if (RenderLayerCompositor::allowsIndependentlyCompositedFrames(this)) {
</span><span class="cx"> // We also need to trigger reevaluation for this and all descendant frames,
</span><span class="cx"> // since a frame uses compositing if any ancestor is compositing.
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> if (RenderView* view = frame->contentRenderer()) {
</span><span class="cx"> RenderLayerCompositor& compositor = view->compositor();
</span><span class="cx"> compositor.setCompositingLayersNeedRebuild();
</span><span class="lines">@@ -2177,7 +2177,7 @@
</span><span class="cx"> if (!page)
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- if (&page->mainFrame() != &frame())
</del><ins>+ if (&page->mainFrame() != m_frame.ptr())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator();
</span><span class="lines">@@ -2294,9 +2294,9 @@
</span><span class="cx">
</span><span class="cx"> bool FrameView::renderedCharactersExceed(unsigned threshold)
</span><span class="cx"> {
</span><del>- if (!m_frame->contentRenderer())
</del><ins>+ if (!frame().contentRenderer())
</ins><span class="cx"> return false;
</span><del>- return countRenderedCharactersInRenderObjectWithThreshold(*m_frame->contentRenderer(), threshold) >= threshold;
</del><ins>+ return countRenderedCharactersInRenderObjectWithThreshold(*frame().contentRenderer(), threshold) >= threshold;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FrameView::availableContentSizeChanged(AvailableSizeChangeReason reason)
</span><span class="lines">@@ -2400,7 +2400,7 @@
</span><span class="cx"> if (page->chrome().client().adjustLayerFlushThrottling(flags))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> if (RenderView* renderView = frame->contentRenderer())
</span><span class="cx"> renderView->compositor().setLayerFlushThrottlingEnabled(flags & LayerFlushThrottleState::Enabled);
</span><span class="cx"> }
</span><span class="lines">@@ -2635,13 +2635,13 @@
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="cx"> void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime)
</span><span class="cx"> {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext()) {
</ins><span class="cx"> frame->view()->serviceScrollAnimations();
</span><span class="cx"> frame->animation().serviceAnimations();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<RefPtr<Document>> documents;
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext())
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext())
</ins><span class="cx"> documents.append(frame->document());
</span><span class="cx">
</span><span class="cx"> for (size_t i = 0; i < documents.size(); ++i)
</span><span class="lines">@@ -2699,7 +2699,7 @@
</span><span class="cx">
</span><span class="cx"> void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool transparent)
</span><span class="cx"> {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> if (FrameView* view = frame->view()) {
</span><span class="cx"> view->setTransparent(transparent);
</span><span class="cx"> view->setBaseBackgroundColor(backgroundColor);
</span><span class="lines">@@ -3356,7 +3356,7 @@
</span><span class="cx"> return step;
</span><span class="cx">
</span><span class="cx"> TrackedRendererListHashSet* positionedObjects = nullptr;
</span><del>- if (RenderView* root = m_frame->contentRenderer()) {
</del><ins>+ if (RenderView* root = frame().contentRenderer()) {
</ins><span class="cx"> if (!root->hasPositionedObjects())
</span><span class="cx"> return step;
</span><span class="cx"> positionedObjects = root->positionedObjects();
</span><span class="lines">@@ -3982,7 +3982,7 @@
</span><span class="cx"> // in the render tree only. This will allow us to restore the selection from the DOM
</span><span class="cx"> // after we paint the snapshot.
</span><span class="cx"> if (shouldPaintSelection == ExcludeSelection) {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> if (RenderView* root = frame->contentRenderer())
</span><span class="cx"> root->clearSelection();
</span><span class="cx"> }
</span><span class="lines">@@ -3998,7 +3998,7 @@
</span><span class="cx">
</span><span class="cx"> // Restore selection.
</span><span class="cx"> if (shouldPaintSelection == ExcludeSelection) {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get()))
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr()))
</ins><span class="cx"> frame->selection().updateAppearance();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4492,7 +4492,7 @@
</span><span class="cx">
</span><span class="cx"> void FrameView::notifyWidgetsInAllFrames(WidgetNotification notification)
</span><span class="cx"> {
</span><del>- for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
</del><ins>+ for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
</ins><span class="cx"> if (FrameView* view = frame->view())
</span><span class="cx"> view->notifyWidgets(notification);
</span><span class="cx"> }
</span><span class="lines">@@ -4763,7 +4763,7 @@
</span><span class="cx"> m_exposedRect = exposedRect;
</span><span class="cx">
</span><span class="cx"> // FIXME: We should support clipping to the exposed rect for subframes as well.
</span><del>- if (!m_frame->isMainFrame())
</del><ins>+ if (!frame().isMainFrame())
</ins><span class="cx"> return;
</span><span class="cx"> if (TiledBacking* tiledBacking = this->tiledBacking()) {
</span><span class="cx"> adjustTiledBackingCoverage();
</span><span class="lines">@@ -4784,7 +4784,7 @@
</span><span class="cx"> m_overrideViewportSize = size;
</span><span class="cx"> m_hasOverrideViewportSize = true;
</span><span class="cx">
</span><del>- if (Document* document = m_frame->document()) {
</del><ins>+ if (Document* document = frame().document()) {
</ins><span class="cx"> // FIXME: this should probably be updateViewportUnitsOnResize(), but synchronously
</span><span class="cx"> // dirtying style here causes assertions on iOS (rdar://problem/19998166).
</span><span class="cx"> document->styleResolverChanged(DeferRecalcStyle);
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (182804 => 182805)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2015-04-14 19:15:28 UTC (rev 182804)
+++ trunk/Source/WebCore/page/FrameView.h        2015-04-14 19:22:35 UTC (rev 182805)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> virtual bool scheduleAnimation() override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- Frame& frame() const { return *m_frame; }
</del><ins>+ Frame& frame() const { return const_cast<Frame&>(m_frame.get()); }
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT RenderView* renderView() const;
</span><span class="cx">
</span><span class="lines">@@ -659,7 +659,7 @@
</span><span class="cx"> LayoutSize m_margins;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<ListHashSet<RenderEmbeddedObject*>> m_embeddedObjectsToUpdate;
</span><del>- const RefPtr<Frame> m_frame;
</del><ins>+ const Ref<Frame> m_frame;
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<HashSet<RenderElement*>> m_slowRepaintObjects;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>