Modifying spellchecked text may lead to discontinuity in the misspelling marker

RESOLVED FIXED in mozilla16

Status

()

Core
Layout
RESOLVED FIXED
8 years ago
5 years ago

People

(Reporter: smaug, Assigned: masayuki)

Tracking

Trunk
mozilla16
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments, 3 obsolete attachments)

(Reporter)

Description

8 years ago
Created attachment 419559 [details]
testcase

See the testcase.

Not yet sure if this is a layout/painting issue or a problem in spellchecker.
(Reporter)

Comment 1

8 years ago
Doesn't seem to be spellchecker problem, since it recognizes two text nodes 
as one word.

Painting seems to start at the beginning of a textframe/node. It should probably
check if the previous frame has the misspelling marker.
(Reporter)

Comment 2

8 years ago
(Not that it matters, but other browsers seem to have the same problem.)
What exactly are the steps to reproduce? If I insert text into that testcase, then first the spellcheck marker goes away, and then if I click outside the text, the whole word is marked again.
(Reporter)

Comment 4

8 years ago
Created attachment 419662 [details]
screenshot

Just load the testcase. You may need to zoom in a bit to see the problem.
Ah, so this is because there are two text nodes and we restart painting of the decoration.

Pretty minor bug :-)
Maybe we want to make the waviness of wavy text decorations relative to the origin of the window?
(Reporter)

Comment 7

8 years ago
Spellchecking marker is different on other platforms. On OSX it is dots.
But still, the bug is visible there too.
(In reply to comment #6)
> Maybe we want to make the waviness of wavy text decorations relative to the
> origin of the window?

I think that it's better especially when we implement CSS3 text-decoration-style. And also dotted and dashed style.
Making it relative to the origin of the window wouldn't work well for scrolling. Maybe relative to the origin of the nearest enclosing block.
Blocks: 59109
OS: Linux → All
Hardware: x86 → All
Version: unspecified → Trunk
Created attachment 523543 [details] [diff] [review]
Patch v0.1 (WIP)

Works fine for me for normal rendering, however, its shadow isn't rendered as I expected. I'll check the text-shadow rendering code.
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Oops, it doesn't work fine with the testcase...
Created attachment 523548 [details] [diff] [review]
Patch v0.2 (WIP)

looks fine for me, I'll add some tests.
Attachment #523543 - Attachment is obsolete: true

Comment 13

6 years ago
(In reply to comment #12)
> Created attachment 523548 [details] [diff] [review]
> Patch v0.2 (WIP)
> 
> looks fine for me, I'll add some tests.

is there a try-server build available with this patch landed?
Created attachment 638624 [details] [diff] [review]
part.1 Paint connection of complex style decoration lines smoothly

This patch paints decoration lines relative to the nearest ancestor block frame.

And also, at painting decoration lines in text-shadow or relative positioned box, this patch paints them with the offset from original (static) position.
Attachment #523548 - Attachment is obsolete: true
Attachment #638624 - Flags: review?(roc)
Created attachment 638626 [details] [diff] [review]
part.2 Remake the test for selection underlines with CSS3 text-decoration

CSS3 text-decoration has been implemented and same methods are used for layouting/painting the CSS3 decoration lines and selection underlines.

And also, the selection underlines test uses canvas and paints with ported methods in decoration_line_rendering.js from nsCSSRendering. So, when we change the code ins nsCSSRendering, we need to change decoration_line_rendering.js too. I think that it doesn't make sense.

Additionally, it works only on Windows with GDI rendering.

So, we should now remake the tests with CSS3 text-decoration. However, unfortunately, there are some difference between selection underline and CSS3 text-decoration. If font doesn't have enough descender for painting underline, CSS3 text-decoration may overlap it on the text. However, selection underline may overflow from the descender. Therefore, this patch may fail on Windows and Mac at testing "double" or "wavy". However, fortunately, all tests pass on Linux. So, the new tests can check new regressions perfectly by running on all platforms.
Attachment #638626 - Flags: review?(roc)
Attachment #638624 - Flags: review?(roc) → review+
Why do the tests pass on Linux but not Windows or Mac?
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #16)
> Why do the tests pass on Linux but not Windows or Mac?

On Mac, all tests with mplus passed. And on Windows, all tests for double and wavy are not passed on tryserver but all tests with mplus passed on my machine.

According to these facts, I guess that it depends on how to compute the descender height. If higher descender font is included in the font group, it can expand the descender. Then, CSS text-decoration and selection underline become same result. And also the difference of native font APIs may cause it too.
I don't think we should have a test that depends on the way the descender height is computed. We might want to change Linux to match the other platforms.
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #18)
> I don't think we should have a test that depends on the way the descender
> height is computed. We might want to change Linux to match the other
> platforms.

Hmm, okay.
Created attachment 638935 [details] [diff] [review]
part.2 Remake the test for selection underlines with CSS3 text-decoration
Attachment #638626 - Attachment is obsolete: true
Attachment #638626 - Flags: review?(roc)
Attachment #638935 - Flags: review?(roc)
Er, kIsWin and kIsMac are not necessary, please ignore them.
Attachment #638935 - Flags: review?(roc) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b58f095b4107
https://hg.mozilla.org/integration/mozilla-inbound/rev/5c4f67197980
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/5c4f67197980
https://hg.mozilla.org/mozilla-central/rev/b58f095b4107
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.