aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko_string_cache
Commit message (Collapse)AuthorAgeFilesLines
* Miscellaneous build / tidy fixes.Emilio Cobos Álvarez2021-02-262-1/+8
|
* style: Avoid some allocations in selector serialization.Emilio Cobos Álvarez2021-02-262-16/+1
| | | | | | | The allocations in display_to_css_identifier show up in the profiles of bug 1675628. Differential Revision: https://phabricator.services.mozilla.com/D97856
* style: Gracefully handle errors creating shared memory UA style sheets.Cameron McCormack2020-06-041-10/+10
| | | | | | | | | | | | We still panic in a debug build, so that developers can notice when they need to add a new static atom after modifying UA sheets. We also add telemetry to note when this happens, add an app note to a crash report, in case any crash later on occurs, and re-up the existing, expired shared memory sheet telemetry probes so we can look at them again. Differential Revision: https://phabricator.services.mozilla.com/D73188
* style: Reformat recent changes.Emilio Cobos Álvarez2020-04-161-1/+12
|
* style: Ensure that derived types are right for optimized-away implementations.Emilio Cobos Álvarez2020-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | We have this optimization where, for non-generic structs, we generate just a clone / move as the ToComputedValue / ToResolvedValue implementation. This moves the optimization a bit further down, and refines it so that we still generate all the relevant where clauses that make it sound, that is, that all the ToComputedValue implementations of the fields return the same type. Otherwise this wouldn't be sound and the type would need to become generic. We add an escape hatch (no_field_bound) for fields that need to be cloned but which don't implement the trait. This is right now only for the RefPtr<> in the shared font-family list, and a piece of code in PaintWorklet which looks kinda fishy, and probably should be fixed (but we don't ship it in Firefox and there's a pre-existing FIXME for servo, so I punted on it for now). The other thing this patch does is adding a bunch of ToComputedValue / ToResolvedValue implementations that are trivial and were missing. Differential Revision: https://phabricator.services.mozilla.com/D67913
* style: Use cbindgen for content property.Emilio Cobos Álvarez2020-02-121-0/+1
| | | | | | | | | | | This cleans up and also allows us to keep the distinction between content: none and content: normal, which allows us to fix the computed style we return from getComputedStyle(). Do this last bit from the resolved value instead of StyleAdjuster, because otherwise we need to tweak every initial struct for ::before / ::after. Differential Revision: https://phabricator.services.mozilla.com/D58276
* style: Rustfmt recent changes.Emilio Cobos Álvarez2019-11-301-1/+2
|
* style: Make Rust static atoms able to be used in const contexts.Emilio Cobos Álvarez2019-11-301-14/+18
| | | | | | | | | | | | | | | | | | I see atom dropping code generated in release builds for stuff like dropping the "class" atom here: https://searchfox.org/mozilla-central/rev/4df8821c1b824db5f40f381f48432f219d99ae36/servo/components/style/gecko/wrapper.rs#592 That is silly, and I hope making Atom be able to be used in const context will help the compiler see that yeah, we're not doing anything interesting and the atom shouldn't get dropped. It also allows us to get rid of a few lazy_static!s, so we should do it anyway. In order to accomplish this, compute the offset into gGkAtoms manually instead of going through the static_atoms() array and then back to the byte offset. Differential Revision: https://phabricator.services.mozilla.com/D55039
* style: Make rust Atom use NonZeroUsize.Emilio Cobos Álvarez2019-11-301-8/+9
| | | | | | | | | | | At first I thought this was going to enable simplifications in the selector parser (to simplify the attribute selector setup), but I couldn't end up shrinking the layout enough. However this should help with bug 1559076, which returns Option<Atom>, and it was easy to write. Differential Revision: https://phabricator.services.mozilla.com/D53766
* Stylo: replace uses of mem::uninitialized with MaybeUninitSimon Sapin2019-07-161-2/+4
| | | | MozReview-Commit-ID: KGhYL6DJRaR
* style: Share computed and specified value representation of ↵Emilio Cobos Álvarez2019-05-291-0/+1
| | | | | | -moz-context-properties. Differential Revision: https://phabricator.services.mozilla.com/D30545
* style: Reformat recent changes.Emilio Cobos Álvarez2019-04-121-1/+5
|
* style: Add derived ToShmem implementations.Cameron McCormack2019-04-121-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17197
* style: Add ToShmem impl for Atom.Cameron McCormack2019-04-121-1/+11
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17192
* style: Document a few more macros.Emilio Cobos Álvarez2019-01-131-0/+2
|
* style: Rustfmt recent changes.Emilio Cobos Álvarez2019-01-111-2/+2
|
* style: Make GkAtoms opaque to avoid lld-link.exe errors.Cameron McCormack2019-01-111-3/+26
| | | | Differential Revision: https://phabricator.services.mozilla.com/D15800
* style: Use atom handles in favour of atom pointers in style system code.Cameron McCormack2019-01-111-26/+78
| | | | Differential Revision: https://phabricator.services.mozilla.com/D15078
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-192-2/+2
|
* style: Add an atom bit to know whether we're ascii lowercase.Emilio Cobos Álvarez2018-11-171-32/+44
| | | | | | | | | | | And thus massively speed up ascii-case-insensitive atom comparisons when both atoms are lowercase (which is the common case by far). This removes almost all the slow selector-matching in this page, and it seems an easier fix than storing the lowercased version of all class-names in quirks mode in elements and selectors... Differential Revision: https://phabricator.services.mozilla.com/D10945
* style: Remove dynamic HTML5 atoms.Emilio Cobos Álvarez2018-11-101-2/+2
| | | | | | Co-authored-by: Nicholas Nethercote <nnethercote@mozilla.com> Differential Revision: https://phabricator.services.mozilla.com/D11035
* `cargo fix --edition --features gecko`Simon Sapin2018-11-102-7/+7
|
* Reorder importsPyfisch2018-11-061-1/+1
|
* style: Make static atom pointers `constexpr`.Nicholas Nethercote2018-10-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This saves one word per static atom, per process. The `nsGkAtoms` change is only a small part of this commit. In regen_atoms.py: - There is now only one link name per platform: nsGkAtoms::sAtoms[]. - But there is a new constant per atom, giving the index into nsGkAtoms::sAtoms[]. - And the `atom!` macro for each atom indexes into nsGkAtoms::sAtoms[] using the index constant. - A couple of `*mut` pointers are now `*const`. Elsewhere, the `(nsStaticAtom*)` casts within the `AppendElement()` calls are necessary to avoid link errors, presumably due to some template instantiation wrinkle. Bug: 1449787 Reviewed-by: froydnj,emilio
* style: Manually inline class and ID getters.Emilio Cobos Álvarez2018-08-181-1/+1
| | | | | | | Somewhat ugly but hopefully not too much. Somehow it ends up removing more lines than adding. Differential Revision: https://phabricator.services.mozilla.com/D3536
* style: Remove unused BorrowedAtom.Cameron McCormack2018-08-181-4/+0
| | | | Differential Revision: https://phabricator.services.mozilla.com/D3159
* Store nsDynamicAtom's chars after the end of the object.Nicholas Nethercote2018-06-231-1/+2
| | | | | | | | | | | | | | | | This reduces memory usage because we only need one allocation instead of two for the dynamic atom and its chars, and because we don't need to store a refcount and a size. It precludes sharing of chars between dynamic atoms, but we weren't benefiting much from that anyway. This reduces per-process memory usage by up to several hundred KiB on my Linux64 box. One consequence of this change is that we need to allocate + copy in DOMString::SetKnownLiveAtom(), which could make some things slower. Bug: 1447951 Reviewed-by: froydnj
* style: Add a ValueInfo trait for exposing types needed by devtools.Xidorn Quan2018-04-291-0/+3
| | | | | | | | | | | | Most of types just derive it using proc_macro directly. Some of value types need manual impl. In my current plan, this new trait will be used in bug 1434130 to expose values as well. Bug: 1455576 Reviewed-by: emilio MozReview-Commit-ID: LI7fy45VkRw
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-102-53/+56
| | | | | | | | | | This was generated with: ./mach cargo fmt --package selectors && ./mach cargo fmt --package servo_arc && ./mach cargo fmt --package style Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
* Statically allocate static atoms.Nicholas Nethercote2018-03-261-5/+15
|
* style: Remove unsound Atom From implementations.Emilio Cobos Álvarez2018-03-191-28/+18
| | | | Fixes #20158
* style: remove unused AsciiExt imports.Emilio Cobos Álvarez2018-03-041-1/+0
| | | | eq_ignore_ascii_case is not in AsciiExt since rustc 1.23.
* style: Optimize serialization of identifiers of length <= 16 🐉🐲Emilio Cobos Álvarez2018-02-071-15/+31
| | | | | | | Much like we optimize to_ascii_lowercase. This also fixes a bug in Servo where attr() rules with an unknown namespace prefix are parsed, which is wrong.
* style: Remove some uses of unused unsafe.Emilio Cobos Álvarez2017-11-151-3/+1
|
* Allow unused imports for AsciiExt in style code.Simon Sapin2017-11-091-1/+1
| | | | See #19128, this part is cherry-picked so Gecko can build with rust nightly.
* Introduce nsStaticAtom.Nicholas Nethercote2017-10-271-2/+12
| | | | | | | 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>.)
* Rename `size_of_is_0!` as `malloc_size_of_is_0!`.Nicholas Nethercote2017-10-181-1/+1
| | | | | The new name makes it clearer that it comes from the `malloc_size_of` crate.
* Rename nsIAtom as nsAtom.Nicholas Nethercote2017-10-092-19/+19
| | | | | | Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of nsISupports. This means that nsAtom is now a better name for it than nsIAtom.
* Update ns[C]String::from -> ns[C]Str::from where possibleMichael Layzell2017-09-261-2/+2
|
* Measure PropertyDeclaration more thoroughly.Nicholas Nethercote2017-09-141-1/+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.
* Overhaul MallocSizeOf and related things.Nicholas Nethercote2017-09-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Harden assert for creating atom from raw pointer.Xidorn Quan2017-08-301-2/+2
|
* order derivable traits listsClément DAVID2017-08-232-2/+2
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* stylo: Devirtualize nsIAtom refcounting.Emilio Cobos Álvarez2017-08-091-2/+2
| | | | | | Bug: 1362338 Reviewed-by: froydnj MozReview-Commit-ID: 3q5rz3L8quQ
* stylo: We've had bitfield accessors for a while now.Emilio Cobos Álvarez2017-08-081-4/+1
|
* stylo: Read mName as a raw nsIAtom* from NodeInfoInner.Ehsan Akhgari2017-07-241-1/+1
|
* Update cssparser to 0.18Simon Sapin2017-07-241-3/+3
| | | | https://github.com/servo/rust-cssparser/pull/171
* style: Clean up after #17427.Emilio Cobos Álvarez2017-06-201-1/+2
|
* Untry styleSimon Sapin2017-06-181-1/+1
|
* ID and class selectors are ASCII case-insensitive in quirks mode.Simon Sapin2017-06-121-23/+23
| | | | https://bugzilla.mozilla.org/show_bug.cgi?id=1363778