Commit graph

6718 commits

Author SHA1 Message Date
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
bors-servo
8f171058f8 Auto merge of #19035 - nnethercote:bug-1411893, r=emilio
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>.)

<!-- 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 https://bugzilla.mozilla.org/show_bug.cgi?id=1411893

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because tested on the Gecko side.

<!-- 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/19035)
<!-- Reviewable:end -->
2017-10-27 04:34:17 -05: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
Connor Brewster
122626e46b Move table -x-span outisde of mako 2017-10-27 01:09:57 -05:00
CYBAI
cefc622e9b style: Move -x-text-zoom outside of mako 2017-10-27 02:32:59 +08: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
bors-servo
ce890be0b9 Auto merge of #19018 - emilio:scroll-snap, r=wafflespeanut
style: Cleanup a bit the scroll-snap-type properties.

Still not perfect, but at least a bit more consistent.

<!-- 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/19018)
<!-- Reviewable:end -->
2017-10-25 13:24:27 -05:00
Emilio Cobos Álvarez
328f142f38
style: Cleanup a bit the scroll-snap-type properties.
Still not perfect, but at least a bit more consistent.
2017-10-25 20:12:37 +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
bors-servo
f9f71c7ed1 Auto merge of #19005 - emilio:less-mako-more-joy, r=jdm
style: Move animation-name and animation-iteration-count outside of mako.

<!-- 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/19005)
<!-- Reviewable:end -->
2017-10-24 15:29:21 -05:00
Emilio Cobos Álvarez
d972b07822
style: Move animation-name outside of mako. 2017-10-24 22:28:40 +02:00
Emilio Cobos Álvarez
71abec6205
style: Fix spec link for animation-iteration-count. 2017-10-24 22:28:39 +02:00
Emilio Cobos Álvarez
dc414134bf
style: Move animation-iteration-count outside of mako. 2017-10-24 22:28:34 +02:00
Emilio Cobos Álvarez
e5781533c4
style: Remove unused From impl. 2017-10-24 15:31:12 +02:00
Emilio Cobos Álvarez
fd1e2c1f3f
style: Move background-repeat and mask-repeat outside of mako. 2017-10-24 15:31:11 +02:00
Emilio Cobos Álvarez
326f914018
style: Do not require to import ToCss in define_css_keyword_enum. 2017-10-24 14:30:51 +02:00
Emilio Cobos Álvarez
066de9f8d2
style: Minimal ParserContext cleanup.
MozReview-Commit-ID: I1Qgy1W7azU
2017-10-24 12:30:20 +02:00
bors-servo
69b9c221f6 Auto merge of #18995 - Manishearth:rm-diagnostics, r=emilio
Revert all hashmap diagnostics changes

We don't need them anymore

<!-- 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/18995)
<!-- Reviewable:end -->
2017-10-23 19:00:24 -05:00
Manish Goregaokar
44f16452b6
Replace manual iteration with retain() 2017-10-23 14:24:16 -07:00
Manish Goregaokar
f61151a726
Revert diagnostics code from 1251537459 2017-10-23 14:10:52 -07:00
Manish Goregaokar
b118ba72d0 Revert "Diagnostic map semantics."
This reverts commit f5c5be00a7.
2017-10-23 13:51:08 -07:00
Nika Layzell
2d3331fbd4 Move nsstring from gecko into servo/support/gecko/nsstring
This is the servo side of bug 1403213.

MozReview-Commit-ID: HFdQiuMnGhJ
2017-10-23 14:22:42 -04:00
bors-servo
eaba7ede23 Auto merge of #18988 - emilio:qs, r=heycam
stylo: querySelector / querySelectorAll machinery.

Bug: 1410624
Reviewed-by: heycam

<!-- 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/18988)
<!-- Reviewable:end -->
2017-10-23 08:14:35 -05:00
bors-servo
6381fdf750 Auto merge of #18989 - emilio:all-is-sad, r=xidorn
style: Ensure logical longhands appear before their physical counter-part.

Bug: 1410028
Reviewed-by: xidorn
MozReview-Commit-ID: KPIbt1e2Eq

<!-- 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/18989)
<!-- Reviewable:end -->
2017-10-23 05:34:49 -05:00
Emilio Cobos Álvarez
b8021335d7
style: Ensure logical longhands appear before their physical counter-part.
Bug: 1410028
Reviewed-by: xidorn
MozReview-Commit-ID: KPIbt1e2Eq
2017-10-23 08:37:49 +02:00
Xidorn Quan
9c23594e74 Remove XBL as a separate cascading level in Stylo.
In Gecko, we handle XBL rules like author rules everywhere, except that
XBL rules are added and sorted in an independent step, behave as if it
has a separate level.

It is not clear to me why Stylo chose to add a separate level for XBL
rules, but it doesn't seem that there is anything special to do with
XBL rules.

This bug happens because we don't handle XBL important rules which are
handled as part of author rules in Gecko due to lack of the additional
level there. We should just follow what Gecko does here and handle them
all the same.
2017-10-23 17:34:34 +11:00
Emilio Cobos Álvarez
9a804f68f9
style: Update bindings. 2017-10-23 08:32:00 +02:00
Emilio Cobos Álvarez
644b502b0d
style: Ensure QuerySelector only processes the light tree.
MozReview-Commit-ID: 7Nw1SEuWNaC
2017-10-23 08:27:50 +02:00
Emilio Cobos Álvarez
dd7196949f
style: Don't use the invalidation machinery unless we may get some benefit from it.
MozReview-Commit-ID: 8Wpn2bjuHBQ
2017-10-23 08:27:49 +02:00
Emilio Cobos Álvarez
d73af807b7
style: Add a few QuerySelector fast-paths.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:27:46 +02:00
Emilio Cobos Álvarez
2274fd7ef3
style: Refactor querySelector to be generic over the query type, and implement a tree-walking variant of it.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:25:09 +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
6d78e9ba54
style: Add a very simple invalidation-based querySelector.
MozReview-Commit-ID: Fimc8tz4OWX
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:22:52 +02:00
Emilio Cobos Álvarez
7f5536d5bc
style: Ensure invalidated_self is called at most once per element.
MozReview-Commit-ID: 1M0WuAduqun
2017-10-23 08:22:51 +02:00
Emilio Cobos Álvarez
bd2a82334b
style: Don't look at user and author rules if the element can't be affected by them.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:22:50 +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
Emilio Cobos Álvarez
258efb70df
style: Move MatchingContext to the InvalidationProcessor.
This avoids threading the quirks mode and nth-index cache around, and prevents
having to thread even more arguments down for the querySelector stuff (at least
VisitedHandlingMode and the style scope).

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:22:48 +02:00
Emilio Cobos Álvarez
5ac0f5121e
style: Add a way to add self-invalidations to the initial collection.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:22:47 +02:00
Emilio Cobos Álvarez
191c39f28c
style: Make invalidations with offset zero "universal" invalidations.
We'll use this for querySelector / querySelectorAll.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-10-23 08:22:46 +02:00
bors-servo
338956461c Auto merge of #18972 - mbrubeck:ok, r=emilio
Remove unnecessary Result::ok calls

- [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 they are code cleanup 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/18972)
<!-- Reviewable:end -->
2017-10-21 11:06:08 -05:00
bors-servo
5ab0ac1620 Auto merge of #18971 - mbrubeck:var, r=emilio
Use env::var_os to read paths from the environment

This avoids unnecessary UTF-8 validation on OsStrings that we just pass
back to the OS.

---
- [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 they are code cleanup 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/18971)
<!-- Reviewable:end -->
2017-10-21 08:09:22 -05:00
bors-servo
48c715c1c8 Auto merge of #18966 - chenpighead:Bug1399049-transform-animate-refactoring, r=hiikezoe
stylo: Avoid using InterpolateMatrix as a fallback for matched transform function pair

In the current implementation, if there is any interpolation error in a matched
transform function pair, we fall-back to use InterpolateMatrix unconditionally.
However, the error could be caused by:

1. mismatched transform function pair
2. matched transform function pair within at least one undecomposable matrix.

Using InterpolateMatrix for case 1 makes sense, however, using InterpolateMatrix
for case 2 does not. According to the spec, we should just report error for
case 2, and let the caller do the fallback procedure. Using InterpolateMatrix
for case 2 will go through more unnecessary code path, and produce more memory
usage and calculation cost, which should be avoidable.

In this patch, we add an extra pass to check if a transform function pair have
matched operations in advance. With this information, we can easily tell whether
the interpolation error in a equal-length transform function pair is caused by
case 1 or case 2. So, we can avoid the unnecessary cost.

---
<!-- 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 [Bug 1399049](https://bugzilla.mozilla.org/show_bug.cgi?id=1399049)
- [X] These changes do not require tests because the change is for some performance gain, and we have tests to ensure that we won't regress the existing behavior already.

<!-- 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/18966)
<!-- Reviewable:end -->
2017-10-21 01:39:41 -05:00
Gecko Backout
662b2e7397 Backed out changeset 196206f129ef (bug 1403213) for referencing non-existing xpcom/rust/gtest/moz.build in xpcom/moz.build. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18941
2017-10-20 19:33:29 +00:00
bors-servo
7e0f5afa83 Auto merge of #18941 - mystor:nsstring, r=mystor
Move nsstring from gecko into servo/support/gecko/nsstring

This is the servo side of bug 1403213.

This cannot merge until https://bugzilla.mozilla.org/show_bug.cgi?id=1377351 merges. It is currently on inbound. This will break autoland when it merges until the gecko-side part has also landed.

<!-- 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/18941)
<!-- Reviewable:end -->
2017-10-20 12:32:05 -05:00
Matt Brubeck
9cadf0981a Remove unnecessary Result::ok calls 2017-10-20 09:11:38 -07:00