aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/custom_properties.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace manual iteration with retain()Manish Goregaokar2017-10-231-5/+1
|
* Revert diagnostics code from 12515374597604499d77e4d9da61821f1801a240Manish Goregaokar2017-10-231-2/+0
|
* Revert "Diagnostic map semantics."Manish Goregaokar2017-10-231-11/+6
| | | | This reverts commit f5c5be00a7df984647364dfc84c0c9bc6d3e2f34.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-2/+2
| | | | | | | | 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.
* Rewrite cycle removal algorithm of custom properties and integrate it with ↵Xidorn Quan2017-10-131-150/+221
| | | | substitution
* style: Avoid cloning inherited CustomPropertiesMap when cascading properties ↵Cameron McCormack2017-10-121-3/+47
| | | | with the same value.
* Update to cssparser 0.22 (source location in error types)Simon Sapin2017-10-101-13/+24
|
* style: Optimize custom properties cycle removal.Emilio Cobos Álvarez2017-10-091-17/+25
| | | | | | | | | | After #18791, this is the major custom_properties perf bottleneck in the testcase from bug 1405411. I'm looking into how to efficiently merge this into `substitute_all`, but meanwhile this is worth landing, and makes most of the overhead go away. MozReview-Commit-ID: LMUGc8kPhhE
* style: Share custom property declarations if they don't contain variable ↵Emilio Cobos Álvarez2017-10-091-131/+157
| | | | references.
* style: Don't go through remove_cycles if there are no references in the ↵Emilio Cobos Álvarez2017-10-091-1/+6
| | | | specified values.
* style: Refactor the custom properties map to have less temporary hashmap ↵Emilio Cobos Álvarez2017-10-091-62/+64
| | | | entries.
* style: Rename CustomPropertiesBuilder::custom_properties to something more ↵Emilio Cobos Álvarez2017-10-091-6/+6
| | | | descriptive.
* style: Hoist cascade() to CustomPropertyBuilder.Emilio Cobos Álvarez2017-10-091-59/+42
|
* style: Introduce CustomPropertiesBuilder.Emilio Cobos Álvarez2017-10-081-19/+51
| | | | | I'm about to introduce more state here to implement optimizations for custom property cascading, so this abstraction is useful to encapsulate that state.
* style: Avoid unused `context` argument.Emilio Cobos Álvarez2017-10-081-5/+6
| | | | | | | In custom_properties::SpecifiedValue::parse. It's not a big deal now, but it's useful to simplify testing this stuff, since it avoids forcing us to mock it.
* Diagnostic map semantics.Bobby Holley2017-10-071-6/+11
| | | | MozReview-Commit-ID: C0a5g6xMPY0
* style: Iterate in the expected order in the custom_properties module.Emilio Cobos Álvarez2017-10-051-5/+5
| | | | | | | | | | | | | | In #18745, I replaced a few manual iterations over `index` with the iterator, and it changed the behavior of `layout/style/test/test_variables_order.html`, since it turns out that the iterator iterates right to left. I think this is just an accident that happened due to inconsistencies in how we were iterating over it, and that our behavior was inconsistent (since we iterated rtl in some cases, but ltr in others seems like it'd be inconsistent depending on the depth of the tree and different stuff). This brings back the expected behavior again, and ensures we iterate over a consistent order every time.
* style: Reformat the substitute_block function.Emilio Cobos Álvarez2017-10-041-6/+9
|
* style: Use map_or instead of map(..) == Some(false).Emilio Cobos Álvarez2017-10-041-1/+1
|
* style: Use the OrderedMap iterator instead of doing our own thing.Emilio Cobos Álvarez2017-10-041-5/+2
|
* style: Use the hashmap indexed getter in the custom props iterator code.Emilio Cobos Álvarez2017-10-041-1/+1
| | | | This will give a nicer error message, plus it's more compact.
* style: Use Option<&mut> instead of &mut Option in custom_properties.rsEmilio Cobos Álvarez2017-10-041-11/+18
|
* style: Avoid being so Arc-happy in the custom properties code.Emilio Cobos Álvarez2017-10-011-10/+13
|
* style: Use PrecomputedHasher for custom properties.Emilio Cobos Álvarez2017-09-301-57/+66
|
* Don't use inherited custom properties for substitutionXidorn Quan2017-09-281-13/+6
|
* Measure PropertyDeclaration more thoroughly.Nicholas Nethercote2017-09-141-0/+1
| | | | | | | | | | | | | | | 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.
* Tidy fixesManish Goregaokar2017-09-011-1/+1
|
* stylo: Replace all hashtable collections with ones from style::hashManish Goregaokar2017-08-311-1/+1
|
* style: Remove HasViewportPercentage.Emilio Cobos Álvarez2017-08-291-7/+1
| | | | It's not needed since #18268
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Auto merge of #18025 - servo:line-counting, r=jdmbors-servo2017-08-091-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * Update to cssparser 0.19, count line numbers during tokenizationSimon Sapin2017-08-091-7/+7
| |
* | style: Implement OrderedMapIteratorFernando Jiménez Moreno2017-08-081-18/+56
| |
* | style: Use OrderedMap for specified values too.Emilio Cobos Álvarez2017-08-081-23/+40
| |
* | style: Make the OrderedMap also generic on the value.Emilio Cobos Álvarez2017-08-081-9/+16
| |
* | style: Make ComputedValuesMap a bit more generic.Emilio Cobos Álvarez2017-08-081-9/+12
|/
* Update cssparser to 0.18Simon Sapin2017-07-241-5/+8
| | | | https://github.com/servo/rust-cssparser/pull/171
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | 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).
* stylo: Update rust-cssparser; extract more specific error types when ↵Josh Matthews2017-07-101-4/+4
| | | | reporting (bug 1352669).
* Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout ↵Gecko Backout2017-07-061-4/+4
| | | | | | CLOSED TREE Backs out https://github.com/servo/servo/pull/17624
* stylo: Update rust-cssparser; extract more specific error types when ↵Josh Matthews2017-07-061-4/+4
| | | | reporting (bug 1352669).
* Derive Eq and PartialEq for CustomPropertiesMapFernando Jiménez Moreno2017-06-281-8/+1
|
* stylo: implement indexed and count getters for custom propertiesFernando Jiménez Moreno2017-06-281-18/+77
|
* Untry styleSimon Sapin2017-06-181-23/+22
|
* Auto merge of #17284 - jyc:custom-properties-cascade, r=emiliobors-servo2017-06-161-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -->
| * style: Propagate changes in custom properties' computed values to descendants.Jonathan Chan2017-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Upgrade cssparser to 0.15Simon Sapin2017-06-161-1/+1
|/
* Thread ParseError return values through CSS parsing.Josh Matthews2017-06-091-29/+41
|
* Remove style::values::HasViewportPercentage reexportAnthony Ramine2017-05-201-2/+2
|