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

📄 cssprimitivevaluemappings.h

📁 linux下开源浏览器WebKit的源码,市面上的很多商用浏览器都是移植自WebKit
💻 H
📖 第 1 页 / 共 4 页
字号:
}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EOverflow e)    : m_type(CSS_IDENT){    switch (e) {        case OVISIBLE:            m_value.ident = CSSValueVisible;            break;        case OHIDDEN:            m_value.ident = CSSValueHidden;            break;        case OSCROLL:            m_value.ident = CSSValueScroll;            break;        case OAUTO:            m_value.ident = CSSValueAuto;            break;        case OMARQUEE:            m_value.ident = CSSValueWebkitMarquee;            break;        case OOVERLAY:            m_value.ident = CSSValueOverlay;            break;    }}template<> inline CSSPrimitiveValue::operator EOverflow() const{    switch (m_value.ident) {        case CSSValueVisible:            return OVISIBLE;        case CSSValueHidden:            return OHIDDEN;        case CSSValueScroll:            return OSCROLL;        case CSSValueAuto:            return OAUTO;        case CSSValueWebkitMarquee:            return OMARQUEE;        case CSSValueOverlay:            return OOVERLAY;        default:            ASSERT_NOT_REACHED();            return OVISIBLE;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPageBreak e)    : m_type(CSS_IDENT){    switch (e) {        case PBAUTO:            m_value.ident = CSSValueAuto;            break;        case PBALWAYS:            m_value.ident = CSSValueAlways;            break;        case PBAVOID:            m_value.ident = CSSValueAvoid;            break;    }}template<> inline CSSPrimitiveValue::operator EPageBreak() const{    switch (m_value.ident) {        case CSSValueAuto:            return PBAUTO;        case CSSValueLeft:        case CSSValueRight:        case CSSValueAlways:            return PBALWAYS; // CSS2.1: "Conforming user agents may map left/right to always."        case CSSValueAvoid:            return PBAVOID;        default:            ASSERT_NOT_REACHED();            return PBAUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPosition e)    : m_type(CSS_IDENT){    switch (e) {        case StaticPosition:            m_value.ident = CSSValueStatic;            break;        case RelativePosition:            m_value.ident = CSSValueRelative;            break;        case AbsolutePosition:            m_value.ident = CSSValueAbsolute;            break;        case FixedPosition:            m_value.ident = CSSValueFixed;            break;    }}template<> inline CSSPrimitiveValue::operator EPosition() const{    switch (m_value.ident) {        case CSSValueStatic:            return StaticPosition;        case CSSValueRelative:            return RelativePosition;        case CSSValueAbsolute:            return AbsolutePosition;        case CSSValueFixed:            return FixedPosition;        default:            ASSERT_NOT_REACHED();            return StaticPosition;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EResize e)    : m_type(CSS_IDENT){    switch (e) {        case RESIZE_BOTH:            m_value.ident = CSSValueBoth;            break;        case RESIZE_HORIZONTAL:            m_value.ident = CSSValueHorizontal;            break;        case RESIZE_VERTICAL:            m_value.ident = CSSValueVertical;            break;        case RESIZE_NONE:            m_value.ident = CSSValueNone;            break;    }}template<> inline CSSPrimitiveValue::operator EResize() const{    switch (m_value.ident) {        case CSSValueBoth:            return RESIZE_BOTH;        case CSSValueHorizontal:            return RESIZE_HORIZONTAL;        case CSSValueVertical:            return RESIZE_VERTICAL;        case CSSValueAuto:            ASSERT_NOT_REACHED(); // Depends on settings, thus should be handled by the caller.            return RESIZE_NONE;        case CSSValueNone:            return RESIZE_NONE;        default:            ASSERT_NOT_REACHED();            return RESIZE_NONE;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETableLayout e)    : m_type(CSS_IDENT){    switch (e) {        case TAUTO:            m_value.ident = CSSValueAuto;            break;        case TFIXED:            m_value.ident = CSSValueFixed;            break;    }}template<> inline CSSPrimitiveValue::operator ETableLayout() const{    switch (m_value.ident) {        case CSSValueFixed:            return TFIXED;        case CSSValueAuto:            return TAUTO;        default:            ASSERT_NOT_REACHED();            return TAUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlign e)    : m_type(CSS_IDENT){    switch (e) {        case TAAUTO:            m_value.ident = CSSValueAuto;            break;        case LEFT:            m_value.ident = CSSValueLeft;            break;        case RIGHT:            m_value.ident = CSSValueRight;            break;        case CENTER:            m_value.ident = CSSValueCenter;            break;        case JUSTIFY:            m_value.ident = CSSValueJustify;            break;        case WEBKIT_LEFT:            m_value.ident = CSSValueWebkitLeft;            break;        case WEBKIT_RIGHT:            m_value.ident = CSSValueWebkitRight;            break;        case WEBKIT_CENTER:            m_value.ident = CSSValueWebkitCenter;            break;    }}template<> inline CSSPrimitiveValue::operator ETextAlign() const{    switch (m_value.ident) {        case CSSValueStart:        case CSSValueEnd:            ASSERT_NOT_REACHED(); // Depends on direction, thus should be handled by the caller.            return LEFT;        default:            return static_cast<ETextAlign>(m_value.ident - CSSValueWebkitAuto);    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)    : m_type(CSS_IDENT){    switch (e) {        case TSNONE:            m_value.ident = CSSValueNone;            break;        case TSDISC:            m_value.ident = CSSValueDisc;            break;        case TSCIRCLE:            m_value.ident = CSSValueCircle;            break;        case TSSQUARE:            m_value.ident = CSSValueSquare;            break;    }}template<> inline CSSPrimitiveValue::operator ETextSecurity() const{    switch (m_value.ident) {        case CSSValueNone:            return TSNONE;        case CSSValueDisc:            return TSDISC;        case CSSValueCircle:            return TSCIRCLE;        case CSSValueSquare:            return TSSQUARE;        default:            ASSERT_NOT_REACHED();            return TSNONE;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextTransform e)    : m_type(CSS_IDENT){    switch (e) {        case CAPITALIZE:            m_value.ident = CSSValueCapitalize;            break;        case UPPERCASE:            m_value.ident = CSSValueUppercase;            break;        case LOWERCASE:            m_value.ident = CSSValueLowercase;            break;        case TTNONE:            m_value.ident = CSSValueNone;            break;    }}template<> inline CSSPrimitiveValue::operator ETextTransform() const{    switch (m_value.ident) {        case CSSValueCapitalize:            return CAPITALIZE;        case CSSValueUppercase:            return UPPERCASE;        case CSSValueLowercase:            return LOWERCASE;        case CSSValueNone:            return TTNONE;        default:            ASSERT_NOT_REACHED();            return TTNONE;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUnicodeBidi e)    : m_type(CSS_IDENT){    switch (e) {        case UBNormal:            m_value.ident = CSSValueNormal;            break;        case Embed:            m_value.ident = CSSValueEmbed;            break;        case Override:            m_value.ident = CSSValueBidiOverride;            break;    }}template<> inline CSSPrimitiveValue::operator EUnicodeBidi() const{    switch (m_value.ident) {        case CSSValueNormal:            return UBNormal;         case CSSValueEmbed:            return Embed;         case CSSValueBidiOverride:            return Override;        default:            ASSERT_NOT_REACHED();            return UBNormal;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserDrag e)    : m_type(CSS_IDENT){    switch (e) {        case DRAG_AUTO:            m_value.ident = CSSValueAuto;            break;        case DRAG_NONE:            m_value.ident = CSSValueNone;            break;        case DRAG_ELEMENT:            m_value.ident = CSSValueElement;            break;    }}template<> inline CSSPrimitiveValue::operator EUserDrag() const{    switch (m_value.ident) {        case CSSValueAuto:            return DRAG_AUTO;        case CSSValueNone:            return DRAG_NONE;        case CSSValueElement:            return DRAG_ELEMENT;        default:            ASSERT_NOT_REACHED();            return DRAG_AUTO;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserModify e)    : m_type(CSS_IDENT){    switch (e) {        case READ_ONLY:            m_value.ident = CSSValueReadOnly;            break;        case READ_WRITE:            m_value.ident = CSSValueReadWrite;            break;        case READ_WRITE_PLAINTEXT_ONLY:            m_value.ident = CSSValueReadWritePlaintextOnly;            break;    }}template<> inline CSSPrimitiveValue::operator EUserModify() const{    return static_cast<EUserModify>(m_value.ident - CSSValueReadOnly);}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EUserSelect e)    : m_type(CSS_IDENT){    switch (e) {        case SELECT_NONE:            m_value.ident = CSSValueNone;            break;        case SELECT_TEXT:            m_value.ident = CSSValueText;            break;    }}template<> inline CSSPrimitiveValue::operator EUserSelect() const{    switch (m_value.ident) {        case CSSValueAuto:            return SELECT_TEXT;        case CSSValueNone:            return SELECT_NONE;        case CSSValueText:            return SELECT_TEXT;        default:            ASSERT_NOT_REACHED();            return SELECT_TEXT;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EVisibility e)    : m_type(CSS_IDENT){    switch (e) {        case VISIBLE:            m_value.ident = CSSValueVisible;            break;        case HIDDEN:            m_value.ident = CSSValueHidden;            break;        case COLLAPSE:            m_value.ident = CSSValueCollapse;            break;    }}template<> inline CSSPrimitiveValue::operator EVisibility() const{    switch (m_value.ident) {        case CSSValueHidden:            return HIDDEN;        case CSSValueVisible:            return VISIBLE;        case CSSValueCollapse:            return COLLAPSE;        default:            ASSERT_NOT_REACHED();            return VISIBLE;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWhiteSpace e)    : m_type(CSS_IDENT){    switch (e) {        case NORMAL:            m_value.ident = CSSValueNormal;            break;        case PRE:            m_value.ident = CSSValuePre;            break;        case PRE_WRAP:            m_value.ident = CSSValuePreWrap;            break;        case PRE_LINE:            m_value.ident = CSSValuePreLine;            break;        case NOWRAP:            m_value.ident = CSSValueNowrap;            break;        case KHTML_NOWRAP:            m_value.ident = CSSValueWebkitNowrap;            break;    }}template<> inline CSSPrimitiveValue::operator EWhiteSpace() const{    switch (m_value.ident) {        case CSSValueWebkitNowrap:            return KHTML_NOWRAP;        case CSSValueNowrap:            return NOWRAP;        case CSSValuePre:            return PRE;        case CSSValuePreWrap:            return PRE_WRAP;        case CSSValuePreLine:            return PRE_LINE;        case CSSValueNormal:            return NORMAL;        default:            ASSERT_NOT_REACHED();            return NORMAL;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordBreak e)    : m_type(CSS_IDENT){    switch (e) {        case NormalWordBreak:            m_value.ident = CSSValueNormal;            break;        case BreakAllWordBreak:            m_value.ident = CSSValueBreakAll;            break;        case BreakWordBreak:            m_value.ident = CSSValueBreakWord;            break;    }}template<> inline CSSPrimitiveValue::operator EWordBreak() const{    switch (m_value.ident) {        case CSSValueBreakAll:            return BreakAllWordBreak;        case CSSValueBreakWord:            return BreakWordBreak;        case CSSValueNormal:            return NormalWordBreak;        default:        ASSERT_NOT_REACHED();        return NormalWordBreak;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EWordWrap e)    : m_type(CSS_IDENT){    switch (e) {        case NormalWordWrap:            m_value.ident = CSSValueNormal;            break;        case BreakWordWrap:            m_value.ident = CSSValueBreakWord;            break;    }}template<> inline CSSPrimitiveValue::operator EWordWrap() const{    switch (m_value.ident) {        case CSSValueBreakWord:            return BreakWordWrap;        case CSSValueNormal:            return NormalWordWrap;        default:            ASSERT_NOT_REACHED();            return NormalWordWrap;    }}template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextDirection e)    : m_type(CSS_IDENT){    switch (e) {        case LTR:            m_value.ident = CSSValueLtr;            break;        case RTL:            m_value.ident = CSSValueRtl;            break;    }}

⌨️ 快捷键说明

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