aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flex.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.Boris Chiou2017-08-041-2/+2
| | | | | | | NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink. GreaterThanOrEqualToOneNumber: for stroke-miterlimit. MozReview-Commit-ID: Kgbt99BPdVA
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | 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: Use ComputedValuesInner instead of ComputedValues when we don't need itManish Goregaokar2017-07-171-2/+2
|
* Rename LengthOrPercentageOrAutoOrContent to FlexBasisAnthony Ramine2017-06-171-12/+15
|
* Make computed types hold Percentage instead of bare CSSFloatAnthony Ramine2017-06-151-2/+2
|
* Refactor how calc() clamping is done on computed values (fixes #15296)Anthony Ramine2017-05-181-11/+12
|
* Fix up script and layout.Bobby Holley2017-05-021-2/+1
|
* Add to_computed method for CalcLengthOrPercentage石博文2017-04-241-7/+5
| | | | | | | | * Add to_computed method to calculate `calc()` value with parent size, if parent container size is `None`, the result will be `None`. * Add from_option method for `MaybeAuto`, to construct from `Option<Au>`. * Update some test case.
* Remove cached thread local context from LayoutContextPu Xingyu2017-02-081-13/+14
| | | | | Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
* Initialize block_container_inline_size for non-block root flowsMatt Brubeck2017-01-271-0/+2
| | | | Fixes #14948.
* Rework the way scroll roots are collectedMartin Robinson2017-01-101-6/+2
| | | | | | | | | | | | 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.
* Auto merge of #14124 - shinglyu:flexbox-trace, r=glennwbors-servo2016-12-281-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flexbox trace <!-- Please describe your changes on the following line: --> This is a follow up for #13740, so r? @jdm The first patch enables JSON serialization for flexbox flows, the second one fixed format incompatibilities for the layout viewer. The 3rd and 4th patches are just layout viewer UI enhancements, we could split that to a spearate PR if you prefer. --- <!-- 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 #13846 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because it's a trivial debug tool <!-- 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/14124) <!-- Reviewable:end -->
| * Activate flexbox layout tracingShing Lyu2016-12-281-5/+5
| |
* | Make the DomTraversalContext own the SharedStyleContext and share it ↵Bobby Holley2016-12-161-1/+1
|/ | | | | | | | | | immutably across the traversal. This allows us to get rid of a bunch of lifetimes and simplify a lot of code. It also lets us get rid of that nasty lifetime transmute, which is awesome. The situation with thread-local contexts is still suboptimal, but we fix that in subsequent patches.
* Rename the MinMaxConstraint to SizeConstraint and enhancementPu Xingyu2016-12-111-3/+3
| | | | | | Renamed to `SizeConstraint`, add an optional `border` parameter to deal with `box-sizing: border-box`, and fix its bug when involving with `calc`.
* style: Add a "start_end()" method to LogicalMarginPu Xingyu2016-11-101-2/+2
| | | | | | 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.
* layout: Mark flex items properly during constructionPu Xingyu2016-11-091-2/+12
| | | | | | | 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-1/+1
| | | | MozReview-Commit-ID: LfaZFCVlIb1
* Use a new id type for tracking scrolling areasMartin Robinson2016-10-301-2/+5
| | | | | | 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: Don't use `BlockFlow::assign_block_size()` when assigning flexPatrick Walton2016-10-261-4/+6
| | | | | | flows' block sizes. This ensures that we never collapse margins for flex flows.
* layout: Add a safe way for layout to perform random access on childPatrick Walton2016-10-261-12/+22
| | | | | | | flows. This uses caching to ensure that we perform no more than O(n) pointer loads.
* layout: Don't leak `FlowRef`s to the flexbox layout code.Patrick Walton2016-10-261-65/+68
| | | | | This can cause memory safety problems. Comments have been added to `flow_list.rs` to prevent this from happening again.
* layout: Make `surrounding_intrinsic_inline_size` report border/paddingPatrick Walton2016-10-261-1/+3
| | | | | | and margin separately. This makes correct table layout easier.
* layout: Refactor `Flow::from_fragment`-style constructors to bePatrick Walton2016-10-261-1/+1
| | | | consistent.
* Simplify stacking context collectionMartin Robinson2016-09-271-6/+2
| | | | | | | | | | Simplify the way that stacking contexts are collected. Instead of passing the StackingContextId down the tree, pass the parent StackingContext itself. This will allow future patches to get more information about the parent stacking context (such as location). Also remove the return value of collect_stacking_contexts, which was unused.
* Reorder `use` statementsUK9922016-09-091-1/+1
|
* Pass SharedLayoutContext to Flow::compute_absolute_position.Ms2ger2016-08-241-2/+2
|
* layout: Freeze flex item properlyPu Xingyu2016-08-081-4/+3
| | | | | | | Fix the currently logic that a item will freeze if it should grow(shrink) and its basesize is less(more) than its min(max) size. Also fix the divide by zero error when an item should shrink but it has zero length and zero min size.
* Add Minor fixes and testsPu Xingyu2016-08-031-28/+25
|
* Refator 'box-sizing' calculation into a methodPu Xingyu2016-07-251-45/+21
| | | | | | The 'box_sizing_boundary()' method return the border_padding width in certain direction if fragment has property 'box-sizing: border-box'. The 'border_padding' field should be initialized before.
* Rename enum 'Mode' to 'Direction'Pu Xingyu2016-07-241-37/+27
| | | | | Rename the 'Mode' enum to 'Direction' and move it to 'model.rs', thus it can be used to indicate logical direction.
* Flex elements in a row flex containerPu Xingyu2016-07-231-69/+215
| | | | | | Iterate over the items, create lines from them, resolve flex lengths against them, set their inline size and margin lengths, and align them according to 'justify-content', 'align-content' and 'align-self'.
* Filter abs-pos children and sort by 'order' fieldPu Xingyu2016-07-221-13/+8
| | | | | | | | | As the flexbox spec change in May 2016, the absolutely positioned children painting order no longer follow the `order` property, thus we can simply filter them out. Also sort items by the order field of 'FlexItem', no longer do two vtable lookups in each compare.
* Add 'get_flex_line()' method to flex flowPu Xingyu2016-07-221-0/+36
| | | | | The method returns 'Option<FlexLine>', can be used to obtain a line in flex container.
* Add FlexLine and its method for flex resolvingPu Xingyu2016-07-221-0/+96
| | | | | Add the 'FlexLine' struct to represent a line in flex container, and the 'flex_resolve()' method for flex lengths resolving.
* Add flags 'is_wrappable' and 'cross_reverse'Pu Xingyu2016-07-221-12/+37
| | | | | | | These 'is_wrappable' flag can be used to determine if a flex flow can be multi-line. The 'is_reverse' flag is replaced by 'main_reverse' and 'cross_reverse' since flex flow can go reverse individually in main and cross direction.
* Extend fields of FlexItem and add methodsPu Xingyu2016-07-221-6/+179
| | | | | | Extend fields of `FlexItem` struct with values that are necessary to resolve flexible lengths, and the 'order' property. Add other methods for size computing to make the code more modular.
* Remove some type aliases that are now just re-exports.Simon Sapin2016-07-201-1/+1
|
* Remove the ComputedValue traits and style_struct_traitsSimon Sapin2016-07-201-1/+1
|
* Pass SharedStyleContext to assign_inline_sizes.Ms2ger2016-06-221-7/+7
|
* Pass SharedStyleContext to compute_used_inline_size.Ms2ger2016-06-221-1/+2
|
* Introduce a script_layout_interface crate and move RestyleDamage to it.Ms2ger2016-06-201-1/+1
|
* Remove unused argument to place_float_if_applicable.Ms2ger2016-06-201-2/+2
|
* script: Keep the DOM-side viewport up to date when scrolling happens inPatrick Walton2016-05-311-1/+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.
* Remove empty lines following braces.Josh Matthews2016-05-271-1/+0
|
* Auto merge of #10987 - shinglyu:flex-reverse, r=shinglyubors-servo2016-05-101-11/+34
|\ | | | | | | | | | | | | | | Bug #10181 - Implement *-reverse flex-directions <!-- 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/10987) <!-- Reviewable:end -->
| * Bug #10181 - Implement *-reverse flex-directionsShing Lyu2016-05-111-11/+34
| |
* | Move width and height from Box to Position.Cameron McCormack2016-05-041-4/+4
|/ | | | This helps with style struct alignment between Servo and Gecko.
* Implement flexbox reorderingDaniel Robertson2016-04-111-49/+67
| | | | | Add style property for order and implement reordering by this property in flex flow. Based on previous work by @zentner-kyle.
* Add tests and clean up *_mode_assign_inline_sizesDaniel Robertson2016-04-091-10/+11
| | | | | Clean up block_mode_assign_inline_sizes and inline_mode_assign_inline_sizes and add extra css tests.