Commit graph

122 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
f072c0bb05
style: Use the hashmap indexed getter in the custom props iterator code.
This will give a nicer error message, plus it's more compact.
2017-10-04 14:51:52 +02:00
Emilio Cobos Álvarez
08fd5ba8c1
style: Use Option<&mut> instead of &mut Option in custom_properties.rs 2017-10-04 14:51:51 +02:00
Emilio Cobos Álvarez
2adfd84636
style: Avoid being so Arc-happy in the custom properties code. 2017-10-01 13:27:15 +02:00
Emilio Cobos Álvarez
b7b22b76a8
style: Use PrecomputedHasher for custom properties. 2017-09-30 14:35:38 +02:00
Xidorn Quan
dba19f53f5 Don't use inherited custom properties for substitution 2017-09-28 19:46:53 +10:00
Nicholas Nethercote
c5aa2cb986 Measure PropertyDeclaration more thoroughly.
This patch replaces the handwritten MallocSizeOf implementation for
PropertyDeclaration with a derived one, which gives much more thorough
measurement.

This requires (a) deriving MallocSizeOf for a *lot* of additional types (most
of which already have `derive(HeapSizeOf)` in Servo builds), and (b)
implementing MallocSizeOf for a few more types in the `malloc_size_of` crate.

These changes would significantly improve the reporting coverage for gmail if
it weren't for the fact that SpecifiedUrl isn't measured due to a lack of
clarity about its fields; that can be fixed as a follow-up once bug 1397971 has
landed.
2017-09-14 13:18:03 +10:00
Manish Goregaokar
3ddb1fda74 Tidy fixes 2017-09-01 09:53:18 -07:00
Manish Goregaokar
5cd296a264
stylo: Replace all hashtable collections with ones from style::hash 2017-08-31 16:28:30 -07:00
Emilio Cobos Álvarez
36ff89bd28
style: Remove HasViewportPercentage.
It's not needed since #18268
2017-08-29 23:51:21 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
bors-servo
845131c425 Auto merge of #18025 - servo:line-counting, r=jdm
Update to cssparser 0.19, count line numbers during tokenization

https://github.com/servo/rust-cssparser/pull/177

Also simplify the `ParseErrorReporter` trait a bit.

<!-- 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/18025)
<!-- Reviewable:end -->
2017-08-09 16:16:33 -05:00
Simon Sapin
7382dad939 Update to cssparser 0.19, count line numbers during tokenization 2017-08-09 22:37:16 +02:00
Fernando Jiménez Moreno
ff1e701fa6 style: Implement OrderedMapIterator 2017-08-08 12:26:45 +02:00
Emilio Cobos Álvarez
fd1f14a41e style: Use OrderedMap for specified values too. 2017-08-08 11:55:33 +02:00
Emilio Cobos Álvarez
6d61d62bf4 style: Make the OrderedMap also generic on the value. 2017-08-08 11:55:32 +02:00
Emilio Cobos Álvarez
d48fd2964d style: Make ComputedValuesMap a bit more generic. 2017-08-08 11:55:32 +02:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02: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
Josh Matthews
0b43d0072c stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-10 20:46:12 -04:00
Gecko Backout
32269fa7cc Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
Josh Matthews
f5a3830ea2 stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-06 14:32:37 -04:00
Fernando Jiménez Moreno
0335c09810 Derive Eq and PartialEq for CustomPropertiesMap 2017-06-28 19:50:29 -07:00
Fernando Jiménez Moreno
93f0de7899 stylo: implement indexed and count getters for custom properties 2017-06-28 12:29:56 -07:00
Simon Sapin
a5bb55790f Untry style 2017-06-18 13:18:13 +02:00
bors-servo
81275234aa Auto merge of #17284 - jyc:custom-properties-cascade, r=emilio
Propagate changes in custom properties' computed values to descendants

If ComputedValues.custom_properties differs between the old and new
ComputedValues, indicate that we have to propogate changes to
descendants by setting child_cascade_requirement to
MustCascadeDescendants in cascade_primary.

style::matching::TElement::cascade_primary already calls
accumulate_damage, which eventually calls
ServoRestyleDamage::compute_style_difference in order to check if other
properties' computed values changed. If any of those change, we signal
that we need to propogate changes for inherited properties.

With Properties & Values, some custom properties will not be inherited,
and we will need to revisit this.

---
<!-- 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 #17283

<!-- 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/17284)
<!-- Reviewable:end -->
2017-06-16 11:04:51 -07:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Jonathan Chan
32f62a5ac6 style: Propagate changes in custom properties' computed values to descendants.
If ComputedValues.custom_properties differs between the old and new
ComputedValues, indicate that we have to propogate changes to
descendants by setting child_cascade_requirement to
MustCascadeDescendants in cascade_primary.

style::matching::TElement::cascade_primary already calls
accumulate_damage, which eventually calls
ServoRestyleDamage::compute_style_difference in order to check if other
properties' computed values changed. If any of those change, we signal
that we need to propogate changes for inherited properties.

With Properties & Values, some custom properties will not be inherited,
and we will need to revisit this.
2017-06-13 13:39:37 -07:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Anthony Ramine
cb2e04acf6 Remove style::values::HasViewportPercentage reexport 2017-05-20 22:00:05 +02:00
Bobby Holley
d78ca4c4f9 Use StyleArc in the style system.
MozReview-Commit-ID: flF0fv9E9M
2017-05-02 17:35:44 -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
Xidorn Quan
03f6d21cb5 Make DeclaredValue store CSSWideKeyword
Rather than having separate variant for each CSS-wide keyword.
2017-03-02 11:09:05 +11:00
Nazım Can Altınova
adb6d20293 Box DeclaredValue::WithVariables 2017-02-09 11:10:10 +01:00
Nazım Can Altınova
43731c5757 Box custom property 2017-02-09 11:10:09 +01:00
Emilio Cobos Álvarez
369c2f299e
style: Simplify the cascade function in the custom_properties module. 2017-01-02 12:57:56 +01:00
Emilio Cobos Álvarez
c44826f1cc
style: Document the custom_properties module. 2017-01-02 12:57:56 +01:00
Xidorn Quan
2a502d7377 Store unset keyword as specified value 2016-12-21 10:43:26 +11:00
Ravi Shankar
dee1a65a69 Use the ParserContext along with Parser in the parse function 2016-11-27 08:49:20 +05:30
Artem Biryukov
9564673b5a Fix related to #14101
Add Parse trait implementation for some structures
2016-11-12 05:26:15 +03:00
Ravi Shankar
6061985898 Prefer Servo-specific ToCss for all types 2016-11-07 09:14:22 +05:30
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Emilio Cobos Álvarez
9e88a495c8
style: Introduce a generic way of gathering information from the cascade, and use it for viewport units. 2016-08-16 10:58:16 -07:00
Manish Goregaokar
2091981db8 Some fixes in style 2016-07-12 20:00:24 +05:30
Ms2ger
79e0d18a1d Add some documentation to the style crate. 2016-06-27 17:33:14 +02:00
Simon Sapin
00b6210519 Make the style crate almost build on stable Rust.
`discriminant_value` will need to be replaced with something else later.
2016-06-22 15:44:13 +02:00
Pawel Kondzior
db2e10a70f Report memory usage from LayoutThreadData Stylist [#7038] 2016-03-19 11:53:13 -07:00
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
Alan Jeffrey
3dec6edd10 Update string_cache to 0.2.
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced atom!(foo) by atom!("foo").
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
2015-11-25 10:13:21 -06:00
Simon Sapin
3973085cb6 Fix double /**//**/ 2015-11-06 23:01:55 +01:00
Simon Sapin
40e6cc118e Detect var() in shorthand declarations. 2015-11-06 23:01:54 +01:00