Give nsStyleContent contents iterator style interface

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
P3
normal
2 years ago
10 months ago

People

(Reporter: xidorn, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox51 affected)

Details

(Reporter)

Description

2 years ago
nsStyleContent has three iterable lists: mContents, mIncrements, and mResets. Currently, users of nsStyleContent need to get the length of the list first, then query items individually via specific method.

It would be great if the items can be iterated via range-for, which would significant the code. e.g.
> for (nsStyleContentData& data : styleContent.Contents()) {
>   doSomething(data);
> }

To have this, we would need to create three methods which returns a pointer range which implements begin() and end(), so that range-for can be used with it.
(Reporter)

Comment 1

2 years ago
Actually we would need 6 methods, 3 for const and 3 for non-const.

Updated

10 months ago
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.