Title: [188305] trunk/Source/WebCore
Revision
188305
Author
[email protected]
Date
2015-08-11 16:00:00 -0700 (Tue, 11 Aug 2015)

Log Message

Use more references in FrameView.
https://bugs.webkit.org/show_bug.cgi?id=147899

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::flushCompositingStateIncludingSubframes):
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::scrollElementToRect):
* page/FrameView.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::imageChanged):
* testing/Internals.cpp:
(WebCore::Internals::scrollElementToRect):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188304 => 188305)


--- trunk/Source/WebCore/ChangeLog	2015-08-11 22:47:30 UTC (rev 188304)
+++ trunk/Source/WebCore/ChangeLog	2015-08-11 23:00:00 UTC (rev 188305)
@@ -1,5 +1,27 @@
 2015-08-11  Zalan Bujtas  <[email protected]>
 
+        Use more references in FrameView.
+        https://bugs.webkit.org/show_bug.cgi?id=147899
+
+        Reviewed by Simon Fraser.
+
+        No change in functionality.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::flushCompositingStateForThisFrame):
+        (WebCore::FrameView::flushCompositingStateIncludingSubframes):
+        (WebCore::FrameView::addSlowRepaintObject):
+        (WebCore::FrameView::scrollElementToRect):
+        * page/FrameView.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::willBeDestroyed):
+        * rendering/RenderScrollbarPart.cpp:
+        (WebCore::RenderScrollbarPart::imageChanged):
+        * testing/Internals.cpp:
+        (WebCore::Internals::scrollElementToRect):
+
+2015-08-11  Zalan Bujtas  <[email protected]>
+
         Invalid FrameView::m_viewportRenderer after layout is finished.
         https://bugs.webkit.org/show_bug.cgi?id=147848
         rdar://problem/22205197

Modified: trunk/Source/WebCore/page/FrameView.cpp (188304 => 188305)


--- trunk/Source/WebCore/page/FrameView.cpp	2015-08-11 22:47:30 UTC (rev 188304)
+++ trunk/Source/WebCore/page/FrameView.cpp	2015-08-11 23:00:00 UTC (rev 188305)
@@ -980,7 +980,7 @@
 }
 #endif
 
-bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)
+bool FrameView::flushCompositingStateForThisFrame(const Frame& rootFrameForFlush)
 {
     RenderView* renderView = this->renderView();
     if (!renderView)
@@ -998,8 +998,7 @@
         tileCache->doPendingRepaints();
 #endif
 
-    renderView->compositor().flushPendingLayerChanges(rootFrameForFlush == m_frame.ptr());
-
+    renderView->compositor().flushPendingLayerChanges(&rootFrameForFlush == m_frame.ptr());
     return true;
 }
 
@@ -1126,12 +1125,12 @@
 {
     InspectorInstrumentation::willComposite(frame());
 
-    bool allFramesFlushed = flushCompositingStateForThisFrame(&frame());
+    bool allFramesFlushed = flushCompositingStateForThisFrame(frame());
 
     for (Frame* child = frame().tree().firstRenderedChild(); child; child = child->tree().traverseNextRendered(m_frame.ptr())) {
         if (!child->view())
             continue;
-        bool flushed = child->view()->flushCompositingStateForThisFrame(&frame());
+        bool flushed = child->view()->flushCompositingStateForThisFrame(frame());
         allFramesFlushed &= flushed;
     }
     return allFramesFlushed;
@@ -1625,7 +1624,7 @@
     bool hadSlowRepaintObjects = hasSlowRepaintObjects();
 
     if (!m_slowRepaintObjects)
-        m_slowRepaintObjects = std::make_unique<HashSet<RenderElement*>>();
+        m_slowRepaintObjects = std::make_unique<HashSet<const RenderElement*>>();
 
     m_slowRepaintObjects->add(o);
 
@@ -2079,12 +2078,12 @@
         scrollToAnchor();
 }
 
