Bug 30366

Summary: if the QWebPage is rendered by a QGraphicsWidget child of another widget with ItemClipsChildrenToShape the scrollbar is not clipped
Product: WebKit Reporter: Marco Martin <notmart>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: commit-queue, eric, hausmann, kenneth, notmart
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
patch that corrects the bug
none
updated patch
kenneth: review-
second patch update none

Marco Martin
Reported 2009-10-14 13:24:41 PDT
at line 150 of ScrollbarThemeQt.cpp there is the followin instruction: p.painter->setClipRect(opt->rect.intersected(damageRect)); this causes the following problem: a QGraphicsWidget renders a QWebPage is the children of another qgw wit the flag ItemClipsChildrenToShape set. the scrollbars will be painted not clipped to the parent shape because of the cliprect reset. this patch intersect the rect, with the previous one, making the scrollbar to be correctly clipped
Attachments
patch that corrects the bug (516 bytes, patch)
2009-10-14 13:25 PDT, Marco Martin
no flags
updated patch (1.44 KB, patch)
2009-12-08 11:37 PST, Marco Martin
kenneth: review-
second patch update (1.45 KB, patch)
2009-12-14 14:03 PST, Marco Martin
no flags
Marco Martin
Comment 1 2009-10-14 13:25:59 PDT
Created attachment 41185 [details] patch that corrects the bug
Simon Hausmann
Comment 2 2009-11-29 16:06:17 PST
(In reply to comment #1) > Created an attachment (id=41185) [details] > patch that corrects the bug Good catch! Marco, your patch looks correct, but it needs to be adapted to the latest code changes in the trunk - the code is now in ScrollbarThemeQt.cpp - and your patch needs a ChangeLog entry. Please see http://webkit.org/coding/contributing.html
Marco Martin
Comment 3 2009-12-08 11:37:38 PST
Created attachment 44478 [details] updated patch updated the patch to the new filename and added a ChangeLog entry
Kenneth Rohde Christiansen
Comment 4 2009-12-14 05:58:44 PST
Is this supposed to be up for review? If so, please set the review flag to r?
Marco Martin
Comment 5 2009-12-14 06:20:16 PST
Comment on attachment 44478 [details] updated patch > Index: WebCore/ChangeLog > =================================================================== > --- WebCore/ChangeLog (revision 51868) > +++ WebCore/ChangeLog (working copy) > @@ -1,3 +1,19 @@ > +2009-12-08 Marco Martin <notmart@gmail.com> > + > + Review pending. > + > + In the Scrollbar painting of the Qt theme integration, > + intersects any previous clip rects with the one needed to paint the scrollbar. > + This fixes the painting in QGraphicsview, when the parent of the widget that > + paints the QWebPage has the QGraphicsItem::ItemClipsChildrenToShape set and > + a piece of the scrollbar should be cipped away > + https://bugs.webkit.org/show_bug.cgi?id=30366 > + > + No new tests. > + > + * platform/qt/ScrollbarThemeQt.cpp: > + (WebCore::ScrollbarThemeQt::paint): > + > 2009-12-08 John Gregg <johnnyg@google.com> > > Reviewed by Adam Barth. > Index: WebCore/platform/qt/ScrollbarThemeQt.cpp > =================================================================== > --- WebCore/platform/qt/ScrollbarThemeQt.cpp (revision 51865) > +++ WebCore/platform/qt/ScrollbarThemeQt.cpp (working copy) > @@ -147,7 +147,7 @@ > p.painter->save(); > QStyleOptionSlider* opt = styleOptionSlider(scrollbar, p.widget); > > - p.painter->setClipRect(opt->rect.intersected(damageRect)); > + p.painter->setClipRect(opt->rect.intersected(damageRect), Qt::IntersectClip); > > #ifdef Q_WS_MAC > p.drawComplexControl(QStyle::CC_ScrollBar, *opt);
Marco Martin
Comment 6 2009-12-14 06:21:12 PST
@Kenneth: yes, the patch should be final i think (apart the revieved by in the changelog :))
Kenneth Rohde Christiansen
Comment 7 2009-12-14 06:26:39 PST
Comment on attachment 44478 [details] updated patch > +2009-12-08 Marco Martin <notmart@gmail.com> > + > + Review pending. > + You need to leave the review line untouched, unless you want to land this manually, but as I believe you do not have commit rights, someone else could add it to the commit-queue. Can you reupload?
Eric Seidel (no email)
Comment 8 2009-12-14 13:52:31 PST
Comment on attachment 44478 [details] updated patch Marco is not a reviewer, clearly r+. I assume you meant to mark this as r? instead?
Eric Seidel (no email)
Comment 9 2009-12-14 13:52:52 PST
I meant "clearing" instead of "clearly", sorry.
Marco Martin
Comment 10 2009-12-14 13:54:49 PST
Comment on attachment 44478 [details] updated patch > Index: WebCore/ChangeLog > =================================================================== > --- WebCore/ChangeLog (revision 51868) > +++ WebCore/ChangeLog (working copy) > @@ -1,3 +1,19 @@ > +2009-12-08 Marco Martin <notmart@gmail.com> > + > + Review pending. > + > + In the Scrollbar painting of the Qt theme integration, > + intersects any previous clip rects with the one needed to paint the scrollbar. > + This fixes the painting in QGraphicsview, when the parent of the widget that > + paints the QWebPage has the QGraphicsItem::ItemClipsChildrenToShape set and > + a piece of the scrollbar should be cipped away > + https://bugs.webkit.org/show_bug.cgi?id=30366 > + > + No new tests. > + > + * platform/qt/ScrollbarThemeQt.cpp: > + (WebCore::ScrollbarThemeQt::paint): > + > 2009-12-08 John Gregg <johnnyg@google.com> > > Reviewed by Adam Barth. > Index: WebCore/platform/qt/ScrollbarThemeQt.cpp > =================================================================== > --- WebCore/platform/qt/ScrollbarThemeQt.cpp (revision 51865) > +++ WebCore/platform/qt/ScrollbarThemeQt.cpp (working copy) > @@ -147,7 +147,7 @@ > p.painter->save(); > QStyleOptionSlider* opt = styleOptionSlider(scrollbar, p.widget); > > - p.painter->setClipRect(opt->rect.intersected(damageRect)); > + p.painter->setClipRect(opt->rect.intersected(damageRect), Qt::IntersectClip); > > #ifdef Q_WS_MAC > p.drawComplexControl(QStyle::CC_ScrollBar, *opt);
Kenneth Rohde Christiansen
Comment 11 2009-12-14 13:58:33 PST
Comment on attachment 44478 [details] updated patch > + Review pending. Don't change the line made by prepare-Changelog > + No new tests. Would be good with a test, at least a manual one (goes in WebCore/manual-tests).
Eric Seidel (no email)
Comment 12 2009-12-14 14:00:28 PST
The Review Patch link is probably not the link you want. "Details" is more useful. Review Patch is kinda a lame hack that just adds the full diff as a comment and shows you the "Formatted Diff" view in an iframe.
Marco Martin
Comment 13 2009-12-14 14:03:23 PST
Created attachment 44821 [details] second patch update I've done the change in the changelog, hope is correct now.
Marco Martin
Comment 14 2009-12-14 14:03:44 PST
Comment on attachment 44821 [details] second patch update > Index: WebCore/ChangeLog > =================================================================== > --- WebCore/ChangeLog (revision 52117) > +++ WebCore/ChangeLog (working copy) > @@ -1,3 +1,19 @@ > +2009-12-14 Marco Martin <notmart@gmail.com> > + > + Reviewed by NOBODY (OOPS!). > + > + In the Scrollbar painting of the Qt theme integration, > + intersects any previous clip rects with the one needed to paint the scrollbar. > + This fixes the painting in QGraphicsview, when the parent of the widget that > + paints the QWebPage has the QGraphicsItem::ItemClipsChildrenToShape set and > + a piece of the scrollbar should be cipped away > + https://bugs.webkit.org/show_bug.cgi?id=30366 > + > + No new tests. > + > + * platform/qt/ScrollbarThemeQt.cpp: > + (WebCore::ScrollbarThemeQt::paint): > + > 2009-12-14 Alexey Proskuryakov <ap@apple.com> > > Reviewed by Dave Hyatt. > Index: WebCore/platform/qt/ScrollbarThemeQt.cpp > =================================================================== > --- WebCore/platform/qt/ScrollbarThemeQt.cpp (revision 51865) > +++ WebCore/platform/qt/ScrollbarThemeQt.cpp (working copy) > @@ -147,7 +147,7 @@ > p.painter->save(); > QStyleOptionSlider* opt = styleOptionSlider(scrollbar, p.widget); > > - p.painter->setClipRect(opt->rect.intersected(damageRect)); > + p.painter->setClipRect(opt->rect.intersected(damageRect), Qt::IntersectClip); > > #ifdef Q_WS_MAC > p.drawComplexControl(QStyle::CC_ScrollBar, *opt);
Kenneth Rohde Christiansen
Comment 15 2009-12-14 14:09:47 PST
Comment on attachment 44821 [details] second patch update LGTM, but please look into adding a test. Thanks for the work Martin
Marco Martin
Comment 16 2009-12-14 14:10:58 PST
in manual-tests i see only html files, since this one is not a rendering problem it would be more useful a short program... i'll look into that. how they should be done?
Kenneth Rohde Christiansen
Comment 17 2009-12-14 14:14:38 PST
Ah ofcourse, sorry. Looking at too many patches :-) I don't know the best way to actually add a test for this that can be tested automatically. The closest would be a Qt autotest, which we use for testing our APIs.
WebKit Commit Bot
Comment 18 2009-12-14 14:31:05 PST
Comment on attachment 44821 [details] second patch update Clearing flags on attachment: 44821 Committed r52122: <http://trac.webkit.org/changeset/52122>
WebKit Commit Bot
Comment 19 2009-12-14 14:31:11 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.