⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cssprimitivevaluemappings.h

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 H
📖 第 1 页 / 共 4 页
字号:
template<> inline CSSPrimitiveValue::operator TextDirection() const{    switch (m_value.ident) {        case CSSValueLtr:            return LTR;        case CSSValueRtl:            return RTL;        default:            ASSERT_NOT_REACHED();            return LTR;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)    : m_type(CSS_IDENT){    switch (e) {        case PE_NONE:            m_value.ident = CSSValueNone;            break;        case PE_STROKE:            m_value.ident = CSSValueStroke;            break;        case PE_FILL:            m_value.ident = CSSValueFill;            break;        case PE_PAINTED:            m_value.ident = CSSValuePainted;            break;        case PE_VISIBLE:            m_value.ident = CSSValueVisible;            break;        case PE_VISIBLE_STROKE:            m_value.ident = CSSValueVisiblestroke;            break;        case PE_VISIBLE_FILL:            m_value.ident = CSSValueVisiblefill;            break;        case PE_VISIBLE_PAINTED:            m_value.ident = CSSValueVisiblepainted;            break;        case PE_AUTO:            m_value.ident = CSSValueAuto;            break;        case PE_ALL:            m_value.ident = CSSValueAll;            break;    }}template<> inline CSSPrimitiveValue::operator EPointerEvents() const{    switch (m_value.ident) {        case CSSValueAll:            return PE_ALL;        case CSSValueAuto:            return PE_AUTO;        case CSSValueNone:            return PE_NONE;        case CSSValueVisiblepainted:            return PE_VISIBLE_PAINTED;        case CSSValueVisiblefill:            return PE_VISIBLE_FILL;        case CSSValueVisiblestroke:            return PE_VISIBLE_STROKE;        case CSSValueVisible:            return PE_VISIBLE;        case CSSValuePainted:            return PE_PAINTED;        case CSSValueFill:            return PE_FILL;        case CSSValueStroke:            return PE_STROKE;        default:            ASSERT_NOT_REACHED();            return PE_ALL;    }}#if ENABLE(SVG)template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)    : m_type(CSS_IDENT){    switch (e) {        case ButtCap:            m_value.ident = CSSValueButt;            break;        case RoundCap:            m_value.ident = CSSValueRound;            break;        case SquareCap:            m_value.ident = CSSValueSquare;            break;    }}template<> inline CSSPrimitiveValue::operator LineCap() const{    switch (m_value.ident) {        case CSSValueButt:            return ButtCap;        case CSSValueRound:            return RoundCap;        case CSSValueSquare:            return SquareCap;        default:            ASSERT_NOT_REACHED();            return ButtCap;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineJoin e)    : m_type(CSS_IDENT){    switch (e) {        case MiterJoin:            m_value.ident = CSSValueMiter;            break;        case RoundJoin:            m_value.ident = CSSValueRound;            break;        case BevelJoin:            m_value.ident = CSSValueBevel;            break;    }}template<> inline CSSPrimitiveValue::operator LineJoin() const{    switch (m_value.ident) {        case CSSValueMiter:            return MiterJoin;        case CSSValueRound:            return RoundJoin;        case CSSValueBevel:            return BevelJoin;        default:            ASSERT_NOT_REACHED();            return MiterJoin;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(WindRule e)    : m_type(CSS_IDENT){    switch (e) {        case RULE_NONZERO:            m_value.ident = CSSValueNonzero;            break;        case RULE_EVENODD:            m_value.ident = CSSValueEvenodd;            break;    }}template<> inline CSSPrimitiveValue::operator WindRule() const{    switch (m_value.ident) {        case CSSValueNonzero:            return RULE_NONZERO;        case CSSValueEvenodd:            return RULE_EVENODD;        default:            ASSERT_NOT_REACHED();            return RULE_NONZERO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EAlignmentBaseline e)    : m_type(CSS_IDENT){    switch (e) {        case AB_AUTO:            m_value.ident = CSSValueAuto;            break;        case AB_BASELINE:            m_value.ident = CSSValueBaseline;            break;        case AB_BEFORE_EDGE:            m_value.ident = CSSValueBeforeEdge;            break;        case AB_TEXT_BEFORE_EDGE:            m_value.ident = CSSValueTextBeforeEdge;            break;        case AB_MIDDLE:            m_value.ident = CSSValueMiddle;            break;        case AB_CENTRAL:            m_value.ident = CSSValueCentral;            break;        case AB_AFTER_EDGE:            m_value.ident = CSSValueAfterEdge;            break;        case AB_TEXT_AFTER_EDGE:            m_value.ident = CSSValueTextAfterEdge;            break;        case AB_IDEOGRAPHIC:            m_value.ident = CSSValueIdeographic;            break;        case AB_ALPHABETIC:            m_value.ident = CSSValueAlphabetic;            break;        case AB_HANGING:            m_value.ident = CSSValueHanging;            break;        case AB_MATHEMATICAL:            m_value.ident = CSSValueMathematical;            break;    }}template<> inline CSSPrimitiveValue::operator EAlignmentBaseline() const{    switch (m_value.ident) {        case CSSValueAuto:            return AB_AUTO;        case CSSValueBaseline:            return AB_BASELINE;        case CSSValueBeforeEdge:            return AB_BEFORE_EDGE;        case CSSValueTextBeforeEdge:            return AB_TEXT_BEFORE_EDGE;        case CSSValueMiddle:            return AB_MIDDLE;        case CSSValueCentral:            return AB_CENTRAL;        case CSSValueAfterEdge:            return AB_AFTER_EDGE;        case CSSValueTextAfterEdge:            return AB_TEXT_AFTER_EDGE;        case CSSValueIdeographic:            return AB_IDEOGRAPHIC;        case CSSValueAlphabetic:            return AB_ALPHABETIC;        case CSSValueHanging:            return AB_HANGING;        case CSSValueMathematical:            return AB_MATHEMATICAL;        default:            ASSERT_NOT_REACHED();            return AB_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorInterpolation e)    : m_type(CSS_IDENT){    switch (e) {        case CI_AUTO:            m_value.ident = CSSValueAuto;            break;        case CI_SRGB:            m_value.ident = CSSValueSrgb;            break;        case CI_LINEARRGB:            m_value.ident = CSSValueLinearrgb;            break;    }}template<> inline CSSPrimitiveValue::operator EColorInterpolation() const{    switch (m_value.ident) {        case CSSValueSrgb:            return CI_SRGB;        case CSSValueLinearrgb:            return CI_LINEARRGB;        case CSSValueAuto:            return CI_AUTO;        default:            ASSERT_NOT_REACHED();            return CI_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)    : m_type(CSS_IDENT){    switch (e) {        case CR_AUTO:            m_value.ident = CSSValueAuto;            break;        case CR_OPTIMIZESPEED:            m_value.ident = CSSValueOptimizespeed;            break;        case CR_OPTIMIZEQUALITY:            m_value.ident = CSSValueOptimizequality;            break;    }}template<> inline CSSPrimitiveValue::operator EColorRendering() const{    switch (m_value.ident) {        case CSSValueOptimizespeed:            return CR_OPTIMIZESPEED;        case CSSValueOptimizequality:            return CR_OPTIMIZEQUALITY;        case CSSValueAuto:            return CR_AUTO;        default:            ASSERT_NOT_REACHED();            return CR_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EDominantBaseline e)    : m_type(CSS_IDENT){    switch (e) {        case DB_AUTO:            m_value.ident = CSSValueAuto;            break;        case DB_USE_SCRIPT:            m_value.ident = CSSValueUseScript;            break;        case DB_NO_CHANGE:            m_value.ident = CSSValueNoChange;            break;        case DB_RESET_SIZE:            m_value.ident = CSSValueResetSize;            break;        case DB_CENTRAL:            m_value.ident = CSSValueCentral;            break;        case DB_MIDDLE:            m_value.ident = CSSValueMiddle;            break;        case DB_TEXT_BEFORE_EDGE:            m_value.ident = CSSValueTextBeforeEdge;            break;        case DB_TEXT_AFTER_EDGE:            m_value.ident = CSSValueTextAfterEdge;            break;        case DB_IDEOGRAPHIC:            m_value.ident = CSSValueIdeographic;            break;        case DB_ALPHABETIC:            m_value.ident = CSSValueAlphabetic;            break;        case DB_HANGING:            m_value.ident = CSSValueHanging;            break;        case DB_MATHEMATICAL:            m_value.ident = CSSValueMathematical;            break;    }}template<> inline CSSPrimitiveValue::operator EDominantBaseline() const{    switch (m_value.ident) {        case CSSValueAuto:            return DB_AUTO;        case CSSValueUseScript:            return DB_USE_SCRIPT;        case CSSValueNoChange:            return DB_NO_CHANGE;        case CSSValueResetSize:            return DB_RESET_SIZE;        case CSSValueIdeographic:            return DB_IDEOGRAPHIC;        case CSSValueAlphabetic:            return DB_ALPHABETIC;        case CSSValueHanging:            return DB_HANGING;        case CSSValueMathematical:            return DB_MATHEMATICAL;        case CSSValueCentral:            return DB_CENTRAL;        case CSSValueMiddle:            return DB_MIDDLE;        case CSSValueTextAfterEdge:            return DB_TEXT_AFTER_EDGE;        case CSSValueTextBeforeEdge:            return DB_TEXT_BEFORE_EDGE;        default:            ASSERT_NOT_REACHED();            return DB_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering e)    : m_type(CSS_IDENT){    switch (e) {        case IR_AUTO:            m_value.ident = CSSValueAuto;            break;        case IR_OPTIMIZESPEED:            m_value.ident = CSSValueOptimizespeed;            break;        case IR_OPTIMIZEQUALITY:            m_value.ident = CSSValueOptimizequality;            break;    }}template<> inline CSSPrimitiveValue::operator EImageRendering() const{    switch (m_value.ident) {        case CSSValueAuto:            return IR_AUTO;        case CSSValueOptimizespeed:            return IR_OPTIMIZESPEED;        case CSSValueOptimizequality:            return IR_OPTIMIZEQUALITY;        default:            ASSERT_NOT_REACHED();            return IR_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)    : m_type(CSS_IDENT){    switch (e) {        case IR_AUTO:            m_value.ident = CSSValueAuto;            break;        case IR_OPTIMIZESPEED:            m_value.ident = CSSValueOptimizespeed;            break;        case SR_CRISPEDGES:            m_value.ident = CSSValueCrispedges;            break;        case SR_GEOMETRICPRECISION:            m_value.ident = CSSValueGeometricprecision;            break;    }}template<> inline CSSPrimitiveValue::operator EShapeRendering() const{    switch (m_value.ident) {        case CSSValueAuto:            return SR_AUTO;        case CSSValueOptimizespeed:            return SR_OPTIMIZESPEED;        case CSSValueCrispedges:            return SR_CRISPEDGES;        case CSSValueGeometricprecision:            return SR_GEOMETRICPRECISION;        default:            ASSERT_NOT_REACHED();            return SR_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAnchor e)    : m_type(CSS_IDENT){    switch (e) {        case TA_START:            m_value.ident = CSSValueStart;            break;        case TA_MIDDLE:            m_value.ident = CSSValueMiddle;            break;        case TA_END:            m_value.ident = CSSValueEnd;            break;    }}template<> inline CSSPrimitiveValue::operator ETextAnchor() const{    switch (m_value.ident) {        case CSSValueStart:            return TA_START;        case CSSValueMiddle:            return TA_MIDDLE;        case CSSValueEnd:            return TA_END;        default:            ASSERT_NOT_REACHED();            return TA_START;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextRendering e)    : m_type(CSS_IDENT){    switch (e) {        case TR_AUTO:            m_value.ident = CSSValueAuto;            break;        case TR_OPTIMIZESPEED:            m_value.ident = CSSValueOptimizespeed;            break;        case TR_OPTIMIZELEGIBILITY:            m_value.ident = CSSValueOptimizelegibility;            break;        case TR_GEOMETRICPRECISION:            m_value.ident = CSSValueGeometricprecision;            break;    }}template<> inline CSSPrimitiveValue::operator ETextRendering() const{    switch (m_value.ident) {        case CSSValueAuto:            return TR_AUTO;        case CSSValueOptimizespeed:            return TR_OPTIMIZESPEED;        case CSSValueOptimizelegibility:            return TR_OPTIMIZELEGIBILITY;        case CSSValueGeometricprecision:            return TR_GEOMETRICPRECISION;        default:            ASSERT_NOT_REACHED();            return TR_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWritingMode e)    : m_type(CSS_IDENT){    switch (e) {        case WM_LRTB:            m_value.ident = CSSValueLrTb;            break;        case WM_LR:            m_value.ident = CSSValueLr;            break;        case WM_RLTB:            m_value.ident = CSSValueRlTb;            break;        case WM_RL:            m_value.ident = CSSValueRl;            break;        case WM_TBRL:            m_value.ident = CSSValueTbRl;            break;        case WM_TB:            m_value.ident = CSSValueTb;            break;    }}template<> inline CSSPrimitiveValue::operator EWritingMode() const{    return static_cast<EWritingMode>(m_value.ident - CSSValueLrTb);}#endif}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -