Commit graph

478 commits

Author SHA1 Message Date
Fernando Jiménez Moreno
892b30edca Implement basic Time To First Paint and First Contentful Paint PWMs 2017-07-20 15:41:21 +02: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
bors-servo
38f4ae80c4 Auto merge of #17739 - jdm:no-vendor-prefixed-errors, r=emilio
Suppress CSS parser errors for vendor-prefixed properties.

This matches the behaviour of Gecko's CSS parser.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17736
- [X] There are tests for these changes

<!-- 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/17739)
<!-- Reviewable:end -->
2017-07-17 07:10:11 -07:00
Josh Matthews
94d631c1f4 Suppress CSS parser errors for vendor-prefixed properties. 2017-07-17 10:00:31 -04:00
Emilio Cobos Álvarez
bf9369b29d
script: Move the layout_wrapper outside of script.
This allows us to have ensure_data() and clear_data() functions on the TElement
trait, instead of hacking around it adding methods in random traits.

This also allows us to do some further cleanup, which I'd rather do in a
followup.
2017-07-15 16:41:12 +02:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
bors-servo
f85778884f Auto merge of #17673 - hgallagher1993:local_branch, r=jdm
Removed unused import

Removed unused import `script_layout_interface::reporter::CSSErrorReporter in components/layout_thread/lib.rs

---
<!-- 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 #17671 (github issue number if applicable).

<!-- 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/17673)
<!-- Reviewable:end -->
2017-07-11 20:09:52 -07:00
Alan Jeffrey
ef033b8362 Implemented paint worklet properties. 2017-07-11 17:28:56 -05:00
Hugh Gallagher
e13daa1e78 Removed unused import script_layout_interface::reporter::CSSErrorReporter 2017-07-11 21:54:07 +01:00
Josh Matthews
a08371e8eb stylo: Create error reporters linked to documents (bug 1352669) 2017-07-10 20:46:08 -04:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
The key of this patch is the split between Stylesheet and StylesheetContents.

Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Jeremy Lempereur
60de05d77d Passing ProfilerChan by reference to the send_profile_data method. 2017-06-25 14:29:44 +02:00
J. Ryan Stinnett
c32c0ac9dc Drop root_flow to avoid rule node leaks 2017-06-22 17:50:10 -05:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Emilio Cobos Álvarez
ffc45e9aaa
style: Inline RestyleData.
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
2017-06-16 03:36:18 +02: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
Emilio Cobos Álvarez
dc521b2799
style: Remove damage_handled, and use a reconstructed_ancestor bit instead.
Reviewed-By: bholley
Bug: 1368236
MozReview-Commit-ID: 8KK0YfhiS2
2017-06-14 13:15:00 +02:00
bors-servo
c0f3ec8780 Auto merge of #17192 - mbrubeck:layout, r=pcwalton
Parallel layout optimizations

This takes some of the optimizations made to parallel styling in #16971 and applies them to parallel layout.  Specifically:

* Reduce the chunk size, to increase chances for parallelism on trees with small fan-out.
* Reduce allocations by using SmallVec.
* Reduce task switching by processing up to one chunk of children within the same rayon task as the parent.

This cuts the "Primary Layout Pass" time in **half** on the MySpace page from [tp5n], and on my other real-world test pages it is a small improvement or close to no change.

[tp5n]: https://wiki.mozilla.org/Buildbot/Talos/Tests#tp5n_pages_set

---
- [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 affect performance 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/17192)
<!-- Reviewable:end -->
2017-06-07 19:57:57 -07:00
Alan Jeffrey
fd17dcd604 Implemented the plumbing for paint worklets. 2017-06-07 13:49:30 -05:00
Matt Brubeck
a158b106f4 Don't spawn layout threads in sequential mode 2017-06-06 11:20:13 -07:00
Matt Brubeck
8eecefe4c8 Make layout_thread debug logs less verbose 2017-06-06 11:20:12 -07:00
Emilio Cobos Álvarez
0adc02a317
style: Avoid some cfg checks in context.rs 2017-05-29 23:24:06 +02:00
Emilio Cobos Álvarez
deaa935f5b
layout: Stop doing unsafe transmutes between refcell references.
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
2017-05-25 10:31:40 +02:00
bors-servo
1306b16d5a Auto merge of #16968 - HeyZoos:stylist-accessors, r=emilio
Stylist accessors

<!-- Please describe your changes on the following line: -->
Add accessor methods for the `device` and `ruleset` fields in the `Stylist` struct.

---
<!-- 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 #16857 (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/16968)
<!-- Reviewable:end -->
2017-05-22 20:12:46 -05:00
Alan Jeffrey
42577365b7 Added a TopLevelBrowsingContextId type. 2017-05-22 09:27:07 -05:00
Cameron McCormack
a397590838
style: Refactor RestyleHint to be a struct.
Later PRs will add additional data to it that is not so easy to
represent using bitflags.
2017-05-20 16:28:09 +02:00
heyzoos
4196156bb9 Change device and rule_set references to accessors 2017-05-18 22:18:16 -05:00
bors-servo
8375319928 Auto merge of #16876 - asajeffrey:constellation-rename-frames, r=cbrewster
Renamed constellation::Frame to constellation::BrowsingContext

<!-- Please describe your changes on the following line: -->

Now that script has `WindowProxy` rather than `BrowsingContext` objects, we can rename `Frame` in the constellation to `BrowsingContext`. In particular, this means that `FrameId`s are now `BrowsingContextid`s, which better captures their purpose (and they are used in a lot of places, not just the constellation).

---
<!-- 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 do not require tests because renaming

<!-- 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/16876)
<!-- Reviewable:end -->
2017-05-16 23:10:45 -05:00
Martin Robinson
9fd2df5c09 Properly handle scroll offsets in hit testing
Scroll roots are no longer nested containers holding items, so instead
we need to track the offsets of each, carefully handling fixed position
items and stacking contexts that create new reference frames.
Additionally, we remove the complexity of the pre-computed page scroll
offset, instead opting to send script scrolls to the layout task in
order to more quickly have a ScrollState there that matches the
script's idea of the scroll world.

Fixes #16405.
2017-05-16 15:27:09 +02:00
Alan Jeffrey
607e011b05 Renamed constellation::Frame to constellation::BrowsingContext. 2017-05-15 21:03:11 -05:00
Josh Matthews
9134918844 Send information to script as part of finishing layout.
This avoids the need for multiple layout RPC operations immediately
following return of control to script. This means that layout and
script can continue to operate in parallel at this point, rather
than one potentially waiting on the shared mutex to be unlocked.
2017-05-15 14:12:08 -04:00
Josh Matthews
c3b9714ab7 Accumulate transitioning nodes inside the layout context. 2017-05-15 14:11:40 -04:00
Josh Matthews
dabebdfbf5 Root nodes for the duration of their CSS transitions.
This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.
2017-05-15 14:07:41 -04:00
Nazım Can Altınova
c54d255d07
stylo: Propagate quirks mode information from Gecko to Servo 2017-05-14 01:51:50 +03:00
Emilio Cobos Álvarez
677daaabc5
style: Parameterize the update and rebuild methods to take an iterator.
In preparation to avoid cloning the stylesheets while rebuilding in Gecko.
2017-05-12 14:50:59 +02:00
Emilio Cobos Álvarez
50e0c67e2c
style: Stop refcounting the stylist. 2017-05-11 21:05:42 +02:00
Emilio Cobos Álvarez
ebd9bf8181
style: Slim down SharedStyleContext.
This slims down SharedStyleContext, in preparation for a few things.

First, I would like to eventually move the stylist to the document in Servo, in
order for it to hold the StyleSheetSet.

Also, this gets rid of a fair amount of overhead while creating it in stylo.

Fixes bug 1363245.
2017-05-11 21:05:41 +02:00
Emilio Cobos Álvarez
46bf5d61f0
Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:05:39 +02:00
Nathan Froyd
681b578326 bump required rayon version to 0.7
...and bring jpeg-decoder along for the ride.  Minor tweaks were
necessary because of rayon API changes.
2017-05-05 10:36:01 -04:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Anthony Ramine
f68e2fded9 Propagate quirks mode all the way to ParserContext
The quirks mode is still not properly propagated in geckolib.
2017-04-27 10:41:55 +02:00
Anthony Ramine
f872fdac9a Make Stylist::quirks_mode hold a QuirksMode 2017-04-26 17:30:28 +02:00
Simon Sapin
512944c32c Don’t report CSS parsing errors from user-agent stylesheets.
This used to make `RUST_LOG=style` basically useless.
2017-04-24 08:27:26 +02:00
Simon Sapin
7fe57ecaea Rename StdoutErrorReporter to RustLogReporter. 2017-04-24 08:23:41 +02:00
bors-servo
541db5f9a7 Auto merge of #16458 - stshine:sequential-fallback, r=pcwalton,emilio
layout: Force reflow in the sequential fallback of block format context

When reflowing a block format context during the inorder traversal,
propagate restyle damage manually to its children since they were
already reflowed. Also, test the border box to see if it can fit into
floats according to CSS 2.1 § 9.5.

Improves reddit and yahoo.

---
<!-- 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 #__ (github issue number if applicable).

<!-- Either: -->
- [X] 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/16458)
<!-- Reviewable:end -->
2017-04-22 23:55:22 -05:00
Pu Xingyu
68f74d5cbe Force reflow in the sequential fallback of block format context
When reflowing a block format context during the inorder traversal,
propagate restyle damage manually to its children since they were
already reflowed.
2017-04-23 08:32:25 +08:00
Martin Robinson
d150cc9f95 Eliminate ScrollRootId
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.
2017-04-20 08:51:38 +02:00
Emilio Cobos Álvarez
4651b94ff0
style: Simplify author_style_disabled handling. 2017-04-19 09:41:37 +02:00
Martin Robinson
4451b8a771 Used shared clips for overflow:hidden and CSS clip
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.
2017-04-17 17:06:43 +02:00