After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672582 - Fix selection behavior inside <iframe>
Fix selection behavior inside <iframe>
Status: RESOLVED FIXED
Product: GtkHtml
Classification: Other
Component: Rendering
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtkhtml-maintainers
gtkhtml-maintainers
: 672862 673456 673531 674205 675058 675143 675356 675642 675709 676127 676552 677761 677773 677939 696194 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-21 18:48 UTC by Adam Williamson
Modified: 2013-03-20 13:41 UTC
See Also:
GNOME target: 3.4
GNOME version: ---


Attachments
Testcase for GtkHtml (170 bytes, text/plain)
2012-04-30 18:34 UTC, Sam Thursfield
  Details
Patch for GtkHTML which fixes the issue (1.24 KB, patch)
2012-05-02 17:24 UTC, Sam Thursfield
none Details | Review

Description Adam Williamson 2012-03-21 18:48:36 UTC
In the last few releases, up to 3.3.92, Evo seems to be displaying some rather odd cursor behaviour.

One I've seen a few times is demonstrated in the attached video, where I'm trying to click on some links in an HTML email. Instead, it seems to be selecting a chunk of text up to the point I'm clicking at. I've no idea why.
Comment 1 Adam Williamson 2012-03-21 18:49:42 UTC
Video's too big to attach. Please find it at http://www.happyassassin.net/extras/shell-20120321-1.webm .
Comment 2 Adam Williamson 2012-03-21 18:50:30 UTC
er, please don't attempt to impersonate me to the alumni office. that would be mean. :)
Comment 3 Matthew Barnes 2012-03-21 18:55:49 UTC
Might be a regression caused by the fix for bug #668215.

Don't know what else it could be at our level.  That bug fix was the only significant change to GtkHtml so far this year, and that was just swapping GtkStyle (deprecated) for GtkStyleContext.
Comment 4 Matthias Clasen 2012-03-23 13:41:49 UTC
seeing this too
Comment 5 Matthew Barnes 2012-03-26 17:16:28 UTC
*** Bug 672862 has been marked as a duplicate of this bug. ***
Comment 6 Frederik Elwert 2012-04-04 20:41:21 UTC
*** Bug 673531 has been marked as a duplicate of this bug. ***
Comment 7 Mathieu Trudel-Lapierre 2012-04-04 21:11:51 UTC
I'm not sure if it's really the GtkStyle->GtkStyleContext change, we're seeing this on Ubuntu in Evo 3.2.3 with gtkhtml 4.2.2; so prior to the change.
Comment 8 Matthew Barnes 2012-04-04 21:14:09 UTC
Maybe try it with GTK+ 3.2, or an early 3.3.  I suspect it'll work again.
Comment 9 Fabien Tassin 2012-04-06 10:31:05 UTC
I'm seeing this too.

evolution 3.4.0.1, gtk+ 3.4.0, gtkhtml 4.4.0.
Comment 10 Dimitri 2012-04-08 18:10:55 UTC
The same here in Mageia (evolution 3.4.0.1, gtk+ 3.4.0, gtkhtml 4.4.0)
Comment 11 Jan de Groot 2012-04-18 00:36:58 UTC
*** Bug 674205 has been marked as a duplicate of this bug. ***
Comment 12 Sam Thursfield 2012-04-19 16:11:21 UTC
The issue doesn't occur with Gtk+ 3.2 and latest GtkHtml and Evolution.
Comment 13 Dimitri 2012-04-19 22:37:07 UTC
Still observable with Evolution 3.4.1, GTK+ 3.4.1 and GtkHtml 4.4.1
Comment 14 Jan de Groot 2012-04-19 22:44:42 UTC
With GTK+ 3.4.1 yes, but not with 3.2.x. I downgraded GTK to 3.2.3 and started evolution. Though themes are completely broken, the regressions does not show up in Evolution anymore.
When I install gnome-themes-standard 3.2.x the themes are working again and evolution still works fine as it should. So it's not the theme, but GTK 3.4.x that causes this regression.
Comment 15 Matthew Barnes 2012-04-19 22:56:50 UTC
Reassigning to GTK+.  Maybe a GTK+ developer can help figure out what broke.
Comment 16 Jan de Groot 2012-04-19 23:41:16 UTC
Started a git bisect in gtk+ module. The oldest release I could compile with current glib is 3.3.12, which happens to show something that looks like correct behaviour.
The oldest prepackaged version that I could find is 3.3.18, which shows the bad selection behaviour. Bisection should be only 7 steps, but I don't think I have time to finish it completely until upcoming sunday.
Comment 17 Jan de Groot 2012-04-20 00:22:20 UTC
fcb58f3c83e8c525c6b2fb09eef9732a96714f08 is the first bad commit
commit fcb58f3c83e8c525c6b2fb09eef9732a96714f08
Author: Alexander Larsson <alexl@redhat.com>
Date:   Sun Feb 19 11:55:22 2012 +0100

    Don't unnecessarily clear background twice in no EXPOSE_MASK case
    
    We already clear in begin_paint, no need to do it again. In fact, this
    will get the wrong result if the background has alpha.

:040000 040000 c7e5b84743c5bb4d5c0685e511bf4014456943b4 751668e7b80938ce0a86939b8dfd5dcc3f4f8fb7 M	gdk
Comment 18 Jan de Groot 2012-04-20 00:44:53 UTC
Too bad reverting that commit on top of 3.4.1 doesn't actually fix things here.
Comment 19 Sam Thursfield 2012-04-23 11:15:02 UTC
I bisected as well and got somewhere completely different :)

Somewhere between 7f35708ceeef47cef6807a8a5edc86f4229e1a80 and 352fdc214aafdc8fcf163746a483164fd372fa5d, which is where the XI2 / multitouch branch landed. It seems likely that we are either missing an event that we used to receive or getting some extra events that are confusing things.

The change in question comes between 3.3.16 and 3.3.17.
Comment 20 Andrew Cowie 2012-04-23 13:28:01 UTC
Experiencing this with Evolution 3.2.3 and GTK 3.4.1

(I wouldn't "me too", but the latest upgrade here didn't change the Evolution but did upgrade GTK from 3.2.x; just wanted to offer an additional data point).

AfC
Comment 21 Sam Thursfield 2012-04-24 09:45:47 UTC
Reverting the following commit against the gtk-3-4 master makes the problem go away.

commit f6393199beb812b81065890d6fec718ee16632f8
Author: Carlos Garcia Campos <cgarcia@igalia.com>
Date:   Fri Feb 11 13:43:56 2011 +0100

    scrolledwindow: Kinetic scrolling support
    
    Kinetic scrolling is only done on touch devices, since it is
    sort of meaningless on pointer devices, besides it implies
    a different input event handling on child widgets that is
    unnecessary there.

    If the scrolling doesn't start after a long press, the scrolling is
    cancelled and events are handled by child widgets normally.
    
    When clicked again close to the previous button press location
    (assuming it had ~0 movement), the scrolled window will allow
    the child to handle the events immediately.
    
    This is so the user doesn't have to wait to the press-and-hold
    timeout in order to operate on the scrolledwindow child.
    
    The innermost scrolled window always gets to capture the events, all
    scrolled windows above it just let the event go through. Ideally
    reaching a limit on the innermost scrolled window would propagate
    the dragging up the hierarchy in order to keep following the touch
    coords, although that'd involve rather evil hacks just to cater
    for broken UIs.
Comment 22 Matthias Clasen 2012-04-24 13:41:18 UTC
All this bisection work is certainly helpful, thanks. Ultimatively, this is not purely a gtk bug though. Plenty of gtk apps scroll just fine with 3.4 and don't exhibit strange selection behaviour. So we need to identify what is different in the gtkhtml case to trigger this problem.
Comment 23 Matthew Barnes 2012-04-25 15:41:29 UTC
For the record, reassigning the bug to GTK+ wasn't meant to simply place blame but to seek assistance from GTK+ developers.  I don't really have time to dig into this right now, nor am I familiar with what all changed in GTK+ with the kinetic scrolling support.
Comment 24 Matthew Barnes 2012-04-29 11:28:50 UTC
*** Bug 675058 has been marked as a duplicate of this bug. ***
Comment 25 Stefan Förster 2012-04-29 16:35:45 UTC
I found a workaround under Arch Linux (bug 675058, which is marked as duplicate of this bug): downgrade the package "gtk3" from 3.4.1 to 3.2.3. This bug and also the "black on black" colour bug (bug 671437) are gone.

It seems that the newer gtk3 versions are buggy.
Comment 26 Matthew Barnes 2012-04-30 12:41:33 UTC
*** Bug 675143 has been marked as a duplicate of this bug. ***
Comment 27 Sam Thursfield 2012-04-30 18:34:52 UTC
Created attachment 213130 [details]
Testcase for GtkHtml

The bug seems to only affect HTML mail .. and I notice that HTML mail is rendered using an iframe. The bug seems to be triggered when the selection is inside the iframe.

I've attached a simple testcase which can be loaded using 'testgtkhtml' from the GtkHtml source tree, and this triggers the selection bug too.
Comment 28 Sam Thursfield 2012-05-02 17:24:15 UTC
Created attachment 213310 [details] [review]
Patch for GtkHTML which fixes the issue

Found a simple fix for the Evo bug.

In GtkHTML, selection inside a <frame> is still broken, but it remains broken when the kinetic scrolling patch is reverted too so must be a separate issue..
Comment 29 Sam Thursfield 2012-05-02 17:34:54 UTC
Patch does not break anything when run against the gtk-3-2 branch
Comment 30 André Klapper 2012-05-02 20:48:28 UTC
(In reply to comment #28)
> Created an attachment (id=213310) [details] [review]
> Patch for GtkHTML which fixes the issue

Should probably go to a separate report as this one is assigned to gtk+ which also means gtk+ maintainers to review (and not Evolution maintainers).
Comment 31 Matthias Clasen 2012-05-02 21:53:49 UTC
Lets just move it back...
Comment 32 Matthew Barnes 2012-05-03 12:14:54 UTC
*** Bug 675356 has been marked as a duplicate of this bug. ***
Comment 33 Matthew Barnes 2012-05-03 19:08:41 UTC
(In reply to comment #28)
> Found a simple fix for the Evo bug.
> 
> In GtkHTML, selection inside a <frame> is still broken, but it remains broken
> when the kinetic scrolling patch is reverted too so must be a separate issue..

Fix confirmed, thanks a ton for the patch!

Committed for GtkHtml 4.5.2 and 4.4.2:

http://git.gnome.org/browse/gtkhtml/commit/?id=7b7b37745d2f46914be314e4d7aef7a575529345

http://git.gnome.org/browse/gtkhtml/commit/?h=gnome-3-4&id=9ec36544203d4c1b98aa843c2c3ff0a4f725da68
Comment 34 Dimitri 2012-05-03 19:20:58 UTC
Confirming the fix. Still, double/triple click selection doesn't work with HTML messages in the viewer. Should we file a new bug for that?
Comment 35 Matthew Barnes 2012-05-03 19:36:48 UTC
(In reply to comment #34)
> Confirming the fix. Still, double/triple click selection doesn't work with HTML
> messages in the viewer. Should we file a new bug for that?

Probably not worth it at this point.  No one is really maintaining GtkHtml and Evolution 3.5.1 has already switched to WebKit.
Comment 36 Matthew Barnes 2012-05-07 12:50:01 UTC
*** Bug 673456 has been marked as a duplicate of this bug. ***
Comment 37 Matthew Barnes 2012-05-07 21:50:33 UTC
*** Bug 675642 has been marked as a duplicate of this bug. ***
Comment 38 Matthew Barnes 2012-05-08 22:42:25 UTC
*** Bug 675709 has been marked as a duplicate of this bug. ***
Comment 39 Joachim Breitner 2012-05-15 21:11:13 UTC
*** Bug 676127 has been marked as a duplicate of this bug. ***
Comment 40 Matthew Barnes 2012-05-22 13:06:38 UTC
*** Bug 676552 has been marked as a duplicate of this bug. ***
Comment 41 Matthew Barnes 2012-06-09 16:34:46 UTC
*** Bug 677761 has been marked as a duplicate of this bug. ***
Comment 42 Matthew Barnes 2012-06-09 22:39:03 UTC
*** Bug 677773 has been marked as a duplicate of this bug. ***
Comment 43 Matthew Barnes 2012-06-12 12:58:25 UTC
*** Bug 677939 has been marked as a duplicate of this bug. ***
Comment 44 Matthew Barnes 2013-03-20 13:41:49 UTC
*** Bug 696194 has been marked as a duplicate of this bug. ***