|
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)) |