[Differential] [Request, 85 lines] D3683: StandardDocumentationView positioning fixes

antonanikin (Anton Anikin) noreply at phabricator.kde.org
Thu Dec 15 06:45:27 UTC 2016


antonanikin created this revision.
antonanikin added a reviewer: KDevelop.
antonanikin added a subscriber: kdevelop-devel.

REVISION SUMMARY
  The patch fixes wrong positioning for StandardDocumentationView. Steps to reproduce:
  
  1. Place such test code into editor:
  
    #include <QWebView>
    #include <QLabel>
    #include <QDebug>
    
    void test()
    {
        QWebView v;
        v.setUrl(QUrl("https://www.kdevelop.org/"));
    
        QLabel l;
        l.setText("label_text");
    
        qDebug() << "debug_message";
    }
  
  2. Move cursor to any method and call context help.
  3. Help view will be shown with **wrong** position.
  4. Recall context help for previous place.
  5. Help view will be shown with **right** position.
  6. At any help view show we will see fast scrollbar "jumping" from initial (0) to some final position.
  
  The patch provides mechanism to fix this behavior.
  
  First, it disable view painter updates during load to avoid content "flickering" and also to hide font size "jumping", which happens for example for Qt help pages with JavaScript enabled for QWebView. This JS also breaks positioning inside page:
  
  1. Some page is loaded and loadFinished() signal emitted, then view set right position inside page.
  
  2. After this, page JS finishes it's work and change font settings (size). This leads to contents "moving" inside view and as a result we have wrong position.
  
  Therefore secondly, we fix position after page loading with simple JS code. JS allow us to "jump" inside already loaded page without it's reloading which happens with using standard view's methods like load() or setUrl().
  
  Such positioning fixing also applied on resize event - standard view's behaviour breaks position during widget resize.

TEST PLAN
  Tested on master branch. For correct work it needs https://phabricator.kde.org/D3671 applied to kdevelop.

REPOSITORY
  R33 KDevPlatform

BRANCH
  webview_fixes

REVISION DETAIL
  https://phabricator.kde.org/D3683

AFFECTED FILES
  documentation/standarddocumentationview.cpp

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: antonanikin, #kdevelop
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20161215/8f348cd7/attachment.html>


More information about the KDevelop-devel mailing list