Skip to content
  • hausmann@webkit.org's avatar
    [Qt] Layer violation: qt_runtime.cpp accesses QWebElement and QTDRTNode... · 83a54729
    hausmann@webkit.org authored
    [Qt] Layer violation: qt_runtime.cpp accesses QWebElement and QTDRTNode https://bugs.webkit.org/show_bug.cgi?id=72595
    
    Reviewed by Noam Rosenthal.
    
    Source/WebCore:
    
    Removed QWebElement and QtDRTNode usage that reached from WebCore into
    WebKit/qt and replaced it with the ability to register custom JSValue
    conversion functions. The old code has been moved to WebKit/qt.
    
    * bridge/qt/qt_instance.cpp:
    (JSC::Bindings::QtInstance::QtInstance): Remove unnecessary meta type registration
    (now done in QtWebElementRuntime::initialize in WebKit/qt).
    * bridge/qt/qt_runtime.cpp:
    (JSC::Bindings::registerCustomType):
    (JSC::Bindings::convertValueToQVariant):
    (JSC::Bindings::convertQVariantToValue):
    * bridge/qt/qt_runtime.h:
    
    Source/WebKit:
    
    * WebKit.pri: Add qwebelement_p.h to HEADERS.
    
    Source/WebKit/qt:
    
    Move QWebElement and QtDRTNode JS bindings from WebCore to WebKit/qt.
    
    * Api/qwebelement.cpp: Add QWebElement to JSValue and JSValue to QWebElement
    conversion through intermediate QVariant.
    (QtWebElementRuntime::create):
    (QtWebElementRuntime::get):
    (convertJSValueToWebElementVariant):
    (convertWebElementVariantToJSValue):
    (QtWebElementRuntime::initialize): Register conversion functions for QWebElement.
    * Api/qwebelement.h:
    * Api/qwebelement_p.h: Added.
    * Api/qwebpage.cpp:
    (QWebPagePrivate::QWebPagePrivate): Initialize QWebElement conversion functions for
    the JS runtime.
    * WebCoreSupport/DumpRenderTreeSupportQt.cpp: Add QtDRTNode to JSValue and JSValue to
    QtDRTNode conversion through intermediate QVariant.
    (QtDRTNodeRuntime::create):
    (QtDRTNodeRuntime::get):
    (convertJSValueToNodeVariant):
    (convertNodeVariantToJSValue):
    (QtDRTNodeRuntime::initialize):
    (DumpRenderTreeSupportQt::initialize): Register conversion functions for QtDRTNode.
    * WebCoreSupport/DumpRenderTreeSupportQt.h:
    
    Tools:
    
    * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
    (WebCore::DumpRenderTree::DumpRenderTree): Use new initialize() function to
    ensure the registration of the DRTNode JS bindings.
    * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
    (LayoutTestController::LayoutTestController): Remove unnecessary explicit qt meta type
    registration of QWebElement (now done implicitly through QWebPage ->
    QtWebElementRunTime::initialize code path)
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    83a54729