aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove usage of unstable feature "raw"Simon Sapin2017-10-131-4/+4
|
* Remove usage of unstable feature conservative_impl_trait in layoutSimon Sapin2017-10-131-2/+2
|
* Auto merge of #18462 - mrobinson:cleanup-building-state, r=emiliobors-servo2017-09-151-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do some minor cleanups in display list building <!-- 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: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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/18462) <!-- Reviewable:end -->
| * Separate stacking context collection and display list building stateMartin Robinson2017-09-121-3/+4
| | | | | | | | | | | | | | These are two different passes during layout, but previously they shared a state object. While some of the members are the same, many are different so we separate them out into two separate objects. We also change the HashMaps of these state objects to use the FnvHashMap.
* | Implement `size_hint` for more iterators.Corey Farwell2017-09-131-0/+4
|/ | | | | | | | ``` implement size hint for more iterators because why not we like fast things ```
* Auto merge of #18175 - stshine:no-floats-in-flexbox, r=mbrubeckbors-servo2017-08-291-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | layout: Stop call normal block size assignment for flex container No need to call the `assign_block_size_block_base()` method of normal block in flex.rs since it is implemented for CSS2. <!-- 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 #14813 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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/18175) <!-- Reviewable:end -->
| * layout: Stop calling normal block size assignment for flex containerPu Xingyu2017-08-291-3/+1
| | | | | | | | | | No need to call the `assign_block_size_block_base()` method of normal block since it is implemented for CSS2.
* | order derivable traits listsClément DAVID2017-08-231-5/+5
|/ | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Improve containing block creation for position:absolute flowsMartin Robinson2017-08-171-8/+5
| | | | | | | | | | Instead of only promoting flows with positioned fragments to containing blocks, also do this for flows which have the transform, perspective or filter properties set. This is what the spec requires and also fixes some failing tests. It will allow us to stop creating stacking contexts for overflow:hidden and overflow:scroll flows. Fixes #18091.
* Use the is_absolute_containing_block method everywhereMartin Robinson2017-08-161-1/+1
| | | | | | This is a better approach than relying on contains_positioned_fragments, because in the future other properties will create absolute containing blocks.
* Allow CalculateStackingRelativePositions to short-circuitMatt Brubeck2017-08-081-2/+1
|
* Code organization: Move all generic traversal code to layout::traversalMatt Brubeck2017-08-081-109/+0
|
* Rename compute_absolute_position to compute_stacking_relative_positionMatt Brubeck2017-08-081-2/+3
|
* Remove unused traverse_postorder_absolute_flows methodMatt Brubeck2017-08-071-18/+0
|
* Add a generic inorder traversal methodMatt Brubeck2017-08-071-1/+16
|
* Fix fixed position items with parents with CSS clipsMartin Robinson2017-08-031-8/+8
| | | | | | | | | | In order to properly handle CSS clipping, we need to keep track of what the different kinds of clips that we have. On one hand, clipping due to overflow rules should respect the containing block hierarchy, while CSS clipping should respect the flow tree hierarchy. In order to represent the complexity of items that are scrolled via one clip/scroll frame and clipped by another we keep track of that status with a ClipAndScrollInfo.
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-3/+3
| | | | | | The alias is left there temporarilly and will be removed completely in a later commit where also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still use the old alias).
* stylo: Switch Gecko over to ServoStyleContextManish Goregaokar2017-07-171-1/+1
|
* stylo: Use ComputedValuesInner instead of ComputedValues when we don't need itManish Goregaokar2017-07-171-5/+5
|
* Upgrade to the latest version of WebRenderMartin Robinson2017-07-131-1/+1
|
* Update flags for absolutely positioned elements on style changesMatt Brubeck2017-06-301-0/+23
| | | | Fixes #17307.
* UntrySimon Sapin2017-06-181-8/+6
|
* Make BaseFlow::stacking_relative_position a vector.Nicolas Silva2017-06-141-3/+3
|
* Bump euclid to 0.14.Nicolas Silva2017-06-141-6/+6
|
* Fix up script and layout.Bobby Holley2017-05-021-3/+3
|
* stylo: support all overflow valuesManish Goregaokar2017-04-251-1/+1
| | | | MozReview-Commit-ID: 1iQdUDsb6u9
* Eliminate ScrollRootIdMartin Robinson2017-04-201-6/+14
| | | | | | | Just use WebRender's ClipId directly. This will allow us to create and use ReferenceFrames in the future, if we need to do that. It will also make it easier to have Servo responsible for creating the root scrolling area, which will allow removing some old hacks in the future.
* Used shared clips for overflow:hidden and CSS clipMartin Robinson2017-04-171-40/+25
| | | | | | | | | | | | | | | | | | Instead of passing down a complex clipping region to each item, used shared clipping to handle overflow:hidden and CSS clips. In addition to being more efficient, this should also fix quite a few issues related to absolutely positioned elements. One existing reftest is slightly modified to avoid tickling a quirk with the way that WebRender rasterizes masks. We are working out how to best express these combined masks with the API or need to. The change does not affect the original subject of the reftest. Fixes #13109. Fixes #10151. Fixes #7575. Fixes #8074. Fixes #8780.
* Update WR (reference frames for fixed position elements).Glenn Watson2017-03-031-2/+6
|
* Update serde to 0.9 (fixes #15325)Anthony Ramine2017-02-181-11/+11
|
* Remove cached thread local context from LayoutContextPu Xingyu2017-02-081-9/+9
| | | | | Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
* Only create scrolling overflow regions when necessaryMartin Robinson2017-01-171-7/+42
| | | | | | | | | | | | | | | | | Only create scroll roots for overflow regions when the overflow region is actually larger than the container size. This prevents creating scrolling roots for elements that do not have overflow scroll as a side-effect of the way their height and width is defined. For example, tables should never respect overflow:scroll since their height and width should always be large enough to prevent overflow. This also decreases the size and complexity of the display list in many other circumstances. As part of this change, transformed overflow calculation is moved from display list construction to layout. This should mean that overflow is handled more accurately earlier. Fixes #14574.
* Rework the way scroll roots are collectedMartin Robinson2017-01-101-8/+4
| | | | | | | | | | | | Collect scroll roots during the collect_stacking_context phase instead of during display list construction. This will be useful in order to collect containing block scroll roots as well as to give scroll roots sequential ids in the future. This change also pulls stacking context children out of the StackingContext struct itself, which should reduce very slightly the memory used by the finished display list. This also simplifies the DisplayListBuilder because it no longer has to maintain a stack of ScrollRootIds and StackingContextIds and can instead just rely on the program stack.
* Make Restyle tracking more granular.Bobby Holley2016-12-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The primary idea of this patch is to ditch the rigid enum of Previous/Current styles, and replace it with a series of indicators for the various types of work that needs to be performed (expanding snapshots, rematching, recascading, and damage processing). This loses us a little bit of sanity checking (since the up-to-date-ness of our style is no longer baked into the type system), but gives us a lot more flexibility that we'll need going forward (especially when we separate matching from cascading). We also eliminate get_styling_mode in favor of a method on the traversal. This patch does a few other things as ridealongs: * Temporarily eliminates the handling for transfering ownership of styles to the frame. We'll need this again at some point, but for now it's causing too much complexity for a half-implemented feature. * Ditches TRestyleDamage, which is no longer necessary post-crate-merge, and is a constant source of compilation failures from either needing to be imported or being unnecessarily imported (which varies between gecko and servo). * Expands Snapshots for the traversal root, which was missing before. * Fixes up the skip_root stuff to avoid visiting the skipped root. * Unifies parallel traversal and avoids spawning for a single work item. * Adds an explicit pre_traverse step do any pre-processing and determine whether we need to traverse at all. MozReview-Commit-ID: IKhLAkAigXE
* Auto merge of #14367 - mrobinson:scroll-fragment-point, r=pcwaltonbors-servo2016-12-061-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement scrolling to fragments <!-- 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 #13736, #10753 (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. --> This reimplemntation of the feature uses ScrollRootIds to scroll particular scrollable areas of the page. Fixes #13736. Fixes #10753. <!-- 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/14367) <!-- Reviewable:end -->
| * Reimplement scrolling to fragmentsMartin Robinson2016-11-291-1/+4
| | | | | | | | | | | | | | | | This reimplemntation of the feature uses ScrollRootIds to scroll particular scrollable areas of the page. Fixes #13736. Fixes #10753.
* | Auto merge of #14424 - mbrubeck:flow-column, r=notriddlebors-servo2016-11-301-13/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | Remove unnecessary Flow::column_sizes methods One of these methods is never called. The other is used only on TableFlow and doesn't need to be implemented for all Flow types. <!-- 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/14424) <!-- Reviewable:end -->
| * Remove unnecessary Flow::column_sizes methodsMatt Brubeck2016-11-301-13/+1
| |
* | 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.
* layout: Mark flex items properly during constructionPu Xingyu2016-11-091-0/+11
| | | | | | | 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
* Migrated -Z trace-layout to serde_jsonShing Lyu2016-11-071-41/+14
|
* Make `FlowRef` a newtypeMichael Howell2016-11-041-7/+7
| | | | | | | | | | | | | 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
* Use a new id type for tracking scrolling areasMartin Robinson2016-10-301-4/+11
| | | | | | This is a step in disassociating scrolling areas from stacking contexts. Now scroll areas are defined by unique ids, which means that in the future stacking context will be able to contain more than one.
* layout: Minor style cleanup.Patrick Walton2016-10-261-1/+2
|
* layout: Remove the old anonymous table object generation code.Patrick Walton2016-10-261-78/+3
|
* layout: Add a new `MARGINS_CANNOT_COLLAPSE` flow flag.Patrick Walton2016-10-261-0/+3
|
* Remove concept of Layers from ServoMartin Robinson2016-10-211-15/+1
| | | | | | | | Layers were a feature of the legacy drawing path. If we re-add them at some point, it probably makes more sense to make them a product of display list inspection. This change also remove a bunch of dead painting code.
* Remove old rendering backend.Glenn Watson2016-10-181-8/+1
| | | | | | | | | | | | | | This removes paint threads, rust-layers dependency, and changes optional webrender types to be required. The use_webrender option has been removed, however I've left the "-w" command line option in place so that wpt runner can continue to pass that. Once it's removed from there we can also remove the -w option. Once this stage is complete, it should be fine to change the display list building code to generate webrender display lists directly and avoid the conversion step.
* layout: Rewrite clipping to be a two-phase process that takes physicalPatrick Walton2016-10-151-1/+3
| | | | | | | | | | | | | | | | | | 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.