aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/inline.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Integrate Canvas into the DisplayListMartin Robinson2015-10-211-10/+1
| | | | | | | | Canvas is currently given a layer at the stacking context level. Instead it's DisplayItem should be given a layer directly. This fixes painting order issues where canvases are painted on top of other positioned content that is later in tree order. It always simplifies the code a bit.
* Auto merge of #7950 - mrobinson:layerize-iframes, r=pcwaltonbors-servo2015-10-201-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integrate iframes into the display list Instead of always promoting iframes to StackingContexts, integrate them into the display list. This prevents stacking bugs when non-stacking-context elements should be drawn on top of iframes. To accomplish this, we add another step to ordering layer creation, where LayeredItems in the DisplayList are added to layers described by the LayerInfo structures collected at the end of the DisplayList. Unlayered items that follow these layered items are added to synthesized layers. Another result of this change is that iframe layers can be positioned directly at the location of the iframe fragment, eliminating the need for the SubpageLayerInfo struct entirely. Iframes are the first type of content treated this way, but this change opens up the possibility to properly order canvas and all other layered content that does not create a stacking context. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7950) <!-- Reviewable:end -->
| * Integrate iframes into the display listMartin Robinson2015-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of always promoting iframes to StackingContexts, integrate them into the display list. This prevents stacking bugs when non-stacking-context elements should be drawn on top of iframes. To accomplish this, we add another step to ordering layer creation, where LayeredItems in the DisplayList are added to layers described by the LayerInfo structures collected at the end of the DisplayList. Unlayered items that follow these layered items are added to synthesized layers. Another result of this change is that iframe layers can be positioned directly at the location of the iframe fragment, eliminating the need for the SubpageLayerInfo struct entirely. Iframes are the first type of content treated this way, but this change opens up the possibility to properly order canvas and all other layered content that does not create a stacking context. Fixes #7566. Fixes #7796.
* | Add support for `pre-wrap` and `pre-line` values for `white-space`.Eli Friedman2015-10-201-48/+40
|/ | | | | | | This is mostly straightforward. I had to modify a couple of places which were accidentally discarding whitespace. Fixes #1513.
* Auto merge of #7825 - eefriedman:div-align, r=mbrubeckbors-servo2015-10-081-3/+12
|\ | | | | | | | | | | | | | | | | | | | | | | Fully implement the "align descendants" rule for div. This adds -servo-left and -servo-right to complement -servo-center. ~~This intentionally doesn't try to address issue #7301.~~ Commit added to address #7301. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7825) <!-- Reviewable:end -->
| * Fully implement the "align descendants" rule for div.Eli Friedman2015-10-021-3/+12
| | | | | | | | | | | | This adds -servo-left and -servo-right to complement -servo-center. This intentionally doesn't try to address issue #7301.
* | Split Au type into separate crate, with minimal dependencies.Glenn Watson2015-10-011-1/+2
| |
* | layout: Make the compositor rather than layout determine the position ofPatrick Walton2015-09-291-4/+15
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | each iframe. The old code that attempted to do this during layout wasn't able to work for multiple reasons: it couldn't know where the iframe was going to be on the page (because of nested iframes), and at the time it was building the display list for a fragment it couldn't know where that fragment was going to be in page coordinates. This patch rewrites that code so that both the sizes and positions of iframes are determined by the compositor. Layout layerizes all iframes and marks the iframe layers with the appropriate pipeline and subpage IDs so that the compositor can place them correctly. This approach is similar in spirit to Gecko's `RefLayer` infrastructure. The logic that determines when it is time to take the screenshot for reftests has been significantly revamped to deal with this change in delegation of responsibility. Additionally, this code removes the infrastructure that sends layout data back to the layout task to be destroyed, since it is now all thread-safe and can be destroyed on the script task. The failing tests now fail because of a pre-existing bug related to intrinsic heights and borders on inline replaced elements. They happened to pass before because we never rendered the iframes at all, which meant they never had a chance to draw the red border the tests expect to not render! Closes #7377.
* Use the correct container size in compute_overflowMatt Brubeck2015-09-281-1/+2
| | | | Fixes #7768 - positioning of RTL stacking contexts.
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-5/+3
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-7/+6
| | | | This merges import blocks that were reported by tidy as unmerged.
* Actually store the overflow for inline-block elements.Michael Howell2015-09-091-2/+31
| | | | Fixes #7571
* Auto merge of #7534 - pcwalton:inline-absolute-out-of-flow, r=mbrubeckbors-servo2015-09-041-9/+16
|\ | | | | | | | | | | | | | | | | | | | | | | layout: Lay absolutely-positioned blocks with inline containing blocks out of flow. Removes the long space before the site-specific drop-down in the Google SERPs. r? @glennw <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7534) <!-- Reviewable:end -->
| * layout: Lay absolutely-positioned blocks with inline containing blocks out ofPatrick Walton2015-09-031-9/+16
| | | | | | | | | | | | flow. Removes the long space before the site-specific drop-down in the Google SERPs.
* | Elide most 'a lifetimesManish Goregaokar2015-09-041-4/+4
|/
* layout: Fix several bugs relating to inline borders, padding, andPatrick Walton2015-09-031-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Auto merge of #7496 - servo:calc_, r=SimonSapinbors-servo2015-09-021-0/+5
|\ | | | | | | | | | | | | | | | | | | Implement CSS3 Calc This is #7185 with one commit added to make it build merged with master, which got support for the `ch` unit in the meantime. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7496) <!-- Reviewable:end -->
| * Merge branch 'master' into calcSimon Sapin2015-09-011-2/+2
| |\
| * | Remove stray changesDavid Zbarsky2015-08-261-1/+1
| | |
| * | Implement Calc for LengthOrPercentageDavid Zbarsky2015-08-261-1/+6
| | |
* | | Upgrade to rustc 1.4.0-dev (cb9323ec0 2015-09-01)Simon Sapin2015-09-021-3/+3
| | |
* | | Auto merge of #7498 - pcwalton:inline-absolute-containing-blocks, r=mbrubeckbors-servo2015-09-011-8/+19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | layout: Implement partial support for inline absolute containing blocks. Improves the position of the down arrows on google.com SERPs. r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7498) <!-- Reviewable:end -->
| * | | layout: Implement partial support for inline absolute containing blocks.Patrick Walton2015-09-011-8/+19
| | |/ | |/| | | | | | | Improves the position of the down arrows on google.com SERPs.
* | | Auto merge of #7313 - pcwalton:position-relative-percentage-overflow, r=mbrubeckbors-servo2015-09-011-10/+14
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | layout: Make overflow calculation take relative percentages into account. This necessitated changing overflow to be calculated by the parent flow if relatively positioned children are present. That is because the overflow regions cannot be calculated without knowing relative offsets, which themselves cannot be calculated without knowing the parent size (because of percentages). To accomplish this without sacrificing parallelism in the non-relative case, this patch splits overflow into "early" and "late" computation. Late overflow computation cannot be parallelized across children, while early overflow computation can. Makes the "Apple Music" text show up over the full-bleed promotional background on apple.com. r? @SimonSapin -- would appreciate a look over the iframe test case that was changed. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7313) <!-- Reviewable:end -->
| * | layout: Make overflow calculation take relative percentages intoPatrick Walton2015-08-311-10/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | account. This necessitated changing overflow to be calculated by the parent flow if relatively positioned children are present. That is because the overflow regions cannot be calculated without knowing relative offsets, which themselves cannot be calculated without knowing the parent size (because of percentages). To accomplish this without sacrificing parallelism in the non-relative case, this patch splits overflow into "early" and "late" computation. Late overflow computation cannot be parallelized across children, while early overflow computation can. Makes the "Apple Music" text show up over the full-bleed promotional background on apple.com.
* / make test-tidy check that = have space after themerneyja2015-09-011-2/+2
|/
* Don’t mark flow_ref::deref_mut as unsafe.Simon Sapin2015-08-211-4/+3
| | | | See discussion in https://github.com/servo/servo/pull/7237
* Replace the unsound `impl DerefMut for FlowRef` with an unsafe function.Simon Sapin2015-08-201-7/+11
| | | | See #6503.
* sort all usesJohann Tuffe2015-08-201-3/+3
|
* flow::Flow should follow *_mut naming conventionsCorey Farwell2015-08-181-5/+5
| | | | Fixes #7148
* Replace uses of `for foo in bar.iter()`,João Oliveira2015-08-181-2/+2
| | | | | and `for foo in bar.iter_mut(), and for foo in bar.into_iter() (continuation of #7197)
* Auto merge of #7177 - pcwalton:intervening-inline-block, r=mbrubeckbors-servo2015-08-171-20/+53
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | layout: Improve our handling of inline absolute containing blocks. Several issues are addressed in this commit: * Inline flows now bubble up their absolute descendants instead of making the inline flow the containing block for them. (In the future, we will need to make the inline flow *sometimes* be the containing block for them, but for now it improves sites to unconditionally bubble up.) * Fragments now look at their inline fragment context to determine whether they are positioned. * Inline flows now push the stacking-relative position of the absolute containing block down to their inline-block fragments. * Inline absolute hypothetical fragments can be containing blocks. * Fixes the logic in `containing_block_range_for_flow_surrounding_fragment_at_index`. The condition to determine whether fragments are positioned was inverted! * `Descendants`/`AbsDescendants` has been refactored in order to become more friendly to inline absolute containing blocks in the future. Improves the inline position of the green drop-down arrow in the Google SERPs. (The block position is still wrong.) r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7177) <!-- Reviewable:end -->
| * layout: Improve our handling of inline absolute containing blocks.Patrick Walton2015-08-171-20/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several issues are addressed in this commit: * Inline flows now bubble up their absolute descendants instead of making the inline flow the containing block for them. (In the future, we will need to make the inline flow *sometimes* be the containing block for them, but for now it improves sites to unconditionally bubble up.) * Fragments now look at their inline fragment context to determine whether they are positioned. * Inline flows now push the stacking-relative position of the absolute containing block down to their inline-block fragments. * Inline absolute hypothetical fragments can be containing blocks. * Fixes the logic in `containing_block_range_for_flow_surrounding_fragment_at_index`. The condition to determine whether fragments are positioned was inverted! * `Descendants`/`AbsDescendants` has been refactored in order to become more friendly to inline absolute containing blocks in the future. Improves the inline position of the green drop-down arrow in the Google SERPs. (The block position is still wrong.)
* | Fix existing syntactics nits.Josh Matthews2015-08-161-5/+5
|/
* Replace uses of `for foo in bar.iter()` and `for foo in bar.iter_mut()`João Oliveira2015-08-151-12/+11
| | | | closes #7197
* layout: Rewrite whitespace stripping.Patrick Walton2015-08-111-30/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`
* layout: Implement basic `overflow: scroll` functionality.Patrick Walton2015-08-101-1/+2
| | | | | | | | | | | | | | | Known issues: * Display list optimization can sometimes optimize out elements that should be shown. This affects the Enyo demo. * The `overflow: scroll` container doesn't clip the inner layer properly when borders, border radius, etc. are present. * `overflow-x: scroll` and `overflow-y: scroll` don't work individually; elements are scrolled all at once. * Scrolling only works on absolutely-positioned elements.
* layout: Introduce infrastructure for tracking, backing up, and splittingPatrick Walton2015-08-081-11/+80
| | | | | | | | | | | at the last known good split point, and use it for `white-space: nowrap`. Fixes overflowing tables on Wikipedia. This infrastructure should form the basis of our fix for inline layout of fragments that don't themselves constitute valid split points. That will require some more work, however.
* Replace Arc<Box<TextRun>> with Arc<TextRun>Matt Brubeck2015-08-051-1/+1
|
* layout: When repairing styles for incremental reflow, only repairPatrick Walton2015-08-041-2/+3
| | | | | | | | | | styles of nodes that represent the dirty node, *including its pseudo-element*. Fixes lots more jumpiness. A manual test, `inline-pseudo-repair-jumpiness.html`, has been added. I was unable to automate it, so I will file a followup issue on that.
* Auto merge of #6784 - glennw:offset-ext, r=pcwaltonbors-servo2015-08-031-0/+2
|\ | | | | | | | | | | | | | | | | | | Implement offsetParent/Top/Left/Width/Height. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6784) <!-- Reviewable:end -->
| * Implement offsetParent/Top/Left/Width/Height.Glenn Watson2015-08-031-0/+2
| |
* | Fix percentage height calculation, absolute containing block height ↵Glenn Watson2015-08-031-1/+1
|/ | | | | | | | | | calculations. It's not possible to correctly determine during the css cascade whether the container height is explicitly specified. Additionally, the spec https://drafts.csswg.org/css2/visudet.html#the-height-property says this should affect the *used* height, rather than the computed height. This significantly improves the layout in #6643.
* Use local slice_charsJack Moffitt2015-07-311-1/+2
| | | | | | | StrExt::slice_chars is deprecated and will be removed in Rust. This lifts the implementation from Rust libstd and puts it in util::str. This fixes a bunch of deprecation warnings in Servo.
* Replace the StyledNode trait with inherent methods.Ms2ger2015-07-271-1/+0
|
* Basic support for bidirectional textMatt Brubeck2015-07-231-37/+107
|
* layout: Make the output of flow tree dumping easier to read when therePatrick Walton2015-07-071-1/+4
| | | | are many fragments.
* Upgrade to rustc 1.3.0-dev (f3b97a74a 2015-07-03)Simon Sapin2015-07-041-4/+3
|
* Simplify next_fragment and fix obsolete docsMatt Brubeck2015-06-221-12/+1
|
* Use euclid from crates.ioecoal952015-06-191-1/+1
|