Commit Graph

43 Commits

Author SHA1 Message Date
Damien Guard
d6553ab62c Ensure win32 has parity with macOS for yardstick specs 2017-01-20 11:36:27 -08:00
Damien Guard
afe7f9a1fa Revert unintentional commit to lines-yardstick-spec.coffee 2017-01-19 23:32:02 -08:00
Damien Guard
d50b56b6a1 Add title for proxy settings config 2017-01-19 18:55:04 -08:00
Max Brunsfeld
2095015e82 Merge pull request #13453 from atom/mb-ns-integrate-new-display-layer
Use new text-buffer version with a more efficient DisplayLayer
2016-12-16 10:25:10 -08:00
Nathan Sobo
b087ab2734 Disable measurement tests for RTL text on Windows
@damieng This is unlike the other tests in this file in that none of the
assertions pass. Maybe you could take a look at some point to enable at
least some coverage on Windows for this?
2016-12-15 03:16:21 -07:00
Max Brunsfeld
a06d77710c Adjust LinesYardstick assertion to reflect removal of redundant leading whitespace span 2016-12-14 14:54:56 -08:00
Nathan Sobo
feb60ca0d3 Merge branch 'master' into farnabaz-master 2016-12-14 13:34:21 -07:00
Nathan Sobo
4e7d13b227 Clean up tests 2016-12-14 13:30:34 -07:00
Damien Guard
bd9ed684fe Lines-yardstick has different measurements on win32 2016-11-29 16:55:14 -08:00
Farnabaz
4d88a9783e add test: remove inconsistent indentations 2016-11-12 06:04:01 +03:30
Farnabaz
bd1919bbe4 add test: cursor position in bidirectional lines 2016-11-12 05:17:51 +03:30
Antonio Scandurra
4df74beba7 Merge branch 'master' into as-deprecate-shadow-dom 2016-10-17 12:06:00 +02:00
Max Brunsfeld
c2363010f8 Map out-of-range pixel positions to valid columns 2016-10-12 11:50:53 -07:00
Antonio Scandurra
901b0b17a3 Fix failing tests 2016-10-07 13:41:00 +02:00
Indrek Ardel
55f3311c01 Remove unused variables 2016-09-26 20:52:13 +03:00
Antonio Scandurra
4f5efe98ff Overshoot to the nearest character when text nodes are not contiguous 2016-05-01 11:05:14 +02:00
Antonio Scandurra
334b4c1104 Overshoot to the end of the text node when the position cannot be found
...because the only possible scenario when a logical position in a text
node cannot be found is when the requested pixel position is exactly at
the end of the node.
2016-04-30 11:51:54 +02:00
Antonio Scandurra
7b2f049cbb 🎨 Refine binary search algorithm 2016-04-29 16:51:51 +02:00
Antonio Scandurra
afdd8d2b6d Avoid creating line nodes twice in lines-yardstick-spec.coffee 2016-04-08 17:41:29 +02:00
Antonio Scandurra
108513f994 Fix LinesYardstick specs to use the new tagCode-based scope structure
Also, remove specs testing RTL behavior. They don’t work as of today,
and I think we need a better approach to handle them, that doesn’t
solely rely on the DOM, but actually takes into account that e.g. (0, 0)
is the rightmost character on a right-to-left string.
2016-04-05 10:47:25 +02:00
Antonio Scandurra
f81843d465 Merge branch 'master' into as-block-decorations 2016-01-14 09:30:06 -07:00
Nathan Sobo
9f6fbacddd Don’t clip screen positions in yardstick
By clipping positions only in the TextEditorComponent, we can ensure
that we check for the presence of a rendered line for the clipped row
value.
2016-01-04 16:32:38 -07:00
Antonio Scandurra
db9f67b9a5 🔥 Remove maxRow parameter 2015-12-18 15:41:46 +01:00
Antonio Scandurra
6a403e441e Start integrating tree-based LineTopIndex 2015-12-18 10:41:21 +01:00
Antonio Scandurra
8c1f0b0e21 Merge branch 'master' into as-block-decorations
# Conflicts:
#	spec/fake-lines-yardstick.coffee
#	spec/lines-yardstick-spec.coffee
#	spec/text-editor-presenter-spec.coffee
#	src/lines-yardstick.coffee
#	src/text-editor-component.coffee
#	src/text-editor-presenter.coffee
2015-12-18 09:59:12 +01:00
Antonio Scandurra
cfb30c795d Use an updated version of LineTopIndex 2015-12-14 15:04:54 +01:00
Nathan Sobo
85c6139579 Don’t force DOM updates in LinesYardstick
Instead, determine the need for a DOM update in the component before
measuring with the lines yardstick, and break `updateSync` into two
explicit pre- and post-measurement phases.
2015-12-10 14:47:05 -07:00
Antonio Scandurra
14d8ecefdd 💚 Fix LinesYardstick specs 2015-12-04 12:54:20 +01:00
Antonio Scandurra
cc4344735e 💚 Fix specs 2015-12-03 17:11:38 +01:00
Antonio Scandurra
6decf222a3 🐛 Fix incorrectly reported width when measuring lines
This commit fixes what seems to be a bug in Chromium.

When measuring lines (and with a special character sequence), it could happen
that Range(0, 0). getBoundingClientRect().width reports a number greater than 0.
This seems to happen when the font size is smaller than 12px and it's probably
due to subpixel font scaling. To solve it we've explicitly included a guard
clause that prevents this problem to happen.
2015-11-01 19:23:09 +01:00
Nathan Sobo
661607857f Fix spec failures due to slight changes in DOM positioning 2015-10-16 11:08:52 -06:00
Nathan Sobo
4c51d29868 Merge remote-tracking branch 'origin/master' into ns-alternative-test-env 2015-10-07 16:10:29 -05:00
Antonio Scandurra
61892f932b Use cached text nodes instead of NodeIterator 2015-10-06 10:43:32 +02:00
Antonio Scandurra
1c56c3f951 🎨 2015-10-05 16:32:51 +02:00
Antonio Scandurra
581ffb1360 🐎 Avoid to measure invisible lines when dragging 2015-10-05 16:05:17 +02:00
Antonio Scandurra
beb7896234 Enable subpixel font scaling
For certain font sizes, enabling `textRendering: optimizeLegibility` caused a
bunch of measurement-related issues. You can reproduce it by setting the following in your stylesheet:

```
atom-text-editor {
  font-size: 14px;
  text-rendering: optimizeLegibility;
}
```

Although I wanted to defer subpixel font scaling to a later moment, it seems
like Chrome needs to have it enabled in order to properly support the
"legibility" path for text rendering. (I guess this is part of the reason why
the Chromium team enabled it by default at some point in the past.)
2015-10-02 18:14:09 +02:00
Antonio Scandurra
b7e373fdca 🐛 Correctly measure RTL characters
This will fix also the "hidden cursor" issue we were experiencing.

/cc: @izuzak
2015-10-02 12:51:10 +02:00
Antonio Scandurra
2ffa7da59e 🐎 Remove rows to measure in the next frame 2015-10-02 12:38:19 +02:00
Antonio Scandurra
33523751ea Thoroughly test LinesYardstick interactions 2015-10-01 18:34:41 +02:00
Antonio Scandurra
af41b71cd8 Redesign LinesYardstick 2015-09-20 12:10:09 +02:00
Antonio Scandurra
bf7d7e0d2a Improve LinesYardstick design
We have shifted the responsibility of orchestrating state updates and
measurements to the yardstick. The presenter still needs to be updated to make
use of these new capabilities.
2015-09-18 10:17:55 +02:00
Antonio Scandurra
2ad336c649 💚 2015-09-17 16:26:55 +02:00
Antonio Scandurra
29846d0a51 Add LinesYardstick
...and create a MockLineNodesProvider for testing purposes
2015-09-15 18:41:41 +02:00