diff options
Diffstat (limited to 'WebKit/chromium/public/WebFrame.h')
-rw-r--r-- | WebKit/chromium/public/WebFrame.h | 102 |
1 files changed, 87 insertions, 15 deletions
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h index a56e6cb..30bf03b 100644 --- a/WebKit/chromium/public/WebFrame.h +++ b/WebKit/chromium/public/WebFrame.h @@ -39,6 +39,8 @@ struct NPObject; #if WEBKIT_USING_V8 namespace v8 { class Context; +class Value; +template <class T> class Handle; template <class T> class Local; } #endif @@ -54,10 +56,12 @@ class WebFormElement; class WebHistoryItem; class WebInputElement; class WebPasswordAutocompleteListener; +class WebPerformance; class WebRange; class WebSecurityOrigin; class WebString; class WebURL; +class WebURLLoader; class WebURLRequest; class WebView; struct WebConsoleMessage; @@ -100,7 +104,14 @@ public: // The name of this frame. virtual WebString name() const = 0; - virtual void clearName() = 0; + + // Sets the name of this frame. For child frames (frames that are not a + // top-most frame) the actual name may have a suffix appended to make the + // frame name unique within the hierarchy. + virtual void setName(const WebString&) = 0; + + // A globally unique identifier for this frame. + virtual long long identifier() const = 0; // The url of the document loaded in this frame. This is equivalent to // dataSource()->request().url(). @@ -123,6 +134,9 @@ public: // NOTE: These routines do not force page layout so their results may // not be accurate if the page layout is out-of-date. + // If set to false, do not draw scrollbars on this frame's view. + virtual void setCanHaveScrollbars(bool) = 0; + // The scroll offset from the top-left corner of the frame in pixels. virtual WebSize scrollOffset() const = 0; @@ -184,6 +198,8 @@ public: virtual WebAnimationController* animationController() = 0; + virtual WebPerformance performance() const = 0; + // Scripting ---------------------------------------------------------- @@ -222,6 +238,11 @@ public: virtual void collectGarbage() = 0; #if WEBKIT_USING_V8 + // Executes script in the context of the current page and returns the value + // that the script evaluated to. + virtual v8::Handle<v8::Value> executeScriptAndReturnValue( + const WebScriptSource&) = 0; + // Returns the V8 context for this frame, or an empty handle if there // is none. virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0; @@ -241,7 +262,9 @@ public: // Navigation ---------------------------------------------------------- // Reload the current document. - virtual void reload() = 0; + // True |ignoreCache| explicitly bypasses caches. + // False |ignoreCache| revalidates any existing cache entries. + virtual void reload(bool ignoreCache = false) = 0; // Load the given URL. virtual void loadRequest(const WebURLRequest&) = 0; @@ -305,8 +328,14 @@ public: // Called to associate the WebURLRequest with this frame. The request // will be modified to inherit parameters that allow it to be loaded. // This method ends up triggering WebFrameClient::willSendRequest. + // DEPRECATED: Please use createAssociatedURLLoader instead. virtual void dispatchWillSendRequest(WebURLRequest&) = 0; + // Returns a WebURLLoader that is associated with this frame. The loader + // will, for example, be cancelled when WebFrame::stopLoading is called. + // FIXME: stopLoading does not yet cancel an associated loader!! + virtual WebURLLoader* createAssociatedURLLoader() = 0; + // Called from within WebFrameClient::didReceiveDocumentData to commit // data for the frame that will be used to construct the frame's // document. @@ -336,6 +365,8 @@ public: virtual WebRange markedRange() const = 0; + virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const = 0; + // Supports commands like Undo, Redo, Cut, Copy, Paste, SelectAll, // Unselect, etc. See EditorCommand.cpp for the full list of supported // commands. @@ -365,10 +396,14 @@ public: // Printing ------------------------------------------------------------ - // Reformats the WebFrame for printing. pageSize is the page size in - // pixels. Returns the number of pages that can be printed at the - // given page size. - virtual int printBegin(const WebSize& pageSize) = 0; + // Reformats the WebFrame for printing. pageSize is the page size in + // points (a point in 1/72 of an inch). printerDPI is the user selected, + // DPI for the printer. Returns the number of pages that + // can be printed at the given page size. The out param useBrowserOverlays + // specifies whether the browser process should use its overlays (header, + // footer, margins etc) or whether the renderer controls this. + virtual int printBegin(const WebSize& pageSize, int printerDPI = 72, + bool* useBrowserOverlays = 0) = 0; // Returns the page shrinking factor calculated by webkit (usually // between 1/1.25 and 1/2). Returns 0 if the page number is invalid or @@ -383,6 +418,21 @@ public: // Reformats the WebFrame for screen display. virtual void printEnd() = 0; + // CSS3 Paged Media ---------------------------------------------------- + + // Returns true if page box (margin boxes and page borders) is visible. + virtual bool isPageBoxVisible(int pageIndex) = 0; + + // Returns the preferred page size and margins in pixels, assuming 96 + // pixels per inch. pageSize, marginTop, marginRight, marginBottom, + // marginLeft must be initialized to the default values that are used if + // auto is specified. + virtual void pageSizeAndMarginsInPixels(int pageIndex, + WebSize& pageSize, + int& marginTop, + int& marginRight, + int& marginBottom, + int& marginLeft) = 0; // Find-in-page -------------------------------------------------------- @@ -446,20 +496,20 @@ public: // Registers a listener for the specified user name input element. The // listener will receive notifications for blur and when autocomplete // should be triggered. - // The WebFrame becomes the owner of the passed listener. - virtual void registerPasswordListener( + // An element can have only one listener. If a listener already exists, + // this method returns false and does not add the new one. + // Either way, the WebFrame becomes the owner of the passed listener. + virtual bool registerPasswordListener( WebInputElement, WebPasswordAutocompleteListener*) = 0; + // Dispatches an Autocompletion notification to registered listener if one + // exists that is registered against the WebInputElement specified. + virtual void notifiyPasswordListenerOfAutocomplete( + const WebInputElement&) = 0; - // Utility ------------------------------------------------------------- - // Given a relative URL, returns an absolute URL by resolving the URL - // relative to the base URL of the frame's document. This uses the - // same algorithm that WebKit uses to resolve hyperlinks found in a - // HTML document. - // Deprecated. Use document().completeURL() instead. - virtual WebURL completeURL(const WebString&) const = 0; + // Utility ------------------------------------------------------------- // Returns the contents of this frame as a string. If the text is // longer than maxChars, it will be clipped to that length. WARNING: @@ -483,6 +533,8 @@ public: // used to support layout tests. virtual WebString counterValueForElementById(const WebString& id) const = 0; + // Calls markerTextForListItem() defined in WebCore/rendering/RenderTreeAsText.h. + virtual WebString markerTextForListItem(const WebElement&) const = 0; // Returns the number of page where the specified element will be put. // This method is used to support layout tests. @@ -490,6 +542,26 @@ public: float pageWidthInPixels, float pageHeightInPixels) const = 0; + // Returns the bounds rect for current selection. If selection is performed + // on transformed text, the rect will still bound the selection but will + // not be transformed itself. If no selection is present, the rect will be + // empty ((0,0), (0,0)). + virtual WebRect selectionBoundsRect() const = 0; + + // Only for testing purpose: + // Returns true if selection.anchorNode has a marker on range from |from| with |length|. + virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0; + + // Pauses and samples an SVG animation. Returns false if there's no svg + // animation to pause. This is only for testing. + virtual bool pauseSVGAnimation(const WebString& animationId, + double time, + const WebString& elementId) = 0; + + // Dumps the layer tree, used by the accelerated compositor, in + // text form. This is used only by layout tests. + virtual WebString layerTreeAsText() const = 0; + protected: ~WebFrame() { } }; |