Commit graph

54 commits

Author SHA1 Message Date
Bobby Holley
a2c7a9d0fb Stop using associated types for the concrete TRestyleDamage implementation.
MozReview-Commit-ID: LfaZFCVlIb1
2016-11-07 11:10:48 -08:00
Ms2ger
5c03dd8eb1 Introduce a script_layout_interface crate and move RestyleDamage to it. 2016-06-20 19:02:36 +02:00
bors-servo
f0b3d1e77d Auto merge of #11417 - stshine:flex-longhand-properties, r=mbrubeck
Support remaining longhand flexbox style properties for servo

- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy --faster` does not report any errors
- [X] There are tests for these changes

Add the remaining longhand CSS properties of flexbox for servo,
including `flex-wrap`, `flex-grow`, `flex-shrink`, `justify-content`,
`align-items`, `align-self` and `align-content`.

Tests for the remaining longhand properties are also enabled. Test for
default value of `align-self` is modified because the new default value
for this property is "auto" is current flexbox CR.

<!-- 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/11417)
<!-- Reviewable:end -->
2016-05-31 21:44:06 -05:00
Matt Brubeck
5c09e26e55 Stop generating flows under display: none.
Because this is a bottom-up traversal it can generates flows and throw them away. To prevent that, this cascades an internal `-servo-under-display-none` property and then checks that during flow construction.  Fixes #1536.
2016-05-25 11:54:21 -07:00
Pu Xingyu
a7733b38d4 Add remaining longhand flexbox style properties
Add the remaining longhand CSS properties of flexbox for servo,
including `flex-wrap`, `flex-grow`, `flex-shrink`, `justify-content`,
`align-items`, `align-self` and `align-content`.

tests for the remaining longhand properties are also enabled. Test for
default value of `align-self` is modified because the new default value
for this property is "auto" is current flexbox CR.
2016-05-25 21:40:34 +08:00
Matt Brubeck
dff1de46b2 Don't let restyle damage infect siblings
Currently `compute_layout_damage` does the following for each child of the
node it's processing.

1. Update the child with damage from the parent.
2. Update the parent with damage from the child.

When these steps are repeated for the next child, the parent's damage may
include flags that came from its previous sibling(s).  This means that damage
ends up propagating to later siblings, and not just between parents and
children as indended.

This patch propagates the same damage to all children, not including any
damage from their siblings.
2016-05-05 16:06:27 -07:00
Cameron McCormack
550d780e17 Move width and height from Box to Position.
This helps with style struct alignment between Servo and Gecko.
2016-05-04 11:06:42 +10:00
Matt Brubeck
1e23d90631 Upgrade to bitflags 0.6.0 and selectors 0.5.6
Types generated by `bitflags!` are now private by default.  This PR marks them
`pub` where necessary.
2016-04-30 10:14:03 -07:00
Daniel Robertson
2d9d31ee04
Add style property for flex-basis
Add the style property for flex-basis. The property should allow all
values acceptable for `width`|`height` with the addition of `content`.
2016-04-24 14:04:40 -04:00
Matt Brubeck
1807fd3cc5 Generate a fragment for an empty elements with borders or padding 2016-04-16 11:01:40 -07:00
bors-servo
256b865055 Auto merge of #10407 - mauricioc:issue10403, r=bholley
Move some CSS properties to match Gecko's representation

Fixes #10403. Animation had an extra transition-delay property, which was also moved to Box. Let me know if I should squash the commits.

<!-- 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/10407)
<!-- Reviewable:end -->
2016-04-07 03:18:15 +05:30
Mauricio Collares
d8222dd63d Move CSS line-height property from InheritedBox to InheritedText 2016-04-05 00:28:18 -03:00
Mauricio Collares
bbc5c51be8 Move CSS flex-direction property from Flex to Position and delete Flex 2016-04-05 00:28:08 -03:00
Mauricio Collares
aae8919da4 Move some CSS properties from Box to Position 2016-04-05 00:21:49 -03:00
Mauricio Collares
281e385ab2 Rename PositionOffsets to Position 2016-04-05 00:21:48 -03:00
Mauricio Collares
841aef06e0 Move CSS content property from Box to Counters 2016-04-05 00:21:47 -03:00
Mauricio Collares
8c8090b5cd Move CSS text-shadow property from Effects to InheritedText 2016-04-05 00:21:46 -03:00
Mauricio Collares
347cf0580c Move CSS text-overflow property from InheritedText to Text 2016-04-05 00:21:39 -03:00
Mauricio Collares
4f0558e84f Move CSS image-rendering property from Effects to InheritedBox 2016-04-04 21:36:51 -03:00
Per Lundberg
4cb4cc93e4 Renamed TComputedValues to ComputedValues
This is a followup to #10210, and a continuation of #10185.
2016-03-29 23:30:13 +03:00
Per Lundberg
c2ad084713 ComputedValues is now ServoComputedValues
This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
2016-03-27 10:55:43 +03:00
Bobby Holley
c2daea2c9c Parameterize the rest of the style system on TNode. 2016-03-24 11:50:57 -07:00
Matt Brubeck
f7d490a7e7 Add missing properties to compute_damage 2016-03-21 16:28:07 -07:00
Matt Brubeck
c2c3b30f87 Short-circuit more of compute_damage 2016-03-21 16:28:07 -07:00
Patrick Walton
7a131ba104 layout: Minor whitespace cleanup. 2016-03-21 08:39:47 -07:00
Patrick Walton
5dca005920 layout: Repaint when z-index is modified. 2016-03-21 08:39:42 -07:00
Patrick Walton
21ea8eef19 layout: Make transform changes require incremental repaint.
The progress bar in browser.html was only accidentally working before,
so actually making use of `REPAINT` makes it stop working without this
change.
2016-03-21 08:38:00 -07:00
Patrick Walton
5ea8c34276 layout: Move overflow calculation to be a separate, sequential,
bottom-up pass.

Right now, the only reason that overflow calculation works is that we
rely on script inducing extra reflows that are sent for display. This
was preventing #10021 from landing.

This change regresses layout performance by about 1% in my tests.

Fixes #7797 properly.
2016-03-18 22:11:51 -07:00
Emilio Cobos Álvarez
61e04df266 style: Refactor the per_pseudo map from StyleData to avoid having an option value type.
This make the layout code way clearer.
2016-02-13 16:05:17 +01:00
Bobby Holley
27987c3bb4 Introduce a concept of restyle damage to the style system.
We can't hoist RestyleDamage itself, because it's very layout-dependent. But this
should be enough to let us hoist the things we need.
2016-01-04 09:38:04 -08:00
Bobby Holley
47059d2d26 Separate style+layout and layout-specific wrapper functionality.
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.
2015-12-29 11:50:03 -08:00
Glenn Watson
f555e3861c Include transform changes in list that cause incremental reflows.
Also ensure that 3d translations get layers.

Fixes #8329.
2015-11-18 10:28:37 +10:00
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Matt Brubeck
0c77705f52 Reconstruct flows when text/font/list styles change
Fixes #6501.
2015-09-17 11:59:00 -07:00
erneyja
17663315dd make test-tidy check that = have space after them 2015-09-01 07:18:19 -04:00
Simon Sapin
649250130b Replace FlowRef with Arc<Flow>, now that Arc supports DST.
… and WeakFlowRef with Weak<Flow>.
2015-08-20 16:49:48 +02:00
João Oliveira
0038580abf Replace uses of for foo in bar.iter() and for foo in bar.iter_mut()
closes #7197
2015-08-15 02:27:39 +01:00
Manish Goregaokar
f80f99fe1e Move to latest hyper everywhere 2015-06-02 20:12:14 +05:30
Patrick Walton
72f031e2a1 layout: Support inline incremental reflow, and stop reconstructing all
flows when mousing over the document.

This exposes more "jumpiness" on sites like Hacker News, but the bug
that causes it was pre-existing.
2015-05-19 11:08:27 -07:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00
Simon Sapin
4c1d778ced Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d107.
2015-03-03 21:16:24 +01:00
Patrick Walton
30fd28d107 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-03 17:31:19 +01:00
Simon Sapin
d5dd1d658e Upgrade to rustc ba2f13ef0 2015-02-04 2015-02-11 14:48:34 -08:00
Simon Sapin
d13d36f57f End the libstyle 'pub use' madness. 2015-01-30 15:08:29 +01:00
Manish Goregaokar
b68b7e87c8 self import 2015-01-28 13:46:00 +05:30
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Claes 'Letharion' Gyllensvärd
2737db3ad7 Remove bitfield! macro in favour of bitflags! 2014-11-18 19:26:10 +01:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00