Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QWebView not repainting on changed content / DOM by javascript



  • Hi all,

    I'm stuck for days now on this issue:
    I've a simple webpage consisting of a button which should toggle the background svg's of elements displayed.

    Onclick of the button nothing happens unless I resize the WebView or manually call "repaint" periodically i.e. a timer.

    Is there any way of detecting changed content besides QWebFrame::toHtml() ?



  • @CertaBit What QtWebKit version are you using?

    If all else fails, you can install event filter to dispatch clicks on webview, and call update()



  • Hi @Konstantin-Tokarev,

    QtWebKit v.5.5.

    Event Filter? Could you elaborate that please? I don't have a public update() method on QWebView...

    my current approach is:

        static QString oldhtml = "";
    
        if(repaintEnabled)
        {
            QString newhtml = view->page()->mainFrame()->toHtml();
            if(QString::compare(oldhtml, newhtml) != 0)
            {
                view->repaint();
            }
    
            oldhtml = view->page()->mainFrame()->toHtml();
        }
    

    the problem is, that eventually updates can occur because of data change in the background, not triggered by user clicking on anything...

    It's an embedded system with touch display showing the state of a physical device which can change based on i.e. sensor signals



  • You should upgrade to QtWebKit 5.212, it's compatible with Qt 5.5 if you require that version. It can be that it's caused by some bug in SVG engine which was fixed since then. You can also upload test page somewhere so I could check it here.

    I don't have a public update() method on QWebView

    It's inherited from QWidget, just like repaint(). Comparing toHtml result is hugely inefficient, even repainting on each mouse click should waste less CPU



  • @Konstantin-Tokarev
    Thanks for the hint, did you mean this fork: https://github.com/annulen/webkit

    since qwebkit has been deprecated after qt 5.5



  • This post is deleted!


  • When trying to compile qWebkit I get this error(s): (beside the fact that's really time consuming (2-3 hours on MacBook Pro with 7 cores assigned to linux vm)

    [ 93%] Building CXX object Source/WebKit2/CMakeFiles/WebKit2.dir/Shared/qt/NativeWebMouseEventQt.cpp.o
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: In member function ‘virtual void WebKit::WebCoordinatedSurface::copyToTexture(WTF::PassRefPtr<WebCore::BitmapTexture>, const WebCore::IntRect&, const WebCore::IntPoint&)’:
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:216:12: error: invalid use of incomplete type ‘class WebCore::BitmapTexture’
         texture->updateContents(image.get(), target, sourceOffset, BitmapTexture::UpdateCanModifyOriginalImageData);
                ^
    In file included from /media/psf/Downloads/qtwebkit/WebKitBuild/Release/DerivedSources/ForwardingHeaders/WebCore/CoordinatedSurface.h:1:0,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.h:26,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:22:
    /media/psf/Downloads/qtwebkit/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedSurface.h:30:7: note: forward declaration of ‘class WebCore::BitmapTexture’
     class BitmapTexture;
           ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:216:64: error: incomplete type ‘WebCore::BitmapTexture’ used in nested name specifier
         texture->updateContents(image.get(), target, sourceOffset, BitmapTexture::UpdateCanModifyOriginalImageData);
                                                                    ^
    In file included from /media/psf/Downloads/qtwebkit/Source/WTF/wtf/RefPtr.h:30:0,
                     from /media/psf/Downloads/qtwebkit/Source/WTF/wtf/VectorTraits.h:25,
                     from /media/psf/Downloads/qtwebkit/Source/WTF/wtf/Vector.h:35,
                     from /media/psf/Downloads/qtwebkit/Source/WTF/wtf/text/StringImpl.h:34,
                     from /media/psf/Downloads/qtwebkit/Source/WTF/wtf/text/WTFString.h:29,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Platform/SharedMemory.h:36,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/ShareableBitmap.h:29,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.h:25,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:22:
    /media/psf/Downloads/qtwebkit/Source/WTF/wtf/PassRefPtr.h: In instantiation of ‘void WTF::derefIfNotNull(T*) [with T = WebCore::BitmapTexture]’:
    /media/psf/Downloads/qtwebkit/Source/WTF/wtf/RefPtr.h:59:45:   required from ‘WTF::RefPtr<T>::~RefPtr() [with T = WebCore::BitmapTexture]’
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:196:46:   required from here
    /media/psf/Downloads/qtwebkit/Source/WTF/wtf/PassRefPtr.h:42:13: error: invalid use of incomplete type ‘class WebCore::BitmapTexture’
                 ptr->deref();
                 ^
    In file included from /media/psf/Downloads/qtwebkit/WebKitBuild/Release/DerivedSources/ForwardingHeaders/WebCore/CoordinatedSurface.h:1:0,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.h:26,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:22:
    /media/psf/Downloads/qtwebkit/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedSurface.h:30:7: note: forward declaration of ‘class WebCore::BitmapTexture’
     class BitmapTexture;
           ^
    Source/WebKit2/CMakeFiles/WebKit2.dir/build.make:10987: recipe for target 'Source/WebKit2/CMakeFiles/WebKit2.dir/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp.o' failed
    make[2]: *** [Source/WebKit2/CMakeFiles/WebKit2.dir/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: In member function ‘void WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext(const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&, const WebCore::Color&, bool, const WebCore::FloatPoint&, WebCore::TextureMapper::PaintFlags)’:
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:76:21: error: ‘TextureMapperGL’ does not name a type
             static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
                         ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:76:36: error: expected ‘>’ before ‘*’ token
             static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
                                        ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:76:36: error: expected ‘(’ before ‘*’ token
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:76:37: error: expected primary-expression before ‘>’ token
             static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
                                         ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:76:63: error: ‘class WebCore::TextureMapper’ has no member named ‘setEnableEdgeDistanceAntialiasing’
             static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
                                                                   ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:76:102: error: expected ‘)’ before ‘;’ token
             static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
                                                                                                          ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:102:50: error: ‘TextureMapperGL’ does not name a type
             GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
                                                      ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:102:65: error: expected ‘>’ before ‘*’ token
             GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
                                                                     ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:102:65: error: expected ‘(’ before ‘*’ token
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:102:66: error: expected primary-expression before ‘>’ token
             GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
                                                                      ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:102:92: error: ‘class WebCore::TextureMapper’ has no member named ‘graphicsContext3D’
             GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
                                                                                                ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:102:111: error: expected ‘)’ before ‘;’ token
             GraphicsContext3D* context = static_cast<TextureMapperGL*>(m_textureMapper.get())->graphicsContext3D();
                                                                                                                   ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:103:16: error: invalid use of incomplete type ‘class WebCore::GraphicsContext3D’
             context->clearColor(m_viewBackgroundColor.red() / 255.0f, m_viewBackgroundColor.green() / 255.0f, m_viewBackgroundColor.blue() / 255.0f, m_viewBackgroundColor.alpha() / 255.0f);
                    ^
    In file included from /media/psf/Downloads/qtwebkit/WebKitBuild/Release/DerivedSources/ForwardingHeaders/WebCore/GraphicsContext.h:1:0,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:27,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:24:
    /media/psf/Downloads/qtwebkit/Source/WebCore/platform/graphics/GraphicsContext.h:90:7: note: forward declaration of ‘class WebCore::GraphicsContext3D’
     class GraphicsContext3D;
           ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:104:16: error: invalid use of incomplete type ‘class WebCore::GraphicsContext3D’
             context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
                    ^
    In file included from /media/psf/Downloads/qtwebkit/WebKitBuild/Release/DerivedSources/ForwardingHeaders/WebCore/GraphicsContext.h:1:0,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:27,
                     from /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:24:
    /media/psf/Downloads/qtwebkit/Source/WebCore/platform/graphics/GraphicsContext.h:90:7: note: forward declaration of ‘class WebCore::GraphicsContext3D’
     class GraphicsContext3D;
           ^
    /media/psf/Downloads/qtwebkit/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:104:24: error: incomplete type ‘WebCore::GraphicsContext3D’ used in nested name specifier
             context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
                            ^
    Source/WebKit2/CMakeFiles/WebKit2.dir/build.make:10963: recipe for target 'Source/WebKit2/CMakeFiles/WebKit2.dir/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp.o' failed
    make[2]: *** [Source/WebKit2/CMakeFiles/WebKit2.dir/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp.o] Error 1
    CMakeFiles/Makefile2:1502: recipe for target 'Source/WebKit2/CMakeFiles/WebKit2.dir/all' failed
    make[1]: *** [Source/WebKit2/CMakeFiles/WebKit2.dir/all] Error 2
    Makefile:138: recipe for target 'all' failed
    make: *** [all] Error 2
    
    

    and this is my cmake command:

    cmake -DPORT=Qt -DCMAKE_BUILD_TYPE=Release -DQt5_DIR=/opt/Qt/5.5/gcc_64/lib/cmake/Qt5 -DCMAKE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu -DENABLE_3D_TRANSFORMS:BOOL=OFF -DENABLE_ACCELERATED_2D_CANVAS:BOOL=OFF -DENABLE_ACCELERATED_OVERFLOW_SCROLLING:BOOL=OFF -DENABLE_ACCESSIBILITY:BOOL=OFF -DENABLE_ALLINONE_BUILD:BOOL=ON -DENABLE_API_TESTS:BOOL=OFF -DENABLE_ASSEMBLER_WX_EXCLUSIVE:BOOL=OFF -DENABLE_ASYNC_SCROLLING:BOOL=OFF -DENABLE_ATTACHMENT_ELEMENT:BOOL=OFF -DENABLE_AVF_CAPTIONS:BOOL=OFF -DENABLE_BATTERY_STATUS:BOOL=OFF -DENABLE_CACHE_PARTITIONING:BOOL=OFF -DENABLE_CANVAS_PATH:BOOL=ON -DENABLE_CANVAS_PROXY:BOOL=OFF -DENABLE_CHANNEL_MESSAGING:BOOL=ON -DENABLE_CONTENT_FILTERING:BOOL=OFF -DENABLE_CONTEXT_MENUS:BOOL=OFF -DENABLE_CREDENTIAL_STORAGE:BOOL=OFF -DENABLE_CSP_NEXT:BOOL=OFF -DENABLE_CSS3_TEXT:BOOL=OFF -DENABLE_CSS3_TEXT_LINE_BREAK:BOOL=OFF -DENABLE_CSS_BOX_DECORATION_BREAK:BOOL=ON -DENABLE_CSS_COMPOSITING:BOOL=OFF -DENABLE_CSS_DEVICE_ADAPTATION:BOOL=OFF -DENABLE_CSS_GRID_LAYOUT:BOOL=ON -DENABLE_CSS_IMAGE_ORIENTATION:BOOL=OFF -DENABLE_CSS_IMAGE_RESOLUTION:BOOL=OFF -DENABLE_CSS_IMAGE_SET:BOOL=ON -DENABLE_CSS_REGIONS:BOOL=ON -DENABLE_CSS_SCROLL_SNAP:BOOL=OFF -DENABLE_CSS_SELECTORS_LEVEL4:BOOL=ON -DENABLE_CSS_SHAPES:BOOL=ON -DENABLE_CURSOR_VISIBILITY:BOOL=OFF -DENABLE_CUSTOM_ELEMENTS:BOOL=OFF -DENABLE_CUSTOM_SCHEME_HANDLER:BOOL=OFF -DENABLE_DASHBOARD_SUPPORT:BOOL=OFF -DENABLE_DATABASE_PROCESS:BOOL=ON -DENABLE_DATACUE_VALUE:BOOL=OFF -DENABLE_DATALIST_ELEMENT:BOOL=ON -DENABLE_DATA_TRANSFER_ITEMS:BOOL=OFF -DENABLE_DETAILS_ELEMENT:BOOL=ON -DENABLE_DEVICE_ORIENTATION:BOOL=OFF -DENABLE_DFG_JIT:BOOL=ON -DENABLE_DOM4_EVENTS_CONSTRUCTOR:BOOL=ON -DENABLE_DOWNLOAD_ATTRIBUTE:BOOL=OFF -DENABLE_DRAG_SUPPORT:BOOL=OFF -DENABLE_ENCRYPTED_MEDIA:BOOL=OFF -DENABLE_ENCRYPTED_MEDIA_V2:BOOL=OFF -DENABLE_ES6_ARROWFUNCTION_SYNTAX:BOOL=ON -DENABLE_ES6_CLASS_SYNTAX:BOOL=ON -DENABLE_ES6_GENERATORS:BOOL=ON -DENABLE_ES6_MODULES:BOOL=OFF -DENABLE_ES6_TEMPLATE_LITERAL_SYNTAX:BOOL=ON -DENABLE_FETCH_API:BOOL=ON -DENABLE_FILTERS_LEVEL_2:BOOL=OFF -DENABLE_FONT_LOAD_EVENTS:BOOL=OFF -DENABLE_FTL_JIT:BOOL=ON -DENABLE_FTPDIR:BOOL=OFF -DENABLE_FULLSCREEN_API:BOOL=ON -DENABLE_GAMEPAD:BOOL=OFF -DENABLE_GAMEPAD_DEPRECATED:BOOL=OFF -DENABLE_GEOLOCATION:BOOL=ON -DENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING:BOOL=OFF -DENABLE_ICONDATABASE:BOOL=ON -DENABLE_IMAGE_DECODER_DOWN_SAMPLING:BOOL=OFF -DENABLE_INDEXED_DATABASE:BOOL=ON -DENABLE_INDEXED_DATABASE_IN_WORKERS:BOOL=OFF -DENABLE_INDIE_UI:BOOL=OFF -DENABLE_INPUT_TYPE_COLOR:BOOL=ON -DENABLE_INPUT_TYPE_COLOR_POPOVER:BOOL=ON -DENABLE_INPUT_TYPE_DATE:BOOL=OFF -DENABLE_INPUT_TYPE_DATETIMELOCAL:BOOL=OFF -DENABLE_INPUT_TYPE_DATETIME_INCOMPLETE:BOOL=OFF -DENABLE_INPUT_TYPE_MONTH:BOOL=OFF -DENABLE_INPUT_TYPE_TIME:BOOL=OFF -DENABLE_INPUT_TYPE_WEEK:BOOL=OFF -DENABLE_INSPECTOR_UI:BOOL=ON -DENABLE_INTL:BOOL=ON -DENABLE_IOS_AIRPLAY:BOOL=OFF -DENABLE_IOS_TEXT_AUTOSIZING:BOOL=OFF -DENABLE_JIT:BOOL=ON -DENABLE_LEGACY_CSS_VENDOR_PREFIXES:BOOL=OFF -DENABLE_LEGACY_NOTIFICATIONS:BOOL=OFF -DENABLE_LEGACY_VENDOR_PREFIXES:BOOL=ON -DENABLE_LEGACY_WEB_AUDIO:BOOL=ON -DENABLE_LETTERPRESS:BOOL=OFF -DENABLE_LINK_PREFETCH:BOOL=ON -DENABLE_MAC_LONG_PRESS:BOOL=OFF -DENABLE_MATHML:BOOL=ON -DENABLE_MEDIA_CAPTURE:BOOL=OFF -DENABLE_MEDIA_CONTROLS_SCRIPT:BOOL=ON -DENABLE_MEDIA_SOURCE:BOOL=ON -DENABLE_MEDIA_STATISTICS:BOOL=OFF -DENABLE_MEDIA_STREAM:BOOL=OFF -DENABLE_MEMORY_SAMPLER:BOOL=OFF -DENABLE_METER_ELEMENT:BOOL=ON -DENABLE_MHTML:BOOL=ON -DENABLE_MINIBROWSER:BOOL=OFF -DENABLE_MOUSE_CURSOR_SCALE:BOOL=OFF -DENABLE_NAVIGATOR_CONTENT_UTILS:BOOL=OFF -DENABLE_NAVIGATOR_HWCONCURRENCY:BOOL=ON -DENABLE_NETSCAPE_PLUGIN_API:BOOL=OFF -DENABLE_NOSNIFF:BOOL=OFF -DENABLE_NOTIFICATIONS:BOOL=OFF -DENABLE_OPENGL:BOOL=OFF -DENABLE_ORIENTATION_EVENTS:BOOL=OFF -DENABLE_PDFKIT_PLUGIN:BOOL=OFF -DENABLE_PERFORMANCE_TIMELINE:BOOL=OFF -DENABLE_POINTER_LOCK:BOOL=OFF -DENABLE_PRINT_SUPPORT:BOOL=OFF -DENABLE_PROXIMITY_EVENTS:BOOL=OFF -DENABLE_PUBLIC_SUFFIX_LIST:BOOL=OFF -DENABLE_QT_GESTURE_EVENTS:BOOL=OFF -DENABLE_QT_WEBCHANNEL:BOOL=ON -DENABLE_QUOTA:BOOL=OFF -DENABLE_REMOTE_INSPECTOR:BOOL=OFF -DENABLE_REQUEST_ANIMATION_FRAME:BOOL=ON -DENABLE_RESOLUTION_MEDIA_QUERY:BOOL=OFF -DENABLE_RESOURCE_TIMING:BOOL=OFF -DENABLE_RESOURCE_USAGE:BOOL=OFF -DENABLE_RUBBER_BANDING:BOOL=OFF -DENABLE_SAMPLING_PROFILER:BOOL=ON -DENABLE_SECCOMP_FILTERS:BOOL=OFF -DENABLE_SERVICE_CONTROLS:BOOL=OFF -DENABLE_SHADOW_DOM:BOOL=OFF -DENABLE_SMOOTH_SCROLLING:BOOL=OFF -DENABLE_SPEECH_SYNTHESIS:BOOL=OFF -DENABLE_SPELLCHECK:BOOL=OFF -DENABLE_STREAMS_API:BOOL=OFF -DENABLE_SUBTLE_CRYPTO:BOOL=OFF -DENABLE_SVG_FONTS:BOOL=ON -DENABLE_SVG_OTF_CONVERTER:BOOL=OFF -DENABLE_TELEPHONE_NUMBER_DETECTION:BOOL=OFF -DENABLE_TEMPLATE_ELEMENT:BOOL=ON -DENABLE_TEXT_AUTOSIZING:BOOL=OFF -DENABLE_THREADED_COMPOSITOR:BOOL=OFF -DENABLE_TOUCH_ADJUSTMENT:BOOL=ON -DENABLE_TOUCH_EVENTS:BOOL=ON -DENABLE_TOUCH_ICON_LOADING:BOOL=OFF -DENABLE_TOUCH_SLIDER:BOOL=OFF -DENABLE_USERSELECT_ALL:BOOL=OFF -DENABLE_USER_MESSAGE_HANDLERS:BOOL=OFF -DENABLE_USER_TIMING:BOOL=OFF -DENABLE_VIBRATION:BOOL=OFF -DENABLE_VIDEO:BOOL=false -DENABLE_VIDEO_TRACK:BOOL=OFF -DENABLE_VIEW_MODE_CSS_MEDIA:BOOL=ON -DENABLE_WEBASSEMBLY:BOOL=OFF -DENABLE_WEBGL:BOOL=OFF -DENABLE_WEBKIT2:BOOL=ON -DENABLE_WEBVTT_REGIONS:BOOL=OFF -DENABLE_WEB_ANIMATIONS:BOOL=OFF -DENABLE_WEB_AUDIO:BOOL=false -DENABLE_WEB_REPLAY:BOOL=OFF -DENABLE_WEB_SOCKETS:BOOL=ON -DENABLE_WEB_TIMING:BOOL=ON -DENABLE_X11_TARGET:BOOL=ON -DENABLE_XSLT:BOOL=ON  ../..
    
    


  • ENABLE_OPENGL=OFF conflicts with ENABLE_WEBKIT2=ON

    Note that arbitrary combinations of options are not supported and may result in compilation errors



  • Thank you for your response
    Already tried this, get different errors:

    [ 98%] Building CXX object Source/WebKit/CMakeFiles/WebKit.dir/qt/WebCoreSupport/EditorClientQt.cpp.o
    [ 98%] Building CXX object Source/WebKit/CMakeFiles/WebKit.dir/qt/WebCoreSupport/FrameLoaderClientQt.cpp.o
    In file included from /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:27:0:
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:36:60: error: expected class-name before ‘{’ token
     class ContextMenuClientQt final : public ContextMenuClient {
                                                                ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:40:28: error: ‘URL’ does not name a type
         void downloadURL(const URL&) final;
                                ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:41:29: error: ‘Frame’ has not been declared
         void lookUpInDictionary(Frame*) final;
                                 ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:42:22: error: ‘String’ does not name a type
         void speak(const String&) final;
                          ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:45:33: error: ‘Frame’ does not name a type
         void searchWithGoogle(const Frame*) final;
                                     ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:38:10: error: ‘void WebCore::ContextMenuClientQt::contextMenuDestroyed()’ marked ‘final’, but is not virtual
         void contextMenuDestroyed() final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:40:10: error: ‘void WebCore::ContextMenuClientQt::downloadURL(const int&)’ marked ‘final’, but is not virtual
         void downloadURL(const URL&) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:41:10: error: ‘void WebCore::ContextMenuClientQt::lookUpInDictionary(int*)’ marked ‘final’, but is not virtual
         void lookUpInDictionary(Frame*) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:42:10: error: ‘void WebCore::ContextMenuClientQt::speak(const int&)’ marked ‘final’, but is not virtual
         void speak(const String&) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:43:10: error: ‘bool WebCore::ContextMenuClientQt::isSpeaking()’ marked ‘final’, but is not virtual
         bool isSpeaking() final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:44:10: error: ‘void WebCore::ContextMenuClientQt::stopSpeaking()’ marked ‘final’, but is not virtual
         void stopSpeaking() final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:45:10: error: ‘void WebCore::ContextMenuClientQt::searchWithGoogle(const int*)’ marked ‘final’, but is not virtual
         void searchWithGoogle(const Frame*) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:43:6: error: prototype for ‘void WebCore::ContextMenuClientQt::downloadURL(const WebCore::URL&)’ does not match any in class ‘WebCore::ContextMenuClientQt’
     void ContextMenuClientQt::downloadURL(const URL&)
          ^
    In file included from /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:27:0:
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:40:10: error: candidate is: void WebCore::ContextMenuClientQt::downloadURL(const int&)
         void downloadURL(const URL&) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:48:6: error: prototype for ‘void WebCore::ContextMenuClientQt::lookUpInDictionary(WebCore::Frame*)’ does not match any in class ‘WebCore::ContextMenuClientQt’
     void ContextMenuClientQt::lookUpInDictionary(Frame*)
          ^
    In file included from /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:27:0:
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:41:10: error: candidate is: void WebCore::ContextMenuClientQt::lookUpInDictionary(int*)
         void lookUpInDictionary(Frame*) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:53:6: error: prototype for ‘void WebCore::ContextMenuClientQt::speak(const WTF::String&)’ does not match any in class ‘WebCore::ContextMenuClientQt’
     void ContextMenuClientQt::speak(const String&)
          ^
    In file included from /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:27:0:
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:42:10: error: candidate is: void WebCore::ContextMenuClientQt::speak(const int&)
         void speak(const String&) final;
              ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:69:6: error: prototype for ‘void WebCore::ContextMenuClientQt::searchWithGoogle(const WebCore::Frame*)’ does not match any in class ‘WebCore::ContextMenuClientQt’
     void ContextMenuClientQt::searchWithGoogle(const Frame*)
          ^
    In file included from /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp:27:0:
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ContextMenuClientQt.h:45:10: error: candidate is: void WebCore::ContextMenuClientQt::searchWithGoogle(const int*)
         void searchWithGoogle(const Frame*) final;
              ^
    Source/WebKit/CMakeFiles/WebKit.dir/build.make:1466: recipe for target 'Source/WebKit/CMakeFiles/WebKit.dir/qt/WebCoreSupport/ContextMenuClientQt.cpp.o' failed
    make[2]: *** [Source/WebKit/CMakeFiles/WebKit.dir/qt/WebCoreSupport/ContextMenuClientQt.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp:93:43: warning: unused parameter ‘dragImage’ [-Wunused-parameter]
     void DragClientQt::startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, DataTransfer& dataTransfer, Frame& frame, bool)
                                               ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp:93:70: warning: unused parameter ‘dragImageOrigin’ [-Wunused-parameter]
     void DragClientQt::startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, DataTransfer& dataTransfer, Frame& frame, bool)
                                                                          ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp:93:103: warning: unused parameter ‘eventPos’ [-Wunused-parameter]
     void DragClientQt::startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, DataTransfer& dataTransfer, Frame& frame, bool)
                                                                                                           ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp:93:127: warning: unused parameter ‘dataTransfer’ [-Wunused-parameter]
     void DragClientQt::startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, DataTransfer& dataTransfer, Frame& frame, bool)
                                                                                                                                   ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/DragClientQt.cpp:93:148: warning: unused parameter ‘frame’ [-Wunused-parameter]
     void DragClientQt::startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, DataTransfer& dataTransfer, Frame& frame, bool)
                                                                                                                                                        ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp:627:53: warning: unused parameter ‘frame’ [-Wunused-parameter]
     void ChromeClientQt::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
                                                         ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp:116:63: warning: unused parameter ‘frame’ [-Wunused-parameter]
     static QString drtPrintFrameUserGestureStatus(WebCore::Frame* frame)
                                                                   ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp:573:63: warning: unused parameter ‘MIMEType’ [-Wunused-parameter]
     bool FrameLoaderClientQt::canShowMIMETypeAsHTML(const String& MIMEType) const
                                                                   ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp:801:73: warning: unused parameter ‘loader’ [-Wunused-parameter]
     void FrameLoaderClientQt::setMainDocumentError(WebCore::DocumentLoader* loader, const WebCore::ResourceError& error)
                                                                             ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp:1061:75: warning: unused parameter ‘loader’ [-Wunused-parameter]
     void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader, unsigned long identifier, const WebCore::ResourceError& error)
                                                                               ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp:1403:65: warning: unused parameter ‘pluginSize’ [-Wunused-parameter]
     RefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const URL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
                                                                     ^
    /media/psf/Home/Downloads/qtwebkit/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp:1403:219: warning: unused parameter ‘loadManually’ [-Wunused-parameter]
     RefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const URL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
                                                                                                                                                                                                                               ^
    CMakeFiles/Makefile2:980: recipe for target 'Source/WebKit/CMakeFiles/WebKit.dir/all' failed
    make[1]: *** [Source/WebKit/CMakeFiles/WebKit.dir/all] Error 2
    Makefile:149: recipe for target 'all' failed
    make: *** [all] Error 2
    
    


  • @CertaBit said in QWebView not repainting on changed content / DOM by javascript:

    -DENABLE_CONTEXT_MENUS:BOOL=OFF

    This is not supported. If you modify non-public options, you are on your own



  • If you need minimal configuration without QML and video, use options from https://github.com/annulen/webkit/wiki/Building-static-libraries (except USE_STATIC_RUNTIME and USE_THIN_ARCHIVES). Otherwise, use default configuration



  • Because of lack of documentation I fetched these options from somewhere in the build scripts. Just wanted to disable all irrelevant stuff -> my final goal ist to cross-compile for small embedded system...



  • You can see public options with some descriptions in ccmake or cmake-gui. Primary configuration for all platforms is default one, i.e. when no options are changed from their default values



  • ok, on got it compiled on MacOS, with this qWebKit fork it works!

    In the meantime: tried this simple example on standard qt 5.5 webkit: https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_inner_html

    Even this doesn't get refreshed automatically but only after window resize! Must have something to do with javascript engine, not SVG as initially expected.

    @Konstantin-Tokarev: do you have any ideas on this?



  • @CertaBit Seems like on macOS 10.14 setting MAP_JIT flag on pages with executable code is required for JIT to work, in the same manner as it was required for iOS previously. Please try running with JSC_useJIT=0 environment variable



  • @Konstantin-Tokarev said in QWebView not repainting on changed content / DOM by javascript:

    MAP_JIT

    Target system is (embedded) linux, so any ideas why javascript changes to text do not cause repaint?



  • Finally found at the root cause by comparing to webkit bridge sample.

    I set the webview attribute to

    view->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled,true);
    
    

    which prohibited page repaint.



  • Interesting. FWIW, in 5.212 tiling backing store is not supported and this setting should have no effect


Log in to reply