Commit graph

584 commits

Author SHA1 Message Date
Simon Sapin
83c7824fda Simplify rust-selectors API for attribute selectors 2017-05-18 17:13:13 +02:00
bors-servo
d8b7013fcd Auto merge of #16900 - emilio:pseudos, r=bholley
Bug 1364850: Move PseudoElement to be just another combinator in selectors. r=bholley

On top of https://github.com/servo/servo/pull/16890.

<!-- 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/16900)
<!-- Reviewable:end -->
2017-05-17 05:40:14 -05:00
Emilio Cobos Álvarez
522f8489d6
Bug 1364850: Move PseudoElement to be just another combinator in selectors. r=bholley
MozReview-Commit-ID: 8OoOIodkKJ5
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-17 10:58:24 +02:00
bors-servo
5da0aa9f11 Auto merge of #16883 - jdm:mutationobserver, r=jdm
Mutation Observer API

Rebased from #16668.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix (partially) #6633
- [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/16883)
<!-- Reviewable:end -->
2017-05-17 01:21:40 -05:00
J. Ryan Stinnett
e385b81fc3 Create a MatchingContext to group related matching args
MozReview-Commit-ID: 7XZTn7HDXrm
2017-05-16 09:19:28 -05:00
Sumit
3ca89204ff Mutation Observer API 2017-05-15 18:15:38 -04:00
Anthony Ramine
73f77e0a53 Rename LayerImage to ImageLayer and make it a type alias 2017-05-15 15:36:21 +02:00
Christian Poveda
62821a6915 Solving merge conficts related to the html5ever_atoms -> html5ever change 2017-05-03 12:57:49 -05:00
Christian Poveda
875e422fe6 Changed all prefixes from DOMString to the atomic Prefix from html5ever 2017-05-03 10:17:42 -05:00
bors-servo
8b41c7c137 Auto merge of #16689 - servo:m5e, r=nox
Upgrade to html5ever 0.16

<!-- 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/16689)
<!-- Reviewable:end -->
2017-05-03 08:42:41 -05:00
Bobby Holley
7b0679848b Fix up script and layout. 2017-05-02 17:35:45 -07:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02: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
bors-servo
ef3903163d Auto merge of #16530 - metajack:kill-domrectlist, r=nox
Remove DOMRectList and use sequences instead.

DOMRectList was removed last back in 2015. See
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26200 for details.

<!-- 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 they are covered by existing tests

<!-- 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/16530)
<!-- Reviewable:end -->
2017-04-24 10:35:52 -05:00
Manish Goregaokar
c1c4c8fa59 stylo: Add basic system font support, use for font-size and font-family 2017-04-21 14:53:09 -07:00
Jack Moffitt
853c91781e Remove DOMRectList and use sequences instead.
DOMRectList was removed last back in 2015. See
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26200 for details.
2017-04-19 07:11:58 -06:00
bors-servo
195100f3ca Auto merge of #16495 - coalman:tidy-brace-alignment, r=emilio
Make tidy check that opening and closing braces that begin a line do …

…so with proper alignment.

---
<!-- 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 #16486 (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/16495)
<!-- Reviewable:end -->
2017-04-19 03:06:31 -05:00
Bobby Holley
9524c5cb57 Introduce SelectorInner and use it for top-level matching.
MozReview-Commit-ID: DxG6USsPIkh
2017-04-18 20:07:53 -07:00
coalman
fc34b9a14d Fix indentation errors in servo rust code that tidy now finds. 2017-04-18 14:56:13 -04:00
Simon Sapin
daba02438d Upgrade to rustc 1.18.0-nightly (5f13a3b54 2017-04-15)
This version enables [struct field reordering][1] which brings the size
of the types for specified values of some CSS properties under the threshold
such that they shouldn’t be boxed anymore, making unit tests fail.

Simply unboxing them moves the test failure to Stylo’s unit tests,
since the stable compiler used in that case does not do field re-ordering.
Therefore, we manually reorder a couple fields to effectively bring this
optimization to older compilers for a few specific types.

[1]: https://github.com/rust-lang/rust/pull/40377
2017-04-15 14:00:00 +02:00
Emilio Cobos Álvarez
39ab49823b
style: relax assertions in dom::element when setting selector flags.
Fixes #16409
2017-04-13 17:40:18 +08:00
Tom Houlé
7ecee05e4a Style: Do not immediately convert absolute specified lengths
The NoCalcLength::Absolute variant has been rewritten to accommodate
other units than Au with the new AbsoluteLength enum. This avoids loss
of precision for some operations.

The conversion from floating point absolute lengths to integer
application unit values adopts the same clamping limits as Gecko.
2017-04-12 11:51:57 +08:00
Emilio Cobos Álvarez
53cad6227e
script: Map HTMLCanvasElement width and height attributes. 2017-04-09 18:15:53 +08:00
Emilio Cobos Álvarez
df29d02026
script: Remove now-unused function.
MozReview-Commit-ID: Cnw5dlczJxv
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-09 18:15:52 +08:00
Emilio Cobos Álvarez
0ea58d1ffa
style: Stop special-casing a few attributes for style sharing, and use a visitor to track dependencies.
Also, simplify all the pre-snapshot attribute hacks in the script and style
code.

