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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 f3576a7edd9cb580e893437c732c834ed1527017..bb6ba98d6f30ae0d646c77ebe8708f3d07e3c154 100644
--- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -127,7 +127,7 @@ static const Vector<CSSPropertyID>& inheritableEditingProperties()
}
template <class StyleDeclarationType>
-static PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyEditingProperties(StyleDeclarationType* style, EditingPropertiesType type = OnlyInheritableEditingProperties)
+static RawPtr<MutableStylePropertySet> copyEditingProperties(StyleDeclarationType* style, EditingPropertiesType type = OnlyInheritableEditingProperties)
{
if (type == AllEditingProperties)
return style->copyPropertiesInSet(allEditingProperties());
@@ -139,14 +139,14 @@ static inline bool isEditingProperty(int id)
return allEditingProperties().contains(static_cast<CSSPropertyID>(id));
}
-static PassRefPtrWillBeRawPtr<MutableStylePropertySet> editingStyleFromComputedStyle(PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
+static RawPtr<MutableStylePropertySet> editingStyleFromComputedStyle(RawPtr<CSSComputedStyleDeclaration> style, EditingPropertiesType type = OnlyInheritableEditingProperties)
{
if (!style)
return MutableStylePropertySet::create(HTMLQuirksMode);
return copyEditingProperties(style.get(), type);
}
-static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ensureComputedStyle(const Position& position)
+static RawPtr<CSSComputedStyleDeclaration> ensureComputedStyle(const Position& position)
{
Element* elem = associatedElementOf(position);
if (!elem)
@@ -154,21 +154,19 @@ static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ensureComputedStyle(c
return CSSComputedStyleDeclaration::create(elem);
}
-static PassRefPtrWillBeRawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
+static RawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle);
enum LegacyFontSizeMode { AlwaysUseLegacyFontSize, UseLegacyFontSizeOnlyIfPixelValuesMatch };
static int legacyFontSizeFromCSSValue(Document*, CSSPrimitiveValue*, bool, LegacyFontSizeMode);
static bool isTransparentColorValue(CSSValue*);
static bool hasTransparentBackgroundColor(CSSStyleDeclaration*);
static bool hasTransparentBackgroundColor(StylePropertySet*);
-static PassRefPtrWillBeRawPtr<CSSValue> backgroundColorValueInEffect(Node*);
+static RawPtr<CSSValue> backgroundColorValueInEffect(Node*);
-class HTMLElementEquivalent : public NoBaseWillBeGarbageCollected<HTMLElementEquivalent> {
- USING_FAST_MALLOC_WILL_BE_REMOVED(HTMLElementEquivalent);
- DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(HTMLElementEquivalent);
+class HTMLElementEquivalent : public GarbageCollected<HTMLElementEquivalent> {
public:
- static PassOwnPtrWillBeRawPtr<HTMLElementEquivalent> create(CSSPropertyID propertyID, CSSValueID primitiveValue, const HTMLQualifiedName& tagName)
+ static RawPtr<HTMLElementEquivalent> create(CSSPropertyID propertyID, CSSValueID primitiveValue, const HTMLQualifiedName& tagName)
{
- return adoptPtrWillBeNoop(new HTMLElementEquivalent(propertyID, primitiveValue, tagName));
+ return new HTMLElementEquivalent(propertyID, primitiveValue, tagName);
}
virtual bool matches(const Element* element) const { return !m_tagName || element->hasTagName(*m_tagName); }
@@ -184,12 +182,10 @@ protected:
HTMLElementEquivalent(CSSPropertyID, const HTMLQualifiedName& tagName);
HTMLElementEquivalent(CSSPropertyID, CSSValueID primitiveValue, const HTMLQualifiedName& tagName);
const CSSPropertyID m_propertyID;
- const RefPtrWillBeMember<CSSPrimitiveValue> m_primitiveValue;
+ const Member<CSSPrimitiveValue> m_primitiveValue;
const HTMLQualifiedName* m_tagName; // We can store a pointer because HTML tag names are const global.
};
-DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(HTMLElementEquivalent);
-
HTMLElementEquivalent::HTMLElementEquivalent(CSSPropertyID id)
: m_propertyID(id)
, m_tagName(0)
@@ -212,7 +208,7 @@ HTMLElementEquivalent::HTMLElementEquivalent(CSSPropertyID id, CSSValueID primit
bool HTMLElementEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const
{
- RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID);
+ RawPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID);
return matches(element) && value && value->isPrimitiveValue() && toCSSPrimitiveValue(value.get())->getValueID() == m_primitiveValue->getValueID();
}
@@ -223,9 +219,9 @@ void HTMLElementEquivalent::addToStyle(Element*, EditingStyle* style) const
class HTMLTextDecorationEquivalent final : public HTMLElementEquivalent {
public:
- static PassOwnPtrWillBeRawPtr<HTMLElementEquivalent> create(CSSValueID primitiveValue, const HTMLQualifiedName& tagName)
+ static RawPtr<HTMLElementEquivalent> create(CSSValueID primitiveValue, const HTMLQualifiedName& tagName)
{
- return adoptPtrWillBeNoop(new HTMLTextDecorationEquivalent(primitiveValue, tagName));
+ return new HTMLTextDecorationEquivalent(primitiveValue, tagName);
}
bool propertyExistsInStyle(const StylePropertySet*) const override;
bool valueIsPresentInStyle(HTMLElement*, StylePropertySet*) const override;
@@ -250,7 +246,7 @@ bool HTMLTextDecorationEquivalent::propertyExistsInStyle(const StylePropertySet*
bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const
{
- RefPtrWillBeRawPtr<CSSValue> styleValue = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
+ RawPtr<CSSValue> styleValue = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
if (!styleValue)
styleValue = style->getPropertyCSSValue(textDecorationPropertyForEditing());
return matches(element) && styleValue && styleValue->isValueList() && toCSSValueList(styleValue.get())->hasValue(m_primitiveValue.get());
@@ -258,20 +254,20 @@ bool HTMLTextDecorationEquivalent::valueIsPresentInStyle(HTMLElement* element, S
class HTMLAttributeEquivalent : public HTMLElementEquivalent {
public:
- static PassOwnPtrWillBeRawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const HTMLQualifiedName& tagName, const QualifiedName& attrName)
+ static RawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const HTMLQualifiedName& tagName, const QualifiedName& attrName)
{
- return adoptPtrWillBeNoop(new HTMLAttributeEquivalent(propertyID, tagName, attrName));
+ return new HTMLAttributeEquivalent(propertyID, tagName, attrName);
}
- static PassOwnPtrWillBeRawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const QualifiedName& attrName)
+ static RawPtr<HTMLAttributeEquivalent> create(CSSPropertyID propertyID, const QualifiedName& attrName)
{
- return adoptPtrWillBeNoop(new HTMLAttributeEquivalent(propertyID, attrName));
+ return new HTMLAttributeEquivalent(propertyID, attrName);
}
bool matches(const Element* element) const override { return HTMLElementEquivalent::matches(element) && element->hasAttribute(m_attrName); }
bool hasAttribute() const override { return true; }
bool valueIsPresentInStyle(HTMLElement*, StylePropertySet*) const override;
void addToStyle(Element*, EditingStyle*) const override;
- virtual PassRefPtrWillBeRawPtr<CSSValue> attributeValueAsCSSValue(Element*) const;
+ virtual RawPtr<CSSValue> attributeValueAsCSSValue(Element*) const;
inline const QualifiedName& attributeName() const { return m_attrName; }
DEFINE_INLINE_VIRTUAL_TRACE() { HTMLElementEquivalent::trace(visitor); }
@@ -296,26 +292,26 @@ HTMLAttributeEquivalent::HTMLAttributeEquivalent(CSSPropertyID id, const Qualifi
bool HTMLAttributeEquivalent::valueIsPresentInStyle(HTMLElement* element, StylePropertySet* style) const
{
- RefPtrWillBeRawPtr<CSSValue> value = attributeValueAsCSSValue(element);
- RefPtrWillBeRawPtr<CSSValue> styleValue = style->getPropertyCSSValue(m_propertyID);
+ RawPtr<CSSValue> value = attributeValueAsCSSValue(element);
+ RawPtr<CSSValue> styleValue = style->getPropertyCSSValue(m_propertyID);
return compareCSSValuePtr(value, styleValue);
}
void HTMLAttributeEquivalent::addToStyle(Element* element, EditingStyle* style) const
{
- if (RefPtrWillBeRawPtr<CSSValue> value = attributeValueAsCSSValue(element))
+ if (RawPtr<CSSValue> value = attributeValueAsCSSValue(element))
style->setProperty(m_propertyID, value->cssText());
}
-PassRefPtrWillBeRawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSValue(Element* element) const
+RawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSValue(Element* element) const
{
ASSERT(element);
const AtomicString& value = element->getAttribute(m_attrName);
if (value.isNull())
return nullptr;
- RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = nullptr;
+ RawPtr<MutableStylePropertySet> dummyStyle = nullptr;
dummyStyle = MutableStylePropertySet::create(HTMLQuirksMode);
dummyStyle->setProperty(m_propertyID, value);
return dummyStyle->getPropertyCSSValue(m_propertyID);
@@ -323,11 +319,11 @@ PassRefPtrWillBeRawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSVal
class HTMLFontSizeEquivalent final : public HTMLAttributeEquivalent {
public:
- static PassOwnPtrWillBeRawPtr<HTMLFontSizeEquivalent> create()
+ static RawPtr<HTMLFontSizeEquivalent> create()
{
- return adoptPtrWillBeNoop(new HTMLFontSizeEquivalent());
+ return new HTMLFontSizeEquivalent();
}
- PassRefPtrWillBeRawPtr<CSSValue> attributeValueAsCSSValue(Element*) const override;
+ RawPtr<CSSValue> attributeValueAsCSSValue(Element*) const override;
DEFINE_INLINE_VIRTUAL_TRACE() { HTMLAttributeEquivalent::trace(visitor); }
@@ -340,7 +336,7 @@ HTMLFontSizeEquivalent::HTMLFontSizeEquivalent()
{
}
-PassRefPtrWillBeRawPtr<CSSValue> HTMLFontSizeEquivalent::attributeValueAsCSSValue(Element* element) const
+RawPtr<CSSValue> HTMLFontSizeEquivalent::attributeValueAsCSSValue(Element* element) const
{
ASSERT(element);
const AtomicString& value = element->getAttribute(m_attrName);
@@ -468,13 +464,13 @@ void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude)
else if (isTabHTMLSpanElement(node))
node = node->parentNode();
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node);
+ RawPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = CSSComputedStyleDeclaration::create(node);
m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copyProperties() : editingStyleFromComputedStyle(computedStyleAtPosition);
if (propertiesToInclude == EditingPropertiesInEffect) {
- if (RefPtrWillBeRawPtr<CSSValue> value = backgroundColorValueInEffect(node))
+ if (RawPtr<CSSValue> value = backgroundColorValueInEffect(node))
m_mutableStyle->setProperty(CSSPropertyBackgroundColor, value->cssText());
- if (RefPtrWillBeRawPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect))
+ if (RawPtr<CSSValue> value = computedStyleAtPosition->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect))
m_mutableStyle->setProperty(CSSPropertyTextDecoration, value->cssText());
}
@@ -526,7 +522,7 @@ void EditingStyle::extractFontSizeDelta()
}
// Get the adjustment amount out of the style.
- RefPtrWillBeRawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta);
+ RawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta);
if (!value || !value->isPrimitiveValue())
return;
@@ -551,13 +547,13 @@ bool EditingStyle::textDirection(WritingDirection& writingDirection) const
if (!m_mutableStyle)
return false;
- RefPtrWillBeRawPtr<CSSValue> unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi);
+ RawPtr<CSSValue> unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi);
if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
return false;
CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID();
if (isEmbedOrIsolate(unicodeBidiValue)) {
- RefPtrWillBeRawPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
+ RawPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
if (!direction || !direction->isPrimitiveValue())
return false;
@@ -591,9 +587,9 @@ void EditingStyle::clear()
m_fontSizeDelta = NoFontDelta;
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::copy() const
+RawPtr<EditingStyle> EditingStyle::copy() const
{
- RefPtrWillBeRawPtr<EditingStyle> copy = EditingStyle::create();
+ RawPtr<EditingStyle> copy = EditingStyle::create();
if (m_mutableStyle)
copy->m_mutableStyle = m_mutableStyle->mutableCopy();
copy->m_isMonospaceFont = m_isMonospaceFont;
@@ -635,9 +631,9 @@ static const Vector<CSSPropertyID>& blockPropertiesVector()
return properties;
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperties()
+RawPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperties()
{
- RefPtrWillBeRawPtr<EditingStyle> blockProperties = EditingStyle::create();
+ RawPtr<EditingStyle> blockProperties = EditingStyle::create();
if (!m_mutableStyle)
return blockProperties;
@@ -647,9 +643,9 @@ PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperti
return blockProperties;
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::extractAndRemoveTextDirection()
+RawPtr<EditingStyle> EditingStyle::extractAndRemoveTextDirection()
{
- RefPtrWillBeRawPtr<EditingStyle> textDirection = EditingStyle::create();
+ RawPtr<EditingStyle> textDirection = EditingStyle::create();
textDirection->m_mutableStyle = MutableStylePropertySet::create(HTMLQuirksMode);
textDirection->m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, CSSValueIsolate, m_mutableStyle->propertyIsImportant(CSSPropertyUnicodeBidi));
textDirection->m_mutableStyle->setProperty(CSSPropertyDirection, m_mutableStyle->getPropertyValue(CSSPropertyDirection),
@@ -673,8 +669,8 @@ void EditingStyle::removeStyleAddedByElement(Element* element)
{
if (!element || !element->parentNode())
return;
- RefPtrWillBeRawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties);
- RefPtrWillBeRawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties);
+ RawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties);
+ RawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties);
nodeStyle->removeEquivalentProperties(parentStyle.get());
m_mutableStyle->removeEquivalentProperties(nodeStyle.get());
}
@@ -684,8 +680,8 @@ void EditingStyle::removeStyleConflictingWithStyleOfElement(Element* element)
if (!element || !element->parentNode() || !m_mutableStyle)
return;
- RefPtrWillBeRawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties);
- RefPtrWillBeRawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties);
+ RawPtr<MutableStylePropertySet> parentStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element->parentNode()), AllEditingProperties);
+ RawPtr<MutableStylePropertySet> nodeStyle = editingStyleFromComputedStyle(CSSComputedStyleDeclaration::create(element), AllEditingProperties);
nodeStyle->removeEquivalentProperties(parentStyle.get());
unsigned propertyCount = nodeStyle->propertyCount();
@@ -698,7 +694,7 @@ void EditingStyle::collapseTextDecorationProperties()
if (!m_mutableStyle)
return;
- RefPtrWillBeRawPtr<CSSValue> textDecorationsInEffect = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
+ RawPtr<CSSValue> textDecorationsInEffect = m_mutableStyle->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
if (!textDecorationsInEffect)
return;
@@ -730,7 +726,7 @@ TriState EditingStyle::triStateOfStyle(EditingStyle* style) const
TriState EditingStyle::triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties shouldIgnoreTextOnlyProperties) const
{
- RefPtrWillBeRawPtr<MutableStylePropertySet> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
+ RawPtr<MutableStylePropertySet> difference = getPropertiesNotIn(m_mutableStyle.get(), styleToCompare);
if (shouldIgnoreTextOnlyProperties == IgnoreTextOnlyProperties)
difference->removePropertiesInSet(textOnlyProperties, WTF_ARRAY_LENGTH(textOnlyProperties));
@@ -755,7 +751,7 @@ TriState EditingStyle::triStateOfStyle(const VisibleSelection& selection) const
bool nodeIsStart = true;
for (Node& node : NodeTraversal::startsAt(selection.start().anchorNode())) {
if (node.layoutObject() && node.hasEditableStyle()) {
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(&node);
+ RawPtr<CSSComputedStyleDeclaration> nodeStyle = CSSComputedStyleDeclaration::create(&node);
if (nodeStyle) {
TriState nodeState = triStateOfStyle(nodeStyle.get(), node.isTextNode() ? EditingStyle::DoNotIgnoreTextOnlyProperties : EditingStyle::IgnoreTextOnlyProperties);
if (nodeIsStart) {
@@ -827,9 +823,9 @@ bool EditingStyle::conflictsWithInlineStyleOfElement(HTMLElement* element, Editi
return conflictingProperties && !conflictingProperties->isEmpty();
}
-static const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& htmlElementEquivalents()
+static const HeapVector<Member<HTMLElementEquivalent>>& htmlElementEquivalents()
{
- DEFINE_STATIC_LOCAL(WillBePersistentHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>, HTMLElementEquivalents, ());
+ 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));
@@ -852,7 +848,7 @@ bool EditingStyle::conflictsWithImplicitStyleOfElement(HTMLElement* element, Edi
if (!m_mutableStyle)
return false;
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents();
+ const HeapVector<Member<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents();
for (size_t i = 0; i < HTMLElementEquivalents.size(); ++i) {
const HTMLElementEquivalent* equivalent = HTMLElementEquivalents[i].get();
if (equivalent->matches(element) && equivalent->propertyExistsInStyle(m_mutableStyle.get())
@@ -865,9 +861,9 @@ bool EditingStyle::conflictsWithImplicitStyleOfElement(HTMLElement* element, Edi
return false;
}
-static const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& htmlAttributeEquivalents()
+static const HeapVector<Member<HTMLAttributeEquivalent>>& htmlAttributeEquivalents()
{
- DEFINE_STATIC_LOCAL(WillBePersistentHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>, HTMLAttributeEquivalents, ());
+ 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.
@@ -888,7 +884,7 @@ bool EditingStyle::conflictsWithImplicitStyleOfAttributes(HTMLElement* element)
if (!m_mutableStyle)
return false;
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents();
+ const HeapVector<Member<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents();
for (const auto& equivalent : HTMLAttributeEquivalents) {
if (equivalent->matches(element) && equivalent->propertyExistsInStyle(m_mutableStyle.get())
&& !equivalent->valueIsPresentInStyle(element, m_mutableStyle.get()))
@@ -907,7 +903,7 @@ bool EditingStyle::extractConflictingImplicitStyleOfAttributes(HTMLElement* elem
if (!m_mutableStyle)
return false;
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents();
+ const HeapVector<Member<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents();
bool removed = false;
for (const auto& attribute : HTMLAttributeEquivalents) {
const HTMLAttributeEquivalent* equivalent = attribute.get();
@@ -941,7 +937,7 @@ bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* elemen
if (isHTMLSpanElement(*element)) {
elementIsSpanOrElementEquivalent = true;
} else {
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents();
+ const HeapVector<Member<HTMLElementEquivalent>>& HTMLElementEquivalents = htmlElementEquivalents();
size_t i;
for (i = 0; i < HTMLElementEquivalents.size(); ++i) {
if (HTMLElementEquivalents[i]->matches(element)) {
@@ -956,7 +952,7 @@ bool EditingStyle::elementIsStyledSpanOrHTMLEquivalent(const HTMLElement* elemen
return elementIsSpanOrElementEquivalent; // span, b, etc... without any attributes
unsigned matchedAttributes = 0;
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents();
+ const HeapVector<Member<HTMLAttributeEquivalent>>& HTMLAttributeEquivalents = htmlAttributeEquivalents();
for (const auto& equivalent : HTMLAttributeEquivalents) {
if (equivalent->matches(element) && equivalent->attributeName() != HTMLNames::dirAttr)
matchedAttributes++;
@@ -992,11 +988,11 @@ void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit
// ReplaceSelectionCommand::handleStyleSpans() requires that this function only removes the editing style.
// If this function was modified in the future to delete all redundant properties, then add a boolean value to indicate
// which one of editingStyleAtPosition or computedStyle is called.
- RefPtrWillBeRawPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect);
+ RawPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect);
StylePropertySet* styleAtPosition = editingStyleAtPosition->m_mutableStyle.get();
- RefPtrWillBeRawPtr<CSSValue> unicodeBidi = nullptr;
- RefPtrWillBeRawPtr<CSSValue> direction = nullptr;
+ RawPtr<CSSValue> unicodeBidi = nullptr;
+ RawPtr<CSSValue> direction = nullptr;
if (shouldPreserveWritingDirection == PreserveWritingDirection) {
unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi);
direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
@@ -1025,7 +1021,7 @@ void EditingStyle::mergeTypingStyle(Document* document)
{
ASSERT(document);
- RefPtrWillBeRawPtr<EditingStyle> typingStyle = document->frame()->selection().typingStyle();
+ RawPtr<EditingStyle> typingStyle = document->frame()->selection().typingStyle();
if (!typingStyle || typingStyle == this)
return;
@@ -1058,7 +1054,7 @@ static inline bool elementMatchesAndPropertyIsNotInInlineStyleDecl(const HTMLEle
&& (mode == EditingStyle::OverrideValues || !equivalent->propertyExistsInStyle(style));
}
-static PassRefPtrWillBeRawPtr<MutableStylePropertySet> extractEditingProperties(const StylePropertySet* style, EditingStyle::PropertiesToInclude propertiesToInclude)
+static RawPtr<MutableStylePropertySet> extractEditingProperties(const StylePropertySet* style, EditingStyle::PropertiesToInclude propertiesToInclude)
{
if (!style)
return nullptr;
@@ -1077,7 +1073,7 @@ static PassRefPtrWillBeRawPtr<MutableStylePropertySet> extractEditingProperties(
void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPropertyOverrideMode mode, PropertiesToInclude propertiesToInclude)
{
- RefPtrWillBeRawPtr<EditingStyle> styleFromRules = EditingStyle::create();
+ RawPtr<EditingStyle> styleFromRules = EditingStyle::create();
styleFromRules->mergeStyleFromRulesForSerialization(element);
if (element->inlineStyle())
@@ -1086,13 +1082,13 @@ void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPro
styleFromRules->m_mutableStyle = extractEditingProperties(styleFromRules->m_mutableStyle.get(), propertiesToInclude);
mergeStyle(styleFromRules->m_mutableStyle.get(), mode);
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent>>& elementEquivalents = htmlElementEquivalents();
+ const HeapVector<Member<HTMLElementEquivalent>>& elementEquivalents = htmlElementEquivalents();
for (const auto& equivalent : elementEquivalents) {
if (elementMatchesAndPropertyIsNotInInlineStyleDecl(equivalent.get(), element, mode, m_mutableStyle.get()))
equivalent->addToStyle(element, this);
}
- const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent>>& attributeEquivalents = htmlAttributeEquivalents();
+ const HeapVector<Member<HTMLAttributeEquivalent>>& attributeEquivalents = htmlAttributeEquivalents();
for (const auto& attribute : attributeEquivalents) {
if (attribute->attributeName() == HTMLNames::dirAttr)
continue; // We don't want to include directionality
@@ -1101,9 +1097,9 @@ void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPro
}
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForAnnotatedSerialization(ContainerNode* context)
+RawPtr<EditingStyle> EditingStyle::wrappingStyleForAnnotatedSerialization(ContainerNode* context)
{
- RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPropertiesInEffect);
+ RawPtr<EditingStyle> wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPropertiesInEffect);
// Styles that Mail blockquotes contribute should only be placed on the Mail
// blockquote, to help us differentiate those styles from ones that the user
@@ -1117,9 +1113,9 @@ PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForAnnotatedSeri
return wrappingStyle.release();
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(ContainerNode* context)
+RawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization(ContainerNode* context)
{
- RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::create();
+ RawPtr<EditingStyle> wrappingStyle = EditingStyle::create();
// When not annotating for interchange, we only preserve inline style declarations.
for (ContainerNode* node = context; node && !node->isDocumentNode(); node = node->parentNode()) {
@@ -1156,7 +1152,7 @@ void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverride
unsigned propertyCount = style->propertyCount();
for (unsigned i = 0; i < propertyCount; ++i) {
StylePropertySet::PropertyReference property = style->propertyAt(i);
- RefPtrWillBeRawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id());
+ RawPtr<CSSValue> value = m_mutableStyle->getPropertyCSSValue(property.id());
// text decorations never override values
if ((property.id() == textDecorationPropertyForEditing() || property.id() == CSSPropertyWebkitTextDecorationsInEffect) && property.value()->isValueList() && value) {
@@ -1172,10 +1168,10 @@ void EditingStyle::mergeStyle(const StylePropertySet* style, CSSPropertyOverride
}
}
-static PassRefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude)
+static RawPtr<MutableStylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude)
{
- RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode);
- RefPtrWillBeRawPtr<StyleRuleList> matchedRules = element->document().ensureStyleResolver().styleRulesForElement(element, rulesToInclude);
+ RawPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(HTMLQuirksMode);
+ RawPtr<StyleRuleList> matchedRules = element->document().ensureStyleResolver().styleRulesForElement(element, rulesToInclude);
if (matchedRules) {
for (unsigned i = 0; i < matchedRules->size(); ++i)
style->mergeAndOverrideOnConflict(&matchedRules->at(i)->properties());
@@ -1185,7 +1181,7 @@ static PassRefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRulesForE
void EditingStyle::mergeStyleFromRules(Element* element)
{
- RefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element,
+ RawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element,
StyleResolver::AuthorCSSRules | StyleResolver::CrossOriginCSSRules);
// Styles from the inline style declaration, held in the variable "style", take precedence
// over those from matched rules.
@@ -1203,8 +1199,8 @@ void EditingStyle::mergeStyleFromRulesForSerialization(Element* element)
// The property value, if it's a percentage, may not reflect the actual computed value.
// For example: style="height: 1%; overflow: visible;" in quirksmode
// FIXME: There are others like this, see <rdar://problem/5195123> Slashdot copy/paste fidelity problem
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element);
- RefPtrWillBeRawPtr<MutableStylePropertySet> fromComputedStyle = MutableStylePropertySet::create(HTMLQuirksMode);
+ RawPtr<CSSComputedStyleDeclaration> computedStyleForElement = CSSComputedStyleDeclaration::create(element);
+ RawPtr<MutableStylePropertySet> fromComputedStyle = MutableStylePropertySet::create(HTMLQuirksMode);
{
unsigned propertyCount = m_mutableStyle->propertyCount();
for (unsigned i = 0; i < propertyCount; ++i) {
@@ -1213,7 +1209,7 @@ void EditingStyle::mergeStyleFromRulesForSerialization(Element* element)
if (!value->isPrimitiveValue())
continue;
if (toCSSPrimitiveValue(value)->isPercentage()) {
- if (RefPtrWillBeRawPtr<CSSValue> computedPropertyValue = computedStyleForElement->getPropertyCSSValue(property.id()))
+ if (RawPtr<CSSValue> computedPropertyValue = computedStyleForElement->getPropertyCSSValue(property.id()))
fromComputedStyle->addRespectingCascade(CSSProperty(property.id(), computedPropertyValue));
}
}
@@ -1238,12 +1234,12 @@ void EditingStyle::removeStyleFromRulesAndContext(Element* element, ContainerNod
return;
// 1. Remove style from matched rules because style remain without repeating it in inline style declaration
- RefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules);
+ RawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFromMatchedRulesForElement(element, StyleResolver::AllButEmptyCSSRules);
if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty())
m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatchedRules->ensureCSSStyleDeclaration());
// 2. Remove style present in context and not overriden by matched rules.
- RefPtrWillBeRawPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect);
+ RawPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingPropertiesInEffect);
if (computedStyle->m_mutableStyle) {
if (!computedStyle->m_mutableStyle->getPropertyCSSValue(CSSPropertyBackgroundColor))
computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent);
@@ -1267,7 +1263,7 @@ void EditingStyle::removePropertiesInElementDefaultStyle(Element* element)
if (!m_mutableStyle || m_mutableStyle->isEmpty())
return;
- RefPtrWillBeRawPtr<StylePropertySet> defaultStyle = styleFromMatchedRulesForElement(element, StyleResolver::UAAndUserCSSRules);
+ RawPtr<StylePropertySet> defaultStyle = styleFromMatchedRulesForElement(element, StyleResolver::UAAndUserCSSRules);
removePropertiesInStyle(m_mutableStyle.get(), defaultStyle.get());
}
@@ -1307,14 +1303,14 @@ void EditingStyle::forceInline()
int EditingStyle::legacyFontSize(Document* document) const
{
- RefPtrWillBeRawPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize);
+ RawPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize);
if (!cssValue || !cssValue->isPrimitiveValue())
return 0;
return legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(cssValue.get()),
m_isMonospaceFont, AlwaysUseLegacyFontSize);
}
-PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const VisibleSelection& selection, bool shouldUseBackgroundColorInEffect)
+RawPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const VisibleSelection& selection, bool shouldUseBackgroundColorInEffect)
{
if (selection.isNone())
return nullptr;
@@ -1333,7 +1329,7 @@ PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const V
if (!element)
return nullptr;
- RefPtrWillBeRawPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::AllProperties);
+ RawPtr<EditingStyle> style = EditingStyle::create(element, EditingStyle::AllProperties);
style->mergeTypingStyle(&element->document());
// If background color is transparent, traverse parent nodes until we hit a different value or document root
@@ -1341,7 +1337,7 @@ PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::styleAtSelectionStart(const V
// and find the background color of the common ancestor.
if (shouldUseBackgroundColorInEffect && (selection.isRange() || hasTransparentBackgroundColor(style->m_mutableStyle.get()))) {
const EphemeralRange range(selection.toNormalizedEphemeralRange());
- if (PassRefPtrWillBeRawPtr<CSSValue> value = backgroundColorValueInEffect(Range::commonAncestorContainer(range.startPosition().computeContainerNode(), range.endPosition().computeContainerNode())))
+ if (RawPtr<CSSValue> value = backgroundColorValueInEffect(Range::commonAncestorContainer(range.startPosition().computeContainerNode(), range.endPosition().computeContainerNode())))
style->setProperty(CSSPropertyBackgroundColor, value->cssText());
}
@@ -1378,8 +1374,8 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
if (!n->isStyledElement())
continue;
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(n);
- RefPtrWillBeRawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi);
+ RawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(n);
+ RawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi);
if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
continue;
@@ -1408,8 +1404,8 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
continue;
Element* element = toElement(node);
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element);
- RefPtrWillBeRawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi);
+ RawPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element);
+ RawPtr<CSSValue> unicodeBidi = style->getPropertyCSSValue(CSSPropertyUnicodeBidi);
if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
continue;
@@ -1421,7 +1417,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
return NaturalWritingDirection;
ASSERT(isEmbedOrIsolate(unicodeBidiValue));
- RefPtrWillBeRawPtr<CSSValue> direction = style->getPropertyCSSValue(CSSPropertyDirection);
+ RawPtr<CSSValue> direction = style->getPropertyCSSValue(CSSPropertyDirection);
if (!direction || !direction->isPrimitiveValue())
continue;
@@ -1449,8 +1445,8 @@ DEFINE_TRACE(EditingStyle)
static void reconcileTextDecorationProperties(MutableStylePropertySet* style)
{
- RefPtrWillBeRawPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
- RefPtrWillBeRawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
+ RawPtr<CSSValue> textDecorationsInEffect = style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
+ RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
// We shouldn't have both text-decoration and -webkit-text-decorations-in-effect because that wouldn't make sense.
ASSERT(!textDecorationsInEffect || !textDecoration);
if (textDecorationsInEffect) {
@@ -1476,9 +1472,9 @@ StyleChange::StyleChange(EditingStyle* style, const Position& position)
if (!style || !style->style() || !document || !document->frame() || !associatedElementOf(position))
return;
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyle = ensureComputedStyle(position);
+ RawPtr<CSSComputedStyleDeclaration> computedStyle = ensureComputedStyle(position);
// FIXME: take care of background-color in effect
- RefPtrWillBeRawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
+ RawPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());
ASSERT(mutableStyle);
reconcileTextDecorationProperties(mutableStyle.get());
@@ -1526,11 +1522,11 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
// 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.
- RefPtrWillBeRawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
+ RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(textDecorationPropertyForEditing());
if (textDecoration && textDecoration->isValueList()) {
DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, underline, (CSSPrimitiveValue::createIdentifier(CSSValueUnderline)));
DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, lineThrough, (CSSPrimitiveValue::createIdentifier(CSSValueLineThrough)));
- RefPtrWillBeRawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy();
+ RawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy();
if (newTextDecoration->removeAll(underline))
m_applyUnderline = true;
if (newTextDecoration->removeAll(lineThrough))
@@ -1562,7 +1558,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
m_applyFontFace.replaceWithLiteral('"', "");
style->removeProperty(CSSPropertyFontFamily);
- if (RefPtrWillBeRawPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) {
+ if (RawPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) {
if (!fontSize->isPrimitiveValue()) {
style->removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size.
} else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(fontSize.get()), isMonospaceFont, UseLegacyFontSizeOnlyIfPixelValuesMatch)) {
@@ -1574,11 +1570,11 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
static void diffTextDecorations(MutableStylePropertySet* style, CSSPropertyID propertID, CSSValue* refTextDecoration)
{
- RefPtrWillBeRawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID);
+ RawPtr<CSSValue> textDecoration = style->getPropertyCSSValue(propertID);
if (!textDecoration || !textDecoration->isValueList() || !refTextDecoration || !refTextDecoration->isValueList())
return;
- RefPtrWillBeRawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy();
+ RawPtr<CSSValueList> newTextDecoration = toCSSValueList(textDecoration.get())->copy();
CSSValueList* valuesInRefTextDecoration = toCSSValueList(refTextDecoration);
for (size_t i = 0; i < valuesInRefTextDecoration->length(); i++)
@@ -1625,20 +1621,20 @@ static bool fontWeightNeedsResolving(CSSValue* fontWeight)
return value == CSSValueLighter || value == CSSValueBolder;
}
-PassRefPtrWillBeRawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
+RawPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, CSSStyleDeclaration* baseStyle)
{
ASSERT(styleWithRedundantProperties);
ASSERT(baseStyle);
- RefPtrWillBeRawPtr<MutableStylePropertySet> result = styleWithRedundantProperties->mutableCopy();
+ RawPtr<MutableStylePropertySet> result = styleWithRedundantProperties->mutableCopy();
result->removeEquivalentProperties(baseStyle);
- RefPtrWillBeRawPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect);
+ RawPtr<CSSValue> baseTextDecorationsInEffect = baseStyle->getPropertyCSSValueInternal(CSSPropertyWebkitTextDecorationsInEffect);
diffTextDecorations(result.get(), textDecorationPropertyForEditing(), baseTextDecorationsInEffect.get());
diffTextDecorations(result.get(), CSSPropertyWebkitTextDecorationsInEffect, baseTextDecorationsInEffect.get());
- if (RefPtrWillBeRawPtr<CSSValue> baseFontWeight = baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight)) {
- if (RefPtrWillBeRawPtr<CSSValue> fontWeight = result->getPropertyCSSValue(CSSPropertyFontWeight)) {
+ if (RawPtr<CSSValue> baseFontWeight = baseStyle->getPropertyCSSValueInternal(CSSPropertyFontWeight)) {
+ if (RawPtr<CSSValue> fontWeight = result->getPropertyCSSValue(CSSPropertyFontWeight)) {
if (!fontWeightNeedsResolving(fontWeight.get()) && !fontWeightNeedsResolving(baseFontWeight.get())
&& (fontWeightIsBold(fontWeight.get()) == fontWeightIsBold(baseFontWeight.get())))
result->removeProperty(CSSPropertyFontWeight);
@@ -1662,7 +1658,7 @@ CSSValueID getIdentifierValue(StylePropertySet* style, CSSPropertyID propertyID)
{
if (!style)
return CSSValueInvalid;
- RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID);
+ RawPtr<CSSValue> value = style->getPropertyCSSValue(propertyID);
if (!value || !value->isPrimitiveValue())
return CSSValueInvalid;
return toCSSPrimitiveValue(value.get())->getValueID();
@@ -1672,7 +1668,7 @@ CSSValueID getIdentifierValue(CSSStyleDeclaration* style, CSSPropertyID property
{
if (!style)
return CSSValueInvalid;
- RefPtrWillBeRawPtr<CSSValue> value = style->getPropertyCSSValueInternal(propertyID);
+ RawPtr<CSSValue> value = style->getPropertyCSSValueInternal(propertyID);
if (!value || !value->isPrimitiveValue())
return CSSValueInvalid;
return toCSSPrimitiveValue(value.get())->getValueID();
@@ -1713,20 +1709,20 @@ bool isTransparentColorValue(CSSValue* cssValue)
bool hasTransparentBackgroundColor(CSSStyleDeclaration* style)
{
- RefPtrWillBeRawPtr<CSSValue> cssValue = style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor);
+ RawPtr<CSSValue> cssValue = style->getPropertyCSSValueInternal(CSSPropertyBackgroundColor);
return isTransparentColorValue(cssValue.get());
}
bool hasTransparentBackgroundColor(StylePropertySet* style)
{
- RefPtrWillBeRawPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor);
+ RawPtr<CSSValue> cssValue = style->getPropertyCSSValue(CSSPropertyBackgroundColor);
return isTransparentColorValue(cssValue.get());
}
-PassRefPtrWillBeRawPtr<CSSValue> backgroundColorValueInEffect(Node* node)
+RawPtr<CSSValue> backgroundColorValueInEffect(Node* node)
{
for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
- RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDeclaration::create(ancestor);
+ RawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDeclaration::create(ancestor);
if (!hasTransparentBackgroundColor(ancestorStyle.get()))
return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.h ('k') | third_party/WebKit/Source/core/editing/EditingTestBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698