-void FrameView::scrollElementToRect(Element* element, const IntRect& rect)
+void FrameView::scrollElementToRect(const Element& element, const IntRect& rect)
 {
     frame().document()->updateLayoutIgnorePendingStylesheets();
 
     LayoutRect bounds;
-    if (RenderElement* renderer = element->renderer())
+    if (RenderElement* renderer = element.renderer())
         bounds = renderer->anchorRect();
     int centeringOffsetX = (rect.width() - bounds.width()) / 2;
     int centeringOffsetY = (rect.height() - bounds.height()) / 2;

Modified: trunk/Source/WebCore/page/FrameView.h (188304 => 188305)


--- trunk/Source/WebCore/page/FrameView.h	2015-08-11 22:47:30 UTC (rev 188304)
+++ trunk/Source/WebCore/page/FrameView.h	2015-08-11 23:00:00 UTC (rev 188305)
@@ -155,7 +155,6 @@
     void willRecalcStyle();
     bool updateCompositingLayersAfterStyleChange();
     void updateCompositingLayersAfterLayout();
-    bool flushCompositingStateForThisFrame(Frame* rootFrameForFlush);
 
     void clearBackingStores();
     void restoreBackingStores();
@@ -265,7 +264,7 @@
 
     void addSlowRepaintObject(RenderElement*);
     void removeSlowRepaintObject(RenderElement*);
-    bool hasSlowRepaintObject(RenderElement* o) const { return m_slowRepaintObjects && m_slowRepaintObjects->contains(o); }
+    bool hasSlowRepaintObject(const RenderElement& renderer) const { return m_slowRepaintObjects && m_slowRepaintObjects->contains(&renderer); }
     bool hasSlowRepaintObjects() const { return m_slowRepaintObjects && m_slowRepaintObjects->size(); }
 
     // Includes fixed- and sticky-position objects.
@@ -404,7 +403,7 @@
     bool scrollToFragment(const URL&);
     bool scrollToAnchor(const String&);
     void maintainScrollPositionAtAnchor(ContainerNode*);
-    WEBCORE_EXPORT void scrollElementToRect(Element*, const IntRect&);
+    WEBCORE_EXPORT void scrollElementToRect(const Element&, const IntRect&);
 
     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
     WEBCORE_EXPORT IntRect convertFromRendererToContainingView(const RenderElement*, const IntRect&) const;
@@ -418,7 +417,7 @@
     virtual IntPoint convertToContainingView(const IntPoint&) const override;
     virtual IntPoint convertFromContainingView(const IntPoint&) const override;
 
-    bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; }
+    bool isFrameViewScrollCorner(const RenderScrollbarPart& scrollCorner) const { return m_scrollCorner == &scrollCorner; }
 
     // isScrollable() takes an optional Scrollability parameter that allows the caller to define what they mean by 'scrollable.'
     // Most callers are interested in the default value, Scrollability::Scrollable, which means that there is actually content
@@ -589,6 +588,7 @@
     bool shouldLayoutAfterContentsResized() const;
 
     bool shouldUpdateCompositingLayersAfterScrolling() const;
+    bool flushCompositingStateForThisFrame(const Frame& rootFrameForFlush);
 
     virtual bool shouldDeferScrollUpdateAfterContentSizeChange() override;
 
@@ -687,7 +687,7 @@
     std::unique_ptr<ListHashSet<RenderEmbeddedObject*>> m_embeddedObjectsToUpdate;
     const Ref<Frame> m_frame;
 
-    std::unique_ptr<HashSet<RenderElement*>> m_slowRepaintObjects;
+    std::unique_ptr<HashSet<const RenderElement*>> m_slowRepaintObjects;
 
     bool m_needsFullRepaint;
     

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (188304 => 188305)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2015-08-11 22:47:30 UTC (rev 188304)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2015-08-11 23:00:00 UTC (rev 188305)
@@ -1539,7 +1539,7 @@
 
     removeFromParent();
 
-    ASSERT(documentBeingDestroyed() || !is<RenderElement>(*this) || !view().frameView().hasSlowRepaintObject(downcast<RenderElement>(this)));
+    ASSERT(documentBeingDestroyed() || !is<RenderElement>(*this) || !view().frameView().hasSlowRepaintObject(downcast<RenderElement>(*this)));
 
     // The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render
     // object for this renderer. So we remove the AX render object now, after the renderer is removed.

Modified: trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp (188304 => 188305)


--- trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp	2015-08-11 22:47:30 UTC (rev 188304)
+++ trunk/Source/WebCore/rendering/RenderScrollbarPart.cpp	2015-08-11 23:00:00 UTC (rev 188305)
@@ -146,7 +146,7 @@
     if (m_scrollbar && m_part != NoPart)
         m_scrollbar->theme()->invalidatePart(*m_scrollbar, m_part);
     else {
-        if (view().frameView().isFrameViewScrollCorner(this)) {
+        if (view().frameView().isFrameViewScrollCorner(*this)) {
             view().frameView().invalidateScrollCorner(view().frameView().scrollCornerRect());
             return;
         }

Modified: trunk/Source/WebCore/testing/Internals.cpp (188304 => 188305)


--- trunk/Source/WebCore/testing/Internals.cpp	2015-08-11 22:47:30 UTC (rev 188304)
+++ trunk/Source/WebCore/testing/Internals.cpp	2015-08-11 23:00:00 UTC (rev 188305)
@@ -1183,7 +1183,7 @@
         return;
     }
     FrameView* frameView = element->document().view();
-    frameView->scrollElementToRect(element, IntRect(x, y, w, h));
+    frameView->scrollElementToRect(*element, IntRect(x, y, w, h));
 }
 
 void Internals::paintControlTints(ExceptionCode& ec)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to