Commit graph

340 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Connor Brewster
deb932784e style: Move text-overflow outside of mako 2017-10-27 23:09:05 -05:00
bors-servo
2b03a9974c Auto merge of #18968 - mbrubeck:try, r=emilio
Use try syntax for Option where appropriate

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they are refactoring only

<!-- 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/18968)
<!-- Reviewable:end -->
2017-10-21 03:31:21 -05:00
Matt Brubeck
2d45e9d2da Use try syntax for Option where appropriate 2017-10-20 08:25:35 -07:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Simon Sapin
b505c9e948 Introduce an unsafe HasBaseFlow trait for base()/base_mut() casts. 2017-10-14 00:03:57 +02:00
bors-servo
b2df99cb65 Auto merge of #18462 - mrobinson:cleanup-building-state, r=emilio
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 -->
2017-09-15 05:30:47 -05:00
Corey Farwell
9cd4535364 Implement size_hint for more iterators.
```
implement size hint for
more iterators because why
not we like fast things
```
2017-09-13 20:29:27 -04:00
Martin Robinson
ee46bc57ed Separate stacking context collection and display list building state
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.
2017-09-12 17:15:06 +02:00
Anthony Ramine
542a9337a4 Use generics for the vertical-align property 2017-08-30 23:01:12 +02:00
Keith Yeung
1df72ba935 Remove border collapse argument from compute_border_and_padding 2017-08-25 23:41:55 -07:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Martin Robinson
0a24c2f03c Use the is_absolute_containing_block method everywhere
This is a better approach than relying on
contains_positioned_fragments, because in the future other properties
will create absolute containing blocks.
2017-08-16 13:32:48 +02:00
Simon Sapin
b5a4b8d6a0 Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
Matt Brubeck
ca300d6424 Allow CalculateStackingRelativePositions to short-circuit 2017-08-08 11:20:16 -07:00
Matt Brubeck
d1a37f1ea3 Code organization: Move all generic traversal code to layout::traversal 2017-08-08 10:53:19 -07:00
Matt Brubeck
a08bc13df9 Rename compute_absolute_position to compute_stacking_relative_position 2017-08-08 10:53:17 -07:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
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).
2017-07-19 09:29:05 +02:00
Manish Goregaokar
808b1f509b stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it 2017-07-17 18:02:25 -07:00
Hugh Gallagher
579de83a53 Removed unsused import 2017-07-13 21:37:35 +01:00
Pu Xingyu
71fcdf683a layout: Stop in-order on children of InlineFlow
No need to do in-order traversal for children of InlineFlow, since
they are either inline-block or absolutely positioned elements, which
are guaranteed to be block formatting context.
2017-07-13 23:50:01 +08:00
Simon Sapin
86293c3b39 Replace remaining usage of deprecated Range::step_by
… which is being removed in https://github.com/rust-lang/rust/pull/43012
2017-07-05 13:54:40 +02:00
Nathan Froyd
096cee8ebc remove various things now that Rust 1.17 is required
std::ptr::eq and Arc::ptr_eq are now usuable, and we can replace a
panic!() with abort().
2017-06-23 10:39:41 -04:00
Nicolas Silva
997608f11f Make BaseFlow::stacking_relative_position a vector. 2017-06-14 16:01:01 +02:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
bors-servo
f3a694a7b4 Auto merge of #16999 - bzbarsky:fix-text-overflow-handling, r=Manishearth
Fix stylo's text-overflow handling to match gecko.

A single value sets the text-overflow on the _end_ of the text, not both start and end.

<!-- 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
- [ ] These changes do not require tests because _____

<!-- 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/16999)
<!-- Reviewable:end -->
2017-05-23 20:39:24 -05:00
Boris Zbarsky
9f482c1430 Fix stylo's text-overflow handling to match gecko.
A single value sets the text-overflow on the _end_ of the text, not both start and end.
2017-05-23 14:35:45 -04:00
Behnam Esfahbod
14c524df4f [gfx] [layout] [style] Upgrade unicode-bidi to 0.3 2017-05-22 20:06:19 -05:00
Manish Goregaokar
2230332f46 Update app_units to 0.4.1 2017-05-19 20:33:02 -07:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Emilio Cobos Álvarez
4bafdedf64
layout: Merge inline nodes based on node address, not node style. 2017-03-11 11:31:12 +01:00
Emilio Cobos Álvarez
6f134892da
layout: Reflow some code and comments in layout/inline.rs 2017-03-11 11:31:11 +01:00
Pu Xingyu
336aa795b4 Remove cached thread local context from LayoutContext
Remove cached thread local context from LayoutContext, use LayoutContext for
assign_inline_sizes(), and simplify the parallel flow traversal code.
2017-02-08 08:47:54 +08:00
bors-servo
c75946c3ed Auto merge of #14978 - shinglyu:inline-flex, r=notriddle
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 -->
2017-01-22 19:57:49 -08:00
Shing Lyu
e31ee04dad Implemented display: inline-flex 2017-01-23 10:30:55 +08:00
Michael Howell
cef4ebed20 Preserve the un-truncated version of fragments
Fixes #14952
2017-01-12 22:02:53 +00:00
Michael Howell
8a90cda09f Do not replace an ellipsis when reflowing a line
The ellipsis should be replaced, if needed, when the text itself is reflowed.
2017-01-12 21:16:27 +00:00
Martin Robinson
29876d2703 Rework the way scroll roots are collected
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.
2017-01-10 13:33:08 +01:00
Emilio Cobos Álvarez
fa26e87030
layout: Remove get_font_arc in favor of clone_font.
Since they do the same.
2016-12-31 04:53:36 +01:00
Bobby Holley
648ce1e44e Make the DomTraversalContext own the SharedStyleContext and share it 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.
2016-12-16 10:57:27 -08:00
Pu Xingyu
07250a7d58 Remove unused replaced size calculation methods
Remove some fields and methods from SpecificFragmentInfo and change
some function signatures.
2016-12-12 18:10:36 +08:00
Nikhil Shagrithaya
4b2737606d implemented string-valued text-overflow 2016-11-10 00:00:21 +05:30
Bobby Holley
a2c7a9d0fb Stop using associated types for the concrete TRestyleDamage implementation.
MozReview-Commit-ID: LfaZFCVlIb1
2016-11-07 11:10:48 -08:00
Shing Lyu
8bea421329 Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
Michael Howell
5f320bd2ca Make FlowRef a newtype
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
2016-11-04 13:36:04 -07:00
Martin Robinson
71d285af80 Use a new id type for tracking scrolling areas
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.
2016-10-30 21:10:04 +01:00
Glenn Watson
acfdfd2fa9 Remove old rendering backend.
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.
2016-10-18 10:21:27 +10:00
Patrick Walton
7df456e8ac layout: Rewrite clipping to be a two-phase process that takes physical
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.
2016-10-15 14:18:48 -07:00