aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/text.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Use word-break to decide how glyph runs should be createdFelipe2016-09-271-2/+7
|
* Reorder `use` statementsUK9922016-09-091-3/+3
|
* Prefer length and percentage for word spacingRavi Shankar2016-08-091-1/+4
|
* Remove the ComputedValue traits and style_struct_traitsSimon Sapin2016-07-201-4/+4
|
* layout: text: Don't consider the ↵Emilio Cobos Álvarez2016-07-101-6/+5
| | | | | | | | | | | | | REQUIRES_LINE_BREAK_AFTERWARD_IF_WRAPPING_ON_NEWLINES if the fragment can wrap text. This was making us fall in a loop where the start split was empty, but we didn't ignore it because the current fragment had this flag, but then we treated it differently depending on the white_space property. Not totally sure this is the proper fix, but it makes sense to me. In case it is: Fixes #12369.
* Move util::linked_list to layoutAnthony Ramine2016-06-291-1/+1
|
* Alignment is wrong.Michael Howell2016-06-181-7/+7
|
* Remove empty lines following braces.Josh Matthews2016-05-271-1/+0
|
* Report use statements that use {} with only one entryCullen Rhodes2016-05-271-1/+1
|
* Always include the last-resort fontMatt Brubeck2016-05-241-9/+4
| | | | | This is used as a fallback for any characters that don't have glyphs in the specified font.
* Removed unused importsPer Lundberg2016-05-151-1/+1
| | | | This fixes #11185.
* Fix some warningsSimon Sapin2016-04-291-3/+3
|
* Use byte indices instead of char indices for text runsMatt Brubeck2016-04-281-52/+29
| | | | | | | Replace character indices with UTF-8 byte offsets throughout the code dealing with text shaping and breaking. This eliminates a lot of complexity when converting from one to the other, and interoperates better with the rest of the Rust ecosystem.
* Don't strip out all empty fragmentsMatt Brubeck2016-04-161-8/+7
| | | | | | | | | | Empty fragments may need to be layed out to draw borders, padding/background, and insertion points. (Fragments that consist of discardable whitespace and control characters, on the other hand, can still be discarded.) This ends up preserving some useless empty fragments. It's possible we could avoid this by storing some sort of flag on "important" empty fragments, so we can discard the rest.
* Fix up inline context flags during text fragment scanningMatt Brubeck2016-04-161-6/+34
| | | | | | | | | | | | | | | This fixes two problems that could cause scanned text fragments to end up with incorrect LAST_FRAGMENT_OF_ELEMENT or FIRST_FRAGMENT_OF_ELEMENT flags: 1. If a single unscanned fragment was split into multiple scanned fragments, then all of them would inherit its flags. We need to clear these flags, except for the first and last scanned fragment. 2. When an unscanned fragment generated zero scanned fragments, we correctly called `meld_with_next_inline_fragment` to transfer LAST_FRAGMENT flags to the preceding fragment, but we didn't do anything to transfer FIRST_FRAGMENT flags to the following fragment. We can fix this by calling `meld_with_prev_inline_fragment` on the following fragment.
* Renamed style structs.Per Lundberg2016-04-081-3/+3
| | | | The idea is to rename all style structs from Foo to ServoFoo, as described out in #10185.
* Draw insertion point even for empty input fieldsMatt Brubeck2016-04-071-4/+8
| | | | | This allows text layout to generate an empty text fragment if the fragment contains the insertion point for a text input box.
* Fix insertion point layout for text runs with multiple fragmentsMatt Brubeck2016-04-071-14/+50
| | | | | | | | Before this fix, if a TextRun containing an insertion point was split into multiple ScannedText fragments, text layout would draw an insertion point inside of each of the fragments. This patch records the insertion point position at most once per TextRun, and copies it only into the appropriate ScannedText fragment.
* Slight refactoring of RunMapping flush methodMatt Brubeck2016-04-071-16/+12
|
* Move CSS line-height property from InheritedBox to InheritedTextMauricio Collares2016-04-051-1/+1
|
* Implement ::selection pseudo-elementEmilio Cobos Álvarez2016-03-301-0/+1
|
* Auto merge of #10277 - perlun:rename-tcomputedvalues-to-computedvalues, ↵bors-servo2016-03-301-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | r=SimonSapin Renamed TComputedValues to ComputedValues This is a followup to #10210, and a continuation of #10185. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10277) <!-- Reviewable:end -->
| * Renamed TComputedValues to ComputedValuesPer Lundberg2016-03-291-1/+1
| | | | | | | | This is a followup to #10210, and a continuation of #10185.
* | Auto merge of #10255 - mbrubeck:box-unscanned, r=pcwaltonbors-servo2016-03-301-2/+2
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | Reduce size of layout::fragment::Fragment struct This reduces the size of the SpecificFragmentInfo enum from 48 to 24. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10255) <!-- Reviewable:end -->
| * Put UnscannedTextFragmentInfo in a BoxMatt Brubeck2016-03-291-2/+2
| | | | | | | | This reduces the size of the SpecificFragmentInfo enum from 48 to 24.
* | ComputedValues is now ServoComputedValuesPer Lundberg2016-03-271-2/+2
|/ | | | This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
* Auto merge of #10176 - mbrubeck:selection-range, r=pcwaltonbors-servo2016-03-261-21/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | Highlight selected text in input fields Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10176) <!-- Reviewable:end -->
| * Convert ScannedTextFragment fields into bitflagsMatt Brubeck2016-03-241-3/+11
| |
| * Highlight selected text in input fieldsMatt Brubeck2016-03-241-19/+44
| | | | | | | | | | Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
* | Parameterize the rest of the style system on TNode.Bobby Holley2016-03-241-1/+1
|/
* Move util::range into its own crateJonathan Schuster2016-02-251-1/+1
|
* Move util::logical_geometry to styleAnthony Ramine2016-02-181-1/+1
|
* Prefer `is_empty` over `len` when option is available.Corey Farwell2016-01-291-1/+1
|
* layout/text.rs: Add assertion for empty fontgroupOlaf Buddenhagen2016-01-141-0/+2
|
* Fix a bunch of clippy lintsJohannes Linke2016-01-021-8/+5
|
* Extend whitespace::T with additional helper methodsKeith Yeung2015-11-201-2/+2
|
* display input caret for textarea. fixes #7758Florian Merz2015-10-211-1/+11
|
* Add support for `pre-wrap` and `pre-line` values for `white-space`.Eli Friedman2015-10-201-15/+13
| | | | | | | This is mostly straightforward. I had to modify a couple of places which were accidentally discarding whitespace. Fixes #1513.
* Split Au type into separate crate, with minimal dependencies.Glenn Watson2015-10-011-1/+1
|
* Fix text-transform:capitalize across text runsMatt Brubeck2015-09-291-5/+8
|
* Break text runs by unicode scriptMatt Brubeck2015-09-291-1/+32
|
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-2/+1
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-2/+1
| | | | This merges import blocks that were reported by tidy as unmerged.
* layout: Query and maintain the position of the insertion pointPatrick Walton2015-09-171-7/+38
| | | | throughout layout for input elements.
* Remove 'get_*' on getters as per RFC 0344 on various componentsMathieu Rheaume2015-09-121-2/+2
|
* layout: Fix several bugs relating to inline borders, padding, andPatrick Walton2015-09-031-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | margins. * The code that attempted to strip out borders that span multiple fragments in the same element could go wrong if fragments were stripped out due to text clumping or whitespace stripping. This patch rewrites that code to maintain flags in the inline fragment context specifying whether the node is the beginning or end of the element. Not only is this easier to maintain, it's closer in spirit to what roc originally suggested two years ago: it's isomorphic to "begin element, end element" markers for inline layout. * Padding and margins for spans containing inline-blocks are now properly handled via a division of labor between the `InlineBlock` fragment and the `BlockFlow` that represents the inline-block. * Unscanned text fragments may not be joined together into a text run if borders, padding, or margins separate them. Because Servo now matches the rendering of Gecko and WebKit on the `input_button_margins_a` reftest, I had to modify it to add some vertical alignment. The combined effect of all of these fixes places "Advertising" on the right place on google.com.
* Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)Simon Sapin2015-09-021-1/+1
|
* Correctly handle length-changing mappings in text-transformAnthony Ramine2015-08-191-6/+7
|
* layout: Rewrite whitespace stripping.Patrick Walton2015-08-111-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes Servo unconditionally strip whitespace before text run scanning (assuming that the `white-space` property allows it). Whitespace stripping during reflow is now only used for handling whitespace at the ends of lines; reflow now never attempts to handle ignorable whitespace. Many CSS tests pass now. There are some new failures, however. The following reference tests now fail due to a pre-existing bug whereby whitespace is used to calculate the position of inline hypothetical boxes for elements with `display: inline; position: absolute`: * `absolute-replaced-height-036.htm` * `vertical-align-sub-001.htm` * `vertical-align-super-001.htm` The following reference tests fail due to a pre-existing bug whereby we don't handle `font-size: 0` properly in inline reflow: * `font-size-zero-1.htm` * `font-size-zero-2.htm` The following reference test fails due to the fact that it relied on our incorrect insertion of whitespace to make room for the black background: * `inline-formatting-context-007.htm`
* Rollup merge of #7015 - mbrubeck:arc-box, r=Ms2gerMatt Brubeck2015-08-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | Replace Arc<Box<TextRun>> with Arc<TextRun> Removes an extraneous level of indirection. r? @pcwalton <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7015) <!-- Reviewable:end -->