Bug 72893 - [Qt][WK2] Add (experimental) viewport attributes view to MiniBrowser/qt
Summary: [Qt][WK2] Add (experimental) viewport attributes view to MiniBrowser/qt
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Brüning
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 09:15 PST by Michael Brüning
Modified: 2011-12-16 03:41 PST (History)
5 users (show)

See Also:


Attachments
Proposed patch (22.10 KB, patch)
2011-11-22 01:59 PST, Michael Brüning
vestbo: review-
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Updated proposed patch (22.73 KB, patch)
2011-11-22 08:54 PST, Michael Brüning
vestbo: review+
Details | Formatted Diff | Diff
Updated proposed patch (23.19 KB, patch)
2011-11-24 02:39 PST, Michael Brüning
vestbo: review+
vestbo: commit-queue-
Details | Formatted Diff | Diff
Updated proposed patch. (23.07 KB, patch)
2011-11-24 04:15 PST, Michael Brüning
vestbo: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Updated patch. (26.49 KB, patch)
2011-11-24 08:28 PST, Michael Brüning
vestbo: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Updated patch after js fix. (28.56 KB, patch)
2011-12-09 08:43 PST, Michael Brüning
no flags Details | Formatted Diff | Diff
Updated patch (29.61 KB, patch)
2011-12-13 07:52 PST, Michael Brüning
no flags Details | Formatted Diff | Diff
Updated patch. (29.51 KB, patch)
2011-12-14 02:14 PST, Michael Brüning
no flags Details | Formatted Diff | Diff
Patch rebased to current HEAD. (29.38 KB, patch)
2011-12-15 03:37 PST, Michael Brüning
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Brüning 2011-11-21 09:15:23 PST
It has been requested to be able to view the viewport attributes in the Qt version of MiniBrowser. 

This should be implemented using the experimental extensions of QQuickWebView.
Comment 1 Michael Brüning 2011-11-22 01:59:20 PST
Created attachment 116191 [details]
Proposed patch
Comment 2 Michael Brüning 2011-11-22 02:39:21 PST
Adding Tor Arne as he has been working with the experimental extensions.
Comment 3 WebKit Review Bot 2011-11-22 02:47:22 PST
Comment on attachment 116191 [details]
Proposed patch

Attachment 116191 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10569048

New failing tests:
css2.1/20110323/abspos-containing-block-initial-004b.htm
fast/repaint/scroll-fixed-reflected-layer.html
fast/repaint/fixed-scale.html
fast/replaced/width100percent-textarea.html
http/tests/inspector/network-preflight-options.html
fast/repaint/fixed-tranformed.html
css2.1/20110323/abspos-containing-block-initial-004d.htm
fast/repaint/fixed-table-overflow-zindex.html
Comment 4 Tor Arne Vestbø 2011-11-22 04:04:38 PST
Comment on attachment 116191 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116191&action=review

> Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h:168
> +    Q_PROPERTY(QWebViewportAttributes* attributes READ attributes CONSTANT FINAL)

I think viewportAttributes is better, since attributes is a bit too generic.

> Tools/MiniBrowser/qt/qml/BrowserWindow.qml:60
> +        viewportAttributesItem.initialScale = webView.experimental.attributes.initialScale
> +        viewportAttributesItem.minimumScale = webView.experimental.attributes.minimumScale
> +        viewportAttributesItem.maximumScale = webView.experimental.attributes.maximumScale
> +
> +        viewportAttributesItem.isScalable = webView.experimental.attributes.isScalable
> +        viewportAttributesItem.layoutWidth = webView.experimental.attributes.layoutWidth
> +        viewportAttributesItem.layoutHeight = webView.experimental.attributes.layoutHeight
> +    }

Why are you not using bindings for these?

> Tools/MiniBrowser/qt/qml/BrowserWindow.qml:242
> +        onHeightChanged: updateViewportAttributes()
> +        onWidthChanged: updateViewportAttributes()
> +        onLoadSucceeded: updateViewportAttributes()

