| Index: third_party/WebKit/Source/core/editing/EditingStyle.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
|
| index b189ce93cb5fcc17673ba44286b22b35a1c75084..d7489943d0f7f90c418129edbd1050c8a2c13b28 100644
|
| --- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
|
| @@ -57,7 +57,6 @@
|
| #include "core/layout/LayoutBox.h"
|
| #include "core/layout/LayoutObject.h"
|
| #include "core/style/ComputedStyle.h"
|
| -#include "wtf/StdLibExtras.h"
|
|
|
| namespace blink {
|
|
|
| @@ -826,7 +825,7 @@
|
|
|
| static const HeapVector<Member<HTMLElementEquivalent>>& htmlElementEquivalents()
|
| {
|
| - DEFINE_STATIC_LOCAL(HeapVector<Member<HTMLElementEquivalent>>, HTMLElementEquivalents, (new HeapVector<Member<HTMLElementEquivalent>>));
|
| + DEFINE_STATIC_LOCAL(PersistentHeapVector<Member<HTMLElementEquivalent>>, HTMLElementEquivalents, ());
|
| if (!HTMLElementEquivalents.size()) {
|
| HTMLElementEquivalents.append(HTMLElementEquivalent::create(CSSPropertyFontWeight, CSSValueBold, HTMLNames::bTag));
|
| HTMLElementEquivalents.append(HTMLElementEquivalent::create(CSSPropertyFontWeight, CSSValueBold, HTMLNames::strongTag));
|
| @@ -864,7 +863,7 @@
|
|
|
| static const HeapVector<Member<HTMLAttributeEquivalent>>& htmlAttributeEquivalents()
|
| {
|
| - DEFINE_STATIC_LOCAL(HeapVector<Member<HTMLAttributeEquivalent>>, HTMLAttributeEquivalents, (new HeapVector<Member<HTMLAttributeEquivalent>>));
|
| + DEFINE_STATIC_LOCAL(PersistentHeapVector<Member<HTMLAttributeEquivalent>>, HTMLAttributeEquivalents, ());
|
| if (!HTMLAttributeEquivalents.size()) {
|
| // elementIsStyledSpanOrHTMLEquivalent depends on the fact each HTMLAttriuteEquivalent matches exactly one attribute
|
| // of exactly one element except dirAttr.
|
| @@ -1131,13 +1130,13 @@
|
|
|
| static void mergeTextDecorationValues(CSSValueList* mergedValue, const CSSValueList* valueToMerge)
|
| {
|
| - DEFINE_STATIC_LOCAL(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
|
| - DEFINE_STATIC_LOCAL(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
|
| - if (valueToMerge->hasValue(&underline) && !mergedValue->hasValue(&underline))
|
| - mergedValue->append(&underline);
|
| -
|
| - if (valueToMerge->hasValue(&lineThrough) && !mergedValue->hasValue(&lineThrough))
|
| - mergedValue->append(&lineThrough);
|
| + DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
|
| + DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
|
| + if (valueToMerge->hasValue(underline) && !mergedValue->hasValue(underline))
|
| + mergedValue->append(underline);
|
| +
|
| + if (valueToMerge->hasValue(lineThrough) && !mergedValue->hasValue(lineThrough))
|
| + mergedValue->append(lineThrough);
|
| }
|
|
|
| void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverrideMode mode)
|
| @@ -1525,12 +1524,12 @@
|
| // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
|
| RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
|
| if (textDecoration && textDecoration->isValueList()) {
|
| - DEFINE_STATIC_LOCAL(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
|
| - DEFINE_STATIC_LOCAL(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
|
| + DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
|
| + DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
|
| RawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy();
|
| - if (newTextDecoration->removeAll(&underline))
|
| + if (newTextDecoration->removeAll(underline))
|
| m_applyUnderline = true;
|
| - if (newTextDecoration->removeAll(&lineThrough))
|
| + if (newTextDecoration->removeAll(lineThrough))
|
| m_applyLineThrough = true;
|
|
|
| // If trimTextDecorations, delete underline and line-through
|
|
|