Commit graph

5541 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
97c9dae40d
style: Use a proper flattened tree iterator if we're under a shadow tree. 2017-10-18 12:14:08 +02:00
bors-servo
421baa854e Auto merge of #18932 - nnethercote:rename-size_of_is_0, r=emilio
Rename `size_of_is_0!` as `malloc_size_of_is_0!`.

The new name makes it clearer that it comes from the `malloc_size_of`
crate.

<!-- 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 it's a trivial name change.

<!-- 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/18932)
<!-- Reviewable:end -->
2017-10-18 02:17:40 -05:00
Nicholas Nethercote
a26d25db12 Rename size_of_is_0! as malloc_size_of_is_0!.
The new name makes it clearer that it comes from the `malloc_size_of`
crate.
2017-10-18 14:26:56 +11:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
bors-servo
aa3122e7d1 Auto merge of #18917 - heycam:observer-test, r=emilio
style: Add some more tests for disallowed rootMargin values.

<!-- 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/18917)
<!-- Reviewable:end -->
2017-10-17 08:11:16 -05:00
Cameron McCormack
893415c85a
style: Add some more tests for disallowed rootMargin values. 2017-10-17 14:43:00 +02:00
bors-servo
c1e0889971 Auto merge of #18904 - emilio:invalidator-less-dependencies, r=heycam,jdm,nox
style: Stop threading the ElementData around the invalidator.

<!-- 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/18904)
<!-- Reviewable:end -->
2017-10-17 05:18:29 -05:00
Emilio Cobos Álvarez
96b71754c3
style: Remove unused TNode::is_in_doc.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-17 08:57:37 +02:00
Emilio Cobos Álvarez
a11d268468
style: Refactor children handling.
Moving traversal_children away from TNode I can make TNode trivial enough, in
order to share a QuerySelector implementation between Servo and Gecko.
2017-10-17 08:57:35 +02:00
Emilio Cobos Álvarez
7c2265360f
style: Stop threading the ElementData around the invalidator. 2017-10-17 08:57:34 +02:00
Emilio Cobos Álvarez
40d9cd99b5
style: Don't require a full SharedStyleContext for TreeStyleInvalidator.
We only use it to get the quirks mode, and a shared style context is a pretty
heavy-weight struct.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-17 08:57:33 +02:00
Cameron McCormack
ef28ccb1a3 style: Add FFI function for parsing IntersectionObserver rootMargin values. 2017-10-17 12:50:02 +08:00
Savid Sharan
dd02d7a8f8 Removed pdqsort dependency and changed style create to use stdlib sort method. 2017-10-16 18:40:17 -04:00
Emilio Cobos Álvarez
bfe230f3ed
style: Remove the ElementExt trait.
It is likely it's the most useless trait ever existing.
2017-10-16 13:30:22 +02:00
bors-servo
1e351ef8c4 Auto merge of #18891 - heycam:color-refactor, r=upsuper
style: add FFI functions for color parsing

Servo side of https://bugzilla.mozilla.org/show_bug.cgi?id=1408312, reviewed there by Xidorn.

<!-- 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/18891)
<!-- Reviewable:end -->
2017-10-16 04:49:33 -05:00
bors-servo
a759ded65d Auto merge of #18884 - emilio:invalidator-ltr, r=heycam
style: Use left-to-right indices in the invalidator.

This will make easier to create external invalidations that don't point to a combinator,
and also makes reasoning about the invalidator a bit easier.

<!-- 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/18884)
<!-- Reviewable:end -->
2017-10-16 03:41:54 -05:00
Cameron McCormack
1db1c7f544 style: Refactor specified::Color parsing/computation functions.
So they can be called without a context.
2017-10-16 15:56:22 +08:00
bors-servo
9b82d08dc5 Auto merge of #18879 - emilio:computed-value-flags-inherited, r=heycam
style: Not all computed value flags are really inherited.

This fixes the fishiness I noticed in:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1407832

<!-- 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/18879)
<!-- Reviewable:end -->
2017-10-16 02:36:22 -05:00
Emilio Cobos Álvarez
f1cc225e97
style: Use left-to-right indices in the invalidator.
This will make easier to create external invalidations, and also makes reasoning
about the invalidator a bit easier.
2017-10-16 08:54:00 +02:00
bors-servo
7e8def9c08 Auto merge of #18886 - servo:urls, r=SimonSapin
Change AttrValue::Url to AttrValue::ResolvedUrl

Things make more sense like this.

<!-- 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/18886)
<!-- Reviewable:end -->
2017-10-15 04:53:29 -05:00
Anthony Ramine
c7b1d3054f Change AttrValue::Url to AttrValue::ResolvedUrl
There is actually only one attribute that can use that, the one for
<body background>.
2017-10-15 11:03:20 +02:00
bors-servo
a200fb4b9d Auto merge of #18876 - emilio:die-localmatchingcontext-die, r=SimonSapin
style: Do not expose 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.

Also, this makes the hover and active quirk work in Servo with no extra effort.

<!-- 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/18876)
<!-- Reviewable:end -->
2017-10-15 02:21:47 -05:00
Emilio Cobos Álvarez
dcb8c2fdc7
style: Properly use nesting_level in the invalidation code. 2017-10-14 17:03:36 +02:00
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
Emilio Cobos Álvarez
6a5576085c
style: Reformat Rule::new. 2017-10-14 17:03:32 +02:00
bors-servo
de324f8b18 Auto merge of #18880 - emilio:fixup-parse-hack, r=emilio
style: Fixup the hack added in #18867.

The declaration can indeed have the same id if it contains variables, or is a
CSS keyword value.

This was making a WPT test fail, so this is tested, though Servo's WPT import
didn't catch this for some reason.

<!-- 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/18880)
<!-- Reviewable:end -->
2017-10-14 09:49:45 -05:00
Emilio Cobos Álvarez
6fbf006680
style: Fixup the hack added in #18867.
The declaration can indeed have the same id if it contains variables, or is a
CSS keyword value.

This was making a WPT test fail, so this is tested, though Servo's WPT import
didn't catch this for some reason.
2017-10-14 15:28:10 +02:00
bors-servo
8b6207c0d6 Auto merge of #18877 - emilio:closest-why, r=nox
stylo: Dumb down the return value of SelectorList_Closest.

So it builds with rust 1.21.

See: https://bugzilla.mozilla.org/show_bug.cgi?id=1408622

<!-- 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/18877)
<!-- Reviewable:end -->
2017-10-14 08:13:59 -05:00
Emilio Cobos Álvarez
b73b5b581b
style: Not all computed value flags are really inherited.
This fixes the fishiness I noticed in:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1407832
2017-10-14 14:48:27 +02:00
Emilio Cobos Álvarez
e9a26f3a89
style: Update bindings. 2017-10-14 14:04:53 +02:00
bors-servo
2be76c5fd7 Auto merge of #18867 - emilio:parse-hack, r=heycam
style: Dishonor display: -moz-box if -webkit-box was specified before

This is a compatibility hack that Gecko supports that is apparently important for android.

I want to remove it, but let's see...

See https://bugzilla.mozilla.org/show_bug.cgi?id=1407701 for reference.

<!-- 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/18867)
<!-- Reviewable:end -->
2017-10-14 05:27:51 -05:00
Emilio Cobos Álvarez
6d694a4bcd
style: Dishonor display: -moz-box if -webkit-box was specified before.
Bug: 1407701
2017-10-14 11:31:01 +02:00
Emilio Cobos Álvarez
25c303ee62
style: Be clearer about whether a declaration comes from parsing or not.
This introduces DeclarationSource, to see if a declaration has been parsed or
set from CSSOM in a declaration block.

The Servo_DeclarationBlock_SetFoo and similar callers are changed to
DeclarationSource::CssOm because their semantics are more CSSOM-y, but it
shouldn't matter since they should all be checked before hand with
Servo_DeclarationBlock_PropertyIsSet.
2017-10-14 11:30:59 +02:00
bors-servo
db29af160c Auto merge of #18864 - emilio:reformat, r=jdm
style: Reformat a few signatures to follow a consistent style.

<!-- 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/18864)
<!-- Reviewable:end -->
2017-10-13 14:11:02 -05:00
Emilio Cobos Álvarez
f64f8b8be2
style: Share code for Element::Closest. 2017-10-13 17:21:31 +02:00
Emilio Cobos Álvarez
9e6c49d479
style: Share code for Element::Matches. 2017-10-13 17:21:26 +02:00
Emilio Cobos Álvarez
77f115b467
stylo: Remove unused function. 2017-10-13 17:01:36 +02:00
Emilio Cobos Álvarez
09d3a11c86
style: Reformat a couple signatures.
MozReview-Commit-ID: 7Wdvj7i8ClR
2017-10-13 17:01:31 +02:00
Emilio Cobos Álvarez
e447f819a2
style: Make InvalidationProcessor methods be &mut self.
This would allow querySelector / querySelectorAll to mutate the list of matched
nodes as it sees fit.
2017-10-13 12:17:02 +02:00
Emilio Cobos Álvarez
9034e6a732
style: Add a way to skip the "invalidation on eager pseudo invalidates self" bit. 2017-10-13 12:17:02 +02:00
Emilio Cobos Álvarez
ecdb10ef5c
Be more precise in should_process_descendants. 2017-10-13 12:17:02 +02:00
Emilio Cobos Álvarez
9e61c1962b
style: Unify invalidated_child with invalidated_descendants.
I think invalidated_descendants was buggy, and this fixes it.
2017-10-13 12:17:01 +02:00
Emilio Cobos Álvarez
557353c1f6
style: Move the bounds up in InvalidationProcessor. 2017-10-13 12:17:00 +02:00
Emilio Cobos Álvarez
a5e2f2c76c
style: Isolate all the restyling related logic in the invalidator in an InvalidationProcessor trait.
Ditto, no change in behavior.
2017-10-13 12:17:00 +02:00
Emilio Cobos Álvarez
b9b3e592dd
style: Split the invalidation collection from the invalidator step.
This is the first step in reusing the invalidation machinery for other stuff,
potentially including QuerySelector / QuerySelectorAll.
2017-10-13 12:16:59 +02:00
Xidorn Quan
1251537459 Rewrite cycle removal algorithm of custom properties and integrate it with substitution 2017-10-13 10:55:24 +11:00
bors-servo
bc18ef7861 Auto merge of #18850 - emilio:bindgenup, r=jdm
Update bindgen.

This includes a clang-sys upgrade that removes crashes in linux32, and nothing
else.

<!-- 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/18850)
<!-- Reviewable:end -->
2017-10-12 09:06:22 -05:00
Emilio Cobos Álvarez
8c3e742cbf
Update bindgen.
This includes a clang-sys upgrade that removes crashes in linux32, and nothing
else.
2017-10-12 14:43:10 +02:00
Emilio Cobos Álvarez
3e9bfdd72e
stylo: Remove :-moz-system-metric pseudo-class.
Bug: 1405311
Reviewed-by: xidorn
MozReview-Commit-ID: CIF64dG1F2k
2017-10-12 14:04:32 +02:00
bors-servo
5682eeff48 Auto merge of #18843 - upsuper:author-text-shadow, r=heycam
Remove text-shadow handling from HasAuthorSpecifiedRules

This is the Servo side change of [bug 1363088](https://bugzilla.mozilla.org/show_bug.cgi?id=1363088).

<!-- 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/18843)
<!-- Reviewable:end -->
2017-10-12 03:12:26 -05:00