Bug 712299 - don't require manual syncing of font data; r=bz

This commit is contained in:
Nathan Froyd 2011-12-20 11:49:16 -05:00
Родитель a0100eeb22
Коммит ac04893f6b
6 изменённых файлов: 56 добавлений и 36 удалений

Просмотреть файл

@ -56,6 +56,7 @@ EXPORTS_NAMESPACES = mozilla/css
EXPORTS = \
nsCSSAnonBoxList.h \
nsCSSAnonBoxes.h \
nsCSSFontDescList.h \
nsCSSKeywordList.h \
nsCSSKeywords.h \
nsCSSParser.h \

Просмотреть файл

@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
CSS_FONT_DESC(font-family, Family)
CSS_FONT_DESC(font-style, Style)
CSS_FONT_DESC(font-weight, Weight)
CSS_FONT_DESC(font-stretch, Stretch)
CSS_FONT_DESC(src, Src)
CSS_FONT_DESC(unicode-range, UnicodeRange)
CSS_FONT_DESC(-moz-font-feature-settings, FontFeatureSettings)
CSS_FONT_DESC(-moz-font-language-override, FontLanguageOverride)

Просмотреть файл

@ -82,18 +82,11 @@ enum nsCSSProperty {
// The "descriptors" that can appear in a @font-face rule.
// They have the syntax of properties but different value rules.
// Keep in sync with kCSSRawFontDescs in nsCSSProps.cpp and
// nsCSSFontFaceStyleDecl::Fields in nsCSSRules.cpp.
enum nsCSSFontDesc {
eCSSFontDesc_UNKNOWN = -1,
eCSSFontDesc_Family,
eCSSFontDesc_Style,
eCSSFontDesc_Weight,
eCSSFontDesc_Stretch,
eCSSFontDesc_Src,
eCSSFontDesc_UnicodeRange,
eCSSFontDesc_FontFeatureSettings,
eCSSFontDesc_FontLanguageOverride,
#define CSS_FONT_DESC(name_, method_) eCSSFontDesc_##method_,
#include "nsCSSFontDescList.h"
#undef CSS_FONT_DESC
eCSSFontDesc_COUNT
};

Просмотреть файл

@ -84,16 +84,10 @@ static nsStaticCaseInsensitiveNameTable* gFontDescTable;
nsCSSProps::gShorthandsContainingTable[eCSSProperty_COUNT_no_shorthands];
/* static */ nsCSSProperty* nsCSSProps::gShorthandsContainingPool = nsnull;
// Keep in sync with enum nsCSSFontDesc in nsCSSProperty.h.
static const char* const kCSSRawFontDescs[] = {
"font-family",
"font-style",
"font-weight",
"font-stretch",
"src",
"unicode-range",
"-moz-font-feature-settings",
"-moz-font-language-override"
#define CSS_FONT_DESC(name_, method_) #name_,
#include "nsCSSFontDescList.h"
#undef CSS_FONT_DESC
};
struct PropertyAndCount {

Просмотреть файл

@ -1309,17 +1309,11 @@ AppendSerializedUnicodeRange(nsCSSValue const & aValue,
}
// Mapping from nsCSSFontDesc codes to nsCSSFontFaceStyleDecl fields.
// Keep this in sync with enum nsCSSFontDesc in nsCSSProperty.h.
nsCSSValue nsCSSFontFaceStyleDecl::* const
nsCSSFontFaceStyleDecl::Fields[] = {
&nsCSSFontFaceStyleDecl::mFamily,
&nsCSSFontFaceStyleDecl::mStyle,
&nsCSSFontFaceStyleDecl::mWeight,
&nsCSSFontFaceStyleDecl::mStretch,
&nsCSSFontFaceStyleDecl::mSrc,
&nsCSSFontFaceStyleDecl::mUnicodeRange,
&nsCSSFontFaceStyleDecl::mFontFeatureSettings,
&nsCSSFontFaceStyleDecl::mFontLanguageOverride
#define CSS_FONT_DESC(name_, method_) &nsCSSFontFaceStyleDecl::m##method_,
#include "nsCSSFontDescList.h"
#undef CSS_FONT_DESC
};
DOMCI_DATA(CSSFontFaceStyleDecl, nsCSSFontFaceStyleDecl)

Просмотреть файл

@ -194,14 +194,9 @@ public:
protected:
friend class nsCSSFontFaceRule;
nsCSSValue mFamily;
nsCSSValue mStyle;
nsCSSValue mWeight;
nsCSSValue mStretch;
nsCSSValue mSrc;
nsCSSValue mUnicodeRange;
nsCSSValue mFontFeatureSettings;
nsCSSValue mFontLanguageOverride;
#define CSS_FONT_DESC(name_, method_) nsCSSValue m##method_;
#include "nsCSSFontDescList.h"
#undef CSS_FONT_DESC
static nsCSSValue nsCSSFontFaceStyleDecl::* const Fields[];
inline nsCSSFontFaceRule* ContainingRule();