mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1420117 - Part 3: Add a ServoCSSParser::ParseCounterStyleDescriptor method. r=xidorn
MozReview-Commit-ID: LHBZ4j1Ji9R --HG-- extra : rebase_source : 800a6271bd524403a9f4dbfb9c9a07dc4e85db8d
This commit is contained in:
parent
5e6e7b03ee
commit
bb4a39a577
@ -757,6 +757,11 @@ SERVO_BINDING_FUNC(Servo_ParseTransformIntoMatrix, bool,
|
||||
RawGeckoGfxMatrix4x4* result);
|
||||
SERVO_BINDING_FUNC(Servo_ParseCounterStyleName, nsAtom*,
|
||||
const nsACString* value);
|
||||
SERVO_BINDING_FUNC(Servo_ParseCounterStyleDescriptor, bool,
|
||||
nsCSSCounterDesc aDescriptor,
|
||||
const nsACString* aValue,
|
||||
RawGeckoURLExtraData* aURLExtraData,
|
||||
nsCSSValue* aResult);
|
||||
|
||||
// AddRef / Release functions
|
||||
#define SERVO_ARC_TYPE(name_, type_) \
|
||||
|
@ -517,6 +517,7 @@ structs-types = [
|
||||
"StyleShapeSource",
|
||||
"StyleTransition",
|
||||
"gfxFontFeatureValueSet",
|
||||
"nsCSSCounterDesc",
|
||||
"nsCSSCounterStyleRule",
|
||||
"nsCSSFontFaceRule",
|
||||
"nsCSSKeyword",
|
||||
|
@ -40,3 +40,14 @@ ServoCSSParser::ParseCounterStyleName(const nsAString& aValue)
|
||||
nsAtom* atom = Servo_ParseCounterStyleName(&value);
|
||||
return already_AddRefed<nsAtom>(atom);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
ServoCSSParser::ParseCounterStyleDescriptor(nsCSSCounterDesc aDescriptor,
|
||||
const nsAString& aValue,
|
||||
URLExtraData* aURLExtraData,
|
||||
nsCSSValue& aResult)
|
||||
{
|
||||
NS_ConvertUTF16toUTF8 value(aValue);
|
||||
return Servo_ParseCounterStyleDescriptor(aDescriptor, &value, aURLExtraData,
|
||||
&aResult);
|
||||
}
|
||||
|
@ -58,6 +58,22 @@ public:
|
||||
* or nullptr if parsing failed or if the name was invalid (like "inherit").
|
||||
*/
|
||||
static already_AddRefed<nsAtom> ParseCounterStyleName(const nsAString& aValue);
|
||||
|
||||
/**
|
||||
* Parses a @counter-style descriptor.
|
||||
*
|
||||
* @param aDescriptor The descriptor to parse.
|
||||
* @param aValue The value of the descriptor.
|
||||
* @param aURLExtraData URL data for parsing. This would be used for
|
||||
* image value URL resolution.
|
||||
* @param aResult The nsCSSValue to store the result in.
|
||||
* @return Whether parsing succeeded.
|
||||
*/
|
||||
static bool
|
||||
ParseCounterStyleDescriptor(nsCSSCounterDesc aDescriptor,
|
||||
const nsAString& aValue,
|
||||
URLExtraData* aURLExtraData,
|
||||
nsCSSValue& aResult);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
Loading…
Reference in New Issue
Block a user