Closed Bug 1989215 Opened 1 year ago Closed 11 months ago

Sanitizer: Use unordered sets and a map instead of lists

Categories

(Core :: DOM: Security, task)

task

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

(Blocks 1 open bug, )

Details

Attachments

(3 files)

The Sanitizer API works on lists, but those lists behave more like sets, because they shouldn't really have duplicates. And during the core sanitization work, it's important to be able to quickly check if a specific element is part of the list. Both of these indicate properties really call for a a hash set, but sadly we have to maintain the insertion order, which is observable via the get() method...

Additionally for the elements case (SanitizerElementNamespaceWithAttributes), we have something that is more similar to a map in practice. It maps (namespace, localname) to (attributes, removeAttributes).

Blocks: 1954437
Assignee: nobody → tschuster

We are going to sort the result of get(), so we can go back to using unordered sets.

Summary: Implement an Ordered Set for use in the Sanitizer API → Sanitizer: Use unordered sets and a map instead of lists
Attachment #9517552 - Attachment description: WIP: Bug 1989215 - Sanitizer: Use unordered sets and a map instead of lists → Bug 1989215 - Sanitizer: Use unordered sets and a map instead of lists. r?smaug
Attachment #9517719 - Attachment description: WIP: Bug 1989215 - Sanitizer: Throw on duplicates. → Bug 1989215 - Sanitizer: Throw on duplicates. r?smaug
Attachment #9517738 - Attachment description: WIP: Bug 1989215 - Sanitizer: Sort the result of the get() method → Bug 1989215 - Sanitizer: Sort the result of the get() method. r?smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/55497 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c147/b146]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: