| Differences between
and this patch
- a/LayoutTests/ChangeLog +15 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-07-12  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
2
3
        [css3-text] Add suport for text-decoration-line
4
        https://bugs.webkit.org/show_bug.cgi?id=90959
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Currently, only "text-decoration" property from CSS spec is implemented. CSS3
9
        spec also specifices other "text-decoration-*" properties. This patch adds
10
        support for "text-decoration-line" as simply a wrapper for text-decoration for
11
        now.
12
13
        * fast/css/getComputedStyle/computed-style-expected.txt:
14
        * fast/css/getComputedStyle/resources/property-names.js:
15
1
2012-07-12  Kent Tamura  <tkent@chromium.org>
16
2012-07-12  Kent Tamura  <tkent@chromium.org>
2
17
3
        Do not save the form state signature if nothing is saved
18
        Do not save the form state signature if nothing is saved
- a/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt +1 lines
Lines 85-90 table-layout: auto; a/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt_sec1
85
tab-size: 8;
85
tab-size: 8;
86
text-align: start;
86
text-align: start;
87
text-decoration: none;
87
text-decoration: none;
88
text-decoration-line: none;
88
text-indent: 0px;
89
text-indent: 0px;
89
text-rendering: auto;
90
text-rendering: auto;
90
text-shadow: none;
91
text-shadow: none;
- a/LayoutTests/fast/css/getComputedStyle/resources/property-names.js +1 lines
Lines 232-237 var propertiesToTest = { a/LayoutTests/fast/css/getComputedStyle/resources/property-names.js_sec1
232
    "text-align": true,
232
    "text-align": true,
233
    "text-anchor": true,
233
    "text-anchor": true,
234
    "text-decoration": true,
234
    "text-decoration": true,
235
    "text-decoration-line": true,
235
    "text-indent": true,
236
    "text-indent": true,
236
    "text-overflow": true,
237
    "text-overflow": true,
237
    "text-rendering": true,
238
    "text-rendering": true,
- a/Source/WebCore/ChangeLog +52 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-07-12  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
2
3
        [css3-text] Add suport for text-decoration-line
4
        https://bugs.webkit.org/show_bug.cgi?id=90959
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Currently, only "text-decoration" property from CSS spec is implemented. CSS3
9
        spec also specifices other "text-decoration-*" properties. This patch adds
10
        support for "text-decoration-line" as simply a wrapper for text-decoration for
11
        now.
12
13
        No new tests (OOPS!).
14
15
        * css/CSSComputedStyleDeclaration.cpp:
16
        (WebCore):
17
        (WebCore::renderTextDecorationLineFlagsToCSSValue):
18
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
19
        * css/CSSParser.cpp:
20
        (WebCore::CSSParser::parseValue):
21
        * css/CSSParser.h:
22
        * css/CSSProperty.cpp:
23
        (WebCore::CSSProperty::isInheritedProperty):
24
        * css/CSSPropertyNames.in:
25
        * css/StyleBuilder.cpp:
26
        (ApplyPropertyTextDecorationLine):
27
        (WebCore::ApplyPropertyTextDecorationLine::applyValue):
28
        (WebCore::ApplyPropertyTextDecorationLine::createHandler):
29
        (WebCore):
30
        (WebCore::StyleBuilder::StyleBuilder):
31
        * css/StyleResolver.cpp:
32
        (WebCore::StyleResolver::collectMatchingRulesForList):
33
        * editing/EditingStyle.cpp:
34
        (WebCore):
35
        (HTMLTextDecorationLineEquivalent):
36
        (WebCore::HTMLTextDecorationLineEquivalent::HTMLTextDecorationLineEquivalent):
37
        (WebCore::HTMLTextDecorationLineEquivalent::create):
38
        (WebCore::EditingStyle::init):
39
        (WebCore::EditingStyle::collapseTextDecorationProperties):
40
        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
41
        (WebCore::htmlElementEquivalents):
42
        (WebCore::EditingStyle::mergeStyle):
43
        (WebCore::reconcileTextDecorationProperties):
44
        (WebCore::StyleChange::extractTextStyles):
45
        (WebCore::getPropertiesNotIn):
46
        * editing/markup.cpp:
47
        (WebCore::createMarkup):
48
        * rendering/style/RenderStyle.h:
49
        * rendering/style/StyleVisualData.h:
50
        (WebCore::StyleVisualData::operator==):
51
        (StyleVisualData):
52
1
2012-07-12  Kent Tamura  <tkent@chromium.org>
53
2012-07-12  Kent Tamura  <tkent@chromium.org>
2
54
3
        Do not save the form state signature if nothing is saved
55
        Do not save the form state signature if nothing is saved
- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +18 lines
Lines 165-170 static const CSSPropertyID computedProperties[] = { a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
165
    CSSPropertyTabSize,
165
    CSSPropertyTabSize,
166
    CSSPropertyTextAlign,
166
    CSSPropertyTextAlign,
167
    CSSPropertyTextDecoration,
167
    CSSPropertyTextDecoration,
168
    CSSPropertyTextDecorationLine,
168
    CSSPropertyTextIndent,
169
    CSSPropertyTextIndent,
169
    CSSPropertyTextRendering,
170
    CSSPropertyTextRendering,
170
    CSSPropertyTextShadow,
171
    CSSPropertyTextShadow,
Lines 1165-1170 static PassRefPtr<CSSValue> renderUnicodeBidiFlagsToCSSValue(EUnicodeBidi unicod a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec2
1165
    return 0;
1166
    return 0;
1166
}
1167
}
1167
1168
1169
static PassRefPtr<CSSValue> renderTextDecorationLineFlagsToCSSValue(int textDecorationLine)
1170
{
1171
    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1172
    if (textDecorationLine & UNDERLINE)
1173
        list->append(cssValuePool().createIdentifierValue(CSSValueUnderline));
1174
    if (textDecorationLine & OVERLINE)
1175
        list->append(cssValuePool().createIdentifierValue(CSSValueOverline));
1176
    if (textDecorationLine & LINE_THROUGH)
1177
        list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough));
1178
1179
    if (!list->length())
1180
        return cssValuePool().createIdentifierValue(CSSValueNone);
1181
    return list;
1182
}
1183
1168
static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration)
1184
static PassRefPtr<CSSValue> renderTextDecorationFlagsToCSSValue(int textDecoration)
1169
{
1185
{
1170
    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
1186
    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
Lines 1922-1927 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec3
1922
            return cssValuePool().createValue(style->textAlign());
1938
            return cssValuePool().createValue(style->textAlign());
1923
        case CSSPropertyTextDecoration:
1939
        case CSSPropertyTextDecoration:
1924
            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
1940
            return renderTextDecorationFlagsToCSSValue(style->textDecoration());
1941
        case CSSPropertyTextDecorationLine:
1942
            return renderTextDecorationLineFlagsToCSSValue(style->textDecorationLine());
1925
        case CSSPropertyWebkitTextDecorationsInEffect:
1943
        case CSSPropertyWebkitTextDecorationsInEffect:
1926
            return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
1944
            return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
1927
        case CSSPropertyWebkitTextFillColor:
1945
        case CSSPropertyWebkitTextFillColor:
- a/Source/WebCore/css/CSSParser.cpp +26 lines
Lines 2086-2091 bool CSSParser::parseValue(CSSPropertyID propId, bool important) a/Source/WebCore/css/CSSParser.cpp_sec1
2086
        break;
2086
        break;
2087
    }
2087
    }
2088
2088
2089
    case CSSPropertyTextDecorationLine:
2090
        // none | [ underline || overline || line-through ] | inherit
2091
        if (id == CSSValueNone)
2092
            validPrimitive = true;
2093
        else {
2094
            RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
2095
            bool isValid = true;
2096
            while (isValid && value) {
2097
                switch (value->id) {
2098
                case CSSValueUnderline:
2099
                case CSSValueOverline:
2100
                case CSSValueLineThrough:
2101
                    list->append(cssValuePool().createIdentifierValue(value->id));
2102
                    break;
2103
                default:
2104
                    isValid = false;
2105
                }
2106
                value = m_valueList->next();
2107
            }
2108
            if (list->length() && isValid) {
2109
                parsedValue = list.release();
2110
                m_valueList->next();
2111
            }
2112
        }
2113
        break;
2114
2089
    case CSSPropertyTextDecoration:
2115
    case CSSPropertyTextDecoration:
2090
    case CSSPropertyWebkitTextDecorationsInEffect:
2116
    case CSSPropertyWebkitTextDecorationsInEffect:
2091
        // none | [ underline || overline || line-through || blink ] | inherit
2117
        // none | [ underline || overline || line-through || blink ] | inherit
- a/Source/WebCore/css/CSSParser.h +2 lines
Lines 223-228 public: a/Source/WebCore/css/CSSParser.h_sec1
223
223
224
    bool parseTextEmphasisStyle(bool important);
224
    bool parseTextEmphasisStyle(bool important);
225
225
226
    bool parseTextDecorationLine();
227
226
    bool parseLineBoxContain(bool important);
228
    bool parseLineBoxContain(bool important);
227
    bool parseCalculation(CSSParserValue*, CalculationPermittedValueRange);
229
    bool parseCalculation(CSSParserValue*, CalculationPermittedValueRange);
228
230
- a/Source/WebCore/css/CSSProperty.cpp +1 lines
Lines 300-305 bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) a/Source/WebCore/css/CSSProperty.cpp_sec1
300
    case CSSPropertyTabSize:
300
    case CSSPropertyTabSize:
301
    case CSSPropertyTextAlign:
301
    case CSSPropertyTextAlign:
302
    case CSSPropertyTextDecoration:
302
    case CSSPropertyTextDecoration:
303
    case CSSPropertyTextDecorationLine:
303
    case CSSPropertyTextIndent:
304
    case CSSPropertyTextIndent:
304
    case CSSPropertyTextRendering:
305
    case CSSPropertyTextRendering:
305
    case CSSPropertyTextShadow:
306
    case CSSPropertyTextShadow:
- a/Source/WebCore/css/CSSPropertyNames.in +1 lines
Lines 156-161 table-layout a/Source/WebCore/css/CSSPropertyNames.in_sec1
156
tab-size
156
tab-size
157
text-align
157
text-align
158
text-decoration
158
text-decoration
159
text-decoration-line
159
text-indent
160
text-indent
160
text-line-through
161
text-line-through
161
text-line-through-color
162
text-line-through-color
- a/Source/WebCore/css/StyleBuilder.cpp +20 lines
Lines 1161-1166 public: a/Source/WebCore/css/StyleBuilder.cpp_sec1
1161
    }
1161
    }
1162
};
1162
};
1163
1163
1164
class ApplyPropertyTextDecorationLine {
1165
public:
1166
    static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1167
    {
1168
        ETextDecoration t = RenderStyle::initialTextDecorationLine();
1169
        for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
1170
            CSSValue* item = i.value();
1171
            ASSERT(item->isPrimitiveValue());
1172
            t |= *static_cast<CSSPrimitiveValue*>(item);
1173
        }
1174
        styleResolver->style()->setTextDecorationLine(t);
1175
    }
1176
    static PropertyHandler createHandler()
1177
    {
1178
        PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecorationLine, ETextDecoration, &RenderStyle::setTextDecorationLine, ETextDecoration, &RenderStyle::initialTextDecorationLine>::createHandler();
1179
        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
1180
    }
1181
};
1182
1164
class ApplyPropertyUnicodeBidi {
1183
class ApplyPropertyUnicodeBidi {
1165
public:
1184
public:
1166
    static void applyValue(StyleResolver* styleResolver, CSSValue* value)
1185
    static void applyValue(StyleResolver* styleResolver, CSSValue* value)
Lines 1918-1923 StyleBuilder::StyleBuilder() a/Source/WebCore/css/StyleBuilder.cpp_sec2
1918
    setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
1937
    setPropertyHandler(CSSPropertyTabSize, ApplyPropertyDefault<unsigned, &RenderStyle::tabSize, unsigned, &RenderStyle::setTabSize, unsigned, &RenderStyle::initialTabSize>::createHandler());
1919
    setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
1938
    setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
1920
    setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
1939
    setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
1940
    setPropertyHandler(CSSPropertyTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
1921
    setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
1941
    setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
1922
    setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
1942
    setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
1923
    setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
1943
    setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
- a/Source/WebCore/css/StyleResolver.cpp +1 lines
Lines 4220-4225 void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) a/Source/WebCore/css/StyleResolver.cpp_sec1
4220
    case CSSPropertyTableLayout:
4220
    case CSSPropertyTableLayout:
4221
    case CSSPropertyTextAlign:
4221
    case CSSPropertyTextAlign:
4222
    case CSSPropertyTextDecoration:
4222
    case CSSPropertyTextDecoration:
4223
    case CSSPropertyTextDecorationLine:
4223
    case CSSPropertyTextIndent:
4224
    case CSSPropertyTextIndent:
4224
    case CSSPropertyTextOverflow:
4225
    case CSSPropertyTextOverflow:
4225
    case CSSPropertyTextRendering:
4226
    case CSSPropertyTextRendering:
- a/Source/WebCore/editing/EditingStyle.cpp -7 / +40 lines
Lines 58-63 namespace WebCore { a/Source/WebCore/editing/EditingStyle.cpp_sec1
58
static const CSSPropertyID editingProperties[] = {
58
static const CSSPropertyID editingProperties[] = {
59
    CSSPropertyBackgroundColor,
59
    CSSPropertyBackgroundColor,
60
    CSSPropertyTextDecoration,
60
    CSSPropertyTextDecoration,
61
    CSSPropertyTextDecorationLine,
61
62
62
    // CSS inheritable properties
63
    // CSS inheritable properties
63
    CSSPropertyColor,
64
    CSSPropertyColor,
Lines 202-207 bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(Element* element, Style a/Source/WebCore/editing/EditingStyle.cpp_sec2
202
    return matches(element) && styleValue && styleValue->isValueList() && static_cast<CSSValueList*>(styleValue.get())->hasValue(m_primitiveValue.get());
203
    return matches(element) && styleValue && styleValue->isValueList() && static_cast<CSSValueList*>(styleValue.get())->hasValue(m_primitiveValue.get());
203
}
204
}
204
205
206
class HTMLTextDecorationLineEquivalent : public HTMLElementEquivalent {
207
public:
208
    HTMLTextDecorationLineEquivalent(int primitiveValue, const QualifiedName& tagName)
209
        : HTMLElementEquivalent(CSSPropertyTextDecorationLine, primitiveValue, tagName)
210
    {
211
    }
212
    static PassOwnPtr<HTMLElementEquivalent> create(int primitiveValue, const QualifiedName& tagName)
213
    {
214
        return adoptPtr(new HTMLTextDecorationLineEquivalent(primitiveValue, tagName));
215
    }
216
};
217
205
class HTMLAttributeEquivalent : public HTMLElementEquivalent {
218
class HTMLAttributeEquivalent : public HTMLElementEquivalent {
206
public:
219
public:
207
    static PassOwnPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const QualifiedName& tagName, const QualifiedName& attrName)
220
    static PassOwnPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const QualifiedName& tagName, const QualifiedName& attrName)
Lines 416-421 void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude) a/Source/WebCore/editing/EditingStyle.cpp_sec3
416
            m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText());
429
            m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText());
417
        if (RefPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect))
430
        if (RefPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect))
418
            m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText());
431
            m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText());
432
        // All values accepted by "text-decoration-line" are accepted by "text-decoration"
433
        if (RefPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyTextDecorationLine))
434
            m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText());
419
    }
435
    }
