summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/Frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page/Frame.h')
-rw-r--r--Source/WebCore/page/Frame.h645
1 files changed, 303 insertions, 342 deletions
diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h
index eff8e141d..fb40aa267 100644
--- a/Source/WebCore/page/Frame.h
+++ b/Source/WebCore/page/Frame.h
@@ -5,7 +5,7 @@
* 2000-2001 Simon Hausmann <hausmann@kde.org>
* 2000-2001 Dirk Mueller <mueller@kde.org>
* 2000 Stefan Schimanski <1Stein@gmx.de>
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2008 Eric Seidel <eric@webkit.org>
*
@@ -25,8 +25,7 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef Frame_h
-#define Frame_h
+#pragma once
#include "AdjustViewSizeOrNot.h"
#include "FrameLoader.h"
@@ -35,7 +34,8 @@
#include "NavigationScheduler.h"
#include "ScrollTypes.h"
#include "UserScriptTypes.h"
-#include <wtf/RefCounted.h>
+#include <memory>
+#include <wtf/ThreadSafeRefCounted.h>
#if PLATFORM(IOS)
#include "ViewportArguments.h"
@@ -46,15 +46,8 @@
#include "FrameWin.h"
#endif
-#if USE(TILED_BACKING_STORE)
-#include "TiledBackingStoreClient.h"
-#endif
-
-#if PLATFORM(IOS)
-OBJC_CLASS DOMCSSStyleDeclaration;
-OBJC_CLASS DOMNode;
+#if PLATFORM(COCOA)
OBJC_CLASS NSArray;
-OBJC_CLASS NSString;
#endif
#if PLATFORM(WIN)
@@ -67,389 +60,357 @@ class RegularExpression;
namespace WebCore {
- class AnimationController;
- class Color;
- class Document;
- class Editor;
- class Element;
- class EventHandler;
- class FloatSize;
- class FrameDestructionObserver;
- class FrameSelection;
- class FrameView;
- class HTMLFrameOwnerElement;
- class HTMLTableCellElement;
- class HitTestResult;
- class ImageBuffer;
- class IntRect;
- class MainFrame;
- class Node;
- class Range;
- class RenderLayer;
- class RenderView;
- class RenderWidget;
- class ScriptController;
- class Settings;
- class TiledBackingStore;
- class VisiblePosition;
- class Widget;
+class CSSAnimationController;
+class Color;
+class Document;
+class Editor;
+class Element;
+class EventHandler;
+class FloatSize;
+class FrameDestructionObserver;
+class FrameSelection;
+class FrameView;
+class HTMLFrameOwnerElement;
+class HTMLTableCellElement;
+class HitTestResult;
+class ImageBuffer;
+class IntRect;
+class MainFrame;
+class Node;
+class Range;
+class RenderLayer;
+class RenderView;
+class RenderWidget;
+class ScriptController;
+class Settings;
+class VisiblePosition;
+class Widget;
#if PLATFORM(IOS)
- enum {
- OverflowScrollNone = 0,
- OverflowScrollLeft = 1 << 0,
- OverflowScrollRight = 1 << 1,
- OverflowScrollUp = 1 << 2,
- OverflowScrollDown = 1 << 3
- };
-
- enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };
- typedef Node* (*NodeQualifier)(const HitTestResult&, Node* terminationNode, IntRect* nodeBounds);
+enum {
+ OverflowScrollNone = 0,
+ OverflowScrollLeft = 1 << 0,
+ OverflowScrollRight = 1 << 1,
+ OverflowScrollUp = 1 << 2,
+ OverflowScrollDown = 1 << 3
+};
+
+enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };
+typedef Node* (*NodeQualifier)(const HitTestResult&, Node* terminationNode, IntRect* nodeBounds);
#endif
-#if !USE(TILED_BACKING_STORE)
- class TiledBackingStoreClient { };
-#endif
-
- enum {
- LayerTreeFlagsIncludeDebugInfo = 1 << 0,
- LayerTreeFlagsIncludeVisibleRects = 1 << 1,
- LayerTreeFlagsIncludeTileCaches = 1 << 2,
- LayerTreeFlagsIncludeRepaintRects = 1 << 3,
- LayerTreeFlagsIncludePaintingPhases = 1 << 4,
- LayerTreeFlagsIncludeContentLayers = 1 << 5
- };
- typedef unsigned LayerTreeFlags;
-
- class Frame : public RefCounted<Frame>, public TiledBackingStoreClient {
- public:
- static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
-
- void init();
+enum {
+ LayerTreeFlagsIncludeDebugInfo = 1 << 0,
+ LayerTreeFlagsIncludeVisibleRects = 1 << 1,
+ LayerTreeFlagsIncludeTileCaches = 1 << 2,
+ LayerTreeFlagsIncludeRepaintRects = 1 << 3,
+ LayerTreeFlagsIncludePaintingPhases = 1 << 4,
+ LayerTreeFlagsIncludeContentLayers = 1 << 5,
+ LayerTreeFlagsIncludeAcceleratesDrawing = 1 << 6,
+};
+typedef unsigned LayerTreeFlags;
+
+class Frame : public ThreadSafeRefCounted<Frame> {
+public:
+ WEBCORE_EXPORT static Ref<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
+
+ void init();
#if PLATFORM(IOS)
- // Creates <html><body style="..."></body></html> doing minimal amount of work.
- void initWithSimpleHTMLDocument(const String& style, const URL&);
+ // Creates <html><body style="..."></body></html> doing minimal amount of work.
+ WEBCORE_EXPORT void initWithSimpleHTMLDocument(const String& style, const URL&);
#endif
- void setView(PassRefPtr<FrameView>);
- void createView(const IntSize&, const Color&, bool,
- const IntSize& fixedLayoutSize = IntSize(), const IntRect& fixedVisibleContentRect = IntRect(),
- bool useFixedLayout = false, ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
- ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
+ WEBCORE_EXPORT void setView(RefPtr<FrameView>&&);
+ WEBCORE_EXPORT void createView(const IntSize&, const Color&, bool,
+ const IntSize& fixedLayoutSize = IntSize(), const IntRect& fixedVisibleContentRect = IntRect(),
+ bool useFixedLayout = false, ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
+ ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
- virtual ~Frame();
+ WEBCORE_EXPORT virtual ~Frame();
- void addDestructionObserver(FrameDestructionObserver*);
- void removeDestructionObserver(FrameDestructionObserver*);
+ void addDestructionObserver(FrameDestructionObserver*);
+ void removeDestructionObserver(FrameDestructionObserver*);
- void willDetachPage();
- void detachFromPage();
- void disconnectOwnerElement();
+ void willDetachPage();
+ void detachFromPage();
+ void disconnectOwnerElement();
- MainFrame& mainFrame() const;
- bool isMainFrame() const;
+ MainFrame& mainFrame() const;
+ bool isMainFrame() const { return this == static_cast<void*>(&m_mainFrame); }
- Page* page() const;
- HTMLFrameOwnerElement* ownerElement() const;
+ Page* page() const;
+ HTMLFrameOwnerElement* ownerElement() const;
- Document* document() const;
- FrameView* view() const;
+ Document* document() const;
+ FrameView* view() const;
- Editor& editor() const;
- EventHandler& eventHandler() const;
- FrameLoader& loader() const;
- NavigationScheduler& navigationScheduler() const;
- FrameSelection& selection() const;
- FrameTree& tree() const;
- AnimationController& animation() const;
- ScriptController& script();
-
- RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame.
- RenderWidget* ownerRenderer() const; // Renderer for the element that contains this frame.
+ Editor& editor() const;
+ EventHandler& eventHandler() const;
+ EventHandler* eventHandlerPtr() const;
+ FrameLoader& loader() const;
+ NavigationScheduler& navigationScheduler() const;
+ FrameSelection& selection() const;
+ FrameTree& tree() const;
+ CSSAnimationController& animation() const;
+ ScriptController& script();
+
+ WEBCORE_EXPORT RenderView* contentRenderer() const; // Root of the render tree for the document contained in this frame.
+ WEBCORE_EXPORT RenderWidget* ownerRenderer() const; // Renderer for the element that contains this frame.
- // ======== All public functions below this point are candidates to move out of Frame into another class. ========
+ bool documentIsBeingReplaced() const { return m_documentIsBeingReplaced; }
- void injectUserScripts(UserScriptInjectionTime);
-
- String layerTreeAsText(LayerTreeFlags = 0) const;
- String trackedRepaintRectsAsText() const;
+// ======== All public functions below this point are candidates to move out of Frame into another class. ========
- static Frame* frameForWidget(const Widget*);
+ void injectUserScripts(UserScriptInjectionTime);
+
+ WEBCORE_EXPORT String layerTreeAsText(LayerTreeFlags = 0) const;
+ WEBCORE_EXPORT String trackedRepaintRectsAsText() const;
- Settings& settings() const { return *m_settings; }
+ WEBCORE_EXPORT static Frame* frameForWidget(const Widget&);
- void setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot);
- bool shouldUsePrintingLayout() const;
- FloatSize resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize);
+ Settings& settings() const { return *m_settings; }
- bool inViewSourceMode() const;
- void setInViewSourceMode(bool = true);
+ void setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot);
+ bool shouldUsePrintingLayout() const;
+ WEBCORE_EXPORT FloatSize resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize);
- void setDocument(PassRefPtr<Document>);
+ void setDocument(RefPtr<Document>&&);
- void setPageZoomFactor(float factor);
- float pageZoomFactor() const { return m_pageZoomFactor; }
- void setTextZoomFactor(float factor);
- float textZoomFactor() const { return m_textZoomFactor; }
- void setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor);
+ WEBCORE_EXPORT void setPageZoomFactor(float);
+ float pageZoomFactor() const { return m_pageZoomFactor; }
+ WEBCORE_EXPORT void setTextZoomFactor(float);
+ float textZoomFactor() const { return m_textZoomFactor; }
+ WEBCORE_EXPORT void setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor);
- // Scale factor of this frame with respect to the container.
- float frameScaleFactor() const;
+ // Scale factor of this frame with respect to the container.
+ WEBCORE_EXPORT float frameScaleFactor() const;
-#if USE(ACCELERATED_COMPOSITING)
- void deviceOrPageScaleFactorChanged();
+ void deviceOrPageScaleFactorChanged();
+
+#if ENABLE(DATA_DETECTION)
+ void setDataDetectionResults(NSArray *results) { m_dataDetectionResults = results; }
+ NSArray *dataDetectionResults() const { return m_dataDetectionResults.get(); }
#endif
#if PLATFORM(IOS)
- const ViewportArguments& viewportArguments() const;
- void setViewportArguments(const ViewportArguments&);
+ const ViewportArguments& viewportArguments() const;
+ WEBCORE_EXPORT void setViewportArguments(const ViewportArguments&);
- Node* deepestNodeAtLocation(const FloatPoint& viewportLocation);
- Node* nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);
- Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation);
+ WEBCORE_EXPORT Node* deepestNodeAtLocation(const FloatPoint& viewportLocation);
+ WEBCORE_EXPORT Node* nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);
+ WEBCORE_EXPORT Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation);
- int indexCountOfWordPrecedingSelection(NSString* word) const;
- NSArray* wordsInCurrentParagraph() const;
- CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const;
+ WEBCORE_EXPORT NSArray *wordsInCurrentParagraph() const;
+ WEBCORE_EXPORT CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const;
- void setSelectionChangeCallbacksDisabled(bool = true);
- bool selectionChangeCallbacksDisabled() const;
+ WEBCORE_EXPORT void setSelectionChangeCallbacksDisabled(bool = true);
+ bool selectionChangeCallbacksDisabled() const;
- enum ViewportOffsetChangeType { IncrementalScrollOffset, CompletedScrollOffset };
- void viewportOffsetChanged(ViewportOffsetChangeType);
- bool containsTiledBackingLayers() const;
+ enum ViewportOffsetChangeType { IncrementalScrollOffset, CompletedScrollOffset };
+ WEBCORE_EXPORT void viewportOffsetChanged(ViewportOffsetChangeType);
+ bool containsTiledBackingLayers() const;
- void overflowScrollPositionChangedForNode(const IntPoint&, Node*, bool isUserScroll);
+ WEBCORE_EXPORT void overflowScrollPositionChangedForNode(const IntPoint&, Node*, bool isUserScroll);
- void resetAllGeolocationPermission();
+ WEBCORE_EXPORT void resetAllGeolocationPermission();
#endif
#if ENABLE(ORIENTATION_EVENTS)
- // Orientation is the interface orientation in degrees. Some examples are:
- // 0 is straight up; -90 is when the device is rotated 90 clockwise;
- // 90 is when rotated counter clockwise.
- void sendOrientationChangeEvent(int orientation);
- int orientation() const { return m_orientation; }
+ // Orientation is the interface orientation in degrees. Some examples are:
+ // 0 is straight up; -90 is when the device is rotated 90 clockwise;
+ // 90 is when rotated counter clockwise.
+ WEBCORE_EXPORT void orientationChanged();
+ int orientation() const;
#endif
- void clearTimers();
- static void clearTimers(FrameView*, Document*);
+ void clearTimers();
+ static void clearTimers(FrameView*, Document*);
- String displayStringModifiedByEncoding(const String&) const;
+ WEBCORE_EXPORT String displayStringModifiedByEncoding(const String&) const;
- VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
- Document* documentAtPoint(const IntPoint& windowPoint);
- PassRefPtr<Range> rangeForPoint(const IntPoint& framePoint);
+ WEBCORE_EXPORT VisiblePosition visiblePositionForPoint(const IntPoint& framePoint) const;
+ Document* documentAtPoint(const IntPoint& windowPoint);
+ WEBCORE_EXPORT RefPtr<Range> rangeForPoint(const IntPoint& framePoint);
- String searchForLabelsAboveCell(JSC::Yarr::RegularExpression*, HTMLTableCellElement*, size_t* resultDistanceFromStartOfCell);
- String searchForLabelsBeforeElement(const Vector<String>& labels, Element*, size_t* resultDistance, bool* resultIsInCellAbove);
- String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
-
-#if ENABLE(IOS_TEXT_AUTOSIZING)
- void setTextAutosizingWidth(float);
- float textAutosizingWidth() const;
-#endif
+ WEBCORE_EXPORT String searchForLabelsAboveCell(const JSC::Yarr::RegularExpression&, HTMLTableCellElement*, size_t* resultDistanceFromStartOfCell);
+ String searchForLabelsBeforeElement(const Vector<String>& labels, Element*, size_t* resultDistance, bool* resultIsInCellAbove);
+ String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
#if PLATFORM(IOS)
- // Scroll the selection in an overflow layer on iOS.
- void scrollOverflowLayer(RenderLayer* , const IntRect& visibleRect, const IntRect& exposeRect);
-
- int preferredHeight() const;
- int innerLineHeight(DOMNode*) const;
- void updateLayout() const;
- NSRect caretRect() const;
- NSRect rectForScrollToVisible() const;
- NSRect rectForSelection(VisibleSelection&) const;
- DOMCSSStyleDeclaration* styleAtSelectionStart() const;
- unsigned formElementsCharacterCount() const;
- void setTimersPaused(bool);
- bool timersPaused() const { return m_timersPausedCount; }
- void dispatchPageHideEventBeforePause();
- void dispatchPageShowEventBeforeResume();
- void setRangedSelectionBaseToCurrentSelection();
- void setRangedSelectionBaseToCurrentSelectionStart();
- void setRangedSelectionBaseToCurrentSelectionEnd();
- void clearRangedSelectionInitialExtent();
- void setRangedSelectionInitialExtentToCurrentSelectionStart();
- void setRangedSelectionInitialExtentToCurrentSelectionEnd();
- VisibleSelection rangedSelectionBase() const;
- VisibleSelection rangedSelectionInitialExtent() const;
- void recursiveSetUpdateAppearanceEnabled(bool);
- NSArray* interpretationsForCurrentRoot() const;
+ // Scroll the selection in an overflow layer.
+ void scrollOverflowLayer(RenderLayer*, const IntRect& visibleRect, const IntRect& exposeRect);
+
+ WEBCORE_EXPORT int preferredHeight() const;
+ WEBCORE_EXPORT void updateLayout() const;
+ WEBCORE_EXPORT NSRect caretRect() const;
+ WEBCORE_EXPORT NSRect rectForScrollToVisible() const;
+ WEBCORE_EXPORT unsigned formElementsCharacterCount() const;
+
+ // This function is used by Legacy WebKit.
+ WEBCORE_EXPORT void setTimersPaused(bool);
+
+ WEBCORE_EXPORT void dispatchPageHideEventBeforePause();
+ WEBCORE_EXPORT void dispatchPageShowEventBeforeResume();
+ WEBCORE_EXPORT void setRangedSelectionBaseToCurrentSelection();
+ WEBCORE_EXPORT void setRangedSelectionBaseToCurrentSelectionStart();
+ WEBCORE_EXPORT void setRangedSelectionBaseToCurrentSelectionEnd();
+ WEBCORE_EXPORT void clearRangedSelectionInitialExtent();
+ WEBCORE_EXPORT void setRangedSelectionInitialExtentToCurrentSelectionStart();
+ WEBCORE_EXPORT void setRangedSelectionInitialExtentToCurrentSelectionEnd();
+ WEBCORE_EXPORT VisibleSelection rangedSelectionBase() const;
+ WEBCORE_EXPORT VisibleSelection rangedSelectionInitialExtent() const;
+ WEBCORE_EXPORT void recursiveSetUpdateAppearanceEnabled(bool);
+ WEBCORE_EXPORT NSArray *interpretationsForCurrentRoot() const;
#endif
- void suspendActiveDOMObjectsAndAnimations();
- void resumeActiveDOMObjectsAndAnimations();
- bool activeDOMObjectsAndAnimationsSuspended() const { return m_activeDOMObjectsAndAnimationsSuspendedCount > 0; }
-
- bool isURLAllowed(const URL&) const;
-
- // ========
-
- protected:
- Frame(Page&, HTMLFrameOwnerElement*, FrameLoaderClient&);
-
- private:
- void injectUserScriptsForWorld(DOMWrapperWorld&, const UserScriptVector&, UserScriptInjectionTime);
+ void suspendActiveDOMObjectsAndAnimations();
+ void resumeActiveDOMObjectsAndAnimations();
+ bool activeDOMObjectsAndAnimationsSuspended() const { return m_activeDOMObjectsAndAnimationsSuspendedCount > 0; }
- HashSet<FrameDestructionObserver*> m_destructionObservers;
+ bool isURLAllowed(const URL&) const;
+ WEBCORE_EXPORT bool isAlwaysOnLoggingAllowed() const;
- MainFrame& m_mainFrame;
- Page* m_page;
- const RefPtr<Settings> m_settings;
- mutable FrameTree m_treeNode;
- mutable FrameLoader m_loader;
- mutable NavigationScheduler m_navigationScheduler;
+// ========
- HTMLFrameOwnerElement* m_ownerElement;
- RefPtr<FrameView> m_view;
- RefPtr<Document> m_doc;
+protected:
+ Frame(Page&, HTMLFrameOwnerElement*, FrameLoaderClient&);
+ void setMainFrameWasDestroyed();
- const std::unique_ptr<ScriptController> m_script;
- const OwnPtr<Editor> m_editor;
- const OwnPtr<FrameSelection> m_selection;
- const OwnPtr<EventHandler> m_eventHandler;
- const std::unique_ptr<AnimationController> m_animationController;
+private:
+ HashSet<FrameDestructionObserver*> m_destructionObservers;
-#if PLATFORM(IOS)
- void betterApproximateNode(const IntPoint& testPoint, NodeQualifier, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);
- bool hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult&, IntPoint& center);
- Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, NodeQualifier, bool shouldApproximate);
-
- void overflowAutoScrollTimerFired(Timer<Frame>*);
- void startOverflowAutoScroll(const IntPoint&);
- int checkOverflowScroll(OverflowScrollAction);
-
- void setTimersPausedInternal(bool);
-
- Timer<Frame> m_overflowAutoScrollTimer;
- float m_overflowAutoScrollDelta;
- IntPoint m_overflowAutoScrollPos;
- ViewportArguments m_viewportArguments;
- bool m_selectionChangeCallbacksDisabled;
- int m_timersPausedCount;
- VisibleSelection m_rangedSelectionBase;
- VisibleSelection m_rangedSelectionInitialExtent;
-#endif
+ MainFrame& m_mainFrame;
+ Page* m_page;
+ const RefPtr<Settings> m_settings;
+ mutable FrameTree m_treeNode;
+ mutable FrameLoader m_loader;
+ mutable NavigationScheduler m_navigationScheduler;
-#if ENABLE(IOS_TEXT_AUTOSIZING)
- float m_textAutosizingWidth;
-#endif
+ HTMLFrameOwnerElement* m_ownerElement;
+ RefPtr<FrameView> m_view;
+ RefPtr<Document> m_doc;
- float m_pageZoomFactor;
- float m_textZoomFactor;
+ const std::unique_ptr<ScriptController> m_script;
+ const std::unique_ptr<Editor> m_editor;
+ const std::unique_ptr<FrameSelection> m_selection;
+ const std::unique_ptr<CSSAnimationController> m_animationController;
-#if ENABLE(ORIENTATION_EVENTS)
- int m_orientation;
+#if ENABLE(DATA_DETECTION)
+ RetainPtr<NSArray> m_dataDetectionResults;
#endif
-
- bool m_inViewSourceMode;
-
-#if USE(TILED_BACKING_STORE)
- // FIXME: The tiled backing store belongs in FrameView, not Frame.
-
- public:
- TiledBackingStore* tiledBackingStore() const { return m_tiledBackingStore.get(); }
- void setTiledBackingStoreEnabled(bool);
-
- private:
- // TiledBackingStoreClient interface
- virtual void tiledBackingStorePaintBegin() override final;
- virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&) override final;
- virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) override final;
- virtual IntRect tiledBackingStoreContentsRect() override final;
- virtual IntRect tiledBackingStoreVisibleRect() override final;
- virtual Color tiledBackingStoreBackgroundColor() const override final;
-
- OwnPtr<TiledBackingStore> m_tiledBackingStore;
+#if PLATFORM(IOS)
+ void betterApproximateNode(const IntPoint& testPoint, NodeQualifier, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);
+ bool hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult&, IntPoint& center);
+ Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, NodeQualifier, bool shouldApproximate);
+
+ void overflowAutoScrollTimerFired();
+ void startOverflowAutoScroll(const IntPoint&);
+ int checkOverflowScroll(OverflowScrollAction);
+
+ void setTimersPausedInternal(bool);
+
+ Timer m_overflowAutoScrollTimer;
+ float m_overflowAutoScrollDelta;
+ IntPoint m_overflowAutoScrollPos;
+ ViewportArguments m_viewportArguments;
+ bool m_selectionChangeCallbacksDisabled;
+ VisibleSelection m_rangedSelectionBase;
+ VisibleSelection m_rangedSelectionInitialExtent;
#endif
- int m_activeDOMObjectsAndAnimationsSuspendedCount;
- };
-
- inline void Frame::init()
- {
- m_loader.init();
- }
-
- inline FrameLoader& Frame::loader() const
- {
- return m_loader;
- }
-
- inline NavigationScheduler& Frame::navigationScheduler() const
- {
- return m_navigationScheduler;
- }
-
- inline FrameView* Frame::view() const
- {
- return m_view.get();
- }
-
- inline ScriptController& Frame::script()
- {
- return *m_script;
- }
-
- inline Document* Frame::document() const
- {
- return m_doc.get();
- }
-
- inline FrameSelection& Frame::selection() const
- {
- return *m_selection;
- }
-
- inline Editor& Frame::editor() const
- {
- return *m_editor;
- }
-
- inline AnimationController& Frame::animation() const
- {
- return *m_animationController;
- }
-
- inline HTMLFrameOwnerElement* Frame::ownerElement() const
- {
- return m_ownerElement;
- }
-
- inline bool Frame::inViewSourceMode() const
- {
- return m_inViewSourceMode;
- }
-
- inline void Frame::setInViewSourceMode(bool mode)
- {
- m_inViewSourceMode = mode;
- }
-
- inline FrameTree& Frame::tree() const
- {
- return m_treeNode;
- }
-
- inline Page* Frame::page() const
- {
- return m_page;
- }
-
- inline void Frame::detachFromPage()
- {
- m_page = 0;
- }
-
- inline EventHandler& Frame::eventHandler() const
- {
- return *m_eventHandler;
- }
-
- inline MainFrame& Frame::mainFrame() const
- {
- return m_mainFrame;
- }
+ float m_pageZoomFactor;
+ float m_textZoomFactor;
+
+ int m_activeDOMObjectsAndAnimationsSuspendedCount;
+ bool m_mainFrameWasDestroyed { false };
+ bool m_documentIsBeingReplaced { false };
+
+protected:
+ std::unique_ptr<EventHandler> m_eventHandler;
+};
+
+inline void Frame::init()
+{
+ m_loader.init();
+}
+
+inline FrameLoader& Frame::loader() const
+{
+ return m_loader;
+}
+
+inline NavigationScheduler& Frame::navigationScheduler() const
+{
+ return m_navigationScheduler;
+}
+
+inline FrameView* Frame::view() const
+{
+ return m_view.get();
+}
+
+inline ScriptController& Frame::script()
+{
+ return *m_script;
+}
+
+inline Document* Frame::document() const
+{
+ return m_doc.get();
+}
+
+inline FrameSelection& Frame::selection() const
+{
+ return *m_selection;
+}
+
+inline Editor& Frame::editor() const
+{
+ return *m_editor;
+}
+
+inline CSSAnimationController& Frame::animation() const
+{
+ return *m_animationController;
+}
+
+inline HTMLFrameOwnerElement* Frame::ownerElement() const
+{
+ return m_ownerElement;
+}
+
+inline FrameTree& Frame::tree() const
+{
+ return m_treeNode;
+}
+
+inline Page* Frame::page() const
+{
+ return m_page;
+}
+
+inline void Frame::detachFromPage()
+{
+ m_page = nullptr;
+}
+
+inline EventHandler& Frame::eventHandler() const
+{
+ return *m_eventHandler;
+}
+
+inline EventHandler* Frame::eventHandlerPtr() const
+{
+ return m_eventHandler.get();
+}
+
+inline MainFrame& Frame::mainFrame() const
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!m_mainFrameWasDestroyed);
+ return m_mainFrame;
+}
+
+inline void Frame::setMainFrameWasDestroyed()
+{
+ m_mainFrameWasDestroyed = false;
+}
} // namespace WebCore
-
-#endif // Frame_h