aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
Commit message (Collapse)AuthorAgeFilesLines
* layout: Stop doing unsafe transmutes between refcell references.Emilio Cobos Álvarez2017-05-251-3/+3
| | | | | | | | | This commit splits the style and layout data in two separate refcells. These transmutes have been a source of trouble (for example on Android), and they feel like a hack anyway. Fixes #16982
* Stylo: Pass style list's image_value to gecko.cku2017-05-161-2/+3
|
* Fix up script and layout.Bobby Holley2017-05-021-3/+4
|
* Use empty pseudo to cascade only inheritable properties for textPu Xingyu2017-04-011-58/+40
| | | | | | Since for nested inline elements non-inheritable properties are properly stored in the inline context of an inline fragment, so get rid of them on the style.
* Use Servo-specific pseudo element for InlineAbsolute fragmentPu Xingyu2017-03-311-2/+3
|
* Use Servo-specific pseudo element for InlineBlock fragmentPu Xingyu2017-03-311-3/+5
|
* Replace RwLock<StyleRule> with Locked<StyleRule>Simon Sapin2017-03-191-13/+14
|
* style: Kill SharedStyleContext::default_computed_values.Emilio Cobos Álvarez2017-03-141-4/+5
| | | | | | | Now that cascade() gets a Device, we can use the default computed values from there to avoid propagating that state all over the place. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* layout: Replace ConstructionResult::swap_out() with get()Patrick Walton2017-03-031-14/+9
| | | | | It only actually swaps out in nonincremental mode (which isn't suitable for real world use), so the name is confusing.
* Make script thread initiate requests for images needed by layout.Josh Matthews2017-02-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In support of this goal, the layout thread collects information about CSS images that are missing image data and hands it off to the script thread after layout completes. The script thread stores a list of nodes that will need to be reflowed after the associated network request is complete. The script thread ensures that the nodes are not GCed while a request is ongoing, which the layout thread is incapable of guaranteeing. The image cache's API has also been redesigned in support of this work. No network requests are made by the new image cache, since it does not possess the document-specific information necessary to initiate them. Instead, there is now a single, synchronous query operation that optionally reserves a slot when a cache entry for a URL cannot be found. This reserved slot is then the responsibility of the queryer to populate with the contents of the network response for the URL once it is complete. Any subsequent queries for the same URL will be informed that the response is pending until that occurs. The changes to layout also remove the synchronous image loading code path, which means that reftests now test the same code that non-test binaries execute. The decision to take a screenshot now considers whether there are any outstanding image requests for layout in order to avoid intermittent failures in reftests that use CSS images.
* Remove cached thread local context from LayoutContextPu Xingyu2017-02-081-13/+18
| | | | | Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
* Remove redundant style_context() method of LayoutContextPu Xingyu2017-02-061-1/+1
|
* Auto merge of #14978 - shinglyu:inline-flex, r=notriddlebors-servo2017-01-221-4/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented display: inline-flex <!-- 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 - [x] These changes fix #14685 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14978) <!-- Reviewable:end -->
| * Implemented display: inline-flexShing Lyu2017-01-231-4/+16
| |
* | Tidy up rust code with regard to new rule (no = in beginning of line)Jure Podgoršek2017-01-061-2/+2
| |
* | Bug 1298588 part 9, servo piece. Pass through useful default styles to ↵Boris Zbarsky2017-01-041-3/+4
| | | | | | | | cascade(). r=bholley
* | Bug 1298588 part 8. Pass a SharedStyleContext, not a Stylist, to Legalizer ↵Boris Zbarsky2017-01-041-20/+19
|/ | | | methods. r=bholley
* Fix an outdated commentMichael Howell2016-12-231-10/+15
|
* Removed util.Alan Jeffrey2016-12-141-1/+1
|
* Remove unused replaced size calculation methodsPu Xingyu2016-12-121-8/+5
| | | | | Remove some fields and methods from SpecificFragmentInfo and change some function signatures.
* use Either type for UrlOrNoneThiago Pontes2016-11-301-3/+4
| | | | | | | | | | | | fix test-tidy errors fix style unit test use the Parse trait instead of ParseWithContext fix stylo test and geckolib build move all specified url parse code to parse trait and remove refs to unused type
* Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal.Bobby Holley2016-11-241-1/+1
| | | | MozReview-Commit-ID: 7wH5XcILVmX
* Rename selector_impl.rs to selector_parser.rsSimon Sapin2016-11-201-1/+1
| | | | This makes it consistent with an upcoming update of the selectors crate.
* Rename selector_matching.rs to stylist.rsSimon Sapin2016-11-201-1/+1
|
* Urlmageddon: Use refcounted urls more often.Emilio Cobos Álvarez2016-11-171-5/+5
|
* Auto merge of #14136 - stshine:orthogonal-symmetry, r=SimonSapinbors-servo2016-11-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | style: Add a "start_end()" method to LogicalMargin <!-- Please describe your changes on the following line: --> Add a `LogicalMargin::start_end()` method that receives a `Direction' parameter. This is useful for some layout that is symmetric in inline and block directions, like flexbox. Part of #14123. --- <!-- 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: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> r? @SimonSapin <!-- 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/14136) <!-- Reviewable:end -->
| * style: Add a "start_end()" method to LogicalMarginPu Xingyu2016-11-101-1/+1
| | | | | | | | | | | | Add a `LogicalMargin::start_end()` method that receives a `Direction' parameter. This is useful for some layout that is symmetric in inline and block directions, like flexbox.
* | style: Centralize specified url value handling, and refcount urls.Emilio Cobos Álvarez2016-11-101-2/+2
|/
* Auto merge of #14035 - Permutatrix:iss-14030, r=emiliobors-servo2016-11-091-28/+47
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't mark the first/last fragment of an {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENT. <!-- Please describe your changes on the following line: --> This change allows inline margins, borders, and padding to interact correctly with {ib} splits. --- <!-- 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 #14030 - [X] There are tests for these changes <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14035) <!-- Reviewable:end -->
| * Elaborated on enclosing_node in comment, moved existing comments aroundPermutator2016-11-061-6/+12
| |
| * Don't mark start/end of {ib} split as FIRST/LAST_FRAGMENT_OF_ELEMENTPermutator2016-11-021-26/+39
| |
* | layout: Mark flex items properly during constructionPu Xingyu2016-11-091-4/+22
| | | | | | | | | | | | | | Set the flag of the fragment of children in a flex container according to the direction of the container. The mark is done on the fragment because flex item enstablish a stacking context when its z-index is non-zero ,despite its `position' property.
* | Stop using associated types for the concrete TRestyleDamage implementation.Bobby Holley2016-11-071-2/+2
| | | | | | | | MozReview-Commit-ID: LfaZFCVlIb1
* | Make `FlowRef` a newtypeMichael Howell2016-11-041-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | This creates a sharp distinction between `Arc<Flow>`s, which may be owned by anyone, and `FlowRef`s, which may only be owned by the traversal code. By checking the reference count, we ensure that a `Flow` cannot be pointed to by `Arc`s and `FlowRef`s simultaneously. This is not a complete fix for #6503, though it is a necessary start (enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far more work). Fixes #14014
* | Update to string-cache 0.3Simon Sapin2016-11-031-2/+8
|/
* Remove extra spaces in function calls and declarationsDaan Sprenkels2016-10-311-1/+1
|
* Move core pseudo-element handling to ThreadSafeLayoutElement.Bobby Holley2016-10-281-13/+11
|
* Eliminate untraversed node types from LayoutNodeType.Bobby Holley2016-10-271-12/+0
| | | | MozReview-Commit-ID: 926ReI1BSsf
* layout: Minor style cleanup.Patrick Walton2016-10-261-7/+14
|
* layout: Use the new `style_for_anonymous_box()` function for thePatrick Walton2016-10-261-2/+3
| | | | anonymous text child of `<input>`.
* layout: Remove the old anonymous table object generation code.Patrick Walton2016-10-261-84/+0
|
* layout: Rewrite the anonymous table object generation code.Patrick Walton2016-10-261-67/+261
| | | | | | | | | | | This patch introduces a "legalizer", which encapsulates all the anonymous flow generation logic in one place. The legalizer knows how to, for example, place adjacent blocks with `display: table-cell` in the same table row. Improves etsy.com. Closes #13782.
* layout: Refactor `Flow::from_fragment`-style constructors to bePatrick Walton2016-10-261-3/+4
| | | | consistent.
* Make list-style-image use UrlOrNone.Cameron McCormack2016-10-161-4/+4
| | | | MozReview-Commit-ID: 6E82Tq5nrfC
* layout: Rewrite Servo's `vertical-align` support to match CSS 2.1 §Patrick Walton2016-10-111-8/+3
| | | | | | | | | | | | | | | | | 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
* Move children_to_process to layout.Bobby Holley2016-10-081-1/+1
| | | | | | | | | | | We don't need this for Gecko, and it's hard to implement in that case because there's nowhere obvious to put it (we don't plan to create TSDs for non-dirty nodes, and non-dirty nodes can have dirty children which require the children_to_process atomic). There are various solutions here, but punting is the easiest. We'll need to rethink this if/when we need to do a bottom-up traversal for Gecko.
* add SVG fragment (SpecificFragmentInfo::Svg)Alexandrov Sergey2016-10-071-2/+7
|
* Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead ↵Bobby Holley2016-10-021-3/+3
| | | | | | | | of RefCell as a container. This allows us to eliminate the unsafe borrows. \o/ MozReview-Commit-ID: 29hpGaWUFQz
* Stop using Ref::map for selected_style and resolved_style.Bobby Holley2016-10-021-10/+10
| | | | | | Same concept as the previous patch. MozReview-Commit-ID: RFC8s7qQPM
* Stop using Ref::map for style().Bobby Holley2016-10-021-12/+12
| | | | | | | | | | It's not possible to implement a Ref::map equivalent method on AtomicRefCell while having AtomicRefCell implemented on top of RwArc. We could potentially reimplement AtomicRefCell to be more like RefCell and add a Ref::map equivalent method, but I (and pcwalton) think we should try just cloning a few extra Arcs at these callsites instead. MozReview-Commit-ID: 6H8vAWguO3z