| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
|
|
|
| |
context.
|
|
|
|
|
|
| |
cross the shadow boundary.
MozReview-Commit-ID: EY9nK3169vv
|
|
|
|
|
|
| |
Bug: 1425757
Reviewed-by: xidorn
MozReview-Commit-ID: G0I0gM2sWTh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without turning it on yet, of course.
The reason why I didn't use the general PseudoElement mechanism is because this
pseudo is a bit of its own thing, and I found easier to make ::selectors know
about it (because you need to jump to the assigned slot) than the other way
around.
Also, we need to support ::slotted(..)::before and such, and supporting multiple
pseudo-elements like that breaks some other invariants around the SelectorMap,
and fixing those would require special-casing slotted a lot more in other parts
of the code.
Let me know if you think otherwise.
I also don't like much the boolean tuple return value, but I plan to do some
cleanup in the area in a bit, so it should go away soon, I'd hope.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
style: Move the code to parse a list of compound selectors.
I'll need this for ::slotted().
<!-- 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/19536)
<!-- Reviewable:end -->
|
| |
| |
| |
| | |
I'll need this for ::slotted().
|
|/
|
|
| |
Also drop a few FIXMEs while at it, since they look bogus.
|
| |
|
|
|
|
|
|
|
| |
These methods are instantiated by the Gecko library, and used during
querySelector, which means that they end up being super-hot in micro-benchmarks.
MozReview-Commit-ID: K1XJb0QyX5a
|
|
|
|
| |
See #19128, this part is cherry-picked so Gecko can build with rust nightly.
|
|
|
|
|
| |
I was doing something unrelated with this code, and each signature uses a
different style. This PR unifies them.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This will make easier to create external invalidations, and also makes reasoning
about the invalidator a bit easier.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf
stuff already in Servo, except better. In particular, it adds deriving support
for MallocSizeOf, which will make it easier to improve coverage.
The patch does the following.
- Combines servo/components/style/stylesheets/memory.rs and the heapsize crate
into a new crate, malloc_size_of.
- Forks the heapsize_derive crate, calling it malloc_size_of, so that
MallocSizeOf can be derived.
- Both the new crates have MIT/Apache licenses, like heapsize, in case they are
incorporated into heapsize in the future.
- Renames the methods within MallocSizeOf and the related traits so they are
more concise.
- Removes MallocSizeOfWithGuard.
- Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an
equivalent or almost-equivalent hand-written implementation.
- Adds stuff so that Rc/Arc can be handled properly.
|
|
|
|
|
|
|
|
|
| |
This patch adds measurement of Selectors within StyleRule. This requires
exposing the pointer within ThinArc.
The patch also adds measurement of the several CssRule variants, in order to
measure nested CssRules (and PropertyDeclarationBlocks) within them:
DocumentRule, MediaRule, PageRule, SupportsRule.
|
| |
|
|
|
|
|
|
| |
combinators in between universal selectors.
MozReview-Commit-ID: EyVrSAICPm
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Gecko’s CSS parsing microbenchmarks before:
```
43.437 ± 0.391 ms Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
29.244 ± 0.042 ms Stylo.Gecko_nsCSSParser_ParseSheet_Bench
281.884 ± 0.028 ms Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
426.242 ± 0.008 ms Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```
After:
```
29.779 ± 0.254 ms Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench
28.841 ± 0.031 ms Stylo.Gecko_nsCSSParser_ParseSheet_Bench
296.240 ± 4.744 ms Stylo.Servo_DeclarationBlock_SetPropertyById_Bench
293.855 ± 4.304 ms Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench
```
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove unused selector visitor argument.
The real win here is avoiding cloning the iterator when nobody actually uses it.
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [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/18225)
<!-- Reviewable:end -->
|
| | |
|
|/
|
|
|
|
| |
Ignoring :
- **generated**.rs
- python/tidy/servo_tidy_tests/rust_tidy.rs
|
| |
|
| |
|
|
|
|
| |
This is all the ones I could find in style/ and selectors/.
|
| |
|
|
|
|
| |
https://github.com/servo/rust-cssparser/pull/171
|
|
|
|
|
|
|
|
|
| |
It's incorrect to track classes and id selectors in a quirks-mode document,
since they should match case-insensitively.
Bug: 1382812
Reviewed-by: bholley
MozReview-Commit-ID: 4uvrfYsWb1v
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Simplify <an+b> in selector args when serializing.
<!-- 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 is part of a series to fix #17182
<!-- Either: -->
I am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.
- [ ] 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/17539)
<!-- Reviewable:end -->
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If omitting the universal selector in the serialization is possible, we
should do it so we obtain a shorter serialization (to match the behavior
asserted in cssom/serialize-namespaced-type-selectors.html).
For example, if someone writes *|*::before and there is no default
namespace, we should serialize to ::before; however, if there is a
default namespace, we should serialize to *|*::before.
(This is the test case "Universal selector in any namespace followed by
pseudo element).
This matches the behavior implemented by WebKit; that one case in
particular isn't implemented by Gecko, but other cases where the
universal selector should be elided are implemented by Gecko but were not
previously by Servo.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Once again it seems we don't need to preserve the original prefix name,
and this lets to_css serialize to the shortest form when there is no
default namespace and the *| prefix is used.
Selectors § 6.1.1 says:
Element type selectors that have no namespace component (no namespace
separator) represent elements without regard to the element's namespace
(equivalent to "*|") unless a default namespace has been declared for
namespaced selectors (e.g. in CSS, in the style sheet). If a default
namespace has been declared, such selectors will represent only elements
in the default namespace.
Then if there is no default namespace, *| (which we write as
QNamePrefix::ExplicitAnyNamespace) is equivalent to what we write as
QNamePrefix::ImplicitAnyNamespace; the latter has a shorter
serialization, so we should use that.
|
|/
|
|
|
|
|
|
|
|
|
| |
DefaultNamespace.
It seems we don't need to preserve the original prefix name, and this
conveniently leads to_css to now implement CSSOM's requirement to elide
the namespace prefix during serialization when it maps to the default
namespace.
https://drafts.csswg.org/cssom/#serialize-a-simple-selector
|
| |
|
|
|
|
|
|
| |
Dependencies are very numerous, and now we shouldn't be getting so many of them.
Style rules just don't need them, so it's a waste of memory.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Implement CSSStyleRule.selectorText.
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
https://github.com/w3c/csswg-drafts/issues/1511
Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.
See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors
CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
<!-- 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 is part of a series to fix #17182
<!-- Either: -->
I am running this to identify what tests will fail; as the other PRs in the series are merged, I believe the tests that pass will change as well.
- [ ] 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/17538)
<!-- Reviewable:end -->
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
https://github.com/w3c/csswg-drafts/issues/1511
Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.
See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors
CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
|
| |
| |
| |
| | |
single-colon syntax.
|
| | |
|
|/ |
|