Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(971)

Unified Diff: Source/core/editing/EditingStyle.cpp

Issue 22371012: Merge 155910 "Revert "Revert "Revert "[css3-text] Implement tex..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1594/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSShorthands.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingStyle.cpp
===================================================================
--- Source/core/editing/EditingStyle.cpp (revision 155922)
+++ Source/core/editing/EditingStyle.cpp (working copy)
@@ -56,12 +56,6 @@
namespace WebCore {
-static const CSSPropertyID& textDecorationPropertyForEditing()
-{
- static const CSSPropertyID property = RuntimeEnabledFeatures::css3TextDecorationsEnabled() ? CSSPropertyTextDecorationLine : CSSPropertyTextDecoration;
- return property;
-}
-
// Editing style properties must be preserved during editing operation.
// e.g. when a user inserts a new paragraph, all properties listed here must be copied to the new paragraph.
// NOTE: Use either allEditingProperties() or inheritableEditingProperties() to
@@ -78,10 +72,7 @@
CSSPropertyLineHeight,
CSSPropertyOrphans,
CSSPropertyTextAlign,
- // FIXME: CSSPropertyTextDecoration needs to be removed when CSS3 Text
- // Decoration feature is no longer experimental.
CSSPropertyTextDecoration,
- CSSPropertyTextDecorationLine,
CSSPropertyTextIndent,
CSSPropertyTextTransform,
CSSPropertyWhiteSpace,
@@ -98,14 +89,8 @@
static const Vector<CSSPropertyID>& allEditingProperties()
{
DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, properties, ());
- if (properties.isEmpty()) {
+ if (properties.isEmpty())
RuntimeCSSEnabled::filterEnabledCSSPropertiesIntoVector(staticEditingProperties, WTF_ARRAY_LENGTH(staticEditingProperties), properties);
- // This ensures we have only one of these properties on the vector.
- if (RuntimeEnabledFeatures::css3TextDecorationsEnabled())
- properties.remove(properties.find(CSSPropertyTextDecoration));
- else
- properties.remove(properties.find(CSSPropertyTextDecorationLine));
- }
return properties;
}
@@ -222,22 +207,21 @@
};
HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent(CSSValueID primitiveValue, const QualifiedName& tagName)
- : HTMLElementEquivalent(textDecorationPropertyForEditing(), primitiveValue, tagName)
+ : HTMLElementEquivalent(CSSPropertyTextDecoration, primitiveValue, tagName)
// m_propertyID is used in HTMLElementEquivalent::addToStyle
{
}
bool HTMLTextDecorationEquivalent::propertyExistsInStyle(const StylePropertySet* style) const
{
- return style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect)
- || style->getPropertyCSSValue(textDecorationPropertyForEditing());
+ return style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect) || style->getPropertyCSSValue(CSSPropertyTextDecoration);
}
bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(Element* element, StylePropertySet* style) const
{
RefPtr<CSSValue> styleValue = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
if (!styleValue)
- styleValue = style->getPropertyCSSValue(textDecorationPropertyForEditing());
+ styleValue = style->getPropertyCSSValue(CSSPropertyTextDecoration);
return matches(element) && styleValue && styleValue->isValueList() && toCSSValueList(styleValue.get())->hasValue(m_primitiveValue.get());
}
@@ -665,18 +649,15 @@
return;
if (textDecorationsInEffect->isValueList())
- m_mutableStyle->setProperty(textDecorationPropertyForEditing(), textDecorationsInEffect->cssText(), m_mutableStyle->propertyIsImportant(textDecorationPropertyForEditing()));
+ m_mutableStyle->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText(), m_mutableStyle->propertyIsImportant(CSSPropertyTextDecoration));
else
- m_mutableStyle->removeProperty(textDecorationPropertyForEditing());
+ m_mutableStyle->removeProperty(CSSPropertyTextDecoration);
m_mutableStyle->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
}
// CSS properties that create a visual difference only when applied to text.
static const CSSPropertyID textOnlyProperties[] = {
- // FIXME: CSSPropertyTextDecoration needs to be removed when CSS3 Text
- // Decoration feature is no longer experimental.
CSSPropertyTextDecoration,
- CSSPropertyTextDecorationLine,
CSSPropertyWebkitTextDecorationsInEffect,
CSSPropertyFontStyle,
CSSPropertyFontWeight,
@@ -753,16 +734,12 @@
if (propertyID == CSSPropertyWhiteSpace && isTabSpanNode(element))
continue;
- if (propertyID == CSSPropertyWebkitTextDecorationsInEffect && inlineStyle->getPropertyCSSValue(textDecorationPropertyForEditing())) {
+ if (propertyID == CSSPropertyWebkitTextDecorationsInEffect && inlineStyle->getPropertyCSSValue(CSSPropertyTextDecoration)) {
if (!conflictingProperties)
return true;
conflictingProperties->append(CSSPropertyTextDecoration);
- // Because text-decoration expands to text-decoration-line when CSS3
- // Text Decoration is enabled, we also state it as conflicting.
- if (RuntimeEnabledFeatures::css3TextDecorationsEnabled())
- conflictingProperties->append(CSSPropertyTextDecorationLine);
if (extractedStyle)
- extractedStyle->setProperty(textDecorationPropertyForEditing(), inlineStyle->getPropertyValue(textDecorationPropertyForEditing()), inlineStyle->propertyIsImportant(textDecorationPropertyForEditing()));
+ extractedStyle->setProperty(CSSPropertyTextDecoration, inlineStyle->getPropertyValue(CSSPropertyTextDecoration), inlineStyle->propertyIsImportant(CSSPropertyTextDecoration));
continue;
}
@@ -1120,7 +1097,7 @@
RefPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id());
// text decorations never override values
- if ((property.id() == textDecorationPropertyForEditing() || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value()->isValueList() && value) {
+ if ((property.id() == CSSPropertyTextDecoration || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value()->isValueList() && value) {
if (value->isValueList()) {
mergeTextDecorationValues(toCSSValueList(value.get()), toCSSValueList(property.value()));
continue;
@@ -1375,18 +1352,18 @@
static void reconcileTextDecorationProperties(MutableStylePropertySet* style)
{
RefPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
- RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
+ RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
// We shouldn't have both text-decoration and -webkit-text-decorations-in-effect because that wouldn't make sense.
ASSERT(!textDecorationsInEffect || !textDecoration);
if (textDecorationsInEffect) {
- style->setProperty(textDecorationPropertyForEditing(), textDecorationsInEffect->cssText());
+ style->setProperty(CSSPropertyTextDecoration, textDecorationsInEffect->cssText());
style->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
textDecoration = textDecorationsInEffect;
}
// If text-decoration is set to "none", remove the property because we don't want to add redundant "text-decoration: none".
if (textDecoration && !textDecoration->isValueList())
- style->removeProperty(textDecorationPropertyForEditing());
+ style->removeProperty(CSSPropertyTextDecoration);
}
StyleChange::StyleChange(EditingStyle* style, const Position& position)
@@ -1450,7 +1427,7 @@
// Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
// Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
- RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
+ RefPtr<CSSValue> textDecoration = style->getPropertyCSSValue(CSSPropertyTextDecoration);
if (textDecoration && textDecoration->isValueList()) {
DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
DEFINE_STATIC_LOCAL(RefPtr<CSSPrimitiveValue>, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
@@ -1462,7 +1439,7 @@
m_applyLineThrough = true;
// If trimTextDecorations, delete underline and line-through
- setTextDecorationProperty(style, newTextDecoration.get(), textDecorationPropertyForEditing());
+ setTextDecorationProperty(style, newTextDecoration.get(), CSSPropertyTextDecoration);
}
int verticalAlign = getIdentifierValue(style, CSSPropertyVerticalAlign);
@@ -1567,7 +1544,7 @@
result->removeEquivalentProperties(baseStyle);
RefPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect);
- diffTextDecorations(result.get(), textDecorationPropertyForEditing(), baseTextDecorationsInEffect.get());
+ diffTextDecorations(result.get(), CSSPropertyTextDecoration, baseTextDecorationsInEffect.get());
diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
if (baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight) && fontWeightIsBold(result.get()) == fontWeightIsBold(baseStyle))
« no previous file with comments | « Source/core/css/CSSShorthands.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698