aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/fragment.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move LayoutNode and related traits to script_layout_interface.Ms2ger2016-06-201-1/+1
|
* Move HTMLCanvasData to script_layout_interface.Ms2ger2016-06-201-1/+1
|
* Introduce a script_layout_interface crate and move RestyleDamage to it.Ms2ger2016-06-201-1/+1
|
* Account for the font of empty input fieldsMichael Howell2016-06-191-3/+3
| | | | Fixes #11653
* Image with height defined in % resizes properlyDarin Minamoto2016-06-151-2/+7
|
* Make layout only depend on script::layout_interface.Ms2ger2016-06-071-1/+1
|
* Auto merge of #11442 - mitchhentges:87-debug-id, r=KiChjangbors-servo2016-06-041-12/+59
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fragment debug_id u16 only exists in debug, prod will format mem address <!-- Please describe your changes on the following line: --> Each fragment has a `u16` `debug_id` in debug mode, but no `debug_id` in production to save memory. To format a debug id in production, the address of the empty `debug_id` is displayed. --- <!-- 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 - [X] These changes fix #87 (github issue number if applicable). <!-- Either: --> - [X] These changes do not require tests because it looks like it's not possible to mock out `cfg` options in `#[test]`s <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/11442) <!-- Reviewable:end -->
| * Fragment debug_id u16 only exists in debug, prod will format mem addressMitchell Hentges2016-06-041-12/+59
| |
* | Auto merge of #11035 - mrobinson:no-stacking-contexts-for-text-fragments, ↵bors-servo2016-06-011-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r=pcwalton Do not create stacking contexts for text fragments Without this change, each text fragment in a block that establishes a stacking context will establish its own stacking context. This is unnecessary and increases the amount of work done during display list construction. This change should not change output, but should improve performance. <!-- 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/11035) <!-- Reviewable:end -->
| * | Do not create stacking contexts for text fragmentsMartin Robinson2016-06-011-0/+7
| | | | | | | | | | | | | | | | | | | | | Without this change, each text fragment in a block that establishes a stacking context will establish its own stacking context. This is unnecessary and increases the amount of work done during display list construction.
* | | script: Keep the DOM-side viewport up to date when scrolling happens inPatrick Walton2016-05-311-2/+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-1/+1
|/
* Always include the last-resort fontMatt Brubeck2016-05-241-0/+5
| | | | | 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 inline size adjustment when stripping trailing whitespace from fragmentsUlf Nilsson2016-05-111-1/+2
| | | | | The whitespace range was not properly shifted which caused us to adjust the fragment's inline size by the advance of a different set of characters. This was causing justified text lines to be too long or too short.
* Make `text-align: justify` incremental layout safeUlf Nilsson2016-05-101-13/+13
|
* Remove redundant code in whitespace strippingMatt Brubeck2016-05-051-7/+2
| | | | | | 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: Minor whitespace cleanup.Patrick Walton2016-05-041-2/+4
|
* layout: Consider vertical alignment of fragments during line breaking.Patrick Walton2016-05-041-2/+20
| | | | | | | 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-9/+36
| | | | 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-0/+11
| | | | between floats.
* Upgrade to bitflags 0.6.0 and selectors 0.5.6Matt Brubeck2016-04-301-2/+2
| | | | | Types generated by `bitflags!` are now private by default. This PR marks them `pub` where necessary.
* Auto merge of #10928 - servo:warnings, r=mbrubeckbors-servo2016-04-301-2/+1
|\ | | | | | | | | | | | | | | Fix some warnings <!-- 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/10928) <!-- Reviewable:end -->
| * Fix some warningsSimon Sapin2016-04-291-2/+1
| |
* | layout: Stop storing PrecomputedStyleData in LayoutNodeEmilio Cobos Álvarez2016-04-291-8/+9
|/ | | | Use the SharedStyleContext instead.
* Use byte indices instead of char indices for text runsMatt Brubeck2016-04-281-70/+42
| | | | | | | 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.
* Auto merge of #10655 - mbrubeck:merge-margin, r=SimonSapinbors-servo2016-04-171-0/+1
|\ | | | | | | | | | | | | | | | | | | | | Update margins when merging inline fragments Fixes #10633. 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/10655) <!-- Reviewable:end -->
| * Update margins when merging inline fragmentsMatt Brubeck2016-04-161-0/+1
| | | | | | | | Fixes #10633.
* | Fix meld_with_next_inline_fragment and add meld_with_prev_inline_fragmentMatt Brubeck2016-04-161-8/+31
| | | | | | | | | | | | | | | | | | | | | | Factor out a new `meld_with_prev_inline_fragment` method that mirrors the existing `meld_with_next_inline_fragment`. This also fixes a bug in `meld_with_next` that was already fixed in the `meld_with_prev` by @notriddle in #10419. The bug is that it was traversing the inline context nodes in the wrong order. It should start at the outermost enclosing node, since the fragments might be at different nesting levels under some common ancestor.
* | Improve debug logging of non-printable charsMatt Brubeck2016-04-161-2/+2
|/
* layout: Minimal refactor in style_specified_intrinsic_inline_size to improve ↵Emilio Cobos Álvarez2016-04-131-9/+7
| | | | legibility.
* layout: take into account max and min inline size for canvas and imagesEmilio Cobos Álvarez2016-04-131-2/+14
|
* layout: Take in account max inline size for inline fragmentsEmilio Cobos Álvarez2016-04-131-2/+7
|
* Auto merge of #10469 - mbrubeck:layout-misc, r=pcwaltonbors-servo2016-04-081-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Some minor layout cleanups * Prevent unnecessary copying in `strip_leading_whitespace_if_necessary` * Remove unused argument to `adjust_clipping_region_for_children` (silences a compiler warning) 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/10469) <!-- Reviewable:end -->
| * Prevent unnecessary copying in strip_leading_whitespace_if_necessaryMatt Brubeck2016-04-071-1/+4
| |
* | Draw insertion point even for empty input fieldsMatt Brubeck2016-04-071-0/+3
|/ | | | | This allows text layout to generate an empty text fragment if the fragment contains the insertion point for a text input box.
* Move some CSS properties from Box to PositionMauricio Collares2016-04-051-4/+4
|
* Implement ::selection pseudo-elementEmilio Cobos Álvarez2016-03-301-0/+12
|
* 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-4/+4
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | 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 -->
| * Unbox IframeFragmentInfo.Matt Brubeck2016-03-291-1/+1
| |
| * Put UnscannedTextFragmentInfo in a BoxMatt Brubeck2016-03-291-3/+3
| | | | | | | | This reduces the size of the SpecificFragmentInfo enum from 48 to 24.
* | Auto merge of #10210 - perlun:rename-computedvalues-to-servocomputedvalues, ↵bors-servo2016-03-291-13/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-13/+12
| |/ | | | | | | 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-6/+23
|/ | | | Fixes #10200.
* Auto merge of #10176 - mbrubeck:selection-range, r=pcwaltonbors-servo2016-03-261-24/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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-19/+31
| |
| * Highlight selected text in input fieldsMatt Brubeck2016-03-241-11/+13
| | | | | | | | | | Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
* | layout: Rewrite the block formatting context/float inline-sizePatrick Walton2016-03-251-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | speculation code. The old code tried to do the speculation as a single bottom-up pass after intrinsic inline-size calculation, which was unable to handle cases like this: <div> <div style="float: left">Foo</div> </div> <div> <div style="overflow: hidden">Bar</div> </div> No single bottom-up pass could possibly handle this case, because the inline-size of the float flowing out of the "Foo" block could never make it down to the "Bar" block, where it is needed for speculation. On the pages I tried, this regresses layout performance by 1%-2%. I first noticed this breaking some pages, like the Google SERPs, several months ago.