本文整理汇总了C#中CssValue.SetPercentValue方法的典型用法代码示例。如果您正苦于以下问题:C# CssValue.SetPercentValue方法的具体用法?C# CssValue.SetPercentValue怎么用?C# CssValue.SetPercentValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CssValue
的用法示例。
在下文中一共展示了CssValue.SetPercentValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseVariant
//.........这里部分代码省略.........
// VARIANT_ZERO_ANGLE.
if (((aVariantMask & VARIANT_NUMBER) != 0) &&
(nsCSSTokenType.Number == tk.mType)) {
aValue.SetFloatValue(tk.mNumber, nsCSSUnit.Number);
return true;
}
if (((aVariantMask & VARIANT_INTEGER) != 0) &&
(nsCSSTokenType.Number == tk.mType) && tk.mIntegerValid) {
aValue.SetIntValue(tk.mInteger, nsCSSUnit.Integer);
return true;
}
if (((aVariantMask & (VARIANT_LENGTH | VARIANT_ANGLE |
VARIANT_FREQUENCY | VARIANT_TIME)) != 0 &&
nsCSSTokenType.Dimension == tk.mType) ||
((aVariantMask & (VARIANT_LENGTH | VARIANT_ZERO_ANGLE)) != 0 &&
nsCSSTokenType.Number == tk.mType &&
tk.mNumber == 0.0f)) {
if (((aVariantMask & VARIANT_POSITIVE_DIMENSION) != 0 &&
tk.mNumber <= 0.0) ||
((aVariantMask & VARIANT_NONNEGATIVE_DIMENSION) != 0 &&
tk.mNumber < 0.0)) {
UngetToken();
return false;
}
if (TranslateDimension(ref aValue, aVariantMask, tk.mNumber, tk.mIdentStr)) {
return true;
}
// Put the token back; we didn't parse it, so we shouldn't consume it
UngetToken();
return false;
}
if (((aVariantMask & VARIANT_PERCENT) != 0) &&
(nsCSSTokenType.Percentage == tk.mType)) {
aValue.SetPercentValue(tk.mNumber);
return true;
}
if (mUnitlessLengthQuirk) { // NONSTANDARD: Nav interprets unitless numbers as px
if (((aVariantMask & VARIANT_LENGTH) != 0) &&
(nsCSSTokenType.Number == tk.mType)) {
aValue.SetFloatValue(tk.mNumber, nsCSSUnit.Pixel);
return true;
}
}
if (IsSVGMode() && !IsParsingCompoundProperty()) {
// STANDARD: SVG Spec states that lengths and coordinates can be unitless
// in which case they default to user-units (1 px = 1 user unit)
if (((aVariantMask & VARIANT_LENGTH) != 0) &&
(nsCSSTokenType.Number == tk.mType)) {
aValue.SetFloatValue(tk.mNumber, nsCSSUnit.Pixel);
return true;
}
}
if (((aVariantMask & VARIANT_URL) != 0) &&
nsCSSTokenType.URL == tk.mType) {
SetValueToURL(ref aValue, tk.mIdentStr);
return true;
}
if ((aVariantMask & VARIANT_GRADIENT) != 0 &&
nsCSSTokenType.Function == tk.mType) {
// a generated gradient
string tmp = tk.mIdentStr;
bool isLegacy = false;
if (StringBeginsWith(tmp, "-moz-")) {
tmp = tmp.Substring(5);