Re: using enum classes for enumerated CSS property values in nsStyleConsts.h

Xidorn Quan <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout
Message-ID <CAMdq69_pPk1cNq33XpaMFetdO9fBP0=p8DPt6VppYJJ3WJokYg@mail.gmail.com>
On Wed, Nov 11, 2015 at 5:40 PM, L. David Baron <[email protected]> wrote:
> On Wednesday 2015-11-11 17:29 +1100, Xidorn Quan wrote:
>> On Wed, Nov 11, 2015 at 5:07 PM, L. David Baron <[email protected]> wrote:
>> > 2. Casts
>> > ========
>> >
>> > Does anybody see a good way to eliminate the casts I needed to use
>> > in the main patch (described in the patch header)?
>>
>> We can probably make them templates?
>
> How?

Ahh, I forgot that KTableValue is a single value which accepts both
keywords and computed constants.

We may want to replace KTableValue[2] with a struct template like

template<typename T>
struct KTableItem
{
  nsCSSKeyword keyword;
  T value;
};

and convert all functions which accept KTables to templates.

It would be a much larger change, though.

- Xidorn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.