Closed Bug 537230 Opened 15 years ago Closed 12 years ago

Modifying spellchecked text may lead to discontinuity in the misspelling marker

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: smaug, Assigned: masayuki)

References

Details

Attachments

(4 files, 3 obsolete files)

Attached file testcase
See the testcase. Not yet sure if this is a layout/painting issue or a problem in spellchecker.
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.
(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.
Attached image 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?
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
Attached patch Patch v0.1 (WIP) (obsolete) — Splinter Review
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...
Attached patch Patch v0.2 (WIP) (obsolete) — Splinter Review
looks fine for me, I'll add some tests.
Attachment #523543 - Attachment is obsolete: true
(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?
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)
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)
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.
Er, kIsWin and kIsMac are not necessary, please ignore them.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: