aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused `fixed_descendants: AbsoluteDescendants`Simon Sapin2016-01-281-12/+2
| | | | … in `construct.rs` for multicol and table wrappers.
* Add Multicolumn support block fragmentation.Simon Sapin2016-01-281-10/+57
|
* Sequentialize assign_block_size for flows that can be fragmented.Simon Sapin2016-01-281-3/+9
| | | | Fragmentation will be intertwined with block size calculation.
* Disable incremental reflow for multicol and their descendants.Simon Sapin2016-01-271-0/+3
| | | | Fragmentation with dynamic updates is hard.
* Fix a bunch of clippy lintsJohannes Linke2016-01-021-12/+6
|
* Separate style+layout and layout-specific wrapper functionality.Bobby Holley2015-12-291-19/+14
| | | | | | | | | | | This patch does a number of things, unfortunately all at once: * Hoists a large subset of the layout wrapper functionality into the style system. * Merges TElementAttributes into the newly-created TElement. * Reorganizes LayoutData by style vs layout, and removes LayoutDataShared. * Simplifies the API for borrowing style/layout data. There's still more to do to make the style system usable standalone, but this is a good start.
* Generalize the rest of layout to operate on generic Layout*.Bobby Holley2015-11-281-38/+49
| | | | | | | There wasn't a good way to split this up, unfortunately. With this change, the only remaining usage of the Servo-specific structures is in layout_task, where the root node is received from the script task. \o/
* Add XMLDocument objectGuillaume Gomez2015-11-271-2/+2
|
* Update string_cache to 0.2.Alan Jeffrey2015-11-251-1/+1
| | | | | | | | | | | Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock. Removed references to string_cache_plugin. Import atom! and ns! from string_cache. Replaced ns!("") by ns!(). Replaced ns!(XML) and co by ns!(xml) and co. Replaced atom!(foo) by atom!("foo"). Replaced Atom::from_slice by Atom::from. Replaced atom.as_slice() by &*atom.
* Rename ThreadSafeLayoutFoo to ServoThreadSafeLayoutFoo and ↵Bobby Holley2015-11-211-33/+33
| | | | TThreadSafeLayoutFoo to ThreadSafeLayoutFoo.
* Hoist exported ThreadSafeLayoutFoo functionality into traits.Bobby Holley2015-11-211-1/+1
|
* Clean up restyle damage after it no longer appliesMartin Robinson2015-11-201-2/+3
| | | | | | | | | BUBBLE_ISIZES and REPAINT can become "stuck" on in the default Servo configuration once they are activated. This is solved by removing these damage bits after they no longer apply. There isn't a good way to test this, other than noting that it doesn't break any existing CSS tests. This will become more important in the future as the REPAINT bit is used to implement display list patching.
* replace InheritTypes imports with inheritance importsrohan.prinja2015-10-301-2/+2
|
* Made block type pattern match less inclusiveDavid Raifaizen2015-10-271-1/+1
|
* Pass all the data layout needs from canvas elements at once.Ms2ger2015-10-261-1/+2
|
* Privatize FlowConstructionUtils.Ms2ger2015-10-261-5/+3
| | | | This makes it match the documentation.
* Generate the TypeId enums in codegenAnthony Ramine2015-10-141-4/+2
|
* Incremental layout: Don't try to repair text fragment stylesMatt Brubeck2015-10-011-4/+10
| | | | Fixes #7814.
* layout: Make the compositor rather than layout determine the position ofPatrick Walton2015-09-291-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-1/+1
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-12/+11
| | | | This merges import blocks that were reported by tidy as unmerged.
* Auto merge of #7656 - mbrubeck:incremental-text-6501, r=pcwaltonbors-servo2015-09-181-4/+8
|\ | | | | | | | | | | | | | | | | | | | | | | Reconstruct flows when text/font styles change These styles are used during text shaping. When they change, we need to re-run shaping and construct new flows. Fixes #6501. r? @pcwalton <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7656) <!-- Reviewable:end -->
| * Always reset HAS_NEWLY_CONSTRUCTED_FLOW during flow constructionMatt Brubeck2015-09-171-4/+8
| | | | | | | | | | | | This extra reflows when the HAS_NEWLY_CONSTRUCTED_FLOW flag remained set during a later reflow. This masked other incremental layout bugs, including the one tested by the reftest in the commit following this one.
* | layout: Query and maintain the position of the insertion pointPatrick Walton2015-09-171-24/+37
|/ | | | throughout layout for input elements.
* Fix match_refs and let_returns in layout, address review changesManish Goregaokar2015-09-041-12/+11
|
* layout: Fix several bugs relating to inline borders, padding, andPatrick Walton2015-09-031-32/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* layout: Implement partial support for inline absolute containing blocks.Patrick Walton2015-09-011-10/+22
| | | | Improves the position of the down arrows on google.com SERPs.
* layout: Fix merge fallout.Patrick Walton2015-08-211-2/+2
|
* Create FlexFlow's for 'display: flex' nodes.Kyle Zentner2015-08-211-0/+16
| | | | | | This commit doesn't implement any flexbox behavior at all. It just constructs FlexFlow's, which act just like the BlockFlow from which they "inherit."
* Don’t mark flow_ref::deref_mut as unsafe.Simon Sapin2015-08-211-18/+10
| | | | See discussion in https://github.com/servo/servo/pull/7237
* Replace FlowRef with Arc<Flow>, now that Arc supports DST.Simon Sapin2015-08-201-33/+27
| | | | … and WeakFlowRef with Weak<Flow>.
* Replace the unsound `impl DerefMut for FlowRef` with an unsafe function.Simon Sapin2015-08-201-19/+27
| | | | See #6503.
* sort all usesJohann Tuffe2015-08-201-3/+3
|
* layout: Make inline absolute hypothetical boxes not clip their contents.Patrick Walton2015-08-181-1/+7
| | | | Improves the logo on ebay.com.
* flow::Flow should follow *_mut naming conventionsCorey Farwell2015-08-181-3/+3
| | | | Fixes #7148
* Replace uses of `for foo in bar.iter()`,João Oliveira2015-08-181-4/+4
| | | | | and `for foo in bar.iter_mut(), and for foo in bar.into_iter() (continuation of #7197)
* layout: Improve our handling of inline absolute containing blocks.Patrick Walton2015-08-171-37/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* Replace uses of `for foo in bar.iter()` and `for foo in bar.iter_mut()`João Oliveira2015-08-151-2/+2
| | | | closes #7197
* replace .len() == 0 with is_empty()João Oliveira2015-08-141-1/+1
| | | | closes #7198
* layout: Make inline margins on `<input type=button>` and friends applyPatrick Walton2015-08-131-5/+10
| | | | | | only to the button and not to the text inside. Improves the Google home page.
* layout: Take relative position offsets for inlines and inline-blocksPatrick Walton2015-08-121-4/+39
| | | | | | | | | | | | | | | | | into account only once. There were two bugs here: (1) relative position applied to scanned/unscanned text fragments independently of the container element that applied that relative position, causing double-counting; (2) relative position applied to inline block fragments independently of the wrapped block itself, causing double-counting. This commit also removes the `cascade_anonymous` function and the related `Fragment` constructor. They were unused, and their functionality has been replaced by the `modify_style_for_*` series of functions. Closes #7067.
* layout: Rewrite whitespace stripping.Patrick Walton2015-08-111-44/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`
* Allow list markers to contain multiple fragmentsMatt Brubeck2015-08-071-9/+8
| | | | Fixes #6913.
* layout: Make sure anonymous table flows are statically positioned.Patrick Walton2015-08-061-39/+49
| | | | | | | | | | The failing `float-applies-to-*` CSS 2.1 tests never really should have been passing in the first place; they depend on floats inside fixed-layout tables working properly, which they don't. Closes #6078. Closes #6709. Closes #6858.
* layout: When repairing styles for incremental reflow, only repairPatrick Walton2015-08-041-2/+17
| | | | | | | | | | 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 #6938 - pcwalton:inline-repair-jumpiness, r=mbrubeckbors-servo2015-08-031-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | construct: When repairing styles for incremental reflow, only repair styles of nodes that represent the dirty node. Fixes jumpiness on many pages; e.g. the WPT results pages. For some reason, this would not reproduce with an automated test. r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6938) <!-- Reviewable:end -->
| * construct: When repairing styles for incremental reflow, only repairPatrick Walton2015-08-031-0/+5
| | | | | | | | | | | | | | | | styles of nodes that represent the dirty node. Fixes jumpiness on many pages; e.g. the WPT results pages. For some reason, this would not reproduce with an automated test.
* | Implement the unicode-bidi propertyMatt Brubeck2015-08-031-0/+57
|/
* Implement getComputedStyleDavid Zbarsky2015-07-291-1/+1
|
* Inline ThreadSafeLayoutNode::get_style.Ms2ger2015-07-271-1/+1
|