2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2006-03-25 08:47:31 +03:00
|
|
|
/*
|
|
|
|
* methods for dealing with CSS properties and tables of the keyword
|
|
|
|
* values they accept
|
|
|
|
*/
|
|
|
|
|
2017-02-14 22:23:11 +03:00
|
|
|
#include "nsCSSProps.h"
|
|
|
|
|
2013-12-09 06:52:54 +04:00
|
|
|
#include "mozilla/ArrayUtils.h"
|
2018-03-06 20:34:04 +03:00
|
|
|
#include "mozilla/Casting.h"
|
2011-10-11 09:50:08 +04:00
|
|
|
|
1999-07-18 04:32:32 +04:00
|
|
|
#include "nsCSSKeywords.h"
|
Bug 773296 - Part 2: Parse CSS variable declarations and store them on Declaration objects. p=ebassi,heycam r=dbaron
Patch co-authored by Emmanuele Bassi <ebassi@gmail.com>
This defines a CSSVariableDeclarations class that holds a set of
variable declarations. This is at the specified value stage, so values
can either be 'initial', 'inherit' or a token stream (which is what you
normally have). The variables are stored in a hash table. Although
it's a bit of a hack, we store 'initial' and 'inherit' using special
string values that can't be valid token streams (we use "!" and ";").
Declaration objects now can have two CSSVariableDeclarations objects
on them, to store normal and !important variable declarations. So that
we keep preserving the order of declarations on the object, we inflate
mOrder to store uint32_ts, where values from eCSSProperty_COUNT onwards
represent custom properties. mVariableOrder stores the names of the
variables corresponding to those entries in mOrder.
We also add a new nsCSSProperty value, eCSSPropertyExtra_variable, which
is used to represent any custom property name.
nsCSSProps::LookupProperty can return this value.
The changes to nsCSSParser are straightforward. Custom properties
are parsed and checked for syntactic validity (e.g. "var(a,)" being
invalid) and stored on the Declaration. We use nsCSSScanner's
recording ability to grab the unparsed CSS string corresponding to
the variable's value.
2013-12-12 06:09:40 +04:00
|
|
|
#include "nsLayoutUtils.h"
|
1999-07-18 04:32:32 +04:00
|
|
|
#include "nsStyleConsts.h"
|
2009-04-02 01:59:02 +04:00
|
|
|
#include "nsIWidget.h"
|
2018-07-25 16:03:45 +03:00
|
|
|
#include "nsStyleConsts.h" // For system widget appearance types
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2018-06-06 16:31:33 +03:00
|
|
|
#include "mozilla/dom/Animation.h"
|
2018-05-07 05:15:16 +03:00
|
|
|
#include "mozilla/dom/AnimationEffectBinding.h" // for PlaybackDirection
|
2011-09-09 06:27:12 +04:00
|
|
|
#include "mozilla/LookAndFeel.h" // for system colors
|
1999-09-10 09:54:46 +04:00
|
|
|
|
1999-07-18 04:32:32 +04:00
|
|
|
#include "nsString.h"
|
2000-08-22 10:57:32 +04:00
|
|
|
#include "nsStaticNameTable.h"
|
1999-07-18 04:32:32 +04:00
|
|
|
|
2012-07-14 03:59:05 +04:00
|
|
|
#include "mozilla/Preferences.h"
|
2018-03-20 02:56:37 +03:00
|
|
|
#include "mozilla/StaticPrefs.h"
|
2012-07-14 03:59:05 +04:00
|
|
|
|
2011-10-11 09:50:08 +04:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
typedef nsCSSProps::KTableEntry KTableEntry;
|
2014-02-05 15:10:44 +04:00
|
|
|
|
2013-11-15 06:42:57 +04:00
|
|
|
static int32_t gPropertyTableRefCount;
|
2008-08-11 01:13:49 +04:00
|
|
|
static nsStaticCaseInsensitiveNameTable* gFontDescTable;
|
2014-06-12 05:10:00 +04:00
|
|
|
static nsStaticCaseInsensitiveNameTable* gCounterDescTable;
|
2016-08-17 04:37:48 +03:00
|
|
|
static nsDataHashtable<nsCStringHashKey,nsCSSPropertyID>* gPropertyIDLNameTable;
|
2008-08-11 01:13:49 +04:00
|
|
|
|
|
|
|
static const char* const kCSSRawFontDescs[] = {
|
2011-12-20 20:49:16 +04:00
|
|
|
#define CSS_FONT_DESC(name_, method_) #name_,
|
|
|
|
#include "nsCSSFontDescList.h"
|
|
|
|
#undef CSS_FONT_DESC
|
2008-08-11 01:13:49 +04:00
|
|
|
};
|
1999-07-18 04:32:32 +04:00
|
|
|
|
2014-06-12 05:10:00 +04:00
|
|
|
static const char* const kCSSRawCounterDescs[] = {
|
|
|
|
#define CSS_COUNTER_DESC(name_, method_) #name_,
|
|
|
|
#include "nsCSSCounterDescList.h"
|
|
|
|
#undef CSS_COUNTER_DESC
|
|
|
|
};
|
|
|
|
|
2018-02-23 08:03:45 +03:00
|
|
|
static nsStaticCaseInsensitiveNameTable*
|
2014-08-06 17:31:21 +04:00
|
|
|
CreateStaticTable(const char* const aRawTable[], int32_t aLength)
|
2014-04-02 19:47:55 +04:00
|
|
|
{
|
2015-05-06 07:13:53 +03:00
|
|
|
auto table = new nsStaticCaseInsensitiveNameTable(aRawTable, aLength);
|
2014-04-02 19:47:55 +04:00
|
|
|
#ifdef DEBUG
|
2015-05-06 07:13:53 +03:00
|
|
|
// Partially verify the entries.
|
|
|
|
for (int32_t index = 0; index < aLength; ++index) {
|
|
|
|
nsAutoCString temp(aRawTable[index]);
|
|
|
|
MOZ_ASSERT(-1 == temp.FindChar('_'),
|
|
|
|
"underscore char in case insensitive name table");
|
2014-04-02 19:47:55 +04:00
|
|
|
}
|
2015-05-06 07:13:53 +03:00
|
|
|
#endif
|
2014-04-02 19:47:55 +04:00
|
|
|
return table;
|
|
|
|
}
|
|
|
|
|
1999-07-18 04:32:32 +04:00
|
|
|
void
|
2009-10-13 10:35:57 +04:00
|
|
|
nsCSSProps::AddRefTable(void)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
2013-11-15 06:42:57 +04:00
|
|
|
if (0 == gPropertyTableRefCount++) {
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(!gFontDescTable, "pre existing array!");
|
|
|
|
MOZ_ASSERT(!gCounterDescTable, "pre existing array!");
|
2015-10-22 11:22:37 +03:00
|
|
|
MOZ_ASSERT(!gPropertyIDLNameTable, "pre existing array!");
|
2008-08-11 01:13:49 +04:00
|
|
|
|
2014-04-02 19:47:55 +04:00
|
|
|
gFontDescTable = CreateStaticTable(kCSSRawFontDescs, eCSSFontDesc_COUNT);
|
2014-06-12 05:10:00 +04:00
|
|
|
gCounterDescTable = CreateStaticTable(
|
|
|
|
kCSSRawCounterDescs, eCSSCounterDesc_COUNT);
|
2008-12-23 17:06:57 +03:00
|
|
|
|
2016-08-17 04:37:48 +03:00
|
|
|
gPropertyIDLNameTable = new nsDataHashtable<nsCStringHashKey,nsCSSPropertyID>;
|
|
|
|
for (nsCSSPropertyID p = nsCSSPropertyID(0);
|
2015-10-22 11:22:37 +03:00
|
|
|
size_t(p) < ArrayLength(kIDLNameTable);
|
2016-08-17 04:37:48 +03:00
|
|
|
p = nsCSSPropertyID(p + 1)) {
|
2015-10-22 11:22:37 +03:00
|
|
|
if (kIDLNameTable[p]) {
|
|
|
|
gPropertyIDLNameTable->Put(nsDependentCString(kIDLNameTable[p]), p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-14 03:59:05 +04:00
|
|
|
static bool prefObserversInited = false;
|
|
|
|
if (!prefObserversInited) {
|
|
|
|
prefObserversInited = true;
|
2018-05-31 06:49:25 +03:00
|
|
|
for (const PropertyPref* pref = kPropertyPrefTable;
|
|
|
|
pref->mPropID != eCSSProperty_UNKNOWN; pref++) {
|
2018-07-01 09:07:30 +03:00
|
|
|
nsCString prefName;
|
|
|
|
prefName.AssignLiteral(pref->mPref, strlen(pref->mPref));
|
2018-05-31 06:49:25 +03:00
|
|
|
bool* enabled = &gPropertyEnabled[pref->mPropID];
|
2018-07-01 09:07:30 +03:00
|
|
|
Preferences::AddBoolVarCache(enabled, prefName);
|
2018-05-31 06:49:25 +03:00
|
|
|
}
|
2012-07-14 03:59:05 +04:00
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-23 17:06:57 +03:00
|
|
|
#undef DEBUG_SHORTHANDS_CONTAINING
|
|
|
|
|
1999-07-18 04:32:32 +04:00
|
|
|
void
|
2009-10-13 10:35:57 +04:00
|
|
|
nsCSSProps::ReleaseTable(void)
|
1999-07-18 04:32:32 +04:00
|
|
|
{
|
2013-11-15 06:42:57 +04:00
|
|
|
if (0 == --gPropertyTableRefCount) {
|
2008-12-23 17:06:57 +03:00
|
|
|
delete gFontDescTable;
|
2012-07-30 18:20:58 +04:00
|
|
|
gFontDescTable = nullptr;
|
2008-12-23 17:06:57 +03:00
|
|
|
|
2014-06-12 05:10:00 +04:00
|
|
|
delete gCounterDescTable;
|
|
|
|
gCounterDescTable = nullptr;
|
|
|
|
|
2015-10-22 11:22:37 +03:00
|
|
|
delete gPropertyIDLNameTable;
|
|
|
|
gPropertyIDLNameTable = nullptr;
|
1999-07-18 04:32:32 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Bug 773296 - Part 2: Parse CSS variable declarations and store them on Declaration objects. p=ebassi,heycam r=dbaron
Patch co-authored by Emmanuele Bassi <ebassi@gmail.com>
This defines a CSSVariableDeclarations class that holds a set of
variable declarations. This is at the specified value stage, so values
can either be 'initial', 'inherit' or a token stream (which is what you
normally have). The variables are stored in a hash table. Although
it's a bit of a hack, we store 'initial' and 'inherit' using special
string values that can't be valid token streams (we use "!" and ";").
Declaration objects now can have two CSSVariableDeclarations objects
on them, to store normal and !important variable declarations. So that
we keep preserving the order of declarations on the object, we inflate
mOrder to store uint32_ts, where values from eCSSProperty_COUNT onwards
represent custom properties. mVariableOrder stores the names of the
variables corresponding to those entries in mOrder.
We also add a new nsCSSProperty value, eCSSPropertyExtra_variable, which
is used to represent any custom property name.
nsCSSProps::LookupProperty can return this value.
The changes to nsCSSParser are straightforward. Custom properties
are parsed and checked for syntactic validity (e.g. "var(a,)" being
invalid) and stored on the Declaration. We use nsCSSScanner's
recording ability to grab the unparsed CSS string corresponding to
the variable's value.
2013-12-12 06:09:40 +04:00
|
|
|
/* static */ bool
|
|
|
|
nsCSSProps::IsCustomPropertyName(const nsAString& aProperty)
|
|
|
|
{
|
2014-04-02 07:32:16 +04:00
|
|
|
return aProperty.Length() >= CSS_CUSTOM_NAME_PREFIX_LENGTH &&
|
|
|
|
StringBeginsWith(aProperty, NS_LITERAL_STRING("--"));
|
Bug 773296 - Part 2: Parse CSS variable declarations and store them on Declaration objects. p=ebassi,heycam r=dbaron
Patch co-authored by Emmanuele Bassi <ebassi@gmail.com>
This defines a CSSVariableDeclarations class that holds a set of
variable declarations. This is at the specified value stage, so values
can either be 'initial', 'inherit' or a token stream (which is what you
normally have). The variables are stored in a hash table. Although
it's a bit of a hack, we store 'initial' and 'inherit' using special
string values that can't be valid token streams (we use "!" and ";").
Declaration objects now can have two CSSVariableDeclarations objects
on them, to store normal and !important variable declarations. So that
we keep preserving the order of declarations on the object, we inflate
mOrder to store uint32_ts, where values from eCSSProperty_COUNT onwards
represent custom properties. mVariableOrder stores the names of the
variables corresponding to those entries in mOrder.
We also add a new nsCSSProperty value, eCSSPropertyExtra_variable, which
is used to represent any custom property name.
nsCSSProps::LookupProperty can return this value.
The changes to nsCSSParser are straightforward. Custom properties
are parsed and checked for syntactic validity (e.g. "var(a,)" being
invalid) and stored on the Declaration. We use nsCSSScanner's
recording ability to grab the unparsed CSS string corresponding to
the variable's value.
2013-12-12 06:09:40 +04:00
|
|
|
}
|
|
|
|
|
2016-08-17 04:37:48 +03:00
|
|
|
nsCSSPropertyID
|
2015-10-22 11:22:37 +03:00
|
|
|
nsCSSProps::LookupPropertyByIDLName(const nsACString& aPropertyIDLName,
|
|
|
|
EnabledState aEnabled)
|
|
|
|
{
|
2016-08-17 04:37:48 +03:00
|
|
|
nsCSSPropertyID res;
|
2015-10-22 11:22:37 +03:00
|
|
|
if (!gPropertyIDLNameTable->Get(aPropertyIDLName, &res)) {
|
|
|
|
return eCSSProperty_UNKNOWN;
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(res < eCSSProperty_COUNT);
|
|
|
|
if (!IsEnabled(res, aEnabled)) {
|
|
|
|
return eCSSProperty_UNKNOWN;
|
|
|
|
}
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2016-08-17 04:37:48 +03:00
|
|
|
nsCSSPropertyID
|
2015-10-22 11:22:37 +03:00
|
|
|
nsCSSProps::LookupPropertyByIDLName(const nsAString& aPropertyIDLName,
|
|
|
|
EnabledState aEnabled)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(gPropertyIDLNameTable, "no lookup table, needs addref");
|
|
|
|
return LookupPropertyByIDLName(NS_ConvertUTF16toUTF8(aPropertyIDLName),
|
|
|
|
aEnabled);
|
|
|
|
}
|
|
|
|
|
2009-10-13 10:35:57 +04:00
|
|
|
nsCSSFontDesc
|
2008-08-11 01:13:49 +04:00
|
|
|
nsCSSProps::LookupFontDesc(const nsAString& aFontDesc)
|
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(gFontDescTable, "no lookup table, needs addref");
|
2013-05-20 06:59:20 +04:00
|
|
|
nsCSSFontDesc which = nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
|
|
|
|
|
2018-03-20 02:56:37 +03:00
|
|
|
if (which == eCSSFontDesc_Display &&
|
|
|
|
!StaticPrefs::layout_css_font_display_enabled()) {
|
2016-01-07 08:02:58 +03:00
|
|
|
which = eCSSFontDesc_UNKNOWN;
|
2013-05-20 06:59:20 +04:00
|
|
|
}
|
|
|
|
return which;
|
2008-08-11 01:13:49 +04:00
|
|
|
}
|
|
|
|
|
2017-06-20 12:19:05 +03:00
|
|
|
const nsCString&
|
2008-08-11 01:13:49 +04:00
|
|
|
nsCSSProps::GetStringValue(nsCSSFontDesc aFontDescID)
|
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(gFontDescTable, "no lookup table, needs addref");
|
2008-08-11 01:13:49 +04:00
|
|
|
if (gFontDescTable) {
|
2012-08-22 19:56:38 +04:00
|
|
|
return gFontDescTable->GetStringValue(int32_t(aFontDescID));
|
2008-08-11 01:13:49 +04:00
|
|
|
} else {
|
|
|
|
static nsDependentCString sNullStr("");
|
|
|
|
return sNullStr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-20 12:19:05 +03:00
|
|
|
const nsCString&
|
2014-06-12 05:10:00 +04:00
|
|
|
nsCSSProps::GetStringValue(nsCSSCounterDesc aCounterDesc)
|
|
|
|
{
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(gCounterDescTable, "no lookup table, needs addref");
|
2014-06-12 05:10:00 +04:00
|
|
|
if (gCounterDescTable) {
|
|
|
|
return gCounterDescTable->GetStringValue(int32_t(aCounterDesc));
|
|
|
|
} else {
|
|
|
|
static nsDependentCString sNullStr("");
|
|
|
|
return sNullStr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-08-22 10:57:32 +04:00
|
|
|
/***************************************************************************/
|
1999-07-18 04:32:32 +04:00
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kBorderImageRepeatKTable[] = {
|
2017-12-21 08:16:40 +03:00
|
|
|
{ eCSSKeyword_stretch, StyleBorderImageRepeat::Stretch },
|
|
|
|
{ eCSSKeyword_repeat, StyleBorderImageRepeat::Repeat },
|
|
|
|
{ eCSSKeyword_round, StyleBorderImageRepeat::Round },
|
|
|
|
{ eCSSKeyword_space, StyleBorderImageRepeat::Space },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2011-12-23 03:34:45 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kBorderStyleKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE },
|
|
|
|
{ eCSSKeyword_hidden, NS_STYLE_BORDER_STYLE_HIDDEN },
|
|
|
|
{ eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED },
|
|
|
|
{ eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED },
|
|
|
|
{ eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID },
|
|
|
|
{ eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE },
|
|
|
|
{ eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE },
|
|
|
|
{ eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE },
|
|
|
|
{ eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET },
|
|
|
|
{ eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kBoxShadowTypeKTable[] = {
|
2016-07-25 09:23:27 +03:00
|
|
|
{ eCSSKeyword_inset, uint8_t(StyleBoxShadowType::Inset) },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2009-02-10 11:45:13 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kCursorKTable[] = {
|
2004-09-12 03:24:30 +04:00
|
|
|
// CSS 2.0
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_auto, NS_STYLE_CURSOR_AUTO },
|
|
|
|
{ eCSSKeyword_crosshair, NS_STYLE_CURSOR_CROSSHAIR },
|
|
|
|
{ eCSSKeyword_default, NS_STYLE_CURSOR_DEFAULT },
|
|
|
|
{ eCSSKeyword_pointer, NS_STYLE_CURSOR_POINTER },
|
|
|
|
{ eCSSKeyword_move, NS_STYLE_CURSOR_MOVE },
|
|
|
|
{ eCSSKeyword_e_resize, NS_STYLE_CURSOR_E_RESIZE },
|
|
|
|
{ eCSSKeyword_ne_resize, NS_STYLE_CURSOR_NE_RESIZE },
|
|
|
|
{ eCSSKeyword_nw_resize, NS_STYLE_CURSOR_NW_RESIZE },
|
|
|
|
{ eCSSKeyword_n_resize, NS_STYLE_CURSOR_N_RESIZE },
|
|
|
|
{ eCSSKeyword_se_resize, NS_STYLE_CURSOR_SE_RESIZE },
|
|
|
|
{ eCSSKeyword_sw_resize, NS_STYLE_CURSOR_SW_RESIZE },
|
|
|
|
{ eCSSKeyword_s_resize, NS_STYLE_CURSOR_S_RESIZE },
|
|
|
|
{ eCSSKeyword_w_resize, NS_STYLE_CURSOR_W_RESIZE },
|
|
|
|
{ eCSSKeyword_text, NS_STYLE_CURSOR_TEXT },
|
|
|
|
{ eCSSKeyword_wait, NS_STYLE_CURSOR_WAIT },
|
|
|
|
{ eCSSKeyword_help, NS_STYLE_CURSOR_HELP },
|
2004-01-09 00:27:56 +03:00
|
|
|
// CSS 2.1
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_progress, NS_STYLE_CURSOR_SPINNING },
|
2004-09-12 03:24:30 +04:00
|
|
|
// CSS3 basic user interface module
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_copy, NS_STYLE_CURSOR_COPY },
|
|
|
|
{ eCSSKeyword_alias, NS_STYLE_CURSOR_ALIAS },
|
|
|
|
{ eCSSKeyword_context_menu, NS_STYLE_CURSOR_CONTEXT_MENU },
|
|
|
|
{ eCSSKeyword_cell, NS_STYLE_CURSOR_CELL },
|
|
|
|
{ eCSSKeyword_not_allowed, NS_STYLE_CURSOR_NOT_ALLOWED },
|
|
|
|
{ eCSSKeyword_col_resize, NS_STYLE_CURSOR_COL_RESIZE },
|
|
|
|
{ eCSSKeyword_row_resize, NS_STYLE_CURSOR_ROW_RESIZE },
|
|
|
|
{ eCSSKeyword_no_drop, NS_STYLE_CURSOR_NO_DROP },
|
|
|
|
{ eCSSKeyword_vertical_text, NS_STYLE_CURSOR_VERTICAL_TEXT },
|
|
|
|
{ eCSSKeyword_all_scroll, NS_STYLE_CURSOR_ALL_SCROLL },
|
|
|
|
{ eCSSKeyword_nesw_resize, NS_STYLE_CURSOR_NESW_RESIZE },
|
|
|
|
{ eCSSKeyword_nwse_resize, NS_STYLE_CURSOR_NWSE_RESIZE },
|
|
|
|
{ eCSSKeyword_ns_resize, NS_STYLE_CURSOR_NS_RESIZE },
|
|
|
|
{ eCSSKeyword_ew_resize, NS_STYLE_CURSOR_EW_RESIZE },
|
|
|
|
{ eCSSKeyword_none, NS_STYLE_CURSOR_NONE },
|
|
|
|
{ eCSSKeyword_grab, NS_STYLE_CURSOR_GRAB },
|
|
|
|
{ eCSSKeyword_grabbing, NS_STYLE_CURSOR_GRABBING },
|
|
|
|
{ eCSSKeyword_zoom_in, NS_STYLE_CURSOR_ZOOM_IN },
|
|
|
|
{ eCSSKeyword_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT },
|
2004-09-12 03:24:30 +04:00
|
|
|
// -moz- prefixed vendor specific
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword__moz_grab, NS_STYLE_CURSOR_GRAB },
|
|
|
|
{ eCSSKeyword__moz_grabbing, NS_STYLE_CURSOR_GRABBING },
|
|
|
|
{ eCSSKeyword__moz_zoom_in, NS_STYLE_CURSOR_ZOOM_IN },
|
|
|
|
{ eCSSKeyword__moz_zoom_out, NS_STYLE_CURSOR_ZOOM_OUT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
KTableEntry nsCSSProps::kDisplayKTable[] = {
|
2016-09-03 21:46:58 +03:00
|
|
|
{ eCSSKeyword_none, StyleDisplay::None },
|
2016-08-28 05:31:50 +03:00
|
|
|
{ eCSSKeyword_inline, StyleDisplay::Inline },
|
|
|
|
{ eCSSKeyword_block, StyleDisplay::Block },
|
|
|
|
{ eCSSKeyword_inline_block, StyleDisplay::InlineBlock },
|
|
|
|
{ eCSSKeyword_list_item, StyleDisplay::ListItem },
|
|
|
|
{ eCSSKeyword_table, StyleDisplay::Table },
|
|
|
|
{ eCSSKeyword_inline_table, StyleDisplay::InlineTable },
|
|
|
|
{ eCSSKeyword_table_row_group, StyleDisplay::TableRowGroup },
|
|
|
|
{ eCSSKeyword_table_header_group, StyleDisplay::TableHeaderGroup },
|
|
|
|
{ eCSSKeyword_table_footer_group, StyleDisplay::TableFooterGroup },
|
|
|
|
{ eCSSKeyword_table_row, StyleDisplay::TableRow },
|
|
|
|
{ eCSSKeyword_table_column_group, StyleDisplay::TableColumnGroup },
|
|
|
|
{ eCSSKeyword_table_column, StyleDisplay::TableColumn },
|
|
|
|
{ eCSSKeyword_table_cell, StyleDisplay::TableCell },
|
|
|
|
{ eCSSKeyword_table_caption, StyleDisplay::TableCaption },
|
2006-04-19 19:10:50 +04:00
|
|
|
// Make sure this is kept in sync with the code in
|
|
|
|
// nsCSSFrameConstructor::ConstructXULFrame
|
2016-12-06 10:36:28 +03:00
|
|
|
{ eCSSKeyword__moz_box, StyleDisplay::MozBox },
|
|
|
|
{ eCSSKeyword__moz_inline_box, StyleDisplay::MozInlineBox },
|
2009-10-13 10:35:57 +04:00
|
|
|
#ifdef MOZ_XUL
|
2016-12-06 10:36:28 +03:00
|
|
|
{ eCSSKeyword__moz_grid, StyleDisplay::MozGrid },
|
|
|
|
{ eCSSKeyword__moz_inline_grid, StyleDisplay::MozInlineGrid },
|
|
|
|
{ eCSSKeyword__moz_grid_group, StyleDisplay::MozGridGroup },
|
|
|
|
{ eCSSKeyword__moz_grid_line, StyleDisplay::MozGridLine },
|
|
|
|
{ eCSSKeyword__moz_stack, StyleDisplay::MozStack },
|
|
|
|
{ eCSSKeyword__moz_inline_stack, StyleDisplay::MozInlineStack },
|
|
|
|
{ eCSSKeyword__moz_deck, StyleDisplay::MozDeck },
|
|
|
|
{ eCSSKeyword__moz_popup, StyleDisplay::MozPopup },
|
|
|
|
{ eCSSKeyword__moz_groupbox, StyleDisplay::MozGroupbox },
|
2006-04-19 19:10:50 +04:00
|
|
|
#endif
|
2016-08-28 05:31:50 +03:00
|
|
|
{ eCSSKeyword_flex, StyleDisplay::Flex },
|
|
|
|
{ eCSSKeyword_inline_flex, StyleDisplay::InlineFlex },
|
|
|
|
{ eCSSKeyword_ruby, StyleDisplay::Ruby },
|
|
|
|
{ eCSSKeyword_ruby_base, StyleDisplay::RubyBase },
|
|
|
|
{ eCSSKeyword_ruby_base_container, StyleDisplay::RubyBaseContainer },
|
|
|
|
{ eCSSKeyword_ruby_text, StyleDisplay::RubyText },
|
|
|
|
{ eCSSKeyword_ruby_text_container, StyleDisplay::RubyTextContainer },
|
|
|
|
{ eCSSKeyword_grid, StyleDisplay::Grid },
|
|
|
|
{ eCSSKeyword_inline_grid, StyleDisplay::InlineGrid },
|
2016-05-24 07:42:36 +03:00
|
|
|
// The next 4 entries are controlled by the layout.css.prefixes.webkit pref.
|
2016-08-28 05:31:50 +03:00
|
|
|
{ eCSSKeyword__webkit_box, StyleDisplay::WebkitBox },
|
|
|
|
{ eCSSKeyword__webkit_inline_box, StyleDisplay::WebkitInlineBox },
|
|
|
|
{ eCSSKeyword__webkit_flex, StyleDisplay::Flex },
|
|
|
|
{ eCSSKeyword__webkit_inline_flex, StyleDisplay::InlineFlex },
|
|
|
|
{ eCSSKeyword_contents, StyleDisplay::Contents },
|
2016-12-23 21:11:03 +03:00
|
|
|
{ eCSSKeyword_flow_root, StyleDisplay::FlowRoot },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignAllKeywords[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_auto, NS_STYLE_ALIGN_AUTO },
|
2016-01-05 23:27:13 +03:00
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_start, NS_STYLE_ALIGN_START },
|
|
|
|
{ eCSSKeyword_end, NS_STYLE_ALIGN_END },
|
|
|
|
{ eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START },
|
|
|
|
{ eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
2016-11-05 04:57:07 +03:00
|
|
|
// Also "first/last baseline"; see nsCSSValue::AppendAlignJustifyValueToString
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_self_start, NS_STYLE_ALIGN_SELF_START },
|
|
|
|
{ eCSSKeyword_self_end, NS_STYLE_ALIGN_SELF_END },
|
|
|
|
{ eCSSKeyword_space_between, NS_STYLE_ALIGN_SPACE_BETWEEN },
|
|
|
|
{ eCSSKeyword_space_around, NS_STYLE_ALIGN_SPACE_AROUND },
|
|
|
|
{ eCSSKeyword_space_evenly, NS_STYLE_ALIGN_SPACE_EVENLY },
|
|
|
|
{ eCSSKeyword_legacy, NS_STYLE_ALIGN_LEGACY },
|
|
|
|
{ eCSSKeyword_safe, NS_STYLE_ALIGN_SAFE },
|
2016-01-05 23:27:13 +03:00
|
|
|
{ eCSSKeyword_unsafe, NS_STYLE_ALIGN_UNSAFE },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignOverflowPosition[] = {
|
2016-01-05 23:27:13 +03:00
|
|
|
{ eCSSKeyword_unsafe, NS_STYLE_ALIGN_UNSAFE },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_safe, NS_STYLE_ALIGN_SAFE },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignSelfPosition[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_start, NS_STYLE_ALIGN_START },
|
|
|
|
{ eCSSKeyword_end, NS_STYLE_ALIGN_END },
|
|
|
|
{ eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START },
|
|
|
|
{ eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_self_start, NS_STYLE_ALIGN_SELF_START },
|
|
|
|
{ eCSSKeyword_self_end, NS_STYLE_ALIGN_SELF_END },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignLegacy[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_legacy, NS_STYLE_ALIGN_LEGACY },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignLegacyPosition[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2016-01-05 23:27:13 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignAutoNormalStretchBaseline[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_auto, NS_STYLE_ALIGN_AUTO },
|
2016-01-05 23:27:13 +03:00
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
2016-11-05 04:57:07 +03:00
|
|
|
// Also "first baseline" & "last baseline"; see CSSParserImpl::ParseAlignEnum
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2016-01-05 23:27:13 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignNormalStretchBaseline[] = {
|
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
2016-11-05 04:57:07 +03:00
|
|
|
// Also "first baseline" & "last baseline"; see CSSParserImpl::ParseAlignEnum
|
2016-01-05 23:27:13 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const KTableEntry nsCSSProps::kAlignNormalBaseline[] = {
|
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
2016-11-05 04:57:07 +03:00
|
|
|
// Also "first baseline" & "last baseline"; see CSSParserImpl::ParseAlignEnum
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignContentDistribution[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_space_between, NS_STYLE_ALIGN_SPACE_BETWEEN },
|
|
|
|
{ eCSSKeyword_space_around, NS_STYLE_ALIGN_SPACE_AROUND },
|
|
|
|
{ eCSSKeyword_space_evenly, NS_STYLE_ALIGN_SPACE_EVENLY },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kAlignContentPosition[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_start, NS_STYLE_ALIGN_START },
|
|
|
|
{ eCSSKeyword_end, NS_STYLE_ALIGN_END },
|
|
|
|
{ eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START },
|
|
|
|
{ eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-11-03 17:18:05 +03:00
|
|
|
};
|
|
|
|
|
2016-02-08 19:35:01 +03:00
|
|
|
// <NOTE> these are only used for auto-completion, not parsing:
|
|
|
|
const KTableEntry nsCSSProps::kAutoCompletionAlignJustifySelf[] = {
|
|
|
|
{ eCSSKeyword_auto, NS_STYLE_ALIGN_AUTO },
|
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
|
|
|
{ eCSSKeyword_last_baseline, NS_STYLE_ALIGN_LAST_BASELINE },
|
|
|
|
{ eCSSKeyword_start, NS_STYLE_ALIGN_START },
|
|
|
|
{ eCSSKeyword_end, NS_STYLE_ALIGN_END },
|
|
|
|
{ eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START },
|
|
|
|
{ eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_self_start, NS_STYLE_ALIGN_SELF_START },
|
|
|
|
{ eCSSKeyword_self_end, NS_STYLE_ALIGN_SELF_END },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const KTableEntry nsCSSProps::kAutoCompletionAlignItems[] = {
|
|
|
|
// Intentionally no 'auto' here.
|
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
|
|
|
{ eCSSKeyword_last_baseline, NS_STYLE_ALIGN_LAST_BASELINE },
|
|
|
|
{ eCSSKeyword_start, NS_STYLE_ALIGN_START },
|
|
|
|
{ eCSSKeyword_end, NS_STYLE_ALIGN_END },
|
|
|
|
{ eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START },
|
|
|
|
{ eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_self_start, NS_STYLE_ALIGN_SELF_START },
|
|
|
|
{ eCSSKeyword_self_end, NS_STYLE_ALIGN_SELF_END },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const KTableEntry nsCSSProps::kAutoCompletionAlignJustifyContent[] = {
|
|
|
|
// Intentionally no 'auto' here.
|
|
|
|
{ eCSSKeyword_normal, NS_STYLE_ALIGN_NORMAL },
|
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_ALIGN_BASELINE },
|
|
|
|
{ eCSSKeyword_last_baseline, NS_STYLE_ALIGN_LAST_BASELINE },
|
|
|
|
{ eCSSKeyword_stretch, NS_STYLE_ALIGN_STRETCH },
|
|
|
|
{ eCSSKeyword_space_between, NS_STYLE_ALIGN_SPACE_BETWEEN },
|
|
|
|
{ eCSSKeyword_space_around, NS_STYLE_ALIGN_SPACE_AROUND },
|
|
|
|
{ eCSSKeyword_space_evenly, NS_STYLE_ALIGN_SPACE_EVENLY },
|
|
|
|
{ eCSSKeyword_start, NS_STYLE_ALIGN_START },
|
|
|
|
{ eCSSKeyword_end, NS_STYLE_ALIGN_END },
|
|
|
|
{ eCSSKeyword_flex_start, NS_STYLE_ALIGN_FLEX_START },
|
|
|
|
{ eCSSKeyword_flex_end, NS_STYLE_ALIGN_FLEX_END },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_left, NS_STYLE_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
// </NOTE>
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kFontSmoothingKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO },
|
|
|
|
{ eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2013-07-30 00:00:41 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kGridAutoFlowKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_row, NS_STYLE_GRID_AUTO_FLOW_ROW },
|
|
|
|
{ eCSSKeyword_column, NS_STYLE_GRID_AUTO_FLOW_COLUMN },
|
|
|
|
{ eCSSKeyword_dense, NS_STYLE_GRID_AUTO_FLOW_DENSE },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2014-03-11 02:54:16 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kGridTrackBreadthKTable[] = {
|
2017-02-17 06:58:36 +03:00
|
|
|
{ eCSSKeyword_min_content, StyleGridTrackBreadth::MinContent },
|
|
|
|
{ eCSSKeyword_max_content, StyleGridTrackBreadth::MaxContent },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2014-03-11 02:54:13 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kLineHeightKTable[] = {
|
2009-05-19 02:13:12 +04:00
|
|
|
// -moz- prefixed, intended for internal use for single-line controls
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword__moz_block_height, NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kContainKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_none, NS_STYLE_CONTAIN_NONE },
|
|
|
|
{ eCSSKeyword_strict, NS_STYLE_CONTAIN_STRICT },
|
2018-05-30 17:49:31 +03:00
|
|
|
{ eCSSKeyword_content, NS_STYLE_CONTAIN_CONTENT },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_layout, NS_STYLE_CONTAIN_LAYOUT },
|
|
|
|
{ eCSSKeyword_style, NS_STYLE_CONTAIN_STYLE },
|
|
|
|
{ eCSSKeyword_paint, NS_STYLE_CONTAIN_PAINT },
|
2018-05-30 17:49:31 +03:00
|
|
|
{ eCSSKeyword_size, NS_STYLE_CONTAIN_SIZE },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2015-06-04 17:38:00 +03:00
|
|
|
};
|
|
|
|
|
2005-03-27 15:36:08 +04:00
|
|
|
// Same as kBorderStyleKTable except 'hidden'.
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kOutlineStyleKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_none, NS_STYLE_BORDER_STYLE_NONE },
|
|
|
|
{ eCSSKeyword_auto, NS_STYLE_BORDER_STYLE_AUTO },
|
|
|
|
{ eCSSKeyword_dotted, NS_STYLE_BORDER_STYLE_DOTTED },
|
|
|
|
{ eCSSKeyword_dashed, NS_STYLE_BORDER_STYLE_DASHED },
|
|
|
|
{ eCSSKeyword_solid, NS_STYLE_BORDER_STYLE_SOLID },
|
|
|
|
{ eCSSKeyword_double, NS_STYLE_BORDER_STYLE_DOUBLE },
|
|
|
|
{ eCSSKeyword_groove, NS_STYLE_BORDER_STYLE_GROOVE },
|
|
|
|
{ eCSSKeyword_ridge, NS_STYLE_BORDER_STYLE_RIDGE },
|
|
|
|
{ eCSSKeyword_inset, NS_STYLE_BORDER_STYLE_INSET },
|
|
|
|
{ eCSSKeyword_outset, NS_STYLE_BORDER_STYLE_OUTSET },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2005-03-27 15:36:08 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kOverflowKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO },
|
|
|
|
{ eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE },
|
|
|
|
{ eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN },
|
|
|
|
{ eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL },
|
2004-09-05 04:04:04 +04:00
|
|
|
// Deprecated:
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword__moz_scrollbars_none, NS_STYLE_OVERFLOW_HIDDEN },
|
|
|
|
{ eCSSKeyword__moz_scrollbars_horizontal, NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL },
|
|
|
|
{ eCSSKeyword__moz_scrollbars_vertical, NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL },
|
|
|
|
{ eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kOverflowClipBoxKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_padding_box, NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX },
|
|
|
|
{ eCSSKeyword_content_box, NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2014-02-22 05:18:23 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kOverflowSubKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO },
|
|
|
|
{ eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE },
|
|
|
|
{ eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN },
|
|
|
|
{ eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL },
|
2004-09-05 04:04:04 +04:00
|
|
|
// Deprecated:
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2004-09-05 04:04:04 +04:00
|
|
|
};
|
|
|
|
|
2017-11-23 03:01:11 +03:00
|
|
|
const KTableEntry nsCSSProps::kOverscrollBehaviorKTable[] = {
|
|
|
|
{ eCSSKeyword_auto, StyleOverscrollBehavior::Auto },
|
|
|
|
{ eCSSKeyword_contain, StyleOverscrollBehavior::Contain },
|
|
|
|
{ eCSSKeyword_none, StyleOverscrollBehavior::None },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kScrollSnapTypeKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_none, NS_STYLE_SCROLL_SNAP_TYPE_NONE },
|
|
|
|
{ eCSSKeyword_mandatory, NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY },
|
|
|
|
{ eCSSKeyword_proximity, NS_STYLE_SCROLL_SNAP_TYPE_PROXIMITY },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2014-02-04 05:54:22 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
KTableEntry nsCSSProps::kTextAlignKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT },
|
|
|
|
{ eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT },
|
|
|
|
{ eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER },
|
|
|
|
{ eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY },
|
|
|
|
{ eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
|
|
|
{ eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
|
|
|
{ eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
|
2016-05-11 07:03:34 +03:00
|
|
|
{ eCSSKeyword_start, NS_STYLE_TEXT_ALIGN_START },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_end, NS_STYLE_TEXT_ALIGN_END },
|
2016-02-24 21:40:30 +03:00
|
|
|
{ eCSSKeyword_unsafe, NS_STYLE_TEXT_ALIGN_UNSAFE },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_match_parent, NS_STYLE_TEXT_ALIGN_MATCH_PARENT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kTextDecorationLineKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_none, NS_STYLE_TEXT_DECORATION_LINE_NONE },
|
|
|
|
{ eCSSKeyword_underline, NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE },
|
|
|
|
{ eCSSKeyword_overline, NS_STYLE_TEXT_DECORATION_LINE_OVERLINE },
|
|
|
|
{ eCSSKeyword_line_through, NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH },
|
|
|
|
{ eCSSKeyword_blink, NS_STYLE_TEXT_DECORATION_LINE_BLINK },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kTextDecorationStyleKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword__moz_none, NS_STYLE_TEXT_DECORATION_STYLE_NONE },
|
|
|
|
{ eCSSKeyword_solid, NS_STYLE_TEXT_DECORATION_STYLE_SOLID },
|
|
|
|
{ eCSSKeyword_double, NS_STYLE_TEXT_DECORATION_STYLE_DOUBLE },
|
|
|
|
{ eCSSKeyword_dotted, NS_STYLE_TEXT_DECORATION_STYLE_DOTTED },
|
|
|
|
{ eCSSKeyword_dashed, NS_STYLE_TEXT_DECORATION_STYLE_DASHED },
|
|
|
|
{ eCSSKeyword_wavy, NS_STYLE_TEXT_DECORATION_STYLE_WAVY },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2011-03-31 16:26:35 +04:00
|
|
|
};
|
|
|
|
|
2015-11-28 03:56:33 +03:00
|
|
|
const KTableEntry nsCSSProps::kTextEmphasisStyleShapeKTable[] = {
|
|
|
|
{ eCSSKeyword_dot, NS_STYLE_TEXT_EMPHASIS_STYLE_DOT },
|
|
|
|
{ eCSSKeyword_circle, NS_STYLE_TEXT_EMPHASIS_STYLE_CIRCLE },
|
|
|
|
{ eCSSKeyword_double_circle, NS_STYLE_TEXT_EMPHASIS_STYLE_DOUBLE_CIRCLE },
|
|
|
|
{ eCSSKeyword_triangle, NS_STYLE_TEXT_EMPHASIS_STYLE_TRIANGLE },
|
|
|
|
{ eCSSKeyword_sesame, NS_STYLE_TEXT_EMPHASIS_STYLE_SESAME} ,
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kTextOverflowKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_clip, NS_STYLE_TEXT_OVERFLOW_CLIP },
|
|
|
|
{ eCSSKeyword_ellipsis, NS_STYLE_TEXT_OVERFLOW_ELLIPSIS },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2011-06-22 22:11:47 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kTouchActionKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_none, NS_STYLE_TOUCH_ACTION_NONE },
|
|
|
|
{ eCSSKeyword_auto, NS_STYLE_TOUCH_ACTION_AUTO },
|
|
|
|
{ eCSSKeyword_pan_x, NS_STYLE_TOUCH_ACTION_PAN_X },
|
|
|
|
{ eCSSKeyword_pan_y, NS_STYLE_TOUCH_ACTION_PAN_Y },
|
|
|
|
{ eCSSKeyword_manipulation, NS_STYLE_TOUCH_ACTION_MANIPULATION },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2014-01-15 19:03:15 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kTransitionTimingFunctionKTable[] = {
|
2018-10-26 21:03:35 +03:00
|
|
|
{ eCSSKeyword_linear, StyleTimingKeyword::Linear },
|
|
|
|
{ eCSSKeyword_ease, StyleTimingKeyword::Ease },
|
|
|
|
{ eCSSKeyword_ease_in, StyleTimingKeyword::EaseIn },
|
|
|
|
{ eCSSKeyword_ease_out, StyleTimingKeyword::EaseOut },
|
|
|
|
{ eCSSKeyword_ease_in_out, StyleTimingKeyword::EaseInOut },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2009-08-21 01:52:47 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kVerticalAlignKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_baseline, NS_STYLE_VERTICAL_ALIGN_BASELINE },
|
|
|
|
{ eCSSKeyword_sub, NS_STYLE_VERTICAL_ALIGN_SUB },
|
|
|
|
{ eCSSKeyword_super, NS_STYLE_VERTICAL_ALIGN_SUPER },
|
|
|
|
{ eCSSKeyword_top, NS_STYLE_VERTICAL_ALIGN_TOP },
|
|
|
|
{ eCSSKeyword_text_top, NS_STYLE_VERTICAL_ALIGN_TEXT_TOP },
|
|
|
|
{ eCSSKeyword_middle, NS_STYLE_VERTICAL_ALIGN_MIDDLE },
|
|
|
|
{ eCSSKeyword__moz_middle_with_baseline, NS_STYLE_VERTICAL_ALIGN_MIDDLE_WITH_BASELINE },
|
|
|
|
{ eCSSKeyword_bottom, NS_STYLE_VERTICAL_ALIGN_BOTTOM },
|
|
|
|
{ eCSSKeyword_text_bottom, NS_STYLE_VERTICAL_ALIGN_TEXT_BOTTOM },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
1999-07-18 04:32:32 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kWidthKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
|
|
|
|
{ eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
|
|
|
|
{ eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT },
|
|
|
|
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2007-05-04 03:11:00 +04:00
|
|
|
};
|
|
|
|
|
2018-03-31 02:50:04 +03:00
|
|
|
// This must be the same as kWidthKTable, but just with 'content' added:
|
|
|
|
const KTableEntry nsCSSProps::kFlexBasisKTable[] = {
|
|
|
|
{ eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
|
|
|
|
{ eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
|
|
|
|
{ eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT },
|
|
|
|
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
|
|
|
|
{ eCSSKeyword_content, NS_STYLE_FLEX_BASIS_CONTENT },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
|
|
|
};
|
|
|
|
static_assert(ArrayLength(nsCSSProps::kFlexBasisKTable) ==
|
|
|
|
ArrayLength(nsCSSProps::kWidthKTable) + 1,
|
|
|
|
"kFlexBasisKTable should have the same entries as "
|
|
|
|
"kWidthKTable, plus one more for 'content'");
|
|
|
|
|
2001-03-06 05:27:50 +03:00
|
|
|
// Specific keyword tables for XUL.properties
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
// keyword tables for SVG properties
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kShapeRadiusKTable[] = {
|
2016-12-03 11:13:49 +03:00
|
|
|
{ eCSSKeyword_closest_side, StyleShapeRadius::ClosestSide },
|
|
|
|
{ eCSSKeyword_farthest_side, StyleShapeRadius::FarthestSide },
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2014-10-15 02:03:00 +04:00
|
|
|
};
|
|
|
|
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry nsCSSProps::kFilterFunctionKTable[] = {
|
2015-11-20 05:08:57 +03:00
|
|
|
{ eCSSKeyword_blur, NS_STYLE_FILTER_BLUR },
|
|
|
|
{ eCSSKeyword_brightness, NS_STYLE_FILTER_BRIGHTNESS },
|
|
|
|
{ eCSSKeyword_contrast, NS_STYLE_FILTER_CONTRAST },
|
|
|
|
{ eCSSKeyword_grayscale, NS_STYLE_FILTER_GRAYSCALE },
|
|
|
|
{ eCSSKeyword_invert, NS_STYLE_FILTER_INVERT },
|
|
|
|
{ eCSSKeyword_opacity, NS_STYLE_FILTER_OPACITY },
|
|
|
|
{ eCSSKeyword_saturate, NS_STYLE_FILTER_SATURATE },
|
|
|
|
{ eCSSKeyword_sepia, NS_STYLE_FILTER_SEPIA },
|
|
|
|
{ eCSSKeyword_hue_rotate, NS_STYLE_FILTER_HUE_ROTATE },
|
|
|
|
{ eCSSKeyword_drop_shadow, NS_STYLE_FILTER_DROP_SHADOW },
|
|
|
|
{ eCSSKeyword_UNKNOWN, -1 }
|
2013-08-06 11:53:30 +04:00
|
|
|
};
|
|
|
|
|
2012-10-03 09:04:50 +04:00
|
|
|
int32_t
|
2014-02-05 15:10:44 +04:00
|
|
|
nsCSSProps::FindIndexOfKeyword(nsCSSKeyword aKeyword,
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry aTable[])
|
2004-10-01 21:15:15 +04:00
|
|
|
{
|
2013-10-28 00:56:32 +04:00
|
|
|
if (eCSSKeyword_UNKNOWN == aKeyword) {
|
|
|
|
// NOTE: we can have keyword tables where eCSSKeyword_UNKNOWN is used
|
|
|
|
// not only for the sentinel, but also in the middle of the table to
|
|
|
|
// knock out values that have been disabled by prefs, e.g. kDisplayKTable.
|
|
|
|
// So we deal with eCSSKeyword_UNKNOWN up front to avoid returning a valid
|
|
|
|
// index in the loop below.
|
|
|
|
return -1;
|
|
|
|
}
|
2015-11-20 05:08:57 +03:00
|
|
|
for (int32_t i = 0; ; ++i) {
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry& entry = aTable[i];
|
2018-01-15 19:14:55 +03:00
|
|
|
if (entry.IsSentinel()) {
|
2013-10-28 00:56:32 +04:00
|
|
|
break;
|
2004-10-01 21:15:15 +04:00
|
|
|
}
|
2015-11-20 05:08:57 +03:00
|
|
|
if (aKeyword == entry.mKeyword) {
|
2013-10-28 00:56:32 +04:00
|
|
|
return i;
|
|
|
|
}
|
2004-10-01 21:15:15 +04:00
|
|
|
}
|
2012-10-03 09:04:50 +04:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2015-11-20 05:09:07 +03:00
|
|
|
nsCSSProps::FindKeyword(nsCSSKeyword aKeyword, const KTableEntry aTable[],
|
2012-10-03 09:04:50 +04:00
|
|
|
int32_t& aResult)
|
|
|
|
{
|
|
|
|
int32_t index = FindIndexOfKeyword(aKeyword, aTable);
|
|
|
|
if (index >= 0) {
|
2015-11-20 05:08:57 +03:00
|
|
|
aResult = aTable[index].mValue;
|
2012-10-03 09:04:50 +04:00
|
|
|
return true;
|
|
|
|
}
|
2011-10-17 18:59:28 +04:00
|
|
|
return false;
|
2004-10-01 21:15:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSKeyword
|
2015-11-20 05:09:07 +03:00
|
|
|
nsCSSProps::ValueToKeywordEnum(int32_t aValue, const KTableEntry aTable[])
|
1999-07-18 04:32:32 +04:00
|
|
|
{
|
2015-11-20 06:31:38 +03:00
|
|
|
#ifdef DEBUG
|
2015-11-20 05:08:57 +03:00
|
|
|
typedef decltype(aTable[0].mValue) table_value_type;
|
|
|
|
NS_ASSERTION(table_value_type(aValue) == aValue, "Value out of range");
|
2015-11-20 06:31:38 +03:00
|
|
|
#endif
|
2015-11-20 05:08:57 +03:00
|
|
|
for (int32_t i = 0; ; ++i) {
|
2015-11-20 05:09:07 +03:00
|
|
|
const KTableEntry& entry = aTable[i];
|
2018-01-15 19:14:55 +03:00
|
|
|
if (entry.IsSentinel()) {
|
1999-07-18 04:32:32 +04:00
|
|
|
break;
|
|
|
|
}
|
2015-11-20 05:08:57 +03:00
|
|
|
if (aValue == entry.mValue) {
|
|
|
|
return entry.mKeyword;
|
1999-07-18 04:32:32 +04:00
|
|
|
}
|
|
|
|
}
|
2004-10-01 21:15:15 +04:00
|
|
|
return eCSSKeyword_UNKNOWN;
|
1999-07-18 04:32:32 +04:00
|
|
|
}
|
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
const nsCString&
|
2015-11-20 05:09:07 +03:00
|
|
|
nsCSSProps::ValueToKeyword(int32_t aValue, const KTableEntry aTable[])
|
2000-03-31 11:08:36 +04:00
|
|
|
{
|
2004-10-01 21:15:15 +04:00
|
|
|
nsCSSKeyword keyword = ValueToKeywordEnum(aValue, aTable);
|
|
|
|
if (keyword == eCSSKeyword_UNKNOWN) {
|
2001-11-28 00:13:53 +03:00
|
|
|
static nsDependentCString sNullStr("");
|
2000-08-22 10:57:32 +04:00
|
|
|
return sNullStr;
|
2000-03-31 11:08:36 +04:00
|
|
|
} else {
|
2004-10-01 21:15:15 +04:00
|
|
|
return nsCSSKeywords::GetStringValue(keyword);
|
2000-03-31 11:08:36 +04:00
|
|
|
}
|
|
|
|
}
|
1999-07-18 04:32:32 +04:00
|
|
|
|
2018-04-26 08:00:50 +03:00
|
|
|
const CSSPropFlags nsCSSProps::kFlagsTable[eCSSProperty_COUNT] = {
|
2018-04-26 02:01:02 +03:00
|
|
|
#define CSS_PROP_LONGHAND(name_, id_, method_, flags_, ...) flags_,
|
|
|
|
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, ...) flags_,
|
|
|
|
#include "mozilla/ServoCSSPropList.h"
|
2009-09-11 14:46:36 +04:00
|
|
|
#undef CSS_PROP_SHORTHAND
|
2018-04-26 02:01:02 +03:00
|
|
|
#undef CSS_PROP_LONGHAND
|
2008-10-08 02:10:19 +04:00
|
|
|
};
|
|
|
|
|
2012-07-14 03:59:05 +04:00
|
|
|
/* static */ bool
|
2013-03-13 20:58:39 +04:00
|
|
|
nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = {
|
2015-10-03 04:12:09 +03:00
|
|
|
// If the property has any "ENABLED_IN" flag set, it is disabled by
|
|
|
|
// default. Note that, if a property has pref, whatever its default
|
|
|
|
// value is, it will later be changed in nsCSSProps::AddRefTable().
|
|
|
|
// If the property has "ENABLED_IN" flags but doesn't have a pref,
|
|
|
|
// it is an internal property which is disabled elsewhere.
|
|
|
|
#define IS_ENABLED_BY_DEFAULT(flags_) \
|
2018-04-26 08:00:50 +03:00
|
|
|
(!((flags_) & (CSSPropFlags::EnabledMask | CSSPropFlags::Inaccessible)))
|
2015-10-03 04:12:09 +03:00
|
|
|
|
2018-04-17 09:57:04 +03:00
|
|
|
#define CSS_PROP_LONGHAND(name_, id_, method_, flags_, ...) \
|
2015-10-03 04:12:09 +03:00
|
|
|
IS_ENABLED_BY_DEFAULT(flags_),
|
2018-04-17 09:57:04 +03:00
|
|
|
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, ...) \
|
2015-10-03 04:12:09 +03:00
|
|
|
IS_ENABLED_BY_DEFAULT(flags_),
|
2018-04-17 09:57:04 +03:00
|
|
|
#define CSS_PROP_ALIAS(...) true,
|
|
|
|
#include "mozilla/ServoCSSPropList.h"
|
2018-04-18 20:10:35 +03:00
|
|
|
#undef CSS_PROP_ALIAS
|
2018-04-17 09:57:04 +03:00
|
|
|
#undef CSS_PROP_SHORTHAND
|
|
|
|
#undef CSS_PROP_LONGHAND
|
2015-10-03 04:12:09 +03:00
|
|
|
|
|
|
|
#undef IS_ENABLED_BY_DEFAULT
|
2012-07-14 03:59:05 +04:00
|
|
|
};
|
2015-01-17 07:16:01 +03:00
|
|
|
|
2015-06-03 22:21:24 +03:00
|
|
|
#include "../../dom/base/PropertyUseCounterMap.inc"
|
|
|
|
|
|
|
|
/* static */ const UseCounter
|
|
|
|
nsCSSProps::gPropertyUseCounter[eCSSProperty_COUNT_no_shorthands] = {
|
|
|
|
#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) privatename_
|
2018-04-17 09:57:04 +03:00
|
|
|
// Need an extra level of macro nesting to force expansion of method_
|
|
|
|
// params before they get pasted.
|
|
|
|
#define CSS_PROP_USE_COUNTER(method_) \
|
2015-06-03 22:21:24 +03:00
|
|
|
static_cast<UseCounter>(USE_COUNTER_FOR_CSS_PROPERTY_##method_),
|
2018-04-17 09:57:04 +03:00
|
|
|
#define CSS_PROP_LONGHAND(name_, id_, method_, ...) \
|
|
|
|
CSS_PROP_USE_COUNTER(method_)
|
|
|
|
#include "mozilla/ServoCSSPropList.h"
|
|
|
|
#undef CSS_PROP_LONGHAND
|
|
|
|
#undef CSS_PROP_USE_COUNTER
|
2015-06-03 22:21:24 +03:00
|
|
|
#undef CSS_PROP_PUBLIC_OR_PRIVATE
|
|
|
|
};
|
|
|
|
|
2015-09-22 08:58:20 +03:00
|
|
|
#include "nsCSSPropsGenerated.inc"
|