MozReview-Commit-ID: 6c9ipeb7Tnr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-09 18:15:50 +08:00
Xidorn Quan
37585309e9 Use a UrlExtraData type alias to unify url handling logic. 2017-04-03 21:57:16 +10:00
Emilio Cobos Álvarez
35496c8ae1
style: Align border-spacing with other engines. 2017-03-27 12:42:26 +02:00
Anthony Ramine
c16234f7a7 Update rustc to 1.17.0-nightly (7dd4e2db7 2017-03-26) 2017-03-26 16:10:44 +02:00
Bobby Holley
63e8367eee Don't resolve URLs at parse time for Stylo.
It's a bit unfortunate the use separate implementations of SpecifiedUrl for Servo
and Gecko, but they're different enough at this point that I don't think it really
makes sense to try to share everything. Splitting them out has some nice
simplifications as well.

I recognize that there's still some potential correctness issues for Servo using
the resolved URI in various places where the original URI may be the right thing,
but I've got too much on my plate to look into that for now.

MozReview-Commit-ID: BeDu93TQ4Ow
2017-03-22 19:11:30 -07:00
Emilio Cobos Álvarez
a9b133bcbb
Bug 1345950: stylo: Fix slow selector flags. r=bholley
MozReview-Commit-ID: QwuSxulNG0
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-22 11:21:24 +01:00
Manish Goregaokar
c9198d92d5 Add separate specified value for keyword font sizes
In Gecko, these keywords compute to different values depending on the
font.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1341775
2017-03-20 00:06:04 -07:00
Simon Sapin
1bacd0eb15 Move all PropertyDeclarationBlock from RwLock<_> to Locked<_> 2017-03-19 22:30:38 +01:00
Bobby Holley
97dd3a1b08 Box more specified values to bring SpecifiedValue/PropertyDeclaration sizes down to 24/32 bytes.
MozReview-Commit-ID: xstAfjVQqi
2017-03-17 22:18:19 -07:00
bors-servo
0a747e23c6 Auto merge of #15966 - mbrubeck:any, r=emilio
Bug 1340683 - stylo: Implement the :-moz-any pseudo-class

Adds support for the non-standard [:-moz-any](https://developer.mozilla.org/en-US/docs/Web/CSS/:any) selector.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1340683
- [x] These changes do not require tests because they are gecko-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/15966)
<!-- Reviewable:end -->
2017-03-16 16:19:12 -07:00
Bobby Holley
8cf331a498 Rearrange PropertyDeclaration to avoid embedding DeclaredValue.
From https://bugzilla.mozilla.org/show_bug.cgi?id=1347719

This effectively combines the discriminants of the two enums and reduces the
size of PropertyDeclaration by one word.

MozReview-Commit-ID: 9rCRiSVZTQT
2017-03-16 14:40:55 -07:00
Matt Brubeck
2872c8bfab Bug 1340683 - stylo: Implement the :-moz-any pseudo-class 2017-03-16 11:44:47 -07:00
Mukilan Thiyagarajan
38a61712e4 Implement the form owner concept 2017-03-15 16:39:55 +01:00
Simon Sapin
da4e5146e9 Make PropertyDeclarationBlock::important_count private. 2017-03-07 23:37:31 +01:00
SendilKumar N
b6e6e84bcf ext. filtering for lang matching 2017-03-07 10:20:16 +08:00
bors-servo
7ee6294922 Auto merge of #15761 - upsuper:shorthand, r=Manishearth
Have shorthand parsing functions not return Option for their longhands

<!-- 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/15761)
<!-- Reviewable:end -->
2017-02-27 23:08:33 -08:00
Xidorn Quan
b24614f894 Resolve color:currentcolor during computing
The keyword value "currentcolor" should be preserved rather than being
replaced by the CSS-wide keyword "inherit" during parsing.
2017-02-28 13:44:50 +11:00
Keith Yeung
7456bcf02b Support lang pseudo class 2017-02-27 17:21:20 -08:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Nazım Can Altınova
78afe2b8d1 Box larger specified values to avoid memmove impact 2017-02-09 11:10:08 +01:00
Bobby Holley
9e860df9df Bug 1336646 - Apply selector flags during traversal. r=emilio 2017-02-08 19:21:05 -08:00
Anthony Ramine
55b2c5c1bd Update selectors to 0.17 2017-02-07 20:33:35 -08:00
Emilio Cobos Álvarez
314f2ce714
style: Define a CascadeLevel enum, and make the rule tree operate on it.
We'll use this level to know where to stop replacing nodes in the tree.
2017-01-30 23:53:53 +01:00
Emilio Cobos Álvarez
31ecc9b692
script: Don't avoid all the mutation notification methods when the style attribute changes.
Styling was correct because of the explicit dirtiness, but still not fun.

Some things, like dynamic updates to with things like [style~="color"] ~ foo
selectors, were pretty broken, because we didn't take snapshots of those
attributes.
2017-01-30 19:24:42 +01:00
Emilio Cobos Álvarez
d37e6f8c66
script: Propagate the attribute into the document's element_attr_will_change method. 2017-01-30 19:24:42 +01:00