Closed Bug 1277773 Opened 10 years ago Closed 6 years ago

Make keyword-value tables generic

Categories

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

defect

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox49 --- affected

People

(Reporter: xidorn, Unassigned)

References

Details

Attachments

(1 file)

To support using enum classes for CSS property enumerated value constants, it would be great if keyword tables could be generic, so that initializing/querying code could be cast-free. In an ideal world, we should store keyword tables in two arrays, one for keywords, and the other for values, as described in bug 1277133 comment 1. But that may need to move the current code into some list file, and use a script to generate code from it, which isn't easy, and the benefits could be marginal. An easier way could be, to make KTableEntry a generic struct but still use int16_t for storing the value. Then we do casting in the constructor and a value() method. (I know this is not completely cast-free, but you would at least no long need to write cast for each value). This looks like the simplest path. I guess we may want to use constexpr for the constructor to ensure we do not encounter runtime static initialization, but that would need a C++11 level constexpr function support first. (I'm looking at you, MSVC2013)
Summary: Make keyword tables generic → Make keyword-value tables generic
Depends on: 1277775
Priority: -- → P3

This is not really needed anymore.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: