Commit graph

1362 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
f993693eb2
style: Introduce TNode::is_in_document.
MozReview-Commit-ID: BrhhoOghtUL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-11-04 11:34:37 +01:00
Emilio Cobos Álvarez
2783297fa9
style: Add a Document::elements_with_id API.
MozReview-Commit-ID: BNtbJp0RI68
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-11-04 11:34:36 +01:00
Gecko Backout
8f8fd517ed Backed out changeset dbd300f4d75b for build bustage. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/19108
2017-11-03 23:56:42 +00:00
Emilio Cobos Álvarez
15ef6b0d8a
style: Update bindings. 2017-11-03 20:25:01 +01:00
Emilio Cobos Álvarez
bcc9c62620
style: Inline a bunch of stuff, fixup indentation of a couple things.
MozReview-Commit-ID: CgUNMeBDOCw
2017-11-03 14:18:49 +01:00
Emilio Cobos Álvarez
be1ba90284
style: Introduce TNode::is_in_document.
MozReview-Commit-ID: BrhhoOghtUL
2017-11-03 14:18:43 +01:00
Emilio Cobos Álvarez
db65c2d346
style: Add a Document::elements_with_id API.
MozReview-Commit-ID: BNtbJp0RI68
2017-11-03 13:49:15 +01:00
Emilio Cobos Álvarez
4e6af723d8
style: Update bindings. 2017-10-31 20:09:20 +01:00
Emilio Cobos Álvarez
b721215a00
style: Update bindgen to 0.31.3.
Constified enums are default now. I think I want to introduce an option to
bindgen to allow setting the default enum behavior, but it doesn't need to block
this.

The ServoBindings.toml changes are somewhat hacky, but that's because of
https://github.com/rust-lang-nursery/rust-bindgen/issues/1125.

Also, the fixups now need to account for whitespace, since quote generates stuff
like root :: nsString, and we don't rustfmt the bindings if there's no rustfmt
installed.

Bug: 1412486
Reviewed-by: xidorn
MozReview-Commit-ID: EY5eNnCiTIw
2017-10-31 20:09:18 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Emilio Cobos Álvarez
0df912be93
style: Make style sharing look at XBL / Shadow DOM rules.
Bug: 1412251
Reviewed-by: bz
MozReview-Commit-ID: II6lk6OmSZU
2017-10-28 12:43:43 +02:00
Gecko Backout
cda9d186c1 Backed out changeset fc813bf68348 for failing reftest layout/reftests/bugs/272646-1.xul on OS X. r=backout
Backs out https://github.com/servo/servo/pull/19045
2017-10-28 08:08:47 +00:00
bors-servo
592c513c28 Auto merge of #19045 - emilio:shadow-style-sharing, r=bzbarsky
style: Make style sharing look at XBL / Shadow DOM rules.

Bug: 1412251
Reviewed-by: bz
MozReview-Commit-ID: II6lk6OmSZU

<!-- 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/19045)
<!-- Reviewable:end -->
2017-10-27 19:14:20 -05:00
Emilio Cobos Álvarez
4b43b7c7f8
style: Make style sharing look at XBL / Shadow DOM rules.
Bug: 1412251
Reviewed-by: bz
MozReview-Commit-ID: II6lk6OmSZU
2017-10-28 02:13:59 +02:00
Boris Chiou
52c81a0a84 Add Servo_ComposeAnimationSegment which composes an animation segment. 2017-10-27 21:18:21 +02:00
Boris Chiou
1f5551c397 Add Servo_AnimationValue_Transform which creates an AnimationValue of transform. 2017-10-27 21:18:11 +02:00
Boris Chiou
f02bd01add Add Servo_AnimationValue_Opacity which creates an AnimationValue of opacity. 2017-10-27 21:18:01 +02:00
Sylvestre Ledru
6d6a68b5b1 Support multi lines declarations in the parsing of the Fx header files
For example, in dom/base/nsGkAtomList.h, we currently have:
GK_ATOM(mouseWheel, "mouseWheel")  // For discrete wheel events (e.g. not OSX magic mouse)
but if we change to
GK_ATOM(mouseWheel,
        "mouseWheel")  // For discrete wheel events (e.g. not OSX magic mouse)
The parser didn't handle the declaration
2017-10-27 17:10:42 +02:00
Nicholas Nethercote
5866b820e0 Introduce nsStaticAtom.
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)
2017-10-27 20:33:40 +11:00
Emilio Cobos Álvarez
dd5cd29a61
style: Introduce TDocument::is_html_element and TDocument::quirks_mode.
This allows some code to read a bit nicer, and stop passing down quirks mode to
querySelector / querySelectorAll.
2017-10-26 13:22:31 +02:00
Emilio Cobos Álvarez
bfa7cd7d9e
style: Add TNode::owner_doc. 2017-10-26 13:03:11 +02:00
Emilio Cobos Álvarez
4d4fa69018
style: Introduce a TDocument trait.
This will be useful for querySelector optimizations.
2017-10-26 12:49:13 +02:00
Emilio Cobos Álvarez
6c796b50ec
style: Remove PresentationalHintsSynthesizer.
This is not really an useful abstraction, and I never knew how to spell it.
2017-10-26 11:45:28 +02:00
Emilio Cobos Álvarez
21b314e633
stylo: Honor CallerType for media query parsing.
So that matchMedia can parse internal stuff in Chrome code.

Bug: 1410074
Reviewed-by: xidorn
MozReview-Commit-ID: 6M4HHqVJ1dp
2017-10-25 14:27:16 +02:00
Emilio Cobos Álvarez
9a804f68f9
style: Update bindings. 2017-10-23 08:32:00 +02:00
Emilio Cobos Álvarez
4f997bf333
style: Add methods to iterate a subtree in preorder.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:25:08 +02:00
Emilio Cobos Álvarez
6ae8bdee61
style: Hook QuerySelector into stylo.
Bug: 1410624
MozReview-Commit-ID: 4uKWN9uqi3r
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:24:57 +02:00
Emilio Cobos Álvarez
1b32709d95
style: avoid selector refcount churn during invalidation.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:22:49 +02:00
bors-servo
7b61e3b6ee Auto merge of #18963 - heycam:rm-property-id, r=upsuper
geckolib: Make Servo_DeclarationBlock_RemovePropertyById return whether it did remove a property.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1408311, 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/18963)
<!-- Reviewable:end -->
2017-10-20 05:26:18 -05:00
bors-servo
b1e6f05ae4 Auto merge of #18962 - upsuper:tree-pseudos, r=emilio
Support matching for ::-moz-tree-* pseudo-elements

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

<!-- 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/18962)
<!-- Reviewable:end -->
2017-10-20 04:18:53 -05:00
Cameron McCormack
d58c967efa style: Record DocumentState dependencies. 2017-10-20 13:13:13 +08:00
Cameron McCormack
c22dba0b87 style: Remove unused SelectorImpl::pseudo_class_state_flag. 2017-10-20 13:12:44 +08:00
Cameron McCormack
01ed7fe4dd geckolib: Make Servo_DeclarationBlock_RemovePropertyById return whether it did remove a property. 2017-10-20 12:00:32 +08:00
Xidorn Quan
2dc714f0ac Implement XUL tree pseudo style resolution for stylo. 2017-10-20 14:08:56 +11:00
Xidorn Quan
915890af77 Correct pseudo element type of tree pseudos. 2017-10-20 14:08:38 +11:00
Xidorn Quan
cd527733c5 Make tree pseudos not precomputed since they are not really anonymous boxes. 2017-10-20 14:08:36 +11:00
Xidorn Quan
4ce3dc7729 Add slots in PerPseudoElementMap for tree pseudos. 2017-10-20 14:08:35 +11:00
Xidorn Quan
b743d68ccd Accept argument-less tree pseudo-element selector. 2017-10-20 14:08:33 +11:00
Xidorn Quan
a2182f8dc3 Store args of tree pseudo-elements as Atom. 2017-10-20 14:08:31 +11: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
bors-servo
fe16c1d5c3 Auto merge of #18809 - Eijebong:bitflags, r=nox
Update bitflags to 1.0 in every servo crate

It still needs dependencies update to remove all the other bitflags
versions.

- [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 it's a dependency update

<!-- 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/18809)
<!-- Reviewable:end -->
2017-10-19 10:35:08 -05: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
Emilio Cobos Álvarez
b0e54968ec
style: Make MatchingContext generic over SelectorImpl.
This will help Xidorn implement tree pseudos, and in general makes sense,
allowing to put specific matching data in a selectors implementation.
2017-10-19 11:33:13 +02:00
Boris Chiou
aa72970f0a Add Servo_StyleSet_GetComputedValuesByAddingAnimation FFI.
Add an FFI to create a temporary ServoStyleContext with the animation value.
We need this because we calculate the Cumulative change hints to check
if we can ignore this animation segment.
2017-10-19 11:05:07 +08:00
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
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
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
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
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