aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/inline.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* layout: Rewrite clipping to be a two-phase process that takes physicalPatrick Walton2016-10-151-10/+12
| | | | | | | | | | | | | | | | | | border box positions and transforms into account. Clipping region computation now follows a simple process: (1) in the parent's coordinate system, parents store appropriate clipping regions into children; (2) each child moves its clipping region to its own coordinate system if necessary. Because clipping region computation is now based on stacking-relative border box positions and the `transform_rect` method, it can handle `position: relative` offsets and more types of transforms, such as scaling. Improves etsy.com. Closes #13753.
* layout: Rewrite Servo's `vertical-align` support to match CSS 2.1 §Patrick Walton2016-10-111-242/+193
| | | | | | | | | | | | | | | | | 10.8, and implement `vertical-align: middle` per CSS 2.1 § 10.8.1. `InlineMetrics` has been split into `InlineMetrics` for fragments and `LineMetrics` for lines. Both structures' fields have been renamed in order to more clearly delineate the difference between *space* and *content*. Vertical positioning of fragments has been reworked to take margins and borders into account only for replaced content. This patch fixes the `vertical_align_super_a.html` reftest. Servo now matches the rendering that Gecko and WebKit produce. Additionally, this includes a test for the popular inline-block centering technique described here: https://s.codepen.io/shshaw/fullpage/gEiDt?#Inline-Block
* layout: Place inline absolute hypothetical boxes properly during blockPatrick Walton2016-10-041-40/+96
| | | | | | | | fragment position assignment. Improves Rust documentation. Closes #13471.
* Auto merge of #13401 - notriddle:master, r=pcwaltonbors-servo2016-09-291-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement sequential fallback to float speculation This shouldn't impact any pages that are already rendering correctly, but it is a very naive implementation of this pass. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #13284 and fix #13223 - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13401) <!-- Reviewable:end -->
| * Implement sequential fallback to float speculationMichael Howell2016-09-271-1/+4
| | | | | | | | | | Fixes #13284 Fixes #13223
* | Auto merge of #13417 - mrobinson:simplify-stacking-context-collection, r=glennwbors-servo2016-09-291-6/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify stacking context collection <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Simplify the way that stacking contexts are collected. Instead of passing the StackingContextId down the tree, pass the parent StackingContext itself. This will allow future patches to get more information about the parent stacking context (such as location). Also remove the return value of collect_stacking_contexts, which was unused. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13417) <!-- Reviewable:end -->
| * | Simplify stacking context collectionMartin Robinson2016-09-271-6/+2
| |/ | | | | | | | | | | | | | | | | | | Simplify the way that stacking contexts are collected. Instead of passing the StackingContextId down the tree, pass the parent StackingContext itself. This will allow future patches to get more information about the parent stacking context (such as location). Also remove the return value of collect_stacking_contexts, which was unused.
* | Auto merge of #13470 - pcwalton:inline-absolute-hypothetical-baseline, ↵bors-servo2016-09-291-6/+8
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | r=notriddle layout: Improve the interaction between baseline-offset-of-last-line-in-flow logic and inline absolute hypothetical boxes. See commits for details. These changes place the heart icon on Twitter in the right place. r? @notriddle <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13470) <!-- Reviewable:end -->
| * layout: Remove a stray newline.Patrick Walton2016-09-281-1/+0
| |
| * layout: Don't count lines that consist solely of hypothetical boxes whenPatrick Walton2016-09-281-5/+8
| | | | | | | | | | | | | | determining the baseline offset of the last line. Improves Twitter by placing the favorite icon in the right place vertically.
* | layout: Add a `REPOSITION` restyle damage type.Patrick Walton2016-09-261-2/+4
|/ | | | | | Separating out `REPOSITION` from `REPAINT` allows us to compute stacking-context-relative positions without rebuilding the display list. This saves a lot of time when responding to script-to-layout queries.
* Reorder `use` statementsUK9922016-09-091-5/+5
|
* Pass SharedLayoutContext to Flow::compute_absolute_position.Ms2ger2016-08-241-2/+2
|
* do not merge inline fragments if there is space in betweenAlexandrov Sergey2016-08-111-0/+4
|
* reset border_padding between, account for border_padding in border_box and ↵Alexandrov Sergey2016-08-081-1/+17
| | | | reset *_FRAGMENT_OF_ELEMENT flag for splitted fragments
* Remove some type aliases that are now just re-exports.Simon Sapin2016-07-201-2/+1
|
* Remove the ComputedValue traits and style_struct_traitsSimon Sapin2016-07-201-1/+1
|
* Move arc_ptr_eq to style.Ms2ger2016-07-111-3/+3
|
* layout: text: Don't consider the ↵Emilio Cobos Álvarez2016-07-101-3/+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::print_tree to gfx_traitsAnthony Ramine2016-07-041-1/+1
|
* Pass SharedStyleContext to assign_inline_sizes.Ms2ger2016-06-221-1/+2
|
* Store SharedStyleContext in AbsoluteAssignBSizesTraversal.Ms2ger2016-06-221-1/+2
|
* Remove REPAINT damage in Fragment::build_display_listMatt Brubeck2016-06-201-6/+2
| | | | | | Previously, the code that called this function was responsible for this. Some code paths neglected to do it. This moves the damage removal to one central location.
* Move LayoutNode and related traits to script_layout_interface.Ms2ger2016-06-201-1/+1
|
* Introduce a script_layout_interface crate and move RestyleDamage to it.Ms2ger2016-06-201-1/+2
|
* Image with height defined in % resizes properlyDarin Minamoto2016-06-151-1/+2
|
* script: Keep the DOM-side viewport up to date when scrolling happens inPatrick Walton2016-05-311-1/+2
| | | | | | | | | | | | | | | WebRender. This happens asynchronously, just as it does in non-WebRender mode. This functionality is a prerequisite for doing proper display-list-based hit testing in WebRender, since it moves the scroll offsets into Servo (and, specifically, into the script thread, enabling iframe event forwarding) instead of keeping them private to WebRender. Requires servo/webrender_traits#55 and servo/webrender#277. Partially addresses #11108.
* Report use statements that use {} with only one entryCullen Rhodes2016-05-271-2/+2
|
* Make `text-align: justify` incremental layout safeUlf Nilsson2016-05-101-22/+8
|
* Remove redundant code in whitespace strippingMatt Brubeck2016-05-051-18/+3
| | | | | | LineBreaker calls Fragment::strip_trailing_whitespace_if_necessary and then recalculates the fragment's inline size. But this isn't necessary because strip_trailing_whitespace_if_necessary already recalculates the size.
* layout: Consider vertical alignment of fragments during line breaking.Patrick Walton2016-05-041-273/+151
| | | | | | | This makes the line breaker determine the final block positions of each line rather than doing it in a separate pass afterward. Not only does this simplify the code, it makes `vertical-align` and float placement interact properly.
* layout: Check flow descendants of inline block fragments to find theirPatrick Walton2016-05-041-1/+18
| | | | baselines when aligning inline fragments per CSS 2.1 § 10.8.1.
* layout: Don't pretend inline fragment sizes are zero when placing themPatrick Walton2016-05-041-1/+1
| | | | between floats.
* Upgrade to bitflags 0.6.0 and selectors 0.5.6Matt Brubeck2016-04-301-1/+1
| | | | | Types generated by `bitflags!` are now private by default. This PR marks them `pub` where necessary.
* Auto merge of #10320 - malayaleecoder:master, r=KiChjangbors-servo2016-04-091-3/+3
|\ | | | | | | | | | | | | | | | | | | | | Rename imm_child_iter() and child_iter(). Fixes #10286 <!-- 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/10320) <!-- Reviewable:end -->
| * Rename imm_child_iter() and child_iter(). Fixes #10286malayaleecoder2016-04-091-3/+3
| |
* | Remove unused argument to adjust_clipping_region_for_childrenMatt Brubeck2016-04-071-2/+1
| |
* | Auto merge of #10407 - mauricioc:issue10403, r=bholleybors-servo2016-04-071-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move some CSS properties to match Gecko's representation Fixes #10403. Animation had an extra transition-delay property, which was also moved to Box. Let me know if I should squash the commits. <!-- 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/10407) <!-- Reviewable:end -->
| * | Move CSS text-overflow property from InheritedText to TextMauricio Collares2016-04-051-1/+1
| |/
* / Whitespace stripping should not result in a dangling, open border.Michael Howell2016-04-051-0/+2
|/
* layout: Propagate selected_style to InlineFragmentNodeInfoEmilio Cobos Álvarez2016-03-301-0/+1
|
* Renamed TComputedValues to ComputedValuesPer Lundberg2016-03-291-1/+1
| | | | This is a followup to #10210, and a continuation of #10185.
* Auto merge of #10210 - perlun:rename-computedvalues-to-servocomputedvalues, ↵bors-servo2016-03-291-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | r=SimonSapin ComputedValues is now ServoComputedValues 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. <!-- 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/10210) <!-- Reviewable:end -->
| * ComputedValues is now ServoComputedValuesPer Lundberg2016-03-271-4/+4
| | | | | | | | 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.
* | Restore stripped whitespace before reflowing text fragmentsMatt Brubeck2016-03-281-0/+3
|/ | | | Fixes #10200.
* Auto merge of #10176 - mbrubeck:selection-range, r=pcwaltonbors-servo2016-03-261-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| |
| * Highlight selected text in input fieldsMatt Brubeck2016-03-241-0/+1
| | | | | | | | | | 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
|/
* Auto merge of #9969 - mbrubeck:quotes-036, r=pcwaltonbors-servo2016-03-121-4/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't re-resolve already-resolved generated content This fixes #7846, a failure in the "quotes-036.htm" test. Servo lays out this test correctly in its initial layout, but then messes it up in any relayout (whether it's an incremental or full layout). The problem is that the ResolveGeneratedContent traversal is not safe to run more than once on the same flow. It mutates some GeneratedContent fragments into ScannedText fragments, but leaves others unmodified (in particular, those that generate empty content). The next time layout runs, these remaining GeneratedContent fragments are processed *again* but with an incorrect correct quote nesting level (because some of the surrounding GeneratedContent fragments are gone). This patch ensures that each GeneratedContent fragment is resolved only once. r? @pcwalton <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9969) <!-- Reviewable:end -->