420
436
421
    if (node && node->computedStyle()) {
437
    if (node && node->computedStyle()) {
Lines 620-632 void EditingStyle::collapseTextDecorationProperties() a/Source/WebCore/editing/EditingStyle.cpp_sec4
620
        return;
636
        return;
621
637
622
    RefPtr<CSSValue> textDecorationsInEffect = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
638
    RefPtr<CSSValue> textDecorationsInEffect = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
623
    if (!textDecorationsInEffect)
639
    RefPtr<CSSValue> textDecorationLine = m_mutableStyle->getPropertyCSSValue(CSSPropertyTextDecorationLine);
640
    if (!textDecorationsInEffect || !textDecorationLine)
624
        return;
641
        return;
625
642
626
    if (textDecorationsInEffect->isValueList())
643
    if (textDecorationLine->isValueList())
644
        m_mutableStyle->setProperty(CSSPropertyTextDecoration, textDecorationLine->cssText(), m_mutableStyle->propertyIsImportant(CSSPropertyTextDecoration));
645
    else if (textDecorationsInEffect->isValueList())
627
        m_mutableStyle->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText(), m_mutableStyle->propertyIsImportant(CSSPropertyTextDecoration));
646
        m_mutableStyle->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText(), m_mutableStyle->propertyIsImportant(CSSPropertyTextDecoration));
628
    else
647
    else
629
        m_mutableStyle->removeProperty(CSSPropertyTextDecoration);
648
        m_mutableStyle->removeProperty(CSSPropertyTextDecoration);
649
    m_mutableStyle->removeProperty(CSSPropertyTextDecorationLine);
630
    m_mutableStyle->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
650
    m_mutableStyle->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
631
}
651
}
632
652
Lines 705-711 bool EditingStyle::conflictsWithInlineStyleOfElement(StyledElement* element, Edi a/Source/WebCore/editing/EditingStyle.cpp_sec5
705
        if (propertyID == CSSPropertyWhiteSpace && isTabSpanNode(element))
725
        if (propertyID == CSSPropertyWhiteSpace && isTabSpanNode(element))
706
            continue;
726
            continue;
707
727
708
        if (propertyID == CSSPropertyWebkitTextDecorationsInEffect && inlineStyle->getPropertyCSSValue(CSSPropertyTextDecoration)) {
728
        if ((propertyID == CSSPropertyWebkitTextDecorationsInEffect || propertyID == CSSPropertyTextDecorationLine) && inlineStyle->getPropertyCSSValue(CSSPropertyTextDecoration)) {
709
            if (!conflictingProperties)
729
            if (!conflictingProperties)
710
                return true;
730
                return true;
711
            conflictingProperties->append(CSSPropertyTextDecoration);
731
            conflictingProperties->append(CSSPropertyTextDecoration);
Lines 752-757 static const Vector<OwnPtr<HTMLElementEquivalent> >& htmlElementEquivalents() a/Source/WebCore/editing/EditingStyle.cpp_sec6
752
        HTMLElementEquivalents.append(HTMLTextDecorationEquivalent::create(CSSValueUnderline, HTMLNames::uTag));
772
        HTMLElementEquivalents.append(HTMLTextDecorationEquivalent::create(CSSValueUnderline, HTMLNames::uTag));
753
        HTMLElementEquivalents.append(HTMLTextDecorationEquivalent::create(CSSValueLineThrough, HTMLNames::sTag));
773
        HTMLElementEquivalents.append(HTMLTextDecorationEquivalent::create(CSSValueLineThrough, HTMLNames::sTag));
754
        HTMLElementEquivalents.append(HTMLTextDecorationEquivalent::create(CSSValueLineThrough, HTMLNames::strikeTag));
774
        HTMLElementEquivalents.append(HTMLTextDecorationEquivalent::create(CSSValueLineThrough, HTMLNames::strikeTag));
775
776
        HTMLElementEquivalents.append(HTMLTextDecorationLineEquivalent::create(CSSValueUnderline, HTMLNames::uTag));
777
        HTMLElementEquivalents.append(HTMLTextDecorationLineEquivalent::create(CSSValueLineThrough, HTMLNames::sTag));
778
        HTMLElementEquivalents.append(HTMLTextDecorationLineEquivalent::create(CSSValueLineThrough, HTMLNames::strikeTag));
755
    }
779
    }
756
780
757
    return HTMLElementEquivalents;
781
    return HTMLElementEquivalents;
Lines 1046-1052 void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverride a/Source/WebCore/editing/EditingStyle.cpp_sec7
1046
        RefPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id());
1070
        RefPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id());
1047
1071
1048
        // text decorations never override values
1072
        // text decorations never override values
1049
        if ((property.id() == CSSPropertyTextDecoration || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value()->isValueList() && value) {
1073
        if ((property.id() == CSSPropertyTextDecoration || property.id() == CSSPropertyTextDecorationLine || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value()->isValueList() && value) {
1050
            if (value->isValueList()) {
1074
            if (value->isValueList()) {
1051
                mergeTextDecorationValues(static_cast<CSSValueList*>(value.get()), static_cast<CSSValueList*>(property.value()));
1075
                mergeTextDecorationValues(static_cast<CSSValueList*>(value.get()), static_cast<CSSValueList*>(property.value()));
1052
                continue;
1076
                continue;
Lines 1302-1311 WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection& a/Source/WebCore/editing/EditingStyle.cpp_sec8
1302
static void reconcileTextDecorationProperties(StylePropertySet* style)
1326
static void reconcileTextDecorationProperties(StylePropertySet* style)
1303
{    
1327
{    
1304
    RefPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
1328
    RefPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
1329
    RefPtr<CSSValue> textDecorationLine = style->getPropertyCSSValue(CSSPropertyTextDecorationLine);
1305
    RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
1330
    RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
1306
    // We shouldn't have both text-decoration and -webkit-text-decorations-in-effect because that wouldn't make sense.
1331
1307
    ASSERT(!textDecorationsInEffect || !textDecoration);
1332
    // XXX
1308
    if (textDecorationsInEffect) {
1333
    // We shouldn't have text-decoration together with text-decoration-line and -webkit-text-decorations-in-effect because that wouldn't make sense.
1334
    ASSERT(!textDecorationsInEffect || !textDecoration || !textDecorationLine);
1335
    if (textDecorationLine) {
1336
        style->setProperty(CSSPropertyTextDecoration, textDecorationLine->cssText());
1337
        style->removeProperty(CSSPropertyTextDecorationLine);
1338
        textDecoration = textDecorationLine;
1339
    } else if (textDecorationsInEffect) {
1309
        style->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText());
1340
        style->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText());
1310
        style->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
1341
        style->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
1311
        textDecoration = textDecorationsInEffect;
1342
        textDecoration = textDecorationsInEffect;
Lines 1376-1381 void StyleChange::extractTextStyles(Document* document, StylePropertySet* style, a/Source/WebCore/editing/EditingStyle.cpp_sec9
1376
    }
1407
    }
1377
1408
1378
    // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
1409
    // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
1410
    // neither text-decoration-line properties.
1379
    // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
1411
    // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
1380
    RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
1412
    RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
1381
    if (textDecoration && textDecoration->isValueList()) {
1413
    if (textDecoration && textDecoration->isValueList()) {
Lines 1493-1498 PassRefPtr<StylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedun a/Source/WebCore/editing/EditingStyle.cpp_sec10
1493
1525
1494
    RefPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect);
1526
    RefPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect);
1495
    diffTextDecorations(result.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
1527
    diffTextDecorations(result.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
1528
    diffTextDecorations(result.get(), CSSPropertyTextDecorationLine, baseTextDecorationsInEffect.get());
1496
    diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
1529
    diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
1497
1530
1498
    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
1531
    if (baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
- a/Source/WebCore/editing/markup.cpp +2 lines
Lines 633-638 String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc a/Source/WebCore/editing/markup.cpp_sec1
633
                    // 'text-decoration' property is "inherit", and copy it.
633
                    // 'text-decoration' property is "inherit", and copy it.
634
                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyTextDecoration))
634
                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyTextDecoration))
635
                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecoration, CSSValueNone);
635
                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecoration, CSSValueNone);
636
                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyTextDecorationLine))
637
                        fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecorationLine, CSSValueNone);
636
                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyWebkitTextDecorationsInEffect))
638
                    if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyWebkitTextDecorationsInEffect))
637
                        fullySelectedRootStyle->style()->setProperty(CSSPropertyWebkitTextDecorationsInEffect, CSSValueNone);
639
                        fullySelectedRootStyle->style()->setProperty(CSSPropertyWebkitTextDecorationsInEffect, CSSValueNone);
638
                    accumulator.wrapWithStyleNode(fullySelectedRootStyle->style(), document, true);
640
                    accumulator.wrapWithStyleNode(fullySelectedRootStyle->style(), document, true);
- a/Source/WebCore/rendering/style/RenderStyle.h +3 lines
Lines 619-624 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
619
    ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
619
    ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
620
    ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
620
    ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
621
    ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
621
    ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
622
    ETextDecoration textDecorationLine() const { return static_cast<ETextDecoration>(visual->textDecorationLine); }
622
    int wordSpacing() const { return inherited->font.wordSpacing(); }
623
    int wordSpacing() const { return inherited->font.wordSpacing(); }
623
    int letterSpacing() const { return inherited->font.letterSpacing(); }
624
    int letterSpacing() const { return inherited->font.letterSpacing(); }
624
625
Lines 1146-1151 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec2
1146
    void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
1147
    void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
1147
    void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
1148
    void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
1148
    void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
1149
    void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
1150
    void setTextDecorationLine(ETextDecoration v) { SET_VAR(visual, textDecorationLine, v); }
1149
    void setDirection(TextDirection v) { inherited_flags._direction = v; }
1151
    void setDirection(TextDirection v) { inherited_flags._direction = v; }
1150
    void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
1152
    void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
1151
    bool setZoom(float);
1153
    bool setZoom(float);
Lines 1600-1605 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec3
1600
    static Length initialLineHeight() { return Length(-100.0, Percent); }
1602
    static Length initialLineHeight() { return Length(-100.0, Percent); }
1601
    static ETextAlign initialTextAlign() { return TASTART; }
1603
    static ETextAlign initialTextAlign() { return TASTART; }
1602
    static ETextDecoration initialTextDecoration() { return TDNONE; }
1604
    static ETextDecoration initialTextDecoration() { return TDNONE; }
1605
    static ETextDecoration initialTextDecorationLine() { return TDNONE; }
1603
    static float initialZoom() { return 1.0f; }
1606
    static float initialZoom() { return 1.0f; }
1604
    static int initialOutlineOffset() { return 0; }
1607
    static int initialOutlineOffset() { return 0; }
1605
    static float initialOpacity() { return 1.0f; }
1608
    static float initialOpacity() { return 1.0f; }
- a/Source/WebCore/rendering/style/StyleVisualData.h -5 / +6 lines
Lines 40-55 public: a/Source/WebCore/rendering/style/StyleVisualData.h_sec1
40
40
41
    bool operator==(const StyleVisualData& o) const
41
    bool operator==(const StyleVisualData& o) const
42
    {
42
    {
43
        return ( clip == o.clip &&
43
        return ( clip == o.clip
44
                 hasClip == o.hasClip &&
44
                 && hasClip == o.hasClip
45
                 textDecoration == o.textDecoration &&
45
                 && textDecoration == o.textDecoration
46
                 m_zoom == o.m_zoom);
46
                 && textDecorationLine == o.textDecorationLine
47
                 && m_zoom == o.m_zoom);
47
    }
48
    }
48
    bool operator!=(const StyleVisualData& o) const { return !(*this == o); }
49
    bool operator!=(const StyleVisualData& o) const { return !(*this == o); }
49
50
50
    LengthBox clip;
51
    LengthBox clip;
51
    bool hasClip : 1;
52
    bool hasClip : 1;
52
    unsigned textDecoration : ETextDecorationBits; // Text decorations defined *only* by this element.
53
    unsigned textDecoration : ETextDecorationBits; // Text decorations defined *only* by this element.
54
    unsigned textDecorationLine : ETextDecorationBits;
53
    
55
    
54
    float m_zoom;
56
    float m_zoom;
55
57
56
- 

Return to Bug 90959