Title: [93434] trunk/Source/WebKit/chromium
Revision
93434
Author
[email protected]
Date
2011-08-19 13:37:17 -0700 (Fri, 19 Aug 2011)

Log Message

Expose Fixed Layout Size mode to Chromium's WebKit API
https://bugs.webkit.org/show_bug.cgi?id=66568

Reviewed by Darin Fisher.

* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::isFixedLayoutModeEnabled):
(WebKit::WebViewImpl::enableFixedLayoutMode):
(WebKit::WebViewImpl::fixedLayoutSize):
(WebKit::WebViewImpl::setFixedLayoutSize):
* src/WebViewImpl.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (93433 => 93434)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-08-19 20:22:00 UTC (rev 93433)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-08-19 20:37:17 UTC (rev 93434)
@@ -1,3 +1,18 @@
+2011-08-19  Fady Samuel  <[email protected]>
+
+        Expose Fixed Layout Size mode to Chromium's WebKit API
+        https://bugs.webkit.org/show_bug.cgi?id=66568
+
+        Reviewed by Darin Fisher.
+
+        * public/WebView.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::isFixedLayoutModeEnabled):
+        (WebKit::WebViewImpl::enableFixedLayoutMode):
+        (WebKit::WebViewImpl::fixedLayoutSize):
+        (WebKit::WebViewImpl::setFixedLayoutSize):
+        * src/WebViewImpl.h:
+
 2011-08-17  Adrienne Walker  <[email protected]>
 
         [chromium] Split tiler into main thread / compositor thread versions

Modified: trunk/Source/WebKit/chromium/public/WebView.h (93433 => 93434)


--- trunk/Source/WebKit/chromium/public/WebView.h	2011-08-19 20:22:00 UTC (rev 93433)
+++ trunk/Source/WebKit/chromium/public/WebView.h	2011-08-19 20:37:17 UTC (rev 93434)
@@ -213,6 +213,18 @@
     virtual void scalePage(float scaleFactor, WebPoint origin) = 0;
 
 
+    // Fixed Layout --------------------------------------------------------
+
+    // In fixed layout mode, the layout of the page is independent of the
+    // view port size, given by WebWidget::size().
+
+    virtual bool isFixedLayoutModeEnabled() const = 0;
+    virtual void enableFixedLayoutMode(bool enable) = 0;
+
+    virtual WebSize fixedLayoutSize() const = 0;
+    virtual void setFixedLayoutSize(const WebSize&) = 0;
+
+
     // Media ---------------------------------------------------------------
 
     // Performs the specified action on the node at the given location.

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (93433 => 93434)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-08-19 20:22:00 UTC (rev 93433)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-08-19 20:37:17 UTC (rev 93434)
@@ -1862,6 +1862,54 @@
     frame->scalePage(scaleFactor, origin);
 }
 
+bool WebViewImpl::isFixedLayoutModeEnabled() const
+{
+    if (!page())
+        return false;
+
+    Frame* frame = page()->mainFrame();
+    if (!frame)
+        return false;
+
+    return frame->view()->useFixedLayout();
+}
+
+void WebViewImpl::enableFixedLayoutMode(bool enable)
+{
+    if (!page())
+        return;
+
+    Frame* frame = page()->mainFrame();
+    if (!frame)
+        return;
+
+    frame->view()->setUseFixedLayout(enable);
+}
+
+WebSize WebViewImpl::fixedLayoutSize() const
+{
+    if (!page())
+        return WebSize();
+
+    Frame* frame = page()->mainFrame();
+    if (!frame)
+        return WebSize();
+
+    return frame->view()->fixedLayoutSize();
+}
+
+void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize)
+{
+    if (!page())
+        return;
+
+    Frame* frame = page()->mainFrame();
+    if (!frame)
+        return;
+
+    frame->view()->setFixedLayoutSize(layoutSize);
+}
+
 void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
                                            const WebPoint& location)
 {

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (93433 => 93434)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-08-19 20:22:00 UTC (rev 93433)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2011-08-19 20:37:17 UTC (rev 93434)
@@ -157,6 +157,10 @@
                                    double maximumZoomLevel);
     virtual float pageScaleFactor() const;
     virtual void scalePage(float scaleFactor, WebPoint origin);
+    virtual bool isFixedLayoutModeEnabled() const;
+    virtual void enableFixedLayoutMode(bool enable);
+    virtual WebSize fixedLayoutSize() const;
+    virtual void setFixedLayoutSize(const WebSize&);
     virtual void performMediaPlayerAction(
         const WebMediaPlayerAction& action,
         const WebPoint& location);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to