New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 709462 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

After selection loss browser don't render some parts of previously selected symbols

Reported by daniloze...@gmail.com, Apr 7 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.138 Safari/537.36 Vivaldi/1.8.770.54

Steps to reproduce the problem:
1. Select italic symbol
2. Click on any free space to lose selection
3. Part of symbol is not rendered
4. If it doesn't happend then try again

What is the expected behavior?

What went wrong?
Part of symbol is not rendered after selection loss

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 57.0.2987.133  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 25.0 r0
 
case.png
16.0 KB View Download
_ _FONTS_ _.html
376 bytes View Download

Comment 1 by e...@chromium.org, Apr 18 2017

Components: -Blink>Fonts Blink>Paint>Invalidation Blink>Editing>Selection

Comment 2 by yosin@chromium.org, Apr 21 2017

Cc: drott@chromium.org
Status: Available (was: Unconfirmed)
Not sure how to handle serif parts. Enlarge selection blue rect to cover serif parts?
Make invalidation to cover serif part? Can we retrieve rect enclosing whole glyph reliably?

drott@, WDYT?

Comment 3 by drott@chromium.org, Apr 21 2017

Cc: wangxianzhu@chromium.org wkorman@chromium.org

Comment 4 by drott@chromium.org, Apr 21 2017

Cc: kojii@chromium.org
Yes, the font code can in principle compute the glyph overflow for a selection of text.  I think the selection rectangle should not necessarily be enlarged but stick to cursor positions, but the invalidation needs to take into account the glyph overflow.
Blocking: 707807
Owner: wangxianzhu@chromium.org
Status: Assigned (was: Available)
There seem two issues (which might be of the same root cause):
1. Selection rect is not big enough to cover all glyph overflows;
2. Glyph overflows outside of the selection rect are not properly rasterized. This often means that some text's visual overflow rect is not big enough, which seems a case of bug 707807.
Labels: OS-Linux OS-Mac
Blocking: -707807
The problem is more obvious if we change the background to another color (attached italic.html). 

We paint the selected character in inverted color (white) but only invalidate the selection rect, causing the overflowing part in an "undefined" state, that is, it's painted in white color, but might not be re-rasterized because it's not invalidated.

I thought of several solutions:
1. (b.png) Expand the selection rect to cover all glyph overflows.
2. (c.png) Keep the current selection rect, but only invert color of the parts,  covered by the selection rect, of the selected glyphs.

1 seems the best but I'm not sure if it is feasible because I'm not sure the glyph overflows of middle characters are tracked. 2 will be simpler by changing the painting code only to apply a clip on the selected text and a inverted clip on the whole text.

Wdyt?
italic.html
164 bytes View Download
I worked on  issue 657325  which seems related, and landed http://crrev.com/2546473003 but have not been super happy with it due to the text selection overlap resulting tracked in issue 674107. I debated the selection inversion aspect essentially with myself (LOL) in  http://crbug.com/657325#c13 .

It would be great to improve things here. I agree that (1) sounds best. Maybe we should put together some samples of what it would look like visually one way vs. the other to help guide discussion. The site and image noted in  http://crbug.com/657325#c17  is one other than the one above to consider.

I am not familiar enough with for example Arabic languages or other scripts that may end up looking really weird with (2). drott@ could perhaps point us to some reference pages or test cases to review w/ selection highlight.
Owner: wkorman@chromium.org
Besides 1 and 2 in #c7, another choice is what drott@ suggested in #c4 that we can keep selection rect but should enlarge invalidation to cover the glyph overflows.

wkorman@ can you take over this bug?
Sure, I'm happy to take this. Will consider further and discuss.
See also http://crbug.com/706298#c39 and http://crrev.com/2803483002 where we incorporated ascent/descent into visual overflow rect.

Comment 12 by kojii@chromium.org, Apr 24 2017

> 1. (b.png) Expand the selection rect to cover all glyph overflows.

Note, word processors such as MS Word slants the selection rect if the first/last character is italic/slant, since simply extending makes harder to identify what is selected for cases like "f." in a fancy italic font.

If we want to do this, some fonts provide the italic angle, so we can add this to FontMetrics, but not all, in that case we need to synthesize using heuristic.
Owner: ----
Status: Available (was: Assigned)
Unassigning self from work that I do not expect to be able to get to soon.

Comment 14 by yosin@chromium.org, Jan 10 2018

Labels: Pri-3
Project Member

Comment 15 by sheriffbot@chromium.org, Jan 10

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment