Commit graph

816 commits

Author SHA1 Message Date
Boris Chiou
190cd5b952 Bug 1374233 - Part 5: Use NonNegativeLength and NonNegativeAu for border-spacing.
We already have NonNegativeLength and NonNegativeAu, so we can re-use it
to define the specified value and the computed value of border-spacing.
And then implement ToAnimatedValue for it.

MozReview-Commit-ID: CLckpKMYVXU
2017-08-04 14:22:36 +08: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
7b134440fc Auto merge of #17614 - cbrewster:custom_element_reactions, r=jdm
Implement custom element reactions

<!-- Please describe your changes on the following line: -->
Initial work for implementing custom element reactions: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions

---
<!-- 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 #17433 (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/17614)
<!-- Reviewable:end -->
2017-07-17 22:58:53 -07:00
Connor Brewster
4665991503 Support custom element callback reactions 2017-07-17 22:23:45 -06:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
Connor Brewster
37e8b89377 Allow element prefix to be set
Implements step 6.1.10 of
https://dom.spec.whatwg.org/#concept-create-element
2017-06-23 21:10:01 -06:00
Connor Brewster
062b128688 Add flag for sync/async CE creation 2017-06-23 21:09:57 -06:00
Connor Brewster
2f36d3544f Support is option when creating elements 2017-06-23 21:09:55 -06:00
bors-servo
626c029623 Auto merge of #17385 - pyfisch:better-scroll, r=mrobinson
Fix several bugs related to scrolling

* scrollLeft/scrollTop returned values of parent or even document root
   Only the scroll of the node itself is returned. Otherwise 0.0.
* Scrolling via script had set viewport.
   This resulted in other nodes appearing scrolled.
   Now scroll_offsets are updated with correct node id.

These bugs caused other odd behavior like both body and
document.documentElement being scrolled or the view for scrolled
elements jumping.

Also try scrolling this [example page](https://pyfisch.org/stuff/scrolltest.html) in servo with and without this change.

<!-- 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
- [x] These changes fix #17342 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes (partially)

<!-- 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/17385)
<!-- Reviewable:end -->
2017-06-23 01:50:39 -07:00
bors-servo
b211664e87 Auto merge of #17439 - bholley:compound_left_to_right, r=SimonSapin
Match compound selectors left-to-right (second try)

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

<!-- 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/17439)
<!-- Reviewable:end -->
2017-06-21 09:28:43 -07:00
Bobby Holley
db8f59407f Hoist sink into selectors.
It probably makes more sense (eventually) to put it in SmallVec.

MozReview-Commit-ID: AIBKCLiMNN2
2017-06-20 11:59:10 -07:00
Connor Brewster
2ccf729aa3 Fix crash when id attribute is set via SetAttributeNode 2017-06-20 10:34:33 -06:00
Pyfisch
284cb8aae8 Fix several bugs related to scrolling
* scrollLeft/scrollTop returned values of parent or even document root
   Only the scroll of the node itself is returned. Otherwise 0.0.
* Scrolling via script had set viewport.
   This resulted in other nodes appearing scrolled.
   Now scroll_offsets are updated with correct node id.

These bugs caused other odd behavior like both body and
document.documentElement being scrolled or the view for scrolled
elements jumping.
2017-06-19 21:43:35 +02:00
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Emilio Cobos Álvarez
cb06375fe2
style: Implement a more fine-grained invalidation method.
This commit also removes the old restyle_hints module and splits it into
multiple modules under components/style/invalidation/element/.

The basic approach is to walk down the tree using compound selectors as needed,
in order to do as little selector-matching as possible.

Bug: 1368240
MozReview-Commit-ID: 2YO8fKFygZI
2017-06-13 13:26:41 +02:00
Simon Sapin
c5c1c1b350 Classes/IDs case-sensitivity: get quirks mode from matching context. 2017-06-13 00:27:41 +02:00
Simon Sapin
5bccf98aa4 ID and class selectors are ASCII case-insensitive in quirks mode.
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
2017-06-12 23:33:53 +02:00
Bobby Holley
a98fff1af8 Hoist ApplicableDeclaration{Block,List} into a separate file.
MozReview-Commit-ID: EXnAzfyoZ1e
2017-06-12 12:13:21 -07:00
Nazım Can Altınova
15fe48f3f6
stylo: Support :hover and :active quirk 2017-06-10 22:18:32 +03:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
bors-servo
24e944ad94 Auto merge of #17219 - upsuper:currentcolor, r=Manishearth,birtles
Support interpolation between currentcolor and numeric color

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

<!-- 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/17219)
<!-- Reviewable:end -->
2017-06-07 21:03:52 -07:00
Xidorn Quan
7568a19688 Merge CSSColor into Color. 2017-06-08 12:59:22 +10:00
Cameron McCormack
524794c09a script: Move extended_filtering to the style crate.
We'll need to call it from the style crate in later patches, when matching
:lang() against element snapshots.
2017-06-08 09:37:09 +08:00
Xidorn Quan
d0d170767d Unify specified Color type between Stylo and Servo. 2017-06-08 10:42:24 +10:00
J. Ryan Stinnett
6b1b8bbee8 Log element during selector matching
MozReview-Commit-ID: D8eFyRCy5BR
2017-06-07 14:23:53 -05:00
Bobby Holley
713c9a63f6 Move the ancestor hashes out of Selector.
MozReview-Commit-ID: 5mipXnjgSED
2017-06-05 19:43:58 -07:00
Anthony Ramine
7da94d0880 Use BorderSideWidth for outline-width 2017-06-02 10:53:27 +02:00
J. Ryan Stinnett
e3a256803d Look for relevant links while matching
Adjust the matching process to look for a "relevant link" while matching.  A
"relevant link" is the element being matched if it is a link or the nearest
ancestor link.

Matching for links now depends on the `VisitedHandlingMode`, which determines
whether all links match as if they are unvisited (the default) or if the
relevant link matches as visited (and all others remain unvisited).

If a relevant link is ever found for any selector, track this as part of the
`MatchingContext` object.  This is used in the next patch to determine if an
additional match and cascade should be performed to compute the styles when
visited.

MozReview-Commit-ID: 3xUbRo7vpuD
2017-05-24 18:07:24 -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
Simon Sapin
7149a6a29d ol[type=…] and li[type=…] preshints need to be case-sensitive 2017-05-18 17:13:18 +02:00
Simon Sapin
c5e37f3d2c Remove unused selectors::Element::each_class 2017-05-18 17:13:14 +02:00
Simon Sapin
9376abdd2c Shrink selectors::Component, add case-insensitive for other attr selectors
* https://bugzilla.mozilla.org/show_bug.cgi?id=1364148
* https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
2017-05-18 17:13:14 +02:00
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