Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (89051 => 89052)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-06-16 18:33:31 UTC (rev 89051)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-06-16 18:39:48 UTC (rev 89052)
@@ -1,3 +1,19 @@
+2011-06-16 Adam Barth <[email protected]>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Prepare to move some APIs from WebFrame to WebDocument
+ https://bugs.webkit.org/show_bug.cgi?id=62781
+
+ This patch adds a WEBKIT_FRAME_TO_DOCUMENT_API_MOVE ifdef to prepare
+ for moving a number of Document-specific APIs from WebFrame to
+ WebDocument. This ifdef will allow us to move these APIs without
+ disrupting the consumers of the APIs (too much).
+
+ * public/WebFrame.h:
+ * src/WebFrameImpl.cpp:
+ * src/WebFrameImpl.h:
+
2011-06-16 Sheriff Bot <[email protected]>
Unreviewed, rolling out r89026.
Modified: trunk/Source/WebKit/chromium/public/WebFrame.h (89051 => 89052)
--- trunk/Source/WebKit/chromium/public/WebFrame.h 2011-06-16 18:33:31 UTC (rev 89051)
+++ trunk/Source/WebKit/chromium/public/WebFrame.h 2011-06-16 18:39:48 UTC (rev 89052)
@@ -128,8 +128,10 @@
// A globally unique identifier for this frame.
virtual long long identifier() const = 0;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
// The url of the document loaded in this frame.
virtual WebURL url() const = 0;
+#endif
// The urls of the given combination types of favicon (if any) specified by
// the document loaded in this frame. The iconTypes is a bit-mask of
@@ -137,12 +139,14 @@
// URLs
virtual WebVector<WebIconURL> iconURLs(int iconTypes) const = 0;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
// The url of the OpenSearch Desription Document (if any) specified by
// the document loaded in this frame.
virtual WebURL openSearchDescriptionURL() const = 0;
// Return the frame's encoding.
virtual WebString encoding() const = 0;
+#endif
// Geometry -----------------------------------------------------------
@@ -215,7 +219,9 @@
virtual WebDocument document() const = 0;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual void forms(WebVector<WebFormElement>&) const = 0;
+#endif
virtual WebAnimationController* animationController() = 0;
@@ -224,6 +230,7 @@
// Scripting ----------------------------------------------------------
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
// Returns the security origin of the current document.
virtual WebSecurityOrigin securityOrigin() const = 0;
@@ -231,6 +238,7 @@
// origins (including file URLs). Use with care. The access is
// revoked when a new document is loaded into this frame.
virtual void grantUniversalAccess() = 0;
+#endif
// Returns a NPObject corresponding to this frame's DOMWindow.
virtual NPObject* windowObject() const = 0;
@@ -289,12 +297,14 @@
// Styling -------------------------------------------------------------
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
// Insert the given text as a STYLE element at the beginning of the
// document. |elementId| can be empty, but if specified then it is used
// as the id for the newly inserted element (replacing an existing one
// with the same id, if any).
virtual bool insertStyleText(const WebString& styleText,
const WebString& elementId) = 0;
+#endif
// Navigation ----------------------------------------------------------
@@ -565,6 +575,7 @@
// Utility -------------------------------------------------------------
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
// Returns the contents of this frame as a string. If the text is
// longer than maxChars, it will be clipped to that length. WARNING:
// This function may be slow depending on the number of characters
@@ -578,6 +589,7 @@
// Returns HTML text for the contents of this frame. This is generated
// from the DOM.
virtual WebString contentAsMarkup() const = 0;
+#endif
// Returns a text representation of the render tree. This method is used
// to support layout tests.
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (89051 => 89052)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2011-06-16 18:33:31 UTC (rev 89051)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2011-06-16 18:39:48 UTC (rev 89052)
@@ -518,10 +518,12 @@
return m_identifier;
}
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
WebURL WebFrameImpl::url() const
{
return m_frame->document()->url();
}
+#endif
WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypes) const
{
@@ -533,6 +535,7 @@
return WebVector<WebIconURL>();
}
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
WebURL WebFrameImpl::openSearchDescriptionURL() const
{
FrameLoader* frameLoader = m_frame->loader();
@@ -559,6 +562,7 @@
{
return frame()->document()->loader()->writer()->encoding();
}
+#endif
WebSize WebFrameImpl::scrollOffset() const
{
@@ -702,6 +706,7 @@
return WebDocument(m_frame->document());
}
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
void WebFrameImpl::forms(WebVector<WebFormElement>& results) const
{
if (!m_frame)
@@ -719,6 +724,7 @@
}
results.assign(temp);
}
+#endif
WebAnimationController* WebFrameImpl::animationController()
{
@@ -733,6 +739,7 @@
return WebPerformance(m_frame->domWindow()->performance());
}
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
WebSecurityOrigin WebFrameImpl::securityOrigin() const
{
if (!m_frame || !m_frame->document())
@@ -747,6 +754,7 @@
if (m_frame && m_frame->document())
m_frame->document()->securityOrigin()->grantUniversalAccess();
}
+#endif
NPObject* WebFrameImpl::windowObject() const
{
@@ -877,6 +885,7 @@
}
#endif
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
bool WebFrameImpl::insertStyleText(
const WebString& css, const WebString& id) {
Document* document = frame()->document();
@@ -909,6 +918,7 @@
ASSERT(success);
return success;
}
+#endif
void WebFrameImpl::reload(bool ignoreCache)
{
@@ -1806,6 +1816,7 @@
m_framesScopingCount = 0;
}
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
WebString WebFrameImpl::contentAsText(size_t maxChars) const
{
if (!m_frame)
@@ -1820,6 +1831,7 @@
{
return createFullMarkup(m_frame->document());
}
+#endif
WebString WebFrameImpl::renderTreeAsText(bool showDebugInfo) const
{
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.h (89051 => 89052)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.h 2011-06-16 18:33:31 UTC (rev 89051)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.h 2011-06-16 18:39:48 UTC (rev 89052)
@@ -69,10 +69,14 @@
virtual WebString name() const;
virtual void setName(const WebString&);
virtual long long identifier() const;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual WebURL url() const;
+#endif
virtual WebVector<WebIconURL> iconURLs(int iconTypes) const;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual WebURL openSearchDescriptionURL() const;
virtual WebString encoding() const;
+#endif
virtual WebSize scrollOffset() const;
virtual void setScrollOffset(const WebSize&);
virtual WebSize contentsSize() const;
@@ -93,11 +97,15 @@
virtual WebFrame* findChildByName(const WebString&) const;
virtual WebFrame* findChildByExpression(const WebString&) const;
virtual WebDocument document() const;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual void forms(WebVector<WebFormElement>&) const;
+#endif
virtual WebAnimationController* animationController();
virtual WebPerformance performance() const;
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual WebSecurityOrigin securityOrigin() const;
virtual void grantUniversalAccess();
+#endif
virtual NPObject* windowObject() const;
virtual void bindToWindowObject(const WebString& name, NPObject*);
virtual void executeScript(const WebScriptSource&);
@@ -120,7 +128,9 @@
const WebString& filePath,
bool isDirectory);
#endif
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual bool insertStyleText(const WebString& css, const WebString& id);
+#endif
virtual void reload(bool ignoreCache);
virtual void loadRequest(const WebURLRequest&);
virtual void loadHistoryItem(const WebHistoryItem&);
@@ -195,8 +205,10 @@
virtual void notifiyPasswordListenerOfAutocomplete(
const WebInputElement&);
+#if !defined(WEBKIT_FRAME_TO_DOCUMENT_API_MOVE)
virtual WebString contentAsText(size_t maxChars) const;
virtual WebString contentAsMarkup() const;
+#endif
virtual WebString renderTreeAsText(bool showDebugInfo = false) const;
virtual WebString counterValueForElementById(const WebString& id) const;
virtual WebString markerTextForListItem(const WebElement&) const;