Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349642 - [client] [textmatestyler] Redraw bug when adding end pattern
Summary: [client] [textmatestyler] Redraw bug when adding end pattern
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Mark Macdonald CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 00:09 EDT by Mark Macdonald CLA
Modified: 2011-09-01 11:41 EDT (History)
1 user (show)

See Also:
bokowski: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2011-06-17 00:09:03 EDT
1. Create an html file with this content:
> <!--foo
> bar--
> baz

2. Put the caret after the -- on line 2, and type '>' to complete the comment terminator.

3. Expected 'baz' to turn from green to black (since it's no longer inside a comment). But it remains green.

The data structures used by the styler are correct, but the range that is repainted (via TextView.redrawRange()) is not large enough.
Comment 1 Mark Macdonald CLA 2011-06-17 12:56:34 EDT
I have a fix. The reason the tests didn't catch this is because they call textView.onLineStyle() to verify that each line has the correct styles.

This is less brittle that pulling DOM nodes from the TextView and examining their CSS classes (which I was doing in an earlier version of the tests). But, it means that we're not actually inspecting the currently displayed styles, which is where the problem lies in this case.

I will add a testcase for this
Comment 3 Boris Bokowski CLA 2011-06-17 15:05:07 EDT
+1 for RC2, I reviewed the change.