Bug 181115 - REGRESSION(r224460): Text fields sometimes get "messed up"
Summary: REGRESSION(r224460): Text fields sometimes get "messed up"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Other
Hardware: PC Linux
: P1 Blocker
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-21 18:55 PST by Michael Catanzaro
Modified: 2018-01-09 06:59 PST (History)
9 users (show)

See Also:


Attachments
Screencast showing problem (211.33 KB, video/webm)
2017-12-21 18:55 PST, Michael Catanzaro
no flags Details
Another screencast (184.53 KB, video/webm)
2017-12-21 19:00 PST, Michael Catanzaro
no flags Details
Another screencast (448.42 KB, video/webm)
2017-12-21 19:00 PST, Michael Catanzaro
no flags Details
Patch (1.87 KB, patch)
2018-01-08 01:05 PST, Carlos Garcia Campos
zalan: review+
Details | Formatted Diff | Diff
Patch for landing (1.65 KB, patch)
2018-01-09 02:14 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2017-12-21 18:55:36 PST
Created attachment 330089 [details]
Screencast showing problem

Text fields sometimes get "messed up" in 2.19.3. This is a regression from 2.18, but unfortunately I have no clue when it was introduced. This problem is hard to describe, so refer to the attached screencast. It looks like some graphics tiling problem. Text is being rendered in the wrong place. In the screencast, I hit the Enter key. I don't type a period: it just appears in the wrong place. Then I press the down arrow key, and then the right arrow key several times.

Unfortunately I do not know how to reproduce this problem.
Comment 1 Michael Catanzaro 2017-12-21 19:00:20 PST
Created attachment 330091 [details]
Another screencast
Comment 2 Michael Catanzaro 2017-12-21 19:00:33 PST
Created attachment 330092 [details]
Another screencast
Comment 3 Zan Dobersek 2017-12-22 23:07:40 PST
Bisected this down to r224460, bug #179279.

The regression is due to m_paintOffset now being adjusted for scroll position in case of an overflow clip in computeOffsets() before it's then used to calculate the clip rect in computeClipRect(), while before this was done in reverse order.

Not sure whether this is intentional or not, so input from Zalan or Antti is welcome in order to get this addressed.
Comment 4 Zan Dobersek 2017-12-22 23:07:56 PST
(In reply to Zan Dobersek from comment #3)
> Bisected this down to r224460, bug #179279.

https://trac.webkit.org/changeset/224460/webkit
Comment 5 zalan 2017-12-23 08:52:04 PST
(In reply to Zan Dobersek from comment #3)
> Bisected this down to r224460, bug #179279.
> 
> The regression is due to m_paintOffset now being adjusted for scroll
> position in case of an overflow clip in computeOffsets() before it's then
> used to calculate the clip rect in computeClipRect(), while before this was
> done in reverse order.
> 
> Not sure whether this is intentional or not, so input from Zalan or Antti is
> welcome in order to get this addressed.
No, it's definitely not intentional. Do you happen to have a cross platform test reduction? I could take a look at it.
Comment 6 Michael Catanzaro 2017-12-23 09:58:43 PST
(In reply to Zan Dobersek from comment #3)
> Bisected this down to r224460, bug #179279.

Wow, that must have taken a while... thank you.
Comment 7 Michael Catanzaro 2018-01-02 15:43:10 PST
(In reply to zalan from comment #5)
> No, it's definitely not intentional. Do you happen to have a cross platform
> test reduction? I could take a look at it.

I think all text entries are broken for GTK, including the comment entry on this Bugzilla. But even though I've been frustrated by this bug for several weeks, I'm still not quite sure what exactly is needed to trigger the bug. Zan must have figured it out in order to bisect it.
Comment 8 Michael Catanzaro 2018-01-05 07:56:07 PST
(I don't normally use Bugzilla priorities, but I will here, because we really can't release 2.20 until we figure out how to fix this.)
Comment 9 Carlos Garcia Campos 2018-01-08 01:05:38 PST
Created attachment 330671 [details]
Patch
Comment 10 Michael Catanzaro 2018-01-08 05:52:40 PST
Thanks a bunch!

Maybe Zalan will review it?
Comment 11 zalan 2018-01-08 07:23:47 PST
(In reply to Michael Catanzaro from comment #10)
> Thanks a bunch!
> 
> Maybe Zalan will review it?
will surely do today.
Comment 12 Simon Fraser (smfr) 2018-01-08 08:25:46 PST
Comment on attachment 330671 [details]
Patch

Is it possible to make a test case? It's odd that this broke GTK but not mac, and having a test case for mac would be good.
Comment 13 zalan 2018-01-08 08:52:44 PST
Comment on attachment 330671 [details]
Patch

I think having paintOffsetForClipRect = m_paintOffset + renderer.scrollPosition(); is more correct/explicit than what we had pre r224460. Also, with this patch, computeOffsets() does not actually computes all the offsets and could lead to incorrect assumptions in the future.
Comment 14 Carlos Garcia Campos 2018-01-09 00:20:32 PST
(In reply to Simon Fraser (smfr) from comment #12)
> Comment on attachment 330671 [details]
> Patch
> 
> Is it possible to make a test case? It's odd that this broke GTK but not
> mac, and having a test case for mac would be good.

Antti suggested the same yesterday and I tried to write a test, but I was unable to reproduce the issue with a tests case. I don't know if it is because there are force repaints/layouts in WTR that don't normally happen.
Comment 15 Carlos Garcia Campos 2018-01-09 02:14:58 PST
Created attachment 330801 [details]
Patch for landing

This makes more sense now, thanks Zalan, Antti!
Comment 16 Carlos Garcia Campos 2018-01-09 02:57:14 PST
Committed r226623: <https://trac.webkit.org/changeset/226623>
Comment 17 Radar WebKit Bug Importer 2018-01-09 02:58:18 PST
<rdar://problem/36372780>
Comment 18 zalan 2018-01-09 06:59:50 PST
(In reply to Carlos Garcia Campos from comment #15)
> Created attachment 330801 [details]
> Patch for landing
> 
> This makes more sense now, thanks Zalan, Antti!

Thanks for fixing it.