This is needed by applications making use of our viewport metatag API, to change the size to fit best with the app and to update it on rotation.
Created attachment 61997 [details]
Attachment 61997 [details] did not pass style-queue:
Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WARNING: File exempt from style guide. Skipping: "WebKit/qt/Api/qgraphicswebview.cpp"
WARNING: File exempt from style guide. Skipping: "WebKit/qt/Api/qgraphicswebview.h"
WebKit/qt/WebCoreSupport/PageClientQt.h:33: Alphabetical sorting problem. [build/include_order] 
Total errors found: 1 in 5 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 62002 [details]
Comment on attachment 62002 [details]
You are missing the \since 4.x below.
> + \property QGraphicsWebView::deviceSize
> + \brief the size of the device using the web view
> + The device size is used by the DOM window object methods
> + otherHeight(), otherWidth() as well as a page for the viewport
> + meta tag attributes device-width and device-height.
> +void QGraphicsWebView::setDeviceSize(QSize size)
> +QSize QGraphicsWebView::deviceSize()
const it, please.
> + QSize deviceSize();
> + void setDeviceSize(QSize);
blocking bug 31552 for further API discussion/review on qtwebkit2.1.
Created attachment 62054 [details]
Patch for landing
Comment on attachment 62054 [details]
Patch for landing
Clearing flags on attachment: 62054
Committed r63740: <http://trac.webkit.org/changeset/63740>
All reviewed patches have been landed. Closing bug.
Why do application developers have to care about this? Can't we retrieve this information automatically from the system?
(In reply to comment #9)
> Why do application developers have to care about this? Can't we retrieve this information automatically from the system?
There is no simple/consistent way to always get it from the system.
You can try to get the screen resolution but that might interfer with things on mobiles such as always present status bar (phone signal etc)
For use with the viewport meta tag is also HAS TO be given in portrait. Actually
width == width of device when in portrait, height = width of device when in landscape.
When testing your app on a desktop it would get the width/height of the desktop, making it hard to test the viewport meta stuff without using something like Xephyr.
Another point is that if the app will do DPI adjustment like Firefox Mobile does, you need to set an adjusted device size.