Bug 48957

Summary: [Qt] Introduce QDRTNode for passing WebCore::Node across JS bridge
Product: WebKit Reporter: Robert Hogan <robert>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, tonikitoo, webkit.review.bot
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on: 53921    
Bug Blocks: 31099, 46601    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Robert Hogan 2010-11-03 15:18:27 PDT
QDRTNode can be used for passing DOM nodes that are not HTMLElements across the JS bridge. Gives us a chance of passing nodesFromRect tests.
Comment 1 Robert Hogan 2010-11-03 15:22:24 PDT
Created attachment 72878 [details]
Patch
Comment 2 WebKit Review Bot 2010-11-03 15:25:50 PDT
Attachment 72878 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'WebCore/ChangeLog', u'WebCore/bridge/qt/qt_runtime.cpp', u'WebKit/qt/ChangeLog', u'WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp', u'WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h']" exit_code: 1
WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h:30:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Robert Hogan 2010-11-06 11:14:27 PDT
Created attachment 73173 [details]
Patch
Comment 4 Robert Hogan 2010-11-06 11:14:50 PDT
This allows fast/dom/nodesFromRect-inner-documents.html an fast/dom/nodesFromRect-links-and-text.html to pass on Qt.
Comment 5 Antonio Gomes 2010-11-08 14:21:59 PST
Looks reasonable, although I will review better soon.

All this path robert had to take is because qwebelement does not work well for text nodes. see bug 31099.
Comment 6 Robert Hogan 2010-11-29 13:47:42 PST
Antonio, thoughts?
Comment 7 Antonio Gomes 2010-11-30 09:38:16 PST
Comment on attachment 73173 [details]
Patch

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

> WebCore/bridge/qt/qt_runtime.cpp:142
> +    static QDRTNode create(Node* element)

'Node* element' looks strange to me, Robert. Could we just name it 'node'?

> WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h:74
> +    WebCore::Node* m_element;

Ditto. m_node make more sense to me, and actually throughout the patch.
Comment 8 Robert Hogan 2010-12-08 11:59:57 PST
Created attachment 75941 [details]
Patch
Comment 9 Robert Hogan 2011-01-02 07:02:56 PST
(In reply to comment #8)
> Created an attachment (id=75941) [details]
> Patch

Hi Antonio,

Thoughts? ;-)
Comment 10 Antonio Gomes 2011-01-02 21:03:05 PST
Comment on attachment 75941 [details]
Patch

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

> WebCore/bridge/qt/qt_runtime.cpp:137
> +// this is here as a proxy, so we'd have a class to friend in QDRTNode,

Capital T.

> WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp:91
> +        m_node = static_cast<Node*>(node);

Do you need to static_cast Node* to Node*?
Comment 11 Robert Hogan 2011-01-04 12:22:41 PST
Created attachment 77915 [details]
Patch
Comment 12 Robert Hogan 2011-01-04 12:24:12 PST
(In reply to comment #10)
> (From update of attachment 75941 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75941&action=review
> 
> > WebCore/bridge/qt/qt_runtime.cpp:137
> > +// this is here as a proxy, so we'd have a class to friend in QDRTNode,
> 
> Capital T.
> 
> > WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp:91
> > +        m_node = static_cast<Node*>(node);
> 
> Do you need to static_cast Node* to Node*?

When fixing up per your comments I realized we should make the expected results less platform-specific. Proposed change to results in the patch. Do you agree?
Comment 13 WebKit Commit Bot 2011-01-05 00:10:31 PST
Comment on attachment 77915 [details]
Patch

Rejecting attachment 77915 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-3', 'apply-attachment', '--no-update', '--non-interactive', 77915]" exit_code: 1
Last 500 characters of output:
rks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
    result = func(*args)
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_http.py", line 756, in https_open
    return self.do_open(conn_factory, req)
  File "/mnt/git/webkit-commit-queue/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_http.py", line 706, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://queues.webkit.org/results/7297400
Comment 14 Robert Hogan 2011-01-05 14:04:20 PST
Created attachment 78041 [details]
Patch
Comment 15 Robert Hogan 2011-01-06 11:26:36 PST
Created attachment 78135 [details]
Patch
Comment 16 WebKit Commit Bot 2011-01-06 12:55:04 PST
Comment on attachment 78135 [details]
Patch

Clearing flags on attachment: 78135

Committed r75189: <http://trac.webkit.org/changeset/75189>
Comment 17 WebKit Commit Bot 2011-01-06 12:55:11 PST
All reviewed patches have been landed.  Closing bug.