[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
ap at apple.com
ap at apple.com
Fri Jan 21 14:57:04 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 031b5ff9e794c256e6c90cf14bff0abbb04a762a
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 5 09:32:57 2011 +0000
2011-01-05 Alexey Proskuryakov <ap at apple.com>
Reviewed by Sam Weinig.
https://bugs.webkit.org/show_bug.cgi?id=51903
Tell UI process which subframe is largest
* WebCore.exp.in: Exported FrameView::contentsSize().
2011-01-05 Alexey Proskuryakov <ap at apple.com>
Reviewed by Sam Weinig.
https://bugs.webkit.org/show_bug.cgi?id=51903
Tell UI process which subframe is largest
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::frameSetLargestFrame):
Remember largest frame in frameset pages.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::frameDidBecomeFrameSet): Reset stored largest frame if main frame
changes to a frameset or back.
(WebKit::WebPageProxy::frameSetLargestFrameChanged): Store a new largest frame when notified
of a change.
* UIProcess/WebPageProxy.messages.in: Added FrameSetLargestFrameChanged.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::area): Calculate area of a frame.
(WebKit::findLargestFrameInFrameSet): Find largest first-level subframe in a frameset page.
(WebKit::WebChromeClient::contentsSizeChanged): Recalculate largest frame, and notify UI
process if it changed.
* WebProcess/WebCoreSupport/WebChromeClient.h: Store the latest largest frame.
* WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::size):
* WebProcess/WebPage/WebFrame.h:
Expose frame size.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 033d829..4c20764 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-05 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=51903
+ Tell UI process which subframe is largest
+
+ * WebCore.exp.in: Exported FrameView::contentsSize().
+
2011-01-04 Chris Fleizach <cfleizach at apple.com>
Unreviewed. GTK build fix.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index b37b289..6067f0e 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -942,6 +942,7 @@ __ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringE
__ZNK7WebCore10RenderText16linesBoundingBoxEv
__ZNK7WebCore10RenderText9firstRunXEv
__ZNK7WebCore10RenderText9firstRunYEv
+__ZNK7WebCore10ScrollView12contentsSizeEv
__ZNK7WebCore10ScrollView12documentViewEv
__ZNK7WebCore10ScrollView14scrollbarModesERNS_13ScrollbarModeES2_
__ZNK7WebCore10ScrollView16contentsToWindowERKNS_7IntRectE
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 209d29b..30c9f42 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,34 @@
+2011-01-05 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=51903
+ Tell UI process which subframe is largest
+
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::frameSetLargestFrame):
+ Remember largest frame in frameset pages.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::frameDidBecomeFrameSet): Reset stored largest frame if main frame
+ changes to a frameset or back.
+ (WebKit::WebPageProxy::frameSetLargestFrameChanged): Store a new largest frame when notified
+ of a change.
+
+ * UIProcess/WebPageProxy.messages.in: Added FrameSetLargestFrameChanged.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::area): Calculate area of a frame.
+ (WebKit::findLargestFrameInFrameSet): Find largest first-level subframe in a frameset page.
+ (WebKit::WebChromeClient::contentsSizeChanged): Recalculate largest frame, and notify UI
+ process if it changed.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h: Store the latest largest frame.
+
+ * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::size):
+ * WebProcess/WebPage/WebFrame.h:
+ Expose frame size.
+
2011-01-04 Benjamin Poulain <benjamin.poulain at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 50bf165..ba5c180 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -1216,6 +1216,8 @@ void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
MESSAGE_CHECK(frame);
frame->setIsFrameSet(value);
+ if (frame->isMainFrame())
+ m_frameSetLargestFrame = value ? m_mainFrame : 0;
}
// PolicyClient
@@ -1916,6 +1918,19 @@ void WebPageProxy::focusedFrameChanged(uint64_t frameID)
m_focusedFrame = frame;
}
+void WebPageProxy::frameSetLargestFrameChanged(uint64_t frameID)
+{
+ if (!frameID) {
+ m_frameSetLargestFrame = 0;
+ return;
+ }
+
+ WebFrameProxy* frame = process()->webFrame(frameID);
+ MESSAGE_CHECK(frame);
+
+ m_frameSetLargestFrame = frame;
+}
+
#if USE(ACCELERATED_COMPOSITING)
void WebPageProxy::didChangeAcceleratedCompositing(bool compositing, DrawingAreaInfo& drawingAreaInfo)
{
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 8a97c3f..330af63 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -112,6 +112,7 @@ public:
WebFrameProxy* mainFrame() const { return m_mainFrame.get(); }
WebFrameProxy* focusedFrame() const { return m_focusedFrame.get(); }
+ WebFrameProxy* frameSetLargestFrame() const { return m_frameSetLargestFrame.get(); }
DrawingAreaProxy* drawingArea() { return m_drawingArea.get(); }
void setDrawingArea(PassOwnPtr<DrawingAreaProxy>);
@@ -446,6 +447,7 @@ private:
void stringCallback(const String&, uint64_t);
void focusedFrameChanged(uint64_t frameID);
+ void frameSetLargestFrameChanged(uint64_t frameID);
#if USE(ACCELERATED_COMPOSITING)
void didChangeAcceleratedCompositing(bool compositing, DrawingAreaInfo&);
@@ -476,6 +478,7 @@ private:
RefPtr<WebPageGroup> m_pageGroup;
RefPtr<WebFrameProxy> m_mainFrame;
RefPtr<WebFrameProxy> m_focusedFrame;
+ RefPtr<WebFrameProxy> m_frameSetLargestFrame;
String m_userAgent;
String m_applicationNameForUserAgent;
diff --git a/WebKit2/UIProcess/WebPageProxy.messages.in b/WebKit2/UIProcess/WebPageProxy.messages.in
index eb2089e..b95d6b4 100644
--- a/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -38,6 +38,7 @@ messages -> WebPageProxy {
SetToolTip(WTF::String toolTip)
TakeFocus(bool direction)
FocusedFrameChanged(uint64_t frameID)
+ FrameSetLargestFrameChanged(uint64_t frameID)
SetToolbarsAreVisible(bool toolbarsAreVisible)
GetToolbarsAreVisible() -> (bool toolbarsAreVisible)
SetMenuBarIsVisible(bool menuBarIsVisible);
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 6ca0f5c..3886eea 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -59,6 +59,32 @@ using namespace HTMLNames;
namespace WebKit {
+static double area(WebFrame* frame)
+{
+ IntSize size = frame->size();
+ return static_cast<double>(size.height()) * size.width();
+}
+
+
+static WebFrame* findLargestFrameInFrameSet(WebPage* page)
+{
+ WebFrame* mainFrame = page->mainFrame();
+ if (!mainFrame->isFrameSet())
+ return 0;
+
+ WebFrame* largestSoFar = 0;
+
+ RefPtr<ImmutableArray> frameChildren = mainFrame->childFrames();
+ size_t count = frameChildren->size();
+ for (size_t i = 0; i < count; ++i) {
+ WebFrame* childFrame = frameChildren->at<WebFrame>(i);
+ if (!largestSoFar || area(childFrame) > area(largestSoFar))
+ largestSoFar = childFrame;
+ }
+
+ return largestSoFar;
+}
+
void WebChromeClient::chromeDestroyed()
{
delete this;
@@ -384,6 +410,12 @@ void WebChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) con
m_page->send(Messages::WebPageProxy::DidChangeContentsSize(size));
#endif
+
+ WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
+ if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
+ m_cachedFrameSetLargestFrame = largestFrame;
+ WebProcess::shared().connection()->send(Messages::WebPageProxy::FrameSetLargestFrameChanged(largestFrame ? largestFrame->frameID() : 0), m_page->pageID());
+ }
}
void WebChromeClient::scrollRectIntoView(const IntRect&, const ScrollView*) const
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index 01678ec..b5f51f5 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -33,6 +33,7 @@
namespace WebKit {
+class WebFrame;
class WebPage;
class WebChromeClient : public WebCore::ChromeClient {
@@ -202,6 +203,7 @@ private:
virtual void dispatchViewportDataDidChange(const WebCore::ViewportArguments&) const;
String m_cachedToolTip;
+ mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
WebPage* m_page;
};
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.cpp b/WebKit2/WebProcess/WebPage/WebFrame.cpp
index 12aa4a3..099d9b4 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -41,6 +41,7 @@
#include <WebCore/Chrome.h>
#include <WebCore/DocumentLoader.h>
#include <WebCore/Frame.h>
+#include <WebCore/FrameView.h>
#include <WebCore/HTMLFrameOwnerElement.h>
#include <WebCore/JSCSSStyleDeclaration.h>
#include <WebCore/JSElement.h>
@@ -287,6 +288,18 @@ String WebFrame::selectionAsString() const
return m_coreFrame->displayStringModifiedByEncoding(m_coreFrame->editor()->selectedText());
}
+IntSize WebFrame::size() const
+{
+ if (!m_coreFrame)
+ return IntSize();
+
+ FrameView* frameView = m_coreFrame->view();
+ if (!frameView)
+ return IntSize();
+
+ return frameView->contentsSize();
+}
+
bool WebFrame::isFrameSet() const
{
if (!m_coreFrame)
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.h b/WebKit2/WebProcess/WebPage/WebFrame.h
index 1693fe9..9d64637 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -77,11 +77,14 @@ public:
String contentsAsString() const;
String selectionAsString() const;
+ WebCore::IntSize size() const;
+
// WKBundleFrame API and SPI functions
bool isMainFrame() const;
String name() const;
String url() const;
String innerText() const;
+ bool isFrameSet() const;
PassRefPtr<ImmutableArray> childFrames();
JSValueRef computedStyleIncludingVisitedInfo(JSObjectRef element);
JSGlobalContextRef jsContext();
@@ -122,8 +125,6 @@ private:
virtual Type type() const { return APIType; }
- bool isFrameSet() const;
-
WebCore::Frame* m_coreFrame;
uint64_t m_policyListenerID;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list