ASSIGNED64553
[Mac] REGRESSION(r90089): search field focus ring painted multiple times
https://bugs.webkit.org/show_bug.cgi?id=64553
Summary [Mac] REGRESSION(r90089): search field focus ring painted multiple times
Daniel Bates
Reported 2011-07-14 12:59:53 PDT
Created attachment 100848 [details] Example When typing into an <input type="search"> the focus rings appears to be drawn multiple times. This is particularly noticeable at the top and bottom-right corner of the focus ring which an extra line and a smear mark, respectively. The extra line seems to grow longer as you type more.
Attachments
Example (215 bytes, text/html)
2011-07-14 12:59 PDT, Daniel Bates
no flags
[Screenshot] Type one character into search field (28.16 KB, image/png)
2011-07-14 13:02 PDT, Daniel Bates
no flags
[Screenshot] Type two words into search field (29.18 KB, image/png)
2011-07-14 13:03 PDT, Daniel Bates
no flags
Patch (12.82 KB, patch)
2011-07-28 06:02 PDT, Kent Tamura
no flags
Patch 2 (40.75 KB, patch)
2011-07-28 18:28 PDT, Kent Tamura
eric: review-
Daniel Bates
Comment 1 2011-07-14 13:02:17 PDT
Created attachment 100849 [details] [Screenshot] Type one character into search field
Daniel Bates
Comment 2 2011-07-14 13:03:11 PDT
Created attachment 100850 [details] [Screenshot] Type two words into search field Notice the rendering artifacts around the top and bottom-right corner of the focus ring.
Daniel Bates
Comment 3 2011-07-14 13:11:32 PDT
For completeness, this issue can be seen in Mac nightly r90991. This issue isn't seen in shipping Safari Version 5.0.5 (6533.21.1) on Mac.
Alexey Proskuryakov
Comment 4 2011-07-14 15:18:28 PDT
Alexey Proskuryakov
Comment 5 2011-07-14 15:19:37 PDT
See also: bug 10049.
Kent Tamura
Comment 6 2011-07-15 01:22:52 PDT
input[type="search"]:focus { outline-width: 6px; } fixes the problem. Is this a correct fix? I'm not sure what is the root cause. I investigated how RenderTextControlSIngleLine::layout() and paint() were called. When a user types a key, the followings are called: r90088: layout(), layout(), PaintPhaseBlockBackgound, PaintPhaseChildBlockBackgrounds, PaintPhaseFloat, PaintPhaseForeground, then PaintPhaseOutline. r90089: layout(), PaintPhaseBlockBackgound, PaintPhaseChildBlockBackgrounds, PaintPhaseFloat, PaintPhaseForeground, then PaintPhaseOutline. It seems that there are no differences of the number of outline paintings.
Kent Tamura
Comment 7 2011-07-20 22:41:27 PDT
(In reply to comment #6) > input[type="search"]:focus { > outline-width: 6px; > } > fixes the problem. Is this a correct fix? I found this fix was incomplete. > r90088: > layout(), layout(), PaintPhaseBlockBackgound, PaintPhaseChildBlockBackgrounds, PaintPhaseFloat, PaintPhaseForeground, then PaintPhaseOutline. > > r90089: > layout(), PaintPhaseBlockBackgound, PaintPhaseChildBlockBackgrounds, PaintPhaseFloat, PaintPhaseForeground, then PaintPhaseOutline. The repainting areas were different: r90088: PaintInfo: context=0x7fff5fbfadc0 (7,41) 131x25 phase=BlockBackground root=0x0 PaintInfo: context=0x7fff5fbfadc0 (7,41) 131x25 phase=ChildBlockBackgrounds root=0x0 PaintInfo: context=0x7fff5fbfadc0 (7,41) 131x25 phase=Float root=0x0 PaintInfo: context=0x7fff5fbfadc0 (7,41) 131x25 phase=Foreground root=0x0 PaintInfo: context=0x7fff5fbfadc0 (7,41) 131x25 phase=Outline root=0x0 r90089 or later: PaintInfo: context=0x7fff5fbfadc0 (24,39) 114x27 phase=BlockBackground root=0x0 PaintInfo: context=0x7fff5fbfadc0 (24,39) 114x27 phase=ChildBlockBackgrounds root=0x0 PaintInfo: context=0x7fff5fbfadc0 (24,39) 114x27 phase=Float root=0x0 PaintInfo: context=0x7fff5fbfadc0 (24,39) 114x27 phase=Foreground root=0x0 PaintInfo: context=0x7fff5fbfadc0 (24,39) 114x27 phase=Outline root=0x0
Jon Lee
Comment 8 2011-07-25 11:04:50 PDT
Using ToT, I am only seeing this on Snow Leopard, and not Lion. Also, I can repro the first screenshot (with the white line), but not the second (with the extra smudges). Has anything changed for your side?
Kent Tamura
Comment 9 2011-07-26 05:46:58 PDT
Well, I understand what's happening. 1. A user types into a search field. 2. The inner editable element is updated. 3. A rectangle larger than the rectangle of the inner editable element is invalidated. See RenderBox::clippedOverflowRectForRepaint(). We inflate the rectangle by RenderStyle::maximulOutlineSize() even if the style has no outline. 4. Clear the inflated rectangle. The search field border is cleared, but the focus ring outside of the inflated rectangle is not cleared. 5. Clip the graphics context with the inflated rectangle 6. Draw NSSearchFieldCell with the focus ring. Surprisingly the focus ring ignores the clipping. So the outer part of focus ring is drawn onto an existing focus ring. I guess Lion respects clipping in focus ring drawing. I'll investigate how to fix this issue.
Kent Tamura
Comment 10 2011-07-28 06:02:42 PDT
Kent Tamura
Comment 11 2011-07-28 06:04:59 PDT
(In reply to comment #10) > Created an attachment (id=102249) [details] > Patch I confirmed the test failed without the patch.
WebKit Review Bot
Comment 12 2011-07-28 07:06:38 PDT
Comment on attachment 102249 [details] Patch Attachment 102249 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9266200 New failing tests: fast/repaint/search-field-cancel.html
Kent Tamura
Comment 13 2011-07-28 18:28:58 PDT
Created attachment 102321 [details] Patch 2 search-field-cance.html should be updated.
WebKit Review Bot
Comment 14 2011-07-28 18:32:47 PDT
Attachment 102321 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1 ERROR: FAILURES FOR <linux, x86, release, cpu> ERROR: Line:19 Test lacks BUG modifier. editing/selection/empty-cell-right-click.html ERROR: Line:20 Test lacks BUG modifier. editing/selection/dump-as-markup.html ERROR: Line:21 Test lacks BUG modifier. fast/js/array-sort-modifying-tostring.html ERROR: Line:22 Test lacks BUG modifier. fast/overflow/lots-of-sibling-inline-boxes.html ERROR: Line:23 Test lacks BUG modifier. inspector/cookie-resource-match.html LayoutTests/platform/qt/test_expectations.txt:19: Test lacks BUG modifier. editing/selection/empty-cell-right-click.html [test/expectations] [2] LayoutTests/platform/qt/test_expectations.txt:20: Test lacks BUG modifier. editing/selection/dump-as-markup.html [test/expectations] [2] LayoutTests/platform/qt/test_expectations.txt:21: Test lacks BUG modifier. fast/js/array-sort-modifying-tostring.html [test/expectations] [2] LayoutTests/platform/qt/test_expectations.txt:22: Test lacks BUG modifier. fast/overflow/lots-of-sibling-inline-boxes.html [test/expectations] [2] LayoutTests/platform/qt/test_expectations.txt:23: Test lacks BUG modifier. inspector/cookie-resource-match.html [test/expectations] [2] Total errors found: 5 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Eric Seidel (no email)
Comment 15 2012-02-13 13:14:32 PST
Comment on attachment 102321 [details] Patch 2 Looking at the pixel results, it looks like we're now invalidating more on the left hand side of the box, no?
Eric Seidel (no email)
Comment 16 2012-03-01 15:35:06 PST
Comment on attachment 102321 [details] Patch 2 Please explain the pixel result change (since it looks like we're painting more, not less). Otherwise I'm happhy to review this once you do.
Note You need to log in before you can comment on or make changes to this bug.