After selection loss browser don't render some parts of previously selected symbols
Reported by
daniloze...@gmail.com,
Apr 7 2017
|
||||||||||||
Issue descriptionUserAgent: 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
,
Apr 21 2017
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?
,
Apr 21 2017
,
Apr 21 2017
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.
,
Apr 21 2017
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.
,
Apr 21 2017
,
Apr 21 2017
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?
,
Apr 21 2017
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.
,
Apr 21 2017
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?
,
Apr 21 2017
Sure, I'm happy to take this. Will consider further and discuss.
,
Apr 21 2017
See also http://crbug.com/706298#c39 and http://crrev.com/2803483002 where we incorporated ascent/descent into visual overflow rect.
,
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.
,
May 11 2017
Unassigning self from work that I do not expect to be able to get to soon.
,
Jan 10 2018
,
Jan 10
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
,
Jan 10
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by e...@chromium.org
, Apr 18 2017