Closed Bug 1559546 Opened 5 years ago Closed 5 years ago

Use atoms for grid line names.

Categories

(Core :: CSS Parsing and Computation, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(3 files)

The style system already atomizes all CustomIdent values, which means that we're
just wasting memory and CPU by doing string copies all over the place.

This also simplifies further changes to use as much of the
rust data structures as possible.

Type: defect → task
Depends on: 1559545

I'm going to need it in an upcoming patch.

The style system already atomizes all CustomIdent values, which means that we're
just wasting memory and CPU by doing string copies all over the place.

This patch fixes it. This also simplifies further changes to use as much of the
rust data structures as possible.

I had to switch from nsTHashtable to mozilla::HashTable because the former
doesn't handle well non-default-constructible structs (like NamedLine, which
now has a StyleAtom, which is not default-constructible).

Depends on D35118

Both for symmetry with other string APIs, and also to prevent footguns (since I
debugged for a while a typo where I wrote nsGkAtoms::empty rather than
nsGkAtoms::_empty).

We could use null here, but that will not be possible in the future when I use
the rust representation of more grid data structures (at least without
increasing memory usage).

So I think I'll keep using ::_empty as a signaling value for "no grid
identifier".

Depends on D35119

Blocks: 1559814
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1e5b608b1442
Allow to construct StyleAtom objects from C++. r=heycam
https://hg.mozilla.org/integration/autoland/rev/acf98e967abe
Use atoms for grid line names. r=mats
https://hg.mozilla.org/integration/autoland/rev/8567a308ac7a
Introduce nsAtom::IsEmpty. r=njn
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: