Bug 1334330 - Part 1: stylo: Abstractify nsMappedAttributes to work on arbitrary containers of specified value data; r=bz,emilio

MozReview-Commit-ID: BSM4TC9RKot

--HG--
extra : rebase_source : 5f2c5d998b9e2bc10a2c9ce8d0b3ce90817a0d39
This commit is contained in:
Manish Goregaokar 2017-01-26 13:39:13 -08:00
Родитель 1e16d07cc0
Коммит 48bc1c741c
60 изменённых файлов: 231 добавлений и 148 удалений

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

@ -37,6 +37,6 @@ nsMappedAttributeElement::GetAttributeMappingFunction() const
void
nsMappedAttributeElement::MapNoAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
}

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

@ -13,13 +13,14 @@
#define NS_MAPPEDATTRIBUTEELEMENT_H_
#include "mozilla/Attributes.h"
#include "mozilla/GenericSpecifiedValues.h"
#include "nsStyledElement.h"
class nsMappedAttributes;
struct nsRuleData;
typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aData);
typedef nsStyledElement nsMappedAttributeElementBase;
@ -36,7 +37,7 @@ public:
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
static void MapNoAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData);
GenericSpecifiedValues* aGenericData);
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
virtual bool SetMappedAttribute(nsIDocument* aDocument,

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

@ -11,8 +11,9 @@
#include "nsMappedAttributes.h"
#include "nsHTMLStyleSheet.h"
#include "nsRuleWalker.h"
#include "nsRuleData.h"
#include "nsRuleWalker.h"
#include "mozilla/GenericSpecifiedValues.h"
#include "mozilla/HashFunctions.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/ServoDeclarationBlock.h"

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

@ -53,8 +53,9 @@ HTMLBRElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLBRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
nsCSSValue* clear = aData->ValueForClear();
if (clear->GetUnit() == eCSSUnit_Null) {
@ -64,7 +65,7 @@ HTMLBRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -46,7 +46,7 @@ private:
virtual ~HTMLBRElement();
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -360,8 +360,9 @@ HTMLBodyElement::UnbindFromTree(bool aDeep, bool aNullParent)
void
HTMLBodyElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
// When display if first asked for, go ahead and get our colors set up.
nsIPresShell *presShell = aData->mPresContext->GetPresShell();
@ -403,8 +404,8 @@ HTMLBodyElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
nsMapRuleToAttributesFunc

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

@ -144,7 +144,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -60,19 +60,21 @@ HTMLDivElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLDivElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
static void
MapMarqueeAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
MapMarqueeAttributesIntoRule(const nsMappedAttributes* aAttributes, GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBGColorInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapBGColorInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -44,7 +44,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -55,8 +55,9 @@ HTMLFontElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLFontElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Font)) {
// face: string list
nsCSSValue* family = aData->ValueForFontFamily();
@ -108,7 +109,7 @@ HTMLFontElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -60,7 +60,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -99,7 +99,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -67,8 +67,9 @@ HTMLHRElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLHRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
bool noshade = false;
const nsAttrValue* colorValue = aAttributes->GetAttr(nsGkAtoms::color);
@ -227,7 +228,7 @@ HTMLHRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -77,7 +77,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -46,10 +46,11 @@ HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLHeadingElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -45,7 +45,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -101,8 +101,9 @@ HTMLIFrameElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLIFrameElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Border)) {
// frameborder: 0 | 1 (| NO | YES in quirks mode)
// If frameborder is 0 or No, set border to 0
@ -150,8 +151,8 @@ HTMLIFrameElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -198,7 +198,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
static const DOMTokenListSupportedToken sSupportedSandboxTokens[];
};

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

@ -319,13 +319,14 @@ HTMLImageElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLImageElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
nsChangeHint

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

@ -361,7 +361,7 @@ private:
bool SourceElementMatches(nsIContent* aSourceNode);
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
bool mInDocResponsiveContent;
RefPtr<ImageLoadTask> mPendingImageLoadTask;

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

@ -5912,19 +5912,20 @@ HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLInputElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value && value->Type() == nsAttrValue::eEnum &&
value->GetEnumValue() == NS_FORM_INPUT_IMAGE) {
nsGenericHTMLFormElementWithState::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapImageBorderAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElementWithState::MapImageMarginAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElementWithState::MapImageSizeAttributesInto(aAttributes, aGenericData);
// Images treat align as "float"
nsGenericHTMLFormElementWithState::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapImageAlignAttributeInto(aAttributes, aGenericData);
}
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aGenericData);
}
nsChangeHint

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

@ -1622,7 +1622,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Returns true if this input's type will fire a DOM "change" event when it

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

@ -72,8 +72,9 @@ HTMLLIElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLLIElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(List)) {
nsCSSValue* listStyleType = aData->ValueForListStyleType();
if (listStyleType->GetUnit() == eCSSUnit_Null) {
@ -84,7 +85,7 @@ HTMLLIElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -63,7 +63,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -505,13 +505,13 @@ HTMLObjectElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLObjectElement::MapAttributesIntoRule(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
GenericSpecifiedValues *aGenericData)
{
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElement::MapImageAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElement::MapImageBorderAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElement::MapImageMarginAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElement::MapImageSizeAttributesInto(aAttributes, aGenericData);
nsGenericHTMLFormElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -269,7 +269,7 @@ private:
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
bool mIsDoneAddingChildren;
};

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

@ -44,10 +44,11 @@ HTMLParagraphElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLParagraphElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -53,7 +53,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -47,8 +47,9 @@ HTMLPreElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
nsCSSValue* whiteSpace = aData->ValueForWhiteSpace();
if (whiteSpace->GetUnit() == eCSSUnit_Null) {
@ -58,7 +59,7 @@ HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -57,7 +57,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -1412,10 +1412,11 @@ HTMLSelectElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLSelectElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLFormElementWithState::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLFormElementWithState::MapImageAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aGenericData);
}
nsChangeHint

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

@ -655,7 +655,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -113,8 +113,9 @@ HTMLSharedElement::ParseAttribute(int32_t aNamespaceID,
static void
DirectoryMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(List)) {
nsCSSValue* listStyleType = aData->ValueForListStyleType();
if (listStyleType->GetUnit() == eCSSUnit_Null) {
@ -130,7 +131,7 @@ DirectoryMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -92,8 +92,9 @@ HTMLSharedListElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLSharedListElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(List)) {
nsCSSValue* listStyleType = aData->ValueForListStyleType();
if (listStyleType->GetUnit() == eCSSUnit_Null) {
@ -105,7 +106,7 @@ HTMLSharedListElement::MapAttributesIntoRule(const nsMappedAttributes* aAttribut
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -83,7 +83,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -259,28 +259,28 @@ HTMLSharedObjectElement::ParseAttribute(int32_t aNamespaceID,
static void
MapAttributesIntoRuleBase(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData);
nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aGenericData);
}
static void
MapAttributesIntoRuleExceptHidden(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
GenericSpecifiedValues* aGenericData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(aAttributes, aData);
MapAttributesIntoRuleBase(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(aAttributes, aGenericData);
}
void
HTMLSharedObjectElement::MapAttributesIntoRule(const nsMappedAttributes *aAttributes,
nsRuleData *aData)
GenericSpecifiedValues* aGenericData)
{
MapAttributesIntoRuleBase(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
MapAttributesIntoRuleBase(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -219,7 +219,7 @@ private:
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Decides whether we should load embed node content.

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

@ -51,8 +51,9 @@ HTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableCaptionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TableBorder)) {
nsCSSValue* captionSide = aData->ValueForCaptionSide();
if (captionSide->GetUnit() == eCSSUnit_Null) {
@ -62,7 +63,7 @@ HTMLTableCaptionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttrib
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -46,7 +46,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -440,8 +440,9 @@ HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableCellElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
// width: value
nsCSSValue* width = aData->ValueForWidth();
@ -509,8 +510,8 @@ HTMLTableCellElement::MapAttributesIntoRule(const nsMappedAttributes* aAttribute
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -162,7 +162,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -64,8 +64,9 @@ HTMLTableColElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableColElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Table)) {
nsCSSValue *span = aData->ValueForSpan();
if (span->GetUnit() == eCSSUnit_Null) {
@ -122,7 +123,7 @@ HTMLTableColElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -88,7 +88,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -707,8 +707,9 @@ HTMLTableElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
// XXX Bug 211636: This function is used by a single style rule
// that's used to match two different type of elements -- tables, and
// table cells. (nsHTMLTableCellElement overrides
@ -841,8 +842,8 @@ HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
borderBottomWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)
@ -880,8 +881,9 @@ HTMLTableElement::GetAttributeMappingFunction() const
static void
MapInheritedTableAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Padding)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellpadding);
if (value && value->Type() == nsAttrValue::eInteger) {

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

@ -228,7 +228,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -264,8 +264,9 @@ HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableRowElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
// height: value
nsCSSValue* height = aData->ValueForHeight();
@ -296,8 +297,8 @@ HTMLTableRowElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -101,7 +101,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -167,8 +167,9 @@ HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableSectionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
// height: value
nsCSSValue* height = aData->ValueForHeight();
@ -197,8 +198,8 @@ HTMLTableSectionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttrib
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -83,7 +83,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -436,8 +436,9 @@ HTMLTextAreaElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTextAreaElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
// wrap=off
nsCSSValue* whiteSpace = aData->ValueForWhiteSpace();
@ -450,8 +451,8 @@ HTMLTextAreaElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes
}
}
nsGenericHTMLFormElementWithState::MapDivAlignAttributeInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLFormElementWithState::MapDivAlignAttributeInto(aAttributes, aGenericData);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aGenericData);
}
nsChangeHint

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

@ -394,7 +394,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -98,10 +98,11 @@ HTMLVideoElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLVideoElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsRuleData* aData = aGenericData->AsRuleData();
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)

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

@ -149,7 +149,7 @@ protected:
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
};
} // namespace dom

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

@ -1206,8 +1206,9 @@ nsGenericHTMLElement::ParseScrollingValue(const nsAString& aString,
}
static inline void
MapLangAttributeInto(const nsMappedAttributes* aAttributes, nsRuleData* aData)
MapLangAttributeInto(const nsMappedAttributes* aAttributes, GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (!(aData->mSIDs & (NS_STYLE_INHERIT_BIT(Font) |
NS_STYLE_INHERIT_BIT(Text)))) {
return;
@ -1247,8 +1248,9 @@ MapLangAttributeInto(const nsMappedAttributes* aAttributes, nsRuleData* aData)
*/
void
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(UserInterface)) {
nsCSSValue* userModify = aData->ValueForUserModify();
if (userModify->GetUnit() == eCSSUnit_Null) {
@ -1271,8 +1273,9 @@ nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(const nsMappedAttribut
void
nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
MapCommonAttributesIntoExceptHidden(aAttributes, aData);
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
@ -1335,13 +1338,14 @@ nsGenericHTMLElement::sBackgroundColorAttributeMap[] = {
void
nsGenericHTMLElement::MapImageAlignAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData)
GenericSpecifiedValues* aGenericData)
{
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum) {
int32_t align = value->GetEnumValue();
nsCSSValue* cssFloat = aRuleData->ValueForFloat();
nsCSSValue* cssFloat = aData->ValueForFloat();
if (cssFloat->GetUnit() == eCSSUnit_Null) {
if (align == NS_STYLE_TEXT_ALIGN_LEFT) {
cssFloat->SetEnumValue(StyleFloat::Left);
@ -1349,7 +1353,7 @@ nsGenericHTMLElement::MapImageAlignAttributeInto(const nsMappedAttributes* aAttr
cssFloat->SetEnumValue(StyleFloat::Right);
}
}
nsCSSValue* verticalAlign = aRuleData->ValueForVerticalAlign();
nsCSSValue* verticalAlign = aData->ValueForVerticalAlign();
if (verticalAlign->GetUnit() == eCSSUnit_Null) {
switch (align) {
case NS_STYLE_TEXT_ALIGN_LEFT:
@ -1366,10 +1370,11 @@ nsGenericHTMLElement::MapImageAlignAttributeInto(const nsMappedAttributes* aAttr
void
nsGenericHTMLElement::MapDivAlignAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData)
GenericSpecifiedValues* aGenericData)
{
if (aRuleData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
nsCSSValue* textAlign = aRuleData->ValueForTextAlign();
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
nsCSSValue* textAlign = aData->ValueForTextAlign();
if (textAlign->GetUnit() == eCSSUnit_Null) {
// align: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
@ -1382,8 +1387,9 @@ nsGenericHTMLElement::MapDivAlignAttributeInto(const nsMappedAttributes* aAttrib
void
nsGenericHTMLElement::MapImageMarginAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (!(aData->mSIDs & NS_STYLE_INHERIT_BIT(Margin)))
return;
@ -1430,8 +1436,9 @@ nsGenericHTMLElement::MapImageMarginAttributeInto(const nsMappedAttributes* aAtt
void
nsGenericHTMLElement::MapImageSizeAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (!(aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)))
return;
@ -1458,8 +1465,9 @@ nsGenericHTMLElement::MapImageSizeAttributesInto(const nsMappedAttributes* aAttr
void
nsGenericHTMLElement::MapImageBorderAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (!(aData->mSIDs & NS_STYLE_INHERIT_BIT(Border)))
return;
@ -1514,8 +1522,9 @@ nsGenericHTMLElement::MapImageBorderAttributeInto(const nsMappedAttributes* aAtt
void
nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (!(aData->mSIDs & NS_STYLE_INHERIT_BIT(Background)))
return;
@ -1542,8 +1551,9 @@ nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
void
nsGenericHTMLElement::MapBGColorInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (!(aData->mSIDs & NS_STYLE_INHERIT_BIT(Background)))
return;
@ -1560,8 +1570,9 @@ nsGenericHTMLElement::MapBGColorInto(const nsMappedAttributes* aAttributes,
void
nsGenericHTMLElement::MapBackgroundAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
MapBackgroundInto(aAttributes, aData);
MapBGColorInto(aAttributes, aData);
}

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

@ -654,7 +654,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData);
GenericSpecifiedValues* aGenericData);
/**
* Same as MapCommonAttributesInto except that it does not handle hidden.
*
@ -663,7 +663,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapCommonAttributesIntoExceptHidden(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData);
GenericSpecifiedValues* aGenericData);
static const MappedAttributeEntry sCommonAttributeMap[];
static const MappedAttributeEntry sImageMarginSizeAttributeMap[];
@ -681,7 +681,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapImageAlignAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the align attribute into a style struct for things
@ -692,7 +692,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapDivAlignAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the image border attribute into a style struct.
@ -702,7 +702,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapImageBorderAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the image margin attribute into a style struct.
*
@ -711,7 +711,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapImageMarginAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the image position attribute into a style struct.
*
@ -720,7 +720,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapImageSizeAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the background attribute
* into a style struct.
@ -730,7 +730,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapBackgroundInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the bgcolor attribute
* into a style struct.
@ -740,7 +740,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapBGColorInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the background attributes (currently background and bgcolor)
* into a style struct.
@ -750,7 +750,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapBackgroundAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Helper to map the scrolling attribute on FRAME and IFRAME
* into a style struct.
@ -760,7 +760,7 @@ public:
* @see GetAttributeMappingFunction
*/
static void MapScrollingAttributeInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
GenericSpecifiedValues* aGenericData);
/**
* Get the presentation context for this content node.
* @return the presentation context

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

@ -487,8 +487,9 @@ nsMathMLElement::ParseNumericValue(const nsString& aString,
void
nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Font)) {
// scriptsizemultiplier
//

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

@ -72,7 +72,7 @@ public:
nsIDocument* aDocument);
static void MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
nsRuleData* aRuleData);
GenericSpecifiedValues* aGenericData);
virtual nsresult GetEventTargetParent(
mozilla::EventChainPreVisitor& aVisitor) override;

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

@ -0,0 +1,33 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
/*
* Generic representation of a container of specified CSS values, which
* could potentially be Servo- or Gecko- format. Used to make attribute mapping
* code generic over style backends.
*/
#ifndef mozilla_GenericSpecifiedValues_h
#define mozilla_GenericSpecifiedValues_h
#include "nsCSSProps.h"
#include "nsCSSValue.h"
#include "nsPresContext.h"
struct nsRuleData;
// This provides a common interface for attribute mappers (MapAttributesIntoRule)
// to use regardless of the style backend. If the style backend is Gecko,
// this will contain an nsRuleData. If it is Servo, it will be a PropertyDeclarationBlock.
class GenericSpecifiedValues {
public:
// Check if we already contain a certain longhand
virtual bool PropertyIsSet(nsCSSPropertyID aId) = 0;
virtual nsRuleData* AsRuleData() = 0;
};
#endif // mozilla_GenericSpecifiedValues_h

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

@ -86,6 +86,7 @@ EXPORTS.mozilla += [
'DeclarationBlock.h',
'DeclarationBlockInlines.h',
'DocumentStyleRootIterator.h',
'GenericSpecifiedValues.h',
'HandleRefPtr.h',
'IncrementalClearCOMRuleArray.h',
'LayerAnimationInfo.h',

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

@ -12,6 +12,7 @@
#define nsRuleData_h_
#include "mozilla/CSSVariableDeclarations.h"
#include "mozilla/GenericSpecifiedValues.h"
#include "mozilla/RuleNodeCacheConditions.h"
#include "mozilla/SheetType.h"
#include "nsAutoPtr.h"
@ -25,7 +26,7 @@ struct nsRuleData;
typedef void (*nsPostResolveFunc)(void* aStyleStruct, nsRuleData* aData);
struct nsRuleData
struct nsRuleData final: GenericSpecifiedValues
{
const uint32_t mSIDs;
mozilla::RuleNodeCacheConditions mConditions;
@ -120,6 +121,15 @@ struct nsRuleData
#undef CSS_PROP
#undef CSS_PROP_PUBLIC_OR_PRIVATE
// GenericSpecifiedValues overrides
bool PropertyIsSet(nsCSSPropertyID aId) override {
return ValueFor(aId)->GetUnit() != eCSSUnit_Null;
}
nsRuleData* AsRuleData() override {
return this;
}
private:
inline size_t GetPoisonOffset();