Commit graph

69 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
11485edc9e
style: Hide LocalMatchingContext.
This type is a lot of complexity related to a very specific thing such as the
hover and active quirk.

Instead of that, move `nesting_level` to `MatchingContext`, and simplify all
this computing whether the quirk applies upfront, for each complex selector we
test.

This is less error-prone, and also allows simplifying more stuff in a bit.
2017-10-14 17:03:35 +02:00
Simon Sapin
7ebedd02a9 Use NonZeroUsize in script_layout_interface 2017-10-13 11:11:02 +02:00
Anthony Ramine
e2dac78d36 Rename LayoutJS<T> to LayoutDom<T> 2017-09-26 09:49:04 +02:00
Emilio Cobos Álvarez
e3c58df155
style: Remove UnsafeNode.
No longer needed since a while ago.
2017-09-25 01:58:52 +02:00
bors-servo
c48ef50b72 Auto merge of #18514 - asajeffrey:layout-dont-panic-if-no-iframe-bc, r=emilio
Remove sources of panic when laying out an iframe without a nested browsing context

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

At the moment, layout panics if it discovers an iframe without a nested browsing context. Under normal circumstances, this is reasonable, but it requires very tight synchronization between script, layout, the constellation and the compositor. In particular, if a layout is in progress when an iframe's browsing context is discarded, this can trigger panic.

This PR fixes this in two ways:

1. Making the pipeline and browsing context ids optional in layout's representation of an iframe.
2. Shutting down layout before discarding a browsing context, rather than after.

This is belt and braces.

---
<!-- 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 #17482 and #18477
- [X] These changes do not require tests because the PR is fixing a panic caused by a race condition

<!-- 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/18514)
<!-- Reviewable:end -->
2017-09-22 09:34:12 -05:00
Alan Jeffrey
fbfb9a80b4 Remove sources of panic when laying out an iframe without a nested browsing context. 2017-09-22 09:04:18 -05:00
Bobby Holley
438740b912 Implement an nth-index cache.
MozReview-Commit-ID: Ee0um3QXkxl
2017-09-21 15:25:38 -07:00
Emilio Cobos Álvarez
bd314747da
style: Implement the body text color quirk in a more straight-forward way.
This avoids grabbing the document when values that inherit from the body,
whatever that means, aren't under the body.

In that case we'll get a semi-random value, but that's also mishandled by Gecko
anyways (and probably Blink, though haven't tested), and doesn't really make
much sense.
2017-09-16 02:44:56 +02:00
Gecko Backout
558e357216 Backed out changeset 67769dac78c4 for busting builds CLOSED TREE
Backs out https://github.com/servo/servo/pull/18519
2017-09-15 20:47:46 +00:00
Emilio Cobos Álvarez
8c3c56909e
style: Implement the body text color quirk in a more straight-forward way.
This avoids grabbing the document when values that inherit from the body,
whatever that means, aren't under the body.

In that case we'll get a semi-random value, but that's also mishandled by Gecko
anyways (and probably Blink, though haven't tested), and doesn't really make
much sense.
2017-09-15 10:34:42 +02:00
Emilio Cobos Álvarez
dcbe196ed5
style: Remove NODE_NEEDS_DIRTY_ON_VIEWPORT_SIZE_CHANGE.
Recascading is enough.
2017-08-28 14:40:48 +02:00
Emilio Cobos Álvarez
723d31a4d8
style: Remove SharedStyleContext::quirks_mode. 2017-08-25 12:23:30 +02: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
Emilio Cobos Álvarez
0f37b209cb
stylo: Remove a lot of the restyle damage related complexity.
The only reason why we had the `existing_style_for_style_damage` bit is to apply
some optimizations that we don't have anymore.

I still want to reintroduce a few of them, at least for the non-eager
pseudo-element case... But I think I won't need this at all.

This allows us to remove a fair amount of Gecko code too.
2017-08-20 13:59:46 +02:00
Bobby Holley
24a52b7990 Do all descendant bit propagation from Gecko over FFI.
Deduplicating code is nice, and it will help us when we make the bit
propagation more complicated in upcoming patches.

MozReview-Commit-ID: KIQnNJVayrM
2017-08-11 17:00:37 -07:00
Simon Sapin
a205c82264 Upgrade to rustc 1.21.0-nightly (599be0d18 2017-07-26) 2017-07-27 02:21:01 +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
Manish Goregaokar
89930e7565 stylo: Switch Gecko over to ServoStyleContext 2017-07-17 18:03:23 -07: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
Renamed from components/script/layout_wrapper.rs (Browse further)