The viewport attributes themselves should change in response to these events, and the bindings then updated.

> Tools/MiniBrowser/qt/qml/ViewportAttributesItem.qml:5
> +    color: "#000000"

black

> Tools/MiniBrowser/qt/qml/ViewportAttributesItem.qml:19
> +        color: "#ffffff"

white

> Tools/MiniBrowser/qt/qml/ViewportAttributesItem.qml:25
> +       color: "#ffffff"

white

> Tools/MiniBrowser/qt/qml/ViewportAttributesItem.qml:31
> +       color: "#ffffff"

style
Comment 5 Michael Brüning 2011-11-22 08:54:16 PST
Created attachment 116234 [details]
Updated proposed patch
Comment 6 Tor Arne Vestbø 2011-11-23 03:23:50 PST
Comment on attachment 116234 [details]
Updated proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116234&action=review

lgtm, a few fixups before landing please

> ChangeLog:9
> +        attributes, which contains the viewport scalability and layout

viewportAttributes

> Source/WebKit/qt/ChangeLog:9
> +        attributes, which contains the viewport scalability and layout

viewportAttributes

> Source/WebKit2/ChangeLog:9
> +        attributes, which contains the viewport scalability and layout

viewportAttributes

> Tools/ChangeLog:9
> +        attributes, which contains the viewport scalability and layout

viewportAttributes

> Tools/MiniBrowser/qt/qml/BrowserWindow.qml:37
> +    property alias viewportattributesitem: viewportAttributesItem

normal lower-case+title-case naming apply (i see that the webview variable does not follow this, it should)
Comment 7 Michael Brüning 2011-11-23 04:24:16 PST
(In reply to comment #6)
> (From update of attachment 116234 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=116234&action=review
> 
> lgtm, a few fixups before landing please
> 
> > ChangeLog:9
> > +        attributes, which contains the viewport scalability and layout
> 
> viewportAttributes
> 
> > Source/WebKit/qt/ChangeLog:9
> > +        attributes, which contains the viewport scalability and layout
> 
> viewportAttributes
> 
> > Source/WebKit2/ChangeLog:9
> > +        attributes, which contains the viewport scalability and layout
> 
> viewportAttributes
> 
> > Tools/ChangeLog:9
> > +        attributes, which contains the viewport scalability and layout
> 
> viewportAttributes
> 
> > Tools/MiniBrowser/qt/qml/BrowserWindow.qml:37
> > +    property alias viewportattributesitem: viewportAttributesItem
> 
> normal lower-case+title-case naming apply (i see that the webview variable does not follow this, it should)

Thanks for the review, will put in the comments...
Comment 8 Michael Brüning 2011-11-24 02:39:12 PST
Created attachment 116491 [details]
Updated proposed patch

Added a comment about the use of the "webview" property workaround for the experimental extension. 
Changed layout of info page.
Comment 9 Tor Arne Vestbø 2011-11-24 03:32:57 PST
Comment on attachment 116491 [details]
Updated proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116491&action=review

r=me, with comments

> ChangeLog:6
> +        Reviewed by Tor Arne Vestbo.

ø

> Source/WebKit/qt/ChangeLog:6
> +        Reviewed by Tor Arne Vestbo.

ø

> Source/WebKit2/ChangeLog:6
> +        Reviewed by Tor Arne Vestbo.

ø

> Tools/ChangeLog:6
> +        Reviewed by Tor Arne Vestbo.

ø

> Tools/MiniBrowser/qt/qml/BrowserWindow.qml:-189
> -

Don't include this hunk
Comment 10 Michael Brüning 2011-11-24 04:15:02 PST
Created attachment 116495 [details]
Updated proposed patch.

Put in the "ø"'s and "ü"'s at the appropriate places. 
Inserted accidentally removed blank line.
Comment 11 WebKit Review Bot 2011-11-24 04:41:02 PST
Comment on attachment 116495 [details]
Updated proposed patch.

Rejecting attachment 116495 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

Last 500 characters of output:
cripts/webkitpy/common/system/executive.py", line 420, in run_command
    close_fds=self._should_close_fds())
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/common/system/executive.py", line 476, in popen
    return subprocess.Popen(*args, **kwargs)
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
TypeError: execv() arg 2 must contain only strings

Full output: http://queues.webkit.org/results/10618280
Comment 12 Kenneth Rohde Christiansen 2011-11-24 04:45:36 PST
Comment on attachment 116495 [details]
Updated proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=116495&action=review

> Source/WebKit2/UIProcess/API/qt/qwebviewportattributes.cpp:40
> +qreal QWebViewportAttributes::initialScale() const
> +{
> +    return m_initialScale;
> +}

What about currentScale? Isnt that pretty useful for debugging?

> Tools/MiniBrowser/qt/qml/BrowserWindow.qml:240
> +        // the issue is resovled.

spelling error. Bug url?
Comment 13 Michael Brüning 2011-11-24 04:57:17 PST
(In reply to comment #12)
> (From update of attachment 116495 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=116495&action=review
> 
> > Source/WebKit2/UIProcess/API/qt/qwebviewportattributes.cpp:40
> > +qreal QWebViewportAttributes::initialScale() const
> > +{
> > +    return m_initialScale;
> > +}
> 
> What about currentScale? Isnt that pretty useful for debugging?
> 
True. Will add it.
> > Tools/MiniBrowser/qt/qml/BrowserWindow.qml:240
> > +        // the issue is resovled.
> 
> spelling error. Bug url?
Not clear where the bug is at the moment, so no bug to add yet.
Comment 14 Michael Brüning 2011-11-24 08:28:49 PST
Created attachment 116517 [details]
Updated patch.

Renamed viewportAttributes to viewportInfo (also in the cpp part), added currentScale, devicePixelRatio and contentsWidth and contentsHeight properties.
Comment 15 Tor Arne Vestbø 2011-11-24 08:37:46 PST
(In reply to comment #14)
> Created an attachment (id=116517) [details]
> Updated patch.
> 
> Renamed viewportAttributes to viewportInfo (also in the cpp part), added currentScale, devicePixelRatio and contentsWidth and contentsHeight properties.

Sorry to keep nitpicking, but it should be contentWidth and contentHeight :/ (not plural)
Comment 16 Michael Brüning 2011-11-24 08:52:16 PST
(In reply to comment #15)
> (In reply to comment #14)
> > Created an attachment (id=116517) [details] [details]
> > Updated patch.
> > 
> > Renamed viewportAttributes to viewportInfo (also in the cpp part), added currentScale, devicePixelRatio and contentsWidth and contentsHeight properties.
> 
> Sorry to keep nitpicking, but it should be contentWidth and contentHeight :/ (not plural)

As discussed in #qtwebkit, the size that is referred to in the properties is the contentsSize, so plural matches the wording in the QQuickWebView handlers...
Comment 17 WebKit Review Bot 2011-11-25 02:41:09 PST
Comment on attachment 116517 [details]
Updated patch.

Rejecting attachment 116517 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

Last 500 characters of output:
cripts/webkitpy/common/system/executive.py", line 420, in run_command
    close_fds=self._should_close_fds())
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/common/system/executive.py", line 476, in popen
    return subprocess.Popen(*args, **kwargs)
  File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
TypeError: execv() arg 2 must contain only strings

Full output: http://queues.webkit.org/results/10644579
Comment 18 Michael Brüning 2011-12-09 08:43:55 PST
Created attachment 118584 [details]
Updated patch after js fix.

Updated patch because the qml extended type fix has been released. 

Added missing update of contentsSize in viewportInfo if the event was received during a page transition. 
To achieve that, I moved the implementation PostTransitionState::apply from qquickwebview_p_p.h to qquickwebview.cpp.
Comment 19 Kenneth Rohde Christiansen 2011-12-10 07:35:02 PST
Comment on attachment 118584 [details]
Updated patch after js fix.

View in context: https://bugs.webkit.org/attachment.cgi?id=118584&action=review

why r? when it is already reviewed?

> Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:210
> +    q->m_experimental->viewportInfo()->setCurrentScale(static_cast<qreal>(scale));

Why are all these value "copied" and not queried? ie queries from the interaction engine.
Comment 20 Michael Brüning 2011-12-13 07:52:30 PST
Created attachment 119018 [details]
Updated patch

Removed the caching of viewport constraint data in QWebViewportInfo and made it use the QQuickWebViewPrivate data instead.
Added layoutSize as a member of QtViewportInteractionEngine::Constraints in order to not cache it in QWebViewportInfo. 
Changed layoutWidth and layoutHeight to layoutSize and contentsWidth/contentsHeight to contentsSize.
Comment 21 Kenneth Rohde Christiansen 2011-12-13 08:06:00 PST
Comment on attachment 119018 [details]
Updated patch

View in context: https://bugs.webkit.org/attachment.cgi?id=119018&action=review

> Source/WebKit2/ChangeLog:6
> +
> +        Reviewed by Tor Arne Vestbø.

I guess such a big change requires you to null this line

> Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp:52
> +    if (!m_webViewPrivate->interactionEngine)
> +        return -1.0;

it would be 1.0 actually :-)

> Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp:60
> +    if (!m_webViewPrivate->interactionEngine)
> +        return -1.0;

I guess it would be 1.0 :-) as well

> Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp:68
> +    if (!m_webViewPrivate->interactionEngine)
> +        return -1.0;

same here
Comment 22 Michael Brüning 2011-12-14 02:14:57 PST
Created attachment 119181 [details]
Updated patch.

Moved the values that depend on the interactionEngine to be QVariants
Comment 23 Kenneth Rohde Christiansen 2011-12-14 04:32:47 PST
Comment on attachment 119181 [details]
Updated patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=119181&action=review

> Source/WebKit2/UIProcess/API/qt/qwebviewportinfo_p.h:39
> +    Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeUpdated)

I miss contentsPosition :-)
Comment 24 WebKit Review Bot 2011-12-14 05:23:06 PST
Comment on attachment 119181 [details]
Updated patch.

Rejecting attachment 119181 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
UIProcess/qt/QtViewportInteractionEngine.h
patching file Source/qtwebkit-export.map
patching file Tools/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Tools/MiniBrowser/qt/MiniBrowser.pro
patching file Tools/MiniBrowser/qt/MiniBrowser.qrc
patching file Tools/MiniBrowser/qt/qml/BrowserWindow.qml
patching file Tools/MiniBrowser/qt/qml/ViewportInfoItem.qml

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--reviewer', u'Kenneth Rohde Christia..." exit_code: 1

Full output: http://queues.webkit.org/results/10871232
Comment 25 Michael Brüning 2011-12-15 03:37:08 PST
Created attachment 119408 [details]
Patch rebased to current HEAD.

Commit queue seems to have been unable to apply die to merge conflicts. 
Rebased patch locally and uploaded that version.
Comment 26 Kenneth Rohde Christiansen 2011-12-15 03:50:31 PST
Comment on attachment 119408 [details]
Patch rebased to current HEAD.

You should have filled in my name and set cq? but now let me r+ and cq+
Comment 27 WebKit Review Bot 2011-12-15 04:38:58 PST
Comment on attachment 119408 [details]
Patch rebased to current HEAD.

Clearing flags on attachment: 119408

Committed r102922: <http://trac.webkit.org/changeset/102922>
Comment 28 Michael Brüning 2011-12-16 03:40:24 PST
Comment on attachment 119181 [details]
Updated patch.

Clearing flags from obsolete patch.
Comment 29 Michael Brüning 2011-12-16 03:41:06 PST
Marked Resolved Fixed as the patch has been landed via cq...