#ifndef FrameView_h
#define FrameView_h
-#include "core/frame/AdjustViewSizeOrNot.h"
-#include "core/rendering/Pagination.h"
#include "core/rendering/PaintPhase.h"
#include "core/rendering/PartialLayoutState.h"
#include "platform/geometry/LayoutRect.h"
class RenderStyle;
class RenderWidget;
-Pagination::Mode paginationModeForRenderStyle(RenderStyle*);
-
typedef unsigned long long DOMTimeStamp;
class FrameView FINAL : public ScrollView {
void layout(bool allowSubtree = true);
bool didFirstLayout() const;
- void layoutTimerFired(Timer<FrameView>*);
void scheduleRelayout();
void scheduleRelayoutOfSubtree(RenderObject*);
- void unscheduleRelayout();
bool layoutPending() const;
- bool isInPerformLayout() const { return m_inPerformLayout; }
+ bool isInPerformLayout() const;
+
+ void setCanRepaintDuringPerformLayout(bool b) { m_canRepaintDuringPerformLayout = b; }
+ bool canRepaintDuringPerformLayout() const { return m_canRepaintDuringPerformLayout; }
RenderObject* layoutRoot(bool onlyDuringLayout = false) const;
void clearLayoutSubtreeRoot() { m_layoutSubtreeRoot = 0; }
bool needsLayout() const;
void setNeedsLayout();
- void setViewportConstrainedObjectsNeedLayout();
// Methods for getting/setting the size Blink should use to layout the contents.
IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
// This is different than visibleContentRect() in that it ignores negative (or overly positive)
// offsets from rubber-banding, and it takes zooming into account.
LayoutRect viewportConstrainedVisibleContentRect() const;
+ void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool heightChanged);
AtomicString mediaType() const;
void setMediaType(const AtomicString&);
bool hasEverPainted() const { return m_lastPaintTime; }
void setNodeToDraw(Node*);
+ bool isServicingAnimations() const { return m_servicingAnimations; }
+
virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE;
virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect) OVERRIDE;
virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&) OVERRIDE;
void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize);
void forceLayout(bool allowSubtree = false);
- void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor, AdjustViewSizeOrNot);
+ void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor);
bool scrollToFragment(const KURL&);
bool scrollToAnchor(const String&);
bool isScrollable();
enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
- void calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
+ void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
virtual IntPoint lastKnownMousePosition() const OVERRIDE;
bool shouldSetCursor() const;
// we need this function in order to do the scroll ourselves.
bool wheelEvent(const PlatformWheelEvent&);
- // Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
- // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all
- // FrameViews in the page cache, but FrameView::pagination() only affects the current
- // FrameView. FrameView::pagination() will return m_pagination if it has been set. Otherwise,
- // it will return Page::pagination() since currently there are no callers that need to
- // distinguish between the two.
- const Pagination& pagination() const;
- void setPagination(const Pagination&);
-
bool inProgrammaticScroll() const { return m_inProgrammaticScroll; }
void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScroll = programmaticScroll; }
void updateCanBlitOnScrollRecursively();
bool contentsInCompositedLayer() const;
- void applyOverflowToViewport(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
- void applyPaginationToViewport();
-
+ void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
- void paintControlTints();
-
void updateCounters();
void autoSizeIfEnabled();
void forceLayoutParentViewIfNeeded();
void gatherDebugLayoutRects(RenderObject* layoutRoot);
+ DocumentLifecycle& lifecycle() const;
+
virtual void repaintContentRectangle(const IntRect&) OVERRIDE;
virtual void contentsResized() OVERRIDE;
virtual void scrollbarExistenceDidChange() OVERRIDE;
void setLayoutSizeInternal(const IntSize&);
bool isSubtreeLayout() const { return !!m_layoutSubtreeRoot; }
+ bool repaintAllowed() const
+ {
+ if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+ return true;
+
+ return !isInPerformLayout() || canRepaintDuringPerformLayout();
+ }
static double s_currentFrameTimeStamp; // used for detecting decoded resource thrash in the cache
static bool s_inPaintContents;
bool m_contentIsOpaque;
unsigned m_slowRepaintObjectCount;
- Timer<FrameView> m_layoutTimer;
- bool m_delayedLayout;
+ bool m_hasPendingLayout;
RenderObject* m_layoutSubtreeRoot;
bool m_layoutSchedulingEnabled;
bool m_inPerformLayout;
+ bool m_canRepaintDuringPerformLayout;
bool m_doingPreLayoutStyleUpdate;
bool m_inSynchronousPostLayout;
int m_layoutCount;
bool m_verticalOverflow;
RenderObject* m_viewportRenderer;
- Pagination m_pagination;
-
bool m_wasScrolledByUser;
bool m_inProgrammaticScroll;
bool m_safeToPropagateScrollToParent;
bool m_hasSoftwareFilters;
+ bool m_servicingAnimations;
+
float m_visibleContentScaleFactor;
IntSize m_inputEventsOffsetForEmulation;
float m_inputEventsScaleFactorForEmulation;
DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFrameView());
+class AllowRepaintScope {
+public:
+ explicit AllowRepaintScope(FrameView* view)
+ : m_view(view)
+ , m_originalValue(view ? view->canRepaintDuringPerformLayout() : false)
+ {
+ if (!m_view)
+ return;
+
+ m_view->setCanRepaintDuringPerformLayout(true);
+ }
+
+ ~AllowRepaintScope()
+ {
+ if (!m_view)
+ return;
+
+ m_view->setCanRepaintDuringPerformLayout(m_originalValue);
+ }
+private:
+ FrameView* m_view;
+ bool m_originalValue;
+};
+
} // namespace WebCore
#endif // FrameView_h