Commit Graph

34 Commits

Author SHA1 Message Date
Antonio Scandurra
5529645ff3 Recycle highlights 2015-10-06 10:26:49 +02:00
Antonio Scandurra
c79cc87172 Prepare DOMElementPool to account for text nodes 2015-10-06 10:02:04 +02:00
Antonio Scandurra
8b52538213 Pool highlight elements 2015-09-17 10:35:20 +02:00
Antonio Scandurra
07dbc545ac 🐛 Use border-box to prevent losing subpixel AA
When highlights are positioned outside the line box, they could get
hidden by a subsequent tile (because of its opaque background). As a
result, subpixel anti-aliasing gets disabled by Chrome.

Using `border-box` as the default `boxSizing` allows highlights to
always fit within the line (except if a styling like `margin` is
applied).
2015-07-23 11:52:32 +02:00
Antonio Scandurra
d294f35849 Get rid of .underlayer
/cc: @nathansobo
2015-06-05 16:26:33 +02:00
Antonio Scandurra
da05e1e234 wip 2015-06-05 16:05:30 +02:00
Jess Lin
79b460a0ca [Gutter] Add ::getDomNode method to all 'components' 2015-04-22 07:28:59 -07:00
Kevin Sawicki
590a4b0fd5 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Antonio Scandurra
0dca5a5fcd Encapsulate state update inside TextEditorPresenter#getState 2015-02-28 09:25:53 +01:00
Nathan Sobo
986e8bf85f Allow multiple space-delimited classes for highlight decorations
Fixes #5747
2015-02-25 14:35:32 -07:00
Nathan Sobo
b0a29bdc2f Make HighlightsComponent a plain object instead of using React 2015-02-19 17:14:53 -07:00
Nathan Sobo
c294bb105a Update highlight nodes manually 2015-02-19 17:14:53 -07:00
Nathan Sobo
fd50a0db6c Construct TextEditorPresenter before component mounts
This allows us to use the presenter for all stages of the component
lifecycle rather than needing to wait until it is created.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:28 -07:00
Nathan Sobo
a5580a704d Remove unused properties in EditorComponent and children 2015-02-03 15:05:25 -07:00
Nathan Sobo
49bf3bb14e Use presenter to render flashes
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
8ebd057b0c Use presenter to render highlights
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-02-03 15:05:22 -07:00
Nathan Sobo
a58af721f1 Assign highlight decoration React keys based on decoration id instead of class
@benogle: I think this should be fine now that we assign id’s, right?

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-11 12:11:26 -07:00
Nathan Sobo
0e57ede712 Only create a shadow root if editor.useShadowDOM config setting is true
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-04 16:37:27 -07:00
Nathan Sobo
5cc243ec11 Inject both underlayer and overlayer via shadow DOM insertion points 2014-11-04 16:37:25 -07:00
Nathan Sobo
ca1220a682 Delay initial measurement until the editor becomes visible
Previously, these measurements were always performed when the editor
component was mounted. This didn't work in situations where the
component was mounted in a non-visible state. This commit includes a
visibility check in the resize polling we were already doing, kicking
off the measurement process as soon as the editor is visible.
2014-07-21 13:40:10 -07:00
Ben Ogle
bf33d96899 Decorations can be flashed 2014-07-03 17:32:37 -07:00
Nathan Sobo
3f9fdad478 Precompute pixel rects for highlight decorations in EditorComponent 2014-06-24 12:56:52 -06:00
Ben Ogle & Nathan Sobo
76a911f17a Render highlights immediately to support underlayer shim 2014-06-23 16:23:45 -06:00
Nathan Sobo
7c356d2592 Revert "Render highlights on their own layer to avoid GPU artifacts" 2014-06-21 01:58:11 -06:00
Nathan Sobo
4218e0a037 Render highlights on their own layer to avoid GPU artifacts
Previously, when the last highlight div was removed from the lines
layer, chunks of the lines would sometimes disappear. Since we've
discovered that giving the lines an opaque background doesn't help with
subpixel anti-aliasing anyway, I've found that rendering highlights on
their own layer behind the lines and making the lines layer transparent
avoids the arficacts.
2014-06-20 15:18:19 -06:00
Nathan Sobo
388763e7cd Wait to measure characters if editor is hidden
Also, when characters *are* measured, request a display update
2014-06-19 04:19:51 -06:00
Nathan Sobo
2fffbba503 Eliminate Decoration class and use plain objects instead 2014-06-17 17:35:56 -06:00
Nathan Sobo
edadedce7b Give highlight decorations unique id's to avoid potential React errors
Using the marker's id plus the decoration class can cause an error in
the event we apply a decoration with the same class twice to the same
marker. This is admittedly unlikely, but I think it's cleaner to just
allocate unique id's for decoration objects.
2014-06-17 15:03:45 -06:00
Nathan Sobo
5d15af943e Rename filterDecorationsByMarkerId to getHighlightDecorations
And rename local variable to highlightDecorations to clarify intent
2014-06-17 14:31:56 -06:00
Ben Ogle
34ec15862f Filter decorations in the components.
This reduces the number of intermediate objects we need to create. The 
downside is a bit more code complexity in the components.
2014-06-16 16:54:21 -07:00
Ben Ogle
7ba498a170 Fix id generation 2014-06-16 16:06:01 -07:00
Ben Ogle
408e62a993 Pass highlightDecorations into the HighlightsComponent 2014-06-16 15:36:08 -07:00
Ben Ogle
1ebdd801f5 Use decorations to render selections 2014-06-16 15:36:08 -07:00
Ben Ogle
084632a985 Rename Selection(s)Component to Highlight(s)Component 2014-06-16 15:36:08 -07:00