зеркало из https://github.com/mozilla/gecko-dev.git
Bug 938123 - Build layout/style in unified mode; r=roc
This commit is contained in:
Родитель
dab5894743
Коммит
35ff0cae16
|
@ -73,6 +73,14 @@ public:
|
||||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||||
|
|
||||||
|
static bool
|
||||||
|
CloneRuleInto(Rule* aRule, void* aArray)
|
||||||
|
{
|
||||||
|
nsRefPtr<Rule> clone = aRule->Clone();
|
||||||
|
static_cast<nsCOMArray<Rule>*>(aArray)->AppendObject(clone);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// to help implement nsIDOMCSSRule
|
// to help implement nsIDOMCSSRule
|
||||||
void AppendRulesToCssText(nsAString& aCssText);
|
void AppendRulesToCssText(nsAString& aCssText);
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
class nsIDOMCSSStyleDeclaration;
|
class nsIDOMCSSStyleDeclaration;
|
||||||
class nsIDOMCSSStyleSheet;
|
class nsIDOMCSSStyleSheet;
|
||||||
|
|
||||||
namespace css = mozilla::css;
|
using namespace mozilla;
|
||||||
|
|
||||||
#define NS_IF_CLONE(member_) \
|
#define NS_IF_CLONE(member_) \
|
||||||
PR_BEGIN_MACRO \
|
PR_BEGIN_MACRO \
|
||||||
|
|
|
@ -76,7 +76,7 @@ EXPORTS.mozilla.css += [
|
||||||
'StyleRule.h',
|
'StyleRule.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
'AnimationCommon.cpp',
|
'AnimationCommon.cpp',
|
||||||
'CSS.cpp',
|
'CSS.cpp',
|
||||||
'Declaration.cpp',
|
'Declaration.cpp',
|
||||||
|
@ -92,7 +92,6 @@ SOURCES += [
|
||||||
'nsCSSProps.cpp',
|
'nsCSSProps.cpp',
|
||||||
'nsCSSPseudoClasses.cpp',
|
'nsCSSPseudoClasses.cpp',
|
||||||
'nsCSSPseudoElements.cpp',
|
'nsCSSPseudoElements.cpp',
|
||||||
'nsCSSRuleProcessor.cpp',
|
|
||||||
'nsCSSRules.cpp',
|
'nsCSSRules.cpp',
|
||||||
'nsCSSScanner.cpp',
|
'nsCSSScanner.cpp',
|
||||||
'nsCSSStyleSheet.cpp',
|
'nsCSSStyleSheet.cpp',
|
||||||
|
@ -123,6 +122,11 @@ SOURCES += [
|
||||||
'StyleRule.cpp',
|
'StyleRule.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# nsCSSRuleProcessor.cpp needs to be built separately because it uses plarena.h.
|
||||||
|
SOURCES += [
|
||||||
|
'nsCSSRuleProcessor.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
FAIL_ON_WARNINGS = True
|
FAIL_ON_WARNINGS = True
|
||||||
|
|
||||||
LIBXUL_LIBRARY = True
|
LIBXUL_LIBRARY = True
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "nsStyleContext.h"
|
#include "nsStyleContext.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
|
|
||||||
namespace css = mozilla::css;
|
using namespace mozilla;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does a fast move of aSource to aDest. The previous value in
|
* Does a fast move of aSource to aDest. The previous value in
|
||||||
|
|
|
@ -19,13 +19,13 @@ const char* const kCSSRawKeywords[] = {
|
||||||
};
|
};
|
||||||
#undef CSS_KEY
|
#undef CSS_KEY
|
||||||
|
|
||||||
static int32_t gTableRefCount;
|
static int32_t gKeywordTableRefCount;
|
||||||
static nsStaticCaseInsensitiveNameTable* gKeywordTable;
|
static nsStaticCaseInsensitiveNameTable* gKeywordTable;
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSKeywords::AddRefTable(void)
|
nsCSSKeywords::AddRefTable(void)
|
||||||
{
|
{
|
||||||
if (0 == gTableRefCount++) {
|
if (0 == gKeywordTableRefCount++) {
|
||||||
NS_ASSERTION(!gKeywordTable, "pre existing array!");
|
NS_ASSERTION(!gKeywordTable, "pre existing array!");
|
||||||
gKeywordTable = new nsStaticCaseInsensitiveNameTable();
|
gKeywordTable = new nsStaticCaseInsensitiveNameTable();
|
||||||
if (gKeywordTable) {
|
if (gKeywordTable) {
|
||||||
|
@ -51,7 +51,7 @@ nsCSSKeywords::AddRefTable(void)
|
||||||
void
|
void
|
||||||
nsCSSKeywords::ReleaseTable(void)
|
nsCSSKeywords::ReleaseTable(void)
|
||||||
{
|
{
|
||||||
if (0 == --gTableRefCount) {
|
if (0 == --gKeywordTableRefCount) {
|
||||||
if (gKeywordTable) {
|
if (gKeywordTable) {
|
||||||
delete gKeywordTable;
|
delete gKeywordTable;
|
||||||
gKeywordTable = nullptr;
|
gKeywordTable = nullptr;
|
||||||
|
|
|
@ -48,7 +48,7 @@ const char* const kCSSRawProperties[eCSSProperty_COUNT_with_aliases] = {
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
static int32_t gTableRefCount;
|
static int32_t gPropertyTableRefCount;
|
||||||
static nsStaticCaseInsensitiveNameTable* gPropertyTable;
|
static nsStaticCaseInsensitiveNameTable* gPropertyTable;
|
||||||
static nsStaticCaseInsensitiveNameTable* gFontDescTable;
|
static nsStaticCaseInsensitiveNameTable* gFontDescTable;
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ static nsCSSProperty gAliases[eCSSAliasCount != 0 ? eCSSAliasCount : 1] = {
|
||||||
void
|
void
|
||||||
nsCSSProps::AddRefTable(void)
|
nsCSSProps::AddRefTable(void)
|
||||||
{
|
{
|
||||||
if (0 == gTableRefCount++) {
|
if (0 == gPropertyTableRefCount++) {
|
||||||
NS_ABORT_IF_FALSE(!gPropertyTable, "pre existing array!");
|
NS_ABORT_IF_FALSE(!gPropertyTable, "pre existing array!");
|
||||||
NS_ABORT_IF_FALSE(!gFontDescTable, "pre existing array!");
|
NS_ABORT_IF_FALSE(!gFontDescTable, "pre existing array!");
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ nsCSSProps::BuildShorthandsContainingTable()
|
||||||
void
|
void
|
||||||
nsCSSProps::ReleaseTable(void)
|
nsCSSProps::ReleaseTable(void)
|
||||||
{
|
{
|
||||||
if (0 == --gTableRefCount) {
|
if (0 == --gPropertyTableRefCount) {
|
||||||
delete gPropertyTable;
|
delete gPropertyTable;
|
||||||
gPropertyTable = nullptr;
|
gPropertyTable = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ using namespace mozilla;
|
||||||
#undef CSS_PSEUDO_CLASS
|
#undef CSS_PSEUDO_CLASS
|
||||||
|
|
||||||
#define CSS_PSEUDO_CLASS(name_, value_, pref_) \
|
#define CSS_PSEUDO_CLASS(name_, value_, pref_) \
|
||||||
NS_STATIC_ATOM_BUFFER(name_##_buffer, value_)
|
NS_STATIC_ATOM_BUFFER(name_##_pseudo_class_buffer, value_)
|
||||||
#include "nsCSSPseudoClassList.h"
|
#include "nsCSSPseudoClassList.h"
|
||||||
#undef CSS_PSEUDO_CLASS
|
#undef CSS_PSEUDO_CLASS
|
||||||
|
|
||||||
static const nsStaticAtom CSSPseudoClasses_info[] = {
|
static const nsStaticAtom CSSPseudoClasses_info[] = {
|
||||||
#define CSS_PSEUDO_CLASS(name_, value_, pref_) \
|
#define CSS_PSEUDO_CLASS(name_, value_, pref_) \
|
||||||
NS_STATIC_ATOM(name_##_buffer, &sPseudoClass_##name_),
|
NS_STATIC_ATOM(name_##_pseudo_class_buffer, &sPseudoClass_##name_),
|
||||||
#include "nsCSSPseudoClassList.h"
|
#include "nsCSSPseudoClassList.h"
|
||||||
#undef CSS_PSEUDO_CLASS
|
#undef CSS_PSEUDO_CLASS
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,13 +21,13 @@ using namespace mozilla;
|
||||||
#undef CSS_PSEUDO_ELEMENT
|
#undef CSS_PSEUDO_ELEMENT
|
||||||
|
|
||||||
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
||||||
NS_STATIC_ATOM_BUFFER(name_##_buffer, value_)
|
NS_STATIC_ATOM_BUFFER(name_##_pseudo_element_buffer, value_)
|
||||||
#include "nsCSSPseudoElementList.h"
|
#include "nsCSSPseudoElementList.h"
|
||||||
#undef CSS_PSEUDO_ELEMENT
|
#undef CSS_PSEUDO_ELEMENT
|
||||||
|
|
||||||
static const nsStaticAtom CSSPseudoElements_info[] = {
|
static const nsStaticAtom CSSPseudoElements_info[] = {
|
||||||
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
#define CSS_PSEUDO_ELEMENT(name_, value_, flags_) \
|
||||||
NS_STATIC_ATOM(name_##_buffer, (nsIAtom**)&nsCSSPseudoElements::name_),
|
NS_STATIC_ATOM(name_##_pseudo_element_buffer, (nsIAtom**)&nsCSSPseudoElements::name_),
|
||||||
#include "nsCSSPseudoElementList.h"
|
#include "nsCSSPseudoElementList.h"
|
||||||
#undef CSS_PSEUDO_ELEMENT
|
#undef CSS_PSEUDO_ELEMENT
|
||||||
};
|
};
|
||||||
|
|
|
@ -505,14 +505,6 @@ ImportRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
||||||
// must be outside the namespace
|
// must be outside the namespace
|
||||||
DOMCI_DATA(CSSImportRule, css::ImportRule)
|
DOMCI_DATA(CSSImportRule, css::ImportRule)
|
||||||
|
|
||||||
static bool
|
|
||||||
CloneRuleInto(css::Rule* aRule, void* aArray)
|
|
||||||
{
|
|
||||||
nsRefPtr<css::Rule> clone = aRule->Clone();
|
|
||||||
static_cast<nsCOMArray<css::Rule>*>(aArray)->AppendObject(clone);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace css {
|
namespace css {
|
||||||
|
|
||||||
|
@ -532,7 +524,7 @@ SetParentRuleReference(Rule* aRule, void* aParentRule)
|
||||||
GroupRule::GroupRule(const GroupRule& aCopy)
|
GroupRule::GroupRule(const GroupRule& aCopy)
|
||||||
: Rule(aCopy)
|
: Rule(aCopy)
|
||||||
{
|
{
|
||||||
const_cast<GroupRule&>(aCopy).mRules.EnumerateForwards(CloneRuleInto, &mRules);
|
const_cast<GroupRule&>(aCopy).mRules.EnumerateForwards(GroupRule::CloneRuleInto, &mRules);
|
||||||
mRules.EnumerateForwards(SetParentRuleReference, this);
|
mRules.EnumerateForwards(SetParentRuleReference, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -749,14 +749,6 @@ static bool SetStyleSheetReference(css::Rule* aRule, void* aSheet)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
|
||||||
CloneRuleInto(css::Rule* aRule, void* aArray)
|
|
||||||
{
|
|
||||||
nsRefPtr<css::Rule> clone = aRule->Clone();
|
|
||||||
static_cast<nsCOMArray<css::Rule>*>(aArray)->AppendObject(clone);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ChildSheetListBuilder {
|
struct ChildSheetListBuilder {
|
||||||
nsRefPtr<nsCSSStyleSheet>* sheetSlot;
|
nsRefPtr<nsCSSStyleSheet>* sheetSlot;
|
||||||
nsCSSStyleSheet* parent;
|
nsCSSStyleSheet* parent;
|
||||||
|
@ -862,7 +854,7 @@ nsCSSStyleSheetInner::nsCSSStyleSheetInner(nsCSSStyleSheetInner& aCopy,
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsCSSStyleSheetInner);
|
MOZ_COUNT_CTOR(nsCSSStyleSheetInner);
|
||||||
AddSheet(aPrimarySheet);
|
AddSheet(aPrimarySheet);
|
||||||
aCopy.mOrderedRules.EnumerateForwards(CloneRuleInto, &mOrderedRules);
|
aCopy.mOrderedRules.EnumerateForwards(css::GroupRule::CloneRuleInto, &mOrderedRules);
|
||||||
mOrderedRules.EnumerateForwards(SetStyleSheetReference, aPrimarySheet);
|
mOrderedRules.EnumerateForwards(SetStyleSheetReference, aPrimarySheet);
|
||||||
|
|
||||||
ChildSheetListBuilder builder = { &mFirstChild, aPrimarySheet };
|
ChildSheetListBuilder builder = { &mFirstChild, aPrimarySheet };
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "imgRequestProxy.h"
|
#include "imgRequestProxy.h"
|
||||||
#include "nsDeviceContext.h"
|
#include "nsDeviceContext.h"
|
||||||
|
|
||||||
namespace css = mozilla::css;
|
using namespace mozilla;
|
||||||
|
|
||||||
nsCSSValue::nsCSSValue(int32_t aValue, nsCSSUnit aUnit)
|
nsCSSValue::nsCSSValue(int32_t aValue, nsCSSUnit aUnit)
|
||||||
: mUnit(aUnit)
|
: mUnit(aUnit)
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
#include "nsAttrValue.h"
|
#include "nsAttrValue.h"
|
||||||
#include "nsAttrValueInlines.h"
|
#include "nsAttrValueInlines.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
using namespace mozilla::dom;
|
using namespace mozilla::dom;
|
||||||
namespace css = mozilla::css;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "nsStyleAnimation.h"
|
#include "nsStyleAnimation.h"
|
||||||
#include "gfxMatrix.h"
|
#include "gfxMatrix.h"
|
||||||
|
|
||||||
namespace css = mozilla::css;
|
using namespace mozilla;
|
||||||
|
|
||||||
namespace nsStyleTransformMatrix {
|
namespace nsStyleTransformMatrix {
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче