Open Bug 1852908 Opened 2 years ago Updated 10 days ago

Remove mirrored C++ maplike/setlike data structures in Custom Highlight API

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: jjaschke, Assigned: jjaschke)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

Attachments

(3 files)

Custom Highlight API classes Highlight and HighlightRegistry are exposed to JS as setlike / maplike interfaces. However, the contents of the maplike/setlike are accessed from C++.

Currently the webIDL interface only provides the ability to inject code into Add()/Set(), Delete() and Clear(). This allowed to add a mirrored data structure (nsTArray<T> for setlike, nsTArray<CompactPair<K, V>> for maplike) which is accessible from C++ and allows to iterate the contents.

Even if these mirrored data structures are private members of the classes, it imposes the danger of the C++ data becoming out of sync with the original data. To avoid this in a proper way, begin() and end() iterators should be provided by the webIDL code so that C++ code can iterate on the original data without imposing the risk of the data becoming out of sync.

See Also: → 1892589
Assignee: nobody → jjaschke
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: