Changeset 150525 in webkit


Ignore:
Timestamp:
May 22, 2013 11:38:07 AM (11 years ago)
Author:
Bruno de Oliveira Abinader
Message:

[css] Update ETextDecorations enum to TextDecorations
https://bugs.webkit.org/show_bug.cgi?id=116581

Reviewed by Andreas Kling.

Currently, ETextDecorations enum uses a C-like coding style for its
enumeration values, as well as a 'E' prefix that surely had some meaning
in the past, but not nowadays.

No behavior changes, covered by existing tests.

  • accessibility/AccessibilityRenderObject.cpp:

(WebCore::AccessibilityRenderObject::hasPlainText):
(WebCore::AccessibilityRenderObject::hasUnderline):

  • accessibility/atk/WebKitAccessibleInterfaceText.cpp:

(getAttributeSetForAccessibilityObject):

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(AXAttributeStringSetStyle):

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(AXAttributeStringSetStyle):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::renderTextDecorationFlagsToCSSValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::operator TextDecoration):

  • css/DeprecatedStyleBuilder.cpp:

(WebCore::ApplyPropertyTextDecoration::applyValue):
(WebCore::ApplyPropertyTextDecoration::createHandler):

  • editing/mac/EditorMac.mm:

(WebCore::Editor::fontAttributesForSelectionStart):

  • platform/mac/HTMLConverter.mm:

(+[WebHTMLConverter editingAttributedStringFromRange:]):

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintDecoration):

  • rendering/InlineTextBox.h:
  • rendering/RenderObject.cpp:

(WebCore::RenderObject::getTextDecorationColors):

  • rendering/style/RenderStyle.h:
  • rendering/style/RenderStyleConstants.h:

(WebCore::operator|):
(WebCore::operator|=):

  • rendering/style/StyleVisualData.h:

(StyleVisualData):

  • rendering/svg/SVGInlineTextBox.cpp:

(WebCore::SVGInlineTextBox::paint):
(WebCore::positionOffsetForDecoration):
(WebCore::thicknessForDecoration):
(WebCore::findRenderObjectDefininingTextDecoration):
(WebCore::SVGInlineTextBox::paintDecoration):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):

  • rendering/svg/SVGInlineTextBox.h:
Location:
trunk/Source/WebCore
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150524 r150525  
     12013-05-22  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
     2
     3        [css] Update ETextDecorations enum to TextDecorations
     4        https://bugs.webkit.org/show_bug.cgi?id=116581
     5
     6        Reviewed by Andreas Kling.
     7
     8        Currently, ETextDecorations enum uses a C-like coding style for its
     9        enumeration values, as well as a 'E' prefix that surely had some meaning
     10        in the past, but not nowadays.
     11
     12        No behavior changes, covered by existing tests.
     13
     14        * accessibility/AccessibilityRenderObject.cpp:
     15        (WebCore::AccessibilityRenderObject::hasPlainText):
     16        (WebCore::AccessibilityRenderObject::hasUnderline):
     17        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
     18        (getAttributeSetForAccessibilityObject):
     19        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
     20        (AXAttributeStringSetStyle):
     21        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     22        (AXAttributeStringSetStyle):
     23        * css/CSSComputedStyleDeclaration.cpp:
     24        (WebCore::renderTextDecorationFlagsToCSSValue):
     25        * css/CSSPrimitiveValueMappings.h:
     26        (WebCore::CSSPrimitiveValue::operator TextDecoration):
     27        * css/DeprecatedStyleBuilder.cpp:
     28        (WebCore::ApplyPropertyTextDecoration::applyValue):
     29        (WebCore::ApplyPropertyTextDecoration::createHandler):
     30        * editing/mac/EditorMac.mm:
     31        (WebCore::Editor::fontAttributesForSelectionStart):
     32        * platform/mac/HTMLConverter.mm:
     33        (+[WebHTMLConverter editingAttributedStringFromRange:]):
     34        * rendering/InlineTextBox.cpp:
     35        (WebCore::InlineTextBox::paint):
     36        (WebCore::InlineTextBox::paintDecoration):
     37        * rendering/InlineTextBox.h:
     38        * rendering/RenderObject.cpp:
     39        (WebCore::RenderObject::getTextDecorationColors):
     40        * rendering/style/RenderStyle.h:
     41        * rendering/style/RenderStyleConstants.h:
     42        (WebCore::operator|):
     43        (WebCore::operator|=):
     44        * rendering/style/StyleVisualData.h:
     45        (StyleVisualData):
     46        * rendering/svg/SVGInlineTextBox.cpp:
     47        (WebCore::SVGInlineTextBox::paint):
     48        (WebCore::positionOffsetForDecoration):
     49        (WebCore::thicknessForDecoration):
     50        (WebCore::findRenderObjectDefininingTextDecoration):
     51        (WebCore::SVGInlineTextBox::paintDecoration):
     52        (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
     53        * rendering/svg/SVGInlineTextBox.h:
     54
    1552013-05-22  Lori Anderson  <lori@rkymtnhi.com>
    256
  • trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp

    r149858 r150525  
    32353235    return style->fontDescription().weight() == FontWeightNormal
    32363236        && style->fontDescription().italic() == FontItalicOff
    3237         && style->textDecorationsInEffect() == TDNONE;
     3237        && style->textDecorationsInEffect() == TextDecorationNone;
    32383238}
    32393239
     
    32673267        return false;
    32683268   
    3269     return m_renderer->style()->textDecorationsInEffect() & UNDERLINE;
     3269    return m_renderer->style()->textDecorationsInEffect() & TextDecorationUnderline;
    32703270}
    32713271
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp

    r150518 r150525  
    314314    }
    315315
    316     result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_UNDERLINE), (style->textDecoration() & UNDERLINE) ? "single" : "none");
     316    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_UNDERLINE), (style->textDecoration() & TextDecorationUnderline) ? "single" : "none");
    317317
    318318    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STYLE), style->font().italic() ? "italic" : "normal");
    319319
    320     result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STRIKETHROUGH), (style->textDecoration() & LINE_THROUGH) ? "true" : "false");
     320    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STRIKETHROUGH), (style->textDecoration() & TextDecorationLineThrough) ? "true" : "false");
    321321
    322322    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_INVISIBLE), (style->visibility() == HIDDEN) ? "true" : "false");
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r150145 r150525  
    15051505               
    15061506    int decor = style->textDecorationsInEffect();
    1507     if ((decor & (UNDERLINE | LINE_THROUGH)) != 0) {
     1507    if ((decor & (TextDecorationUnderline | TextDecorationLineThrough)) != 0) {
    15081508        // find colors using quirk mode approach (strict mode would use current
    15091509        // color for all but the root line box, which would use getTextDecorationColors)
     
    15111511        renderer->getTextDecorationColors(decor, underline, overline, linethrough);
    15121512       
    1513         if (decor & UNDERLINE)
     1513        if (decor & TextDecorationUnderline)
    15141514            AXAttributeStringSetNumber(attrString, UIAccessibilityTokenUnderline, [NSNumber numberWithBool:YES], range);
    15151515    }
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r150214 r150525  
    673673    // set underline and strikethrough
    674674    int decor = style->textDecorationsInEffect();
    675     if ((decor & UNDERLINE) == 0) {
     675    if ((decor & TextDecorationUnderline) == 0) {
    676676        [attrString removeAttribute:NSAccessibilityUnderlineTextAttribute range:range];
    677677        [attrString removeAttribute:NSAccessibilityUnderlineColorTextAttribute range:range];
    678678    }
    679679   
    680     if ((decor & LINE_THROUGH) == 0) {
     680    if ((decor & TextDecorationLineThrough) == 0) {
    681681        [attrString removeAttribute:NSAccessibilityStrikethroughTextAttribute range:range];
    682682        [attrString removeAttribute:NSAccessibilityStrikethroughColorTextAttribute range:range];
    683683    }
    684684   
    685     if ((decor & (UNDERLINE | LINE_THROUGH)) != 0) {
     685    if ((decor & (TextDecorationUnderline | TextDecorationLineThrough)) != 0) {
    686686        // find colors using quirk mode approach (strict mode would use current
    687687        // color for all but the root line box, which would use getTextDecorationColors)
     
    689689        renderer->getTextDecorationColors(decor, underline, overline, linethrough);
    690690       
    691         if ((decor & UNDERLINE) != 0) {
     691        if ((decor & TextDecorationUnderline) != 0) {
    692692            AXAttributeStringSetNumber(attrString, NSAccessibilityUnderlineTextAttribute, [NSNumber numberWithBool:YES], range);
    693693            AXAttributeStringSetColor(attrString, NSAccessibilityUnderlineColorTextAttribute, nsColor(underline), range);
    694694        }
    695695       
    696         if ((decor & LINE_THROUGH) != 0) {
     696        if ((decor & TextDecorationLineThrough) != 0) {
    697697            AXAttributeStringSetNumber(attrString, NSAccessibilityStrikethroughTextAttribute, [NSNumber numberWithBool:YES], range);
    698698            AXAttributeStringSetColor(attrString, NSAccessibilityStrikethroughColorTextAttribute, nsColor(linethrough), range);
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r150387 r150525  
    13361336    // Blink value is ignored.
    13371337    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
    1338     if (textDecoration & UNDERLINE)
     1338    if (textDecoration & TextDecorationUnderline)
    13391339        list->append(cssValuePool().createIdentifierValue(CSSValueUnderline));
    1340     if (textDecoration & OVERLINE)
     1340    if (textDecoration & TextDecorationOverline)
    13411341        list->append(cssValuePool().createIdentifierValue(CSSValueOverline));
    1342     if (textDecoration & LINE_THROUGH)
     1342    if (textDecoration & TextDecorationLineThrough)
    13431343        list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough));
    13441344
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r148949 r150525  
    24122412#endif // CSS3_TEXT
    24132413
    2414 template<> inline CSSPrimitiveValue::operator ETextDecoration() const
     2414template<> inline CSSPrimitiveValue::operator TextDecoration() const
    24152415{
    24162416    switch (m_value.ident) {
    24172417    case CSSValueNone:
    2418         return TDNONE;
     2418        return TextDecorationNone;
    24192419    case CSSValueUnderline:
    2420         return UNDERLINE;
     2420        return TextDecorationUnderline;
    24212421    case CSSValueOverline:
    2422         return OVERLINE;
     2422        return TextDecorationOverline;
    24232423    case CSSValueLineThrough:
    2424         return LINE_THROUGH;
     2424        return TextDecorationLineThrough;
    24252425    case CSSValueBlink:
    2426         return BLINK;
    2427     }
    2428 
    2429     ASSERT_NOT_REACHED();
    2430     return TDNONE;
     2426        return TextDecorationBlink;
     2427    }
     2428
     2429    ASSERT_NOT_REACHED();
     2430    return TextDecorationNone;
    24312431}
    24322432
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r150387 r150525  
    12521252    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
    12531253    {
    1254         ETextDecoration t = RenderStyle::initialTextDecoration();
     1254        TextDecoration t = RenderStyle::initialTextDecoration();
    12551255        for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
    12561256            CSSValue* item = i.value();
     
    12621262    static PropertyHandler createHandler()
    12631263    {
    1264         PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecoration, ETextDecoration, &RenderStyle::setTextDecoration, ETextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
     1264        PropertyHandler handler = ApplyPropertyDefaultBase<TextDecoration, &RenderStyle::textDecoration, TextDecoration, &RenderStyle::setTextDecoration, TextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
    12651265        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
    12661266    }
  • trunk/Source/WebCore/editing/mac/EditorMac.mm

    r150351 r150525  
    208208
    209209    int decoration = style->textDecorationsInEffect();
    210     if (decoration & LINE_THROUGH)
     210    if (decoration & TextDecorationLineThrough)
    211211        [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
    212212
     
    232232        [result setObject:[NSNumber numberWithInt:superscriptInt] forKey:NSSuperscriptAttributeName];
    233233
    234     if (decoration & UNDERLINE)
     234    if (decoration & TextDecorationUnderline)
    235235        [result setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
    236236
  • trunk/Source/WebCore/platform/mac/HTMLConverter.mm

    r149255 r150525  
    16931693            continue;
    16941694        RenderStyle* style = renderer->style();
    1695         if (style->textDecorationsInEffect() & UNDERLINE)
     1695        if (style->textDecorationsInEffect() & TextDecorationUnderline)
    16961696            [attrs.get() setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
    16971697        if (NSFont *font = style->font().primaryFont()->getNSFont())
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r150365 r150525  
    780780
    781781    // Paint decorations
    782     ETextDecoration textDecorations = styleToUse->textDecorationsInEffect();
    783     if (textDecorations != TDNONE && paintInfo.phase != PaintPhaseSelection) {
     782    TextDecoration textDecorations = styleToUse->textDecorationsInEffect();
     783    if (textDecorations != TextDecorationNone && paintInfo.phase != PaintPhaseSelection) {
    784784        updateGraphicsContext(context, textFillColor, textStrokeColor, textStrokeWidth, styleToUse->colorSpace());
    785785        if (combinedText)
     
    11201120#endif // CSS3_TEXT
    11211121
    1122 void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint& boxOrigin, ETextDecoration deco, TextDecorationStyle decorationStyle, const ShadowData* shadow)
     1122void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint& boxOrigin, TextDecoration deco, TextDecorationStyle decorationStyle, const ShadowData* shadow)
    11231123{
    11241124    // FIXME: We should improve this rule and not always just assume 1.
     
    11471147    context->setStrokeThickness(textDecorationThickness);
    11481148
    1149     bool linesAreOpaque = !isPrinting && (!(deco & UNDERLINE) || underline.alpha() == 255) && (!(deco & OVERLINE) || overline.alpha() == 255) && (!(deco & LINE_THROUGH) || linethrough.alpha() == 255);
     1149    bool linesAreOpaque = !isPrinting && (!(deco & TextDecorationUnderline) || underline.alpha() == 255) && (!(deco & TextDecorationOverline) || overline.alpha() == 255) && (!(deco & TextDecorationLineThrough) || linethrough.alpha() == 255);
    11501150
    11511151    RenderStyle* styleToUse = renderer()->style(isFirstLineStyle());
     
    11951195#endif // CSS3_TEXT
    11961196        context->setStrokeStyle(textDecorationStyleToStrokeStyle(decorationStyle));
    1197         if (deco & UNDERLINE) {
     1197        if (deco & TextDecorationUnderline) {
    11981198            context->setStrokeColor(underline, colorSpace);
    11991199#if ENABLE(CSS3_TEXT)
     
    12191219#endif // CSS3_TEXT
    12201220        }
    1221         if (deco & OVERLINE) {
     1221        if (deco & TextDecorationOverline) {
    12221222            context->setStrokeColor(overline, colorSpace);
    12231223#if ENABLE(CSS3_TEXT)
     
    12381238#endif // CSS3_TEXT
    12391239        }
    1240         if (deco & LINE_THROUGH) {
     1240        if (deco & TextDecorationLineThrough) {
    12411241            context->setStrokeColor(linethrough, colorSpace);
    12421242#if ENABLE(CSS3_TEXT)
  • trunk/Source/WebCore/rendering/InlineTextBox.h

    r150312 r150525  
    185185
    186186private:
    187     void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, ETextDecoration, TextDecorationStyle, const ShadowData*);
     187    void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, TextDecoration, TextDecorationStyle, const ShadowData*);
    188188    void paintSelection(GraphicsContext*, const FloatPoint& boxOrigin, RenderStyle*, const Font&, Color textColor);
    189189    void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&, bool grammar);
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r150355 r150525  
    28152815    RenderObject* curr = this;
    28162816    RenderStyle* styleToUse = 0;
    2817     ETextDecoration currDecs = TDNONE;
     2817    TextDecoration currDecs = TextDecorationNone;
    28182818    Color resultColor;
    28192819    do {
     
    28232823        // Parameter 'decorations' is cast as an int to enable the bitwise operations below.
    28242824        if (currDecs) {
    2825             if (currDecs & UNDERLINE) {
    2826                 decorations &= ~UNDERLINE;
     2825            if (currDecs & TextDecorationUnderline) {
     2826                decorations &= ~TextDecorationUnderline;
    28272827                underline = resultColor;
    28282828            }
    2829             if (currDecs & OVERLINE) {
    2830                 decorations &= ~OVERLINE;
     2829            if (currDecs & TextDecorationOverline) {
     2830                decorations &= ~TextDecorationOverline;
    28312831                overline = resultColor;
    28322832            }
    2833             if (currDecs & LINE_THROUGH) {
    2834                 decorations &= ~LINE_THROUGH;
     2833            if (currDecs & TextDecorationLineThrough) {
     2834                decorations &= ~TextDecorationLineThrough;
    28352835                linethrough = resultColor;
    28362836            }
     
    28482848        styleToUse = curr->style(firstlineStyle);
    28492849        resultColor = decorationColor(styleToUse);
    2850         if (decorations & UNDERLINE)
     2850        if (decorations & TextDecorationUnderline)
    28512851            underline = resultColor;
    2852         if (decorations & OVERLINE)
     2852        if (decorations & TextDecorationOverline)
    28532853            overline = resultColor;
    2854         if (decorations & LINE_THROUGH)
     2854        if (decorations & TextDecorationLineThrough)
    28552855            linethrough = resultColor;
    28562856    }
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r150387 r150525  
    190190        unsigned _text_align : 4; // ETextAlign
    191191        unsigned _text_transform : 2; // ETextTransform
    192         unsigned _text_decorations : ETextDecorationBits;
     192        unsigned _text_decorations : TextDecorationBits;
    193193        unsigned _cursor_style : 6; // ECursor
    194194#if ENABLE(CURSOR_VISIBILITY)
     
    575575    ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
    576576    ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
    577     ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
    578     ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
     577    TextDecoration textDecorationsInEffect() const { return static_cast<TextDecoration>(inherited_flags._text_decorations); }
     578    TextDecoration textDecoration() const { return static_cast<TextDecoration>(visual->textDecoration); }
    579579#if ENABLE(CSS3_TEXT)
    580580    TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
     
    11441144    void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
    11451145    void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
    1146     void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
    1147     void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
    1148     void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
     1146    void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations |= v; }
     1147    void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations = v; }
     1148    void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v); }
    11491149#if ENABLE(CSS3_TEXT)
    11501150    void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
     
    16291629    static Length initialLineHeight() { return Length(-100.0, Percent); }
    16301630    static ETextAlign initialTextAlign() { return TASTART; }
    1631     static ETextDecoration initialTextDecoration() { return TDNONE; }
     1631    static TextDecoration initialTextDecoration() { return TextDecorationNone; }
    16321632#if ENABLE(CSS3_TEXT)
    16331633    static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r150259 r150525  
    340340};
    341341
    342 static const size_t ETextDecorationBits = 4;
    343 enum ETextDecoration {
    344     TDNONE = 0x0 , UNDERLINE = 0x1, OVERLINE = 0x2, LINE_THROUGH= 0x4, BLINK = 0x8
    345 };
    346 inline ETextDecoration operator|(ETextDecoration a, ETextDecoration b) { return ETextDecoration(int(a) | int(b)); }
    347 inline ETextDecoration& operator|=(ETextDecoration& a, ETextDecoration b) { return a = a | b; }
     342static const size_t TextDecorationBits = 4;
     343enum TextDecoration {
     344    TextDecorationNone = 0x0, TextDecorationUnderline = 0x1, TextDecorationOverline = 0x2, TextDecorationLineThrough = 0x4, TextDecorationBlink = 0x8
     345};
     346inline TextDecoration operator| (TextDecoration a, TextDecoration b) { return TextDecoration(int(a) | int(b)); }
     347inline TextDecoration& operator|= (TextDecoration& a, TextDecoration b) { return a = a | b; }
    348348
    349349enum TextDecorationStyle {
  • trunk/Source/WebCore/rendering/style/StyleVisualData.h

    r125925 r150525  
    5353    LengthBox clip;
    5454    bool hasClip : 1;
    55     unsigned textDecoration : ETextDecorationBits; // Text decorations defined *only* by this element.
     55    unsigned textDecoration : TextDecorationBits; // Text decorations defined *only* by this element.
    5656
    5757#if ENABLE(TEXT_AUTOSIZING)
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

    r127421 r150525  
    319319        // Spec: All text decorations except line-through should be drawn before the text is filled and stroked; thus, the text is rendered on top of these decorations.
    320320        int decorations = style->textDecorationsInEffect();
    321         if (decorations & UNDERLINE)
    322             paintDecoration(paintInfo.context, UNDERLINE, fragment);
    323         if (decorations & OVERLINE)
    324             paintDecoration(paintInfo.context, OVERLINE, fragment);
     321        if (decorations & TextDecorationUnderline)
     322            paintDecoration(paintInfo.context, TextDecorationUnderline, fragment);
     323        if (decorations & TextDecorationOverline)
     324            paintDecoration(paintInfo.context, TextDecorationOverline, fragment);
    325325
    326326        // Fill text
     
    337337
    338338        // Spec: Line-through should be drawn after the text is filled and stroked; thus, the line-through is rendered on top of the text.
    339         if (decorations & LINE_THROUGH)
    340             paintDecoration(paintInfo.context, LINE_THROUGH, fragment);
     339        if (decorations & TextDecorationLineThrough)
     340            paintDecoration(paintInfo.context, TextDecorationLineThrough, fragment);
    341341
    342342        m_paintingResourceMode = ApplyToDefaultMode;
     
    479479}
    480480
    481 static inline float positionOffsetForDecoration(ETextDecoration decoration, const FontMetrics& fontMetrics, float thickness)
     481static inline float positionOffsetForDecoration(TextDecoration decoration, const FontMetrics& fontMetrics, float thickness)
    482482{
    483483    // FIXME: For SVG Fonts we need to use the attributes defined in the <font-face> if specified.
    484484    // Compatible with Batik/Opera.
    485     if (decoration == UNDERLINE)
     485    if (decoration == TextDecorationUnderline)
    486486        return fontMetrics.floatAscent() + thickness * 1.5f;
    487     if (decoration == OVERLINE)
     487    if (decoration == TextDecorationOverline)
    488488        return thickness;
    489     if (decoration == LINE_THROUGH)
     489    if (decoration == TextDecorationLineThrough)
    490490        return fontMetrics.floatAscent() * 5 / 8.0f;
    491491
     
    494494}
    495495
    496 static inline float thicknessForDecoration(ETextDecoration, const Font& font)
     496static inline float thicknessForDecoration(TextDecoration, const Font& font)
    497497{
    498498    // FIXME: For SVG Fonts we need to use the attributes defined in the <font-face> if specified.
     
    508508        renderer = parentBox->renderer();
    509509
    510         if (renderer->style() && renderer->style()->textDecoration() != TDNONE)
     510        if (renderer->style() && renderer->style()->textDecoration() != TextDecorationNone)
    511511            break;
    512512
     
    518518}
    519519
    520 void SVGInlineTextBox::paintDecoration(GraphicsContext* context, ETextDecoration decoration, const SVGTextFragment& fragment)
    521 {
    522     if (textRenderer()->style()->textDecorationsInEffect() == TDNONE)
     520void SVGInlineTextBox::paintDecoration(GraphicsContext* context, TextDecoration decoration, const SVGTextFragment& fragment)
     521{
     522    if (textRenderer()->style()->textDecorationsInEffect() == TextDecorationNone)
    523523        return;
    524524
     
    548548}
    549549
    550 void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, ETextDecoration decoration, const SVGTextFragment& fragment, RenderObject* decorationRenderer)
     550void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDecoration decoration, const SVGTextFragment& fragment, RenderObject* decorationRenderer)
    551551{
    552552    ASSERT(!m_paintingResource);
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h

    r149110 r150525  
    7575    void restoreGraphicsContextAfterTextPainting(GraphicsContext*&, TextRun&);
    7676
    77     void paintDecoration(GraphicsContext*, ETextDecoration, const SVGTextFragment&);
    78     void paintDecorationWithStyle(GraphicsContext*, ETextDecoration, const SVGTextFragment&, RenderObject* decorationRenderer);
     77    void paintDecoration(GraphicsContext*, TextDecoration, const SVGTextFragment&);
     78    void paintDecorationWithStyle(GraphicsContext*, TextDecoration, const SVGTextFragment&, RenderObject* decorationRenderer);
    7979    void paintTextWithShadows(GraphicsContext*, RenderStyle*, TextRun&, const SVGTextFragment&, int startPosition, int endPosition);
    8080    void paintText(GraphicsContext*, RenderStyle*, RenderStyle* selectionStyle, const SVGTextFragment&, bool hasSelection, bool paintSelectedTextOnly);
Note: See TracChangeset for help on using the changeset viewer.