Changeset 75189 in webkit
- Timestamp:
- Jan 6, 2011 12:54:44 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r75181 r75189 1 2011-01-06 Robert Hogan <robert@webkit.org> 2 3 Reviewed by Antonio Gomes. 4 5 [Qt] Introduce QDRTNode for passing WebCore::Node across JS bridge 6 7 This allows LayoutTestController to pass WebCore::Node back to 8 layout tests. 9 10 Also amend nodesFromRect-links-and-text.html and 11 nodesFromRect-inner-documents.html so that they do not produce 12 platform-specific results. 13 14 Unskip: 15 fast/dom/nodesFromRect-links-and-text.html 16 fast/dom/nodesFromRect-inner-documents.html 17 18 https://bugs.webkit.org/show_bug.cgi?id=48957 19 20 * fast/dom/nodesFromRect-inner-documents-expected.txt: 21 * fast/dom/nodesFromRect-inner-documents.html: 22 * fast/dom/nodesFromRect-links-and-text-expected.txt: 23 * fast/dom/nodesFromRect-links-and-text.html: 24 * fast/dom/resources/nodesFromRect.js: 25 (check): 26 (getTopFor): 27 (getBottomFor): 28 * platform/qt/Skipped: 29 1 30 2011-01-06 Stephen White <senorblanco@chromium.org> 2 31 -
trunk/LayoutTests/fast/dom/nodesFromRect-basic-expected.txt
r69939 r75189 2 2 3 3 TEST COMPLETE 4 PASS All correct nodes found for rect [53,71], [0,0,0,0]5 PASS All correct nodes found for rect [53,71], [10,0,0,0]6 PASS All correct nodes found for rect [53,71], [0,10,0,0]7 PASS All correct nodes found for rect [53,71], [0,0,10,0]8 PASS All correct nodes found for rect [53,71], [0,0,0,10]9 PASS All correct nodes found for rect [53,71], [0,10,0,10]10 PASS All correct nodes found for rect [53,71], [10,0,10,0]11 PASS All correct nodes found for rect [53,71], [10,10,10,10]12 PASS All correct nodes found for rect [152,105], [10,0,0,0]13 PASS All correct nodes found for rect [152,105], [0,10,0,0]14 PASS All correct nodes found for rect [152,105], [0,0,10,0]15 PASS All correct nodes found for rect [152,105], [0,0,0,10]16 PASS All correct nodes found for rect [152,105], [10,0,10,0]17 PASS All correct nodes found for rect [152,105], [0,10,0,10]18 PASS All correct nodes found for rect [152,105], [10,10,10,10]19 PASS All correct nodes found for rect [153,193], [0,0,0,0]20 PASS All correct nodes found for rect [153,193], [0,20,0,20]21 PASS All correct nodes found for rect [153,193], [20,0,20,0]22 PASS All correct nodes found for rect [77,240], [0,0,0,0]23 PASS All correct nodes found for rect [77,240], [1,0,0,0]24 PASS All correct nodes found for rect [77,240], [0,0,1,0]25 PASS All correct nodes found for rect [77,240], [1,0,1,0]26 PASS All correct nodes found for rect [144,183], [0,0,0,0]27 PASS All correct nodes found for rect [144,183], [1,0,1,0]28 PASS All correct nodes found for rect [144,183], [0,1,0,1]29 PASS All correct nodes found for rect [144,183], [0,0,1,0]30 PASS All correct nodes found for rect [144,183], [0,0,0,1]31 PASS All correct nodes found for rect [144,183], [0,0,1,1]32 PASS All correct nodes found for rect [144,183], [1,1,1,1]33 PASS All correct nodes found for rect [77,240], [0,0,0,0]34 PASS All correct nodes found for rect [77,240], [0,1,0,1]35 PASS All correct nodes found for rect [77,240], [1,0,0,0]36 PASS All correct nodes found for rect [77,240], [0,0,1,0]37 PASS All correct nodes found for rect [77,240], [1,0,1,0]38 PASS All correct nodes found for rect [77,240], [1,1,1,1]39 PASS All correct nodes found for rect [39,212], [0,0,0,0]40 PASS All correct nodes found for rect [39,212], [10,0,0,0]41 PASS All correct nodes found for rect [39,212], [0,0,10,0]42 PASS All correct nodes found for rect [39,212], [10,1,30,0]43 PASS All correct nodes found for rect [39,212], [10,5,30,0]44 PASS All correct nodes found for rect [39,212], [10,15,30,0]45 PASS All correct nodes found for rect [39,212], [10,0,10,0]46 PASS All correct nodes found for rect [39,212], [0,10,0,10]47 PASS All correct nodes found for rect [39,212], [10,10,10,10]4 PASS All correct nodes found for rect 5 PASS All correct nodes found for rect 6 PASS All correct nodes found for rect 7 PASS All correct nodes found for rect 8 PASS All correct nodes found for rect 9 PASS All correct nodes found for rect 10 PASS All correct nodes found for rect 11 PASS All correct nodes found for rect 12 PASS All correct nodes found for rect 13 PASS All correct nodes found for rect 14 PASS All correct nodes found for rect 15 PASS All correct nodes found for rect 16 PASS All correct nodes found for rect 17 PASS All correct nodes found for rect 18 PASS All correct nodes found for rect 19 PASS All correct nodes found for rect 20 PASS All correct nodes found for rect 21 PASS All correct nodes found for rect 22 PASS All correct nodes found for rect 23 PASS All correct nodes found for rect 24 PASS All correct nodes found for rect 25 PASS All correct nodes found for rect 26 PASS All correct nodes found for rect 27 PASS All correct nodes found for rect 28 PASS All correct nodes found for rect 29 PASS All correct nodes found for rect 30 PASS All correct nodes found for rect 31 PASS All correct nodes found for rect 32 PASS All correct nodes found for rect 33 PASS All correct nodes found for rect 34 PASS All correct nodes found for rect 35 PASS All correct nodes found for rect 36 PASS All correct nodes found for rect 37 PASS All correct nodes found for rect 38 PASS All correct nodes found for rect 39 PASS All correct nodes found for rect 40 PASS All correct nodes found for rect 41 PASS All correct nodes found for rect 42 PASS All correct nodes found for rect 43 PASS All correct nodes found for rect 44 PASS All correct nodes found for rect 45 PASS All correct nodes found for rect 46 PASS All correct nodes found for rect 47 PASS All correct nodes found for rect 48 48 -
trunk/LayoutTests/fast/dom/nodesFromRect-inner-documents-expected.txt
r70147 r75189 2 2 3 3 TEST COMPLETE 4 PASS All correct nodes found for rect [176,120], [0,0,0,0]5 PASS All correct nodes found for rect [176,120], [10,10,10,10]6 PASS All correct nodes found for rect [14,167], [0,10,0,0]7 PASS All correct nodes found for rect [150,17], [0,0,0,0]8 PASS All correct nodes found for rect [150,17], [0,0,10,0]9 PASS All correct nodes found for rect [150,17], [0,0,25,0]4 PASS All correct nodes found for rect 5 PASS All correct nodes found for rect 6 PASS All correct nodes found for rect 7 PASS All correct nodes found for rect 8 PASS All correct nodes found for rect 9 PASS All correct nodes found for rect 10 10 -
trunk/LayoutTests/fast/dom/nodesFromRect-inner-documents.html
r70147 r75189 39 39 var body = innerDocument.getElementsByTagName('body')[0]; 40 40 var divCenter = getCenterFor(div); 41 var divBottom = getBottomFor(div); 42 var pCenter = getCenterFor(p); 41 43 check(divCenter.x, divCenter.y, 0, 0, 0, 0, [div], innerDocument); 42 check(divCenter.x, divCenter.y, 0, 0, 10, 0, [div, body], innerDocument);43 check(divCenter.x, divCenter.y, 0, 0, 25, 0, [p, div, body], innerDocument);44 check(divCenter.x, divCenter.y, 0, 0, divBottom.y - divCenter.y, 0, [div, body], innerDocument); 45 check(divCenter.x, divCenter.y, 0, 0, pCenter.y - divCenter.y, 0, [p, div, body], innerDocument); 44 46 45 47 if (window.layoutTestController) -
trunk/LayoutTests/fast/dom/nodesFromRect-links-and-text-expected.txt
r70078 r75189 5 5 6 6 TEST COMPLETE 7 PASS All correct nodes found for rect [37,32], [0,0,0,0]8 PASS All correct nodes found for rect [37,32], [10,0,0,0]9 PASS All correct nodes found for rect [37,32], [0,0,18,0]10 PASS All correct nodes found for rect [37,32], [0,11.5,0,0]11 PASS All correct nodes found for rect [37,32], [0,23,0,0]12 PASS All correct nodes found for rect [37,32], [0,23,18,0]7 PASS All correct nodes found for rect 8 PASS All correct nodes found for rect 9 PASS All correct nodes found for rect 10 PASS All correct nodes found for rect 11 PASS All correct nodes found for rect 12 PASS All correct nodes found for rect 13 13 -
trunk/LayoutTests/fast/dom/nodesFromRect-links-and-text.html
r70058 r75189 27 27 var centerA2 = getCenterFor(e.a2); 28 28 var centerA3 = getCenterFor(e.a3); 29 var topP1 = getTopFor(e.p1); 30 var topA1 = getTopFor(e.a1); 29 31 var centerText = { x : (centerA2.x + centerA1.x) / 2, y : centerA1.y }; //text node between a1 and a2 30 32 31 33 check(centerA1.x, centerA1.y, 0, 0, 0, 0, [e.a1.firstChild]); 32 check(centerA1.x, centerA1.y, 10, 0, 0, 0, [e.a1.firstChild, e.a1, e.p1]);34 check(centerA1.x, centerA1.y, topA1.y - topP1.y, 0, 0, 0, [e.a1.firstChild, e.a1, e.p1]); 33 35 34 36 check(centerA1.x, centerA1.y, 0, 0, centerA3.y - centerA1.y, 0, [e.a3.firstChild, e.a3, e.p1, e.a1.firstChild, e.a1]); -
trunk/LayoutTests/fast/dom/resources/nodesFromRect.js
r70147 r75189 35 35 } 36 36 37 testPassed("All correct nodes found for rect " + 38 "[" + x + "," + y + "], " + 39 "[" + topPadding + "," + rightPadding + 40 "," + bottomPadding + "," + leftPadding + "]"); 37 testPassed("All correct nodes found for rect"); 41 38 } 42 39 … … 47 44 } 48 45 46 function getTopFor(element) 47 { 48 var rect = element.getBoundingClientRect(); 49 return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt(rect.top)}; 50 } 51 52 function getBottomFor(element) 53 { 54 var rect = element.getBoundingClientRect(); 55 return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt(rect.bottom)}; 56 } 57 49 58 var successfullyParsed = true; -
trunk/LayoutTests/platform/qt/Skipped
r75150 r75189 5288 5288 fast/filesystem 5289 5289 5290 # Needs more investigation.5291 fast/dom/nodesFromRect-links-and-text.html5292 fast/dom/nodesFromRect-inner-documents.html5293 5294 5290 # It fails, because 3D canvas is disabled by default. 5295 5291 http/tests/canvas/webgl/origin-clean-conformance.html -
trunk/WebCore/ChangeLog
r75188 r75189 1 2011-01-06 Robert Hogan <robert@webkit.org> 2 3 Reviewed by Antonio Gomes. 4 5 [Qt] Introduce QDRTNode for passing WebCore::Node across JS bridge 6 7 This allows LayoutTestController to pass WebCore::Node back to 8 layout tests. 9 10 Also amend nodesFromRect-links-and-text.html and 11 nodesFromRect-inner-documents.html so that they do not produce 12 platform-specific results. 13 14 Unskip: 15 fast/dom/nodesFromRect-links-and-text.html 16 fast/dom/nodesFromRect-inner-documents.html 17 18 https://bugs.webkit.org/show_bug.cgi?id=48957 19 20 * bridge/qt/qt_runtime.cpp: 21 (JSC::Bindings::QtDRTNodeRuntime::create): 22 (JSC::Bindings::QtDRTNodeRuntime::get): 23 (JSC::Bindings::convertValueToQVariant): 24 (JSC::Bindings::convertQVariantToValue): 25 1 26 2011-01-06 Joone Hur <joone.hur@collabora.co.uk> 2 27 -
trunk/WebCore/bridge/qt/qt_runtime.cpp
r71004 r75189 25 25 #include "DateMath.h" 26 26 #include "DatePrototype.h" 27 #include "DumpRenderTreeSupportQt.h" 27 28 #include "FunctionPrototype.h" 28 29 #include "Interpreter.h" … … 131 132 { 132 133 return element.m_element; 134 } 135 }; 136 137 // this is here as a proxy, so we'd have a class to friend in QDRTNode, 138 // as getting/setting a WebCore in QDRTNode is private. 139 // We only need to pass WebCore Nodes for layout tests. 140 class QtDRTNodeRuntime { 141 public: 142 static QDRTNode create(Node* node) 143 { 144 return QDRTNode(node); 145 } 146 147 static Node* get(const QDRTNode& node) 148 { 149 return node.m_node; 133 150 } 134 151 }; … … 753 770 else 754 771 ret = QVariant::fromValue<QWebElement>(QWebElement()); 772 } else if (hint == (QMetaType::Type) qMetaTypeId<QDRTNode>()) { 773 if (object && object->inherits(&JSNode::s_info)) 774 ret = QVariant::fromValue<QDRTNode>(QtDRTNodeRuntime::create((static_cast<JSNode*>(object))->impl())); 755 775 } else if (hint == (QMetaType::Type) qMetaTypeId<QVariant>()) { 756 776 if (value.isUndefinedOrNull()) { … … 897 917 898 918 return toJS(exec, toJSDOMGlobalObject(document, exec), QtWebElementRuntime::get(variant.value<QWebElement>())); 919 } 920 921 if (type == qMetaTypeId<QDRTNode>()) { 922 if (!root->globalObject()->inherits(&JSDOMWindow::s_info)) 923 return jsUndefined(); 924 925 Document* document = (static_cast<JSDOMWindow*>(root->globalObject()))->impl()->document(); 926 if (!document) 927 return jsUndefined(); 928 929 return toJS(exec, toJSDOMGlobalObject(document, exec), QtDRTNodeRuntime::get(variant.value<QDRTNode>())); 899 930 } 900 931 -
trunk/WebKit/qt/ChangeLog
r75119 r75189 1 2011-01-06 Robert Hogan <robert@webkit.org> 2 3 Reviewed by Antonio Gomes. 4 5 [Qt] Introduce QDRTNode for passing WebCore::Node across JS bridge 6 7 This allows LayoutTestController to pass WebCore::Node back to 8 layout tests. 9 10 Also amend nodesFromRect-links-and-text.html and 11 nodesFromRect-inner-documents.html so that they do not produce 12 platform-specific results. 13 14 Unskip: 15 fast/dom/nodesFromRect-links-and-text.html 16 fast/dom/nodesFromRect-inner-documents.html 17 18 https://bugs.webkit.org/show_bug.cgi?id=48957 19 20 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 21 (QDRTNode::QDRTNode): 22 (QDRTNode::~QDRTNode): 23 (DumpRenderTreeSupportQt::nodesFromRect): 24 * WebCoreSupport/DumpRenderTreeSupportQt.h: 25 1 26 2011-01-04 Girish Ramakrishnan <girish@forwardbias.in> 2 27 -
trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r73862 r75189 83 83 QMap<int, QWebScriptWorld*> m_worldMap; 84 84 85 QDRTNode::QDRTNode() 86 : m_node(0) 87 { 88 } 89 90 QDRTNode::QDRTNode(WebCore::Node* node) 91 : m_node(0) 92 { 93 if (node) { 94 m_node = node; 95 m_node->ref(); 96 } 97 } 98 99 QDRTNode::~QDRTNode() 100 { 101 if (m_node) 102 m_node->deref(); 103 } 104 105 85 106 DumpRenderTreeSupportQt::DumpRenderTreeSupportQt() 86 107 { … … 855 876 QVariant v; 856 877 // QWebElement will be null if the Node is not an HTML Element 857 v.setValue(QWebElement(nodes->item(i))); 878 if (nodes->item(i)->isHTMLElement()) 879 v.setValue(QWebElement(nodes->item(i))); 880 else 881 v.setValue(QDRTNode(nodes->item(i))); 858 882 res << v; 859 883 } -
trunk/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
r73862 r75189 27 27 #include <QVariant> 28 28 29 namespace WebCore { 30 class Text; 31 class Node; 32 } 33 34 35 #if defined(WTF_USE_V8) && WTF_USE_V8 36 namespace V8 { 37 namespace Bindings { 38 class QtDRTNodeRuntime; 39 } 40 } 41 #else 42 namespace JSC { 43 namespace Bindings { 44 class QtDRTNodeRuntime; 45 } 46 } 47 #endif 48 29 49 class QWebElement; 30 50 class QWebFrame; … … 34 54 35 55 extern QMap<int, QWebScriptWorld*> m_worldMap; 56 57 // Used to pass WebCore::Node's to layout tests using LayoutTestController 58 class QWEBKIT_EXPORT QDRTNode { 59 public: 60 QDRTNode(); 61 ~QDRTNode(); 62 63 private: 64 explicit QDRTNode(WebCore::Node*); 65 66 friend class DumpRenderTreeSupportQt; 67 68 #if defined(WTF_USE_V8) && WTF_USE_V8 69 friend class V8::Bindings::QtDRTNodeRuntime; 70 #else 71 friend class JSC::Bindings::QtDRTNodeRuntime; 72 #endif 73 74 WebCore::Node* m_node; 75 }; 76 77 Q_DECLARE_METATYPE(QDRTNode) 36 78 37 79 class QWEBKIT_EXPORT DumpRenderTreeSupportQt {
Note: See TracChangeset
for help on using the changeset viewer.