Commit 1da039b6 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Fix naming of SVG{AnimatedProperty,PropertyTearOff}Base::contextElement

contextElement -> ContextElement

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If22cc5a0624cfaf9e1e448198c891de3030bc889
Reviewed-on: https://chromium-review.googlesource.com/1181058Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584435}
parent 8c4177dc
...@@ -64,7 +64,7 @@ void SVGAnimatedPropertyBase::SynchronizeAttribute() { ...@@ -64,7 +64,7 @@ void SVGAnimatedPropertyBase::SynchronizeAttribute() {
} }
bool SVGAnimatedPropertyBase::IsSpecified() const { bool SVGAnimatedPropertyBase::IsSpecified() const {
return IsAnimating() || contextElement()->hasAttribute(AttributeName()); return IsAnimating() || ContextElement()->hasAttribute(AttributeName());
} }
} // namespace blink } // namespace blink
...@@ -62,7 +62,7 @@ class SVGAnimatedPropertyBase : public GarbageCollectedMixin { ...@@ -62,7 +62,7 @@ class SVGAnimatedPropertyBase : public GarbageCollectedMixin {
return static_cast<AnimatedPropertyType>(type_); return static_cast<AnimatedPropertyType>(type_);
} }
SVGElement* contextElement() const { return context_element_; } SVGElement* ContextElement() const { return context_element_; }
const QualifiedName& AttributeName() const { return attribute_name_; } const QualifiedName& AttributeName() const { return attribute_name_; }
...@@ -191,12 +191,12 @@ class SVGAnimatedProperty : public SVGAnimatedPropertyCommon<Property> { ...@@ -191,12 +191,12 @@ class SVGAnimatedProperty : public SVGAnimatedPropertyCommon<Property> {
base_value_updated_ = true; base_value_updated_ = true;
DCHECK(this->AttributeName() != QualifiedName::Null()); DCHECK(this->AttributeName() != QualifiedName::Null());
this->contextElement()->InvalidateSVGAttributes(); this->ContextElement()->InvalidateSVGAttributes();
this->contextElement()->SvgAttributeBaseValChanged(this->AttributeName()); this->ContextElement()->SvgAttributeBaseValChanged(this->AttributeName());
} }
PrimitiveType animVal() { PrimitiveType animVal() {
this->contextElement()->EnsureAttributeAnimValUpdated(); this->ContextElement()->EnsureAttributeAnimValUpdated();
return this->CurrentValue()->Value(); return this->CurrentValue()->Value();
} }
...@@ -255,7 +255,7 @@ class SVGAnimatedProperty<Property, TearOffType, void> ...@@ -255,7 +255,7 @@ class SVGAnimatedProperty<Property, TearOffType, void>
virtual TearOffType* baseVal() { virtual TearOffType* baseVal() {
if (!base_val_tear_off_) { if (!base_val_tear_off_) {
base_val_tear_off_ = base_val_tear_off_ =
TearOffType::Create(this->BaseValue(), this->contextElement(), TearOffType::Create(this->BaseValue(), this->ContextElement(),
kPropertyIsNotAnimVal, this->AttributeName()); kPropertyIsNotAnimVal, this->AttributeName());
} }
return base_val_tear_off_; return base_val_tear_off_;
...@@ -264,7 +264,7 @@ class SVGAnimatedProperty<Property, TearOffType, void> ...@@ -264,7 +264,7 @@ class SVGAnimatedProperty<Property, TearOffType, void>
TearOffType* animVal() { TearOffType* animVal() {
if (!anim_val_tear_off_) { if (!anim_val_tear_off_) {
anim_val_tear_off_ = anim_val_tear_off_ =
TearOffType::Create(this->CurrentValue(), this->contextElement(), TearOffType::Create(this->CurrentValue(), this->ContextElement(),
kPropertyIsAnimVal, this->AttributeName()); kPropertyIsAnimVal, this->AttributeName());
} }
return anim_val_tear_off_; return anim_val_tear_off_;
......
...@@ -55,7 +55,7 @@ class ListItemPropertyTraits { ...@@ -55,7 +55,7 @@ class ListItemPropertyTraits {
// the same values as newItem and this item is inserted into the list. // the same values as newItem and this item is inserted into the list.
// Otherwise, newItem itself is inserted into the list. // Otherwise, newItem itself is inserted into the list.
if (new_item->IsImmutable() || new_item->Target()->OwnerList() || if (new_item->IsImmutable() || new_item->Target()->OwnerList() ||
new_item->contextElement()) { new_item->ContextElement()) {
// We have to copy the incoming |newItem|, // We have to copy the incoming |newItem|,
// Otherwise we'll end up having two tearoffs that operate on the same // Otherwise we'll end up having two tearoffs that operate on the same
// SVGProperty. Consider the example below: SVGRectElements // SVGProperty. Consider the example below: SVGRectElements
...@@ -195,7 +195,7 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> { ...@@ -195,7 +195,7 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> {
ItemPropertyType* GetValueForInsertionFromTearOff(ItemTearOffType* new_item) { ItemPropertyType* GetValueForInsertionFromTearOff(ItemTearOffType* new_item) {
return ItemTraits::GetValueForInsertionFromTearOff( return ItemTraits::GetValueForInsertionFromTearOff(
new_item, ToDerived()->contextElement(), ToDerived()->AttributeName()); new_item, ToDerived()->ContextElement(), ToDerived()->AttributeName());
} }
ItemTearOffType* CreateItemTearOff(ItemPropertyType* value) { ItemTearOffType* CreateItemTearOff(ItemPropertyType* value) {
...@@ -203,7 +203,7 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> { ...@@ -203,7 +203,7 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> {
return nullptr; return nullptr;
if (value->OwnerList() == ToDerived()->Target()) if (value->OwnerList() == ToDerived()->Target())
return ItemTraits::CreateTearOff(value, ToDerived()->contextElement(), return ItemTraits::CreateTearOff(value, ToDerived()->ContextElement(),
ToDerived()->PropertyIsAnimVal(), ToDerived()->PropertyIsAnimVal(),
ToDerived()->AttributeName()); ToDerived()->AttributeName());
......
...@@ -44,11 +44,11 @@ void SVGPropertyTearOffBase::ThrowReadOnly(ExceptionState& exception_state) { ...@@ -44,11 +44,11 @@ void SVGPropertyTearOffBase::ThrowReadOnly(ExceptionState& exception_state) {
void SVGPropertyTearOffBase::CommitChange() { void SVGPropertyTearOffBase::CommitChange() {
DCHECK(!IsImmutable()); DCHECK(!IsImmutable());
if (!contextElement() || IsAnimVal()) if (!ContextElement() || IsAnimVal())
return; return;
DCHECK(attribute_name_ != QualifiedName::Null()); DCHECK(attribute_name_ != QualifiedName::Null());
contextElement()->InvalidateSVGAttributes(); ContextElement()->InvalidateSVGAttributes();
contextElement()->SvgAttributeBaseValChanged(attribute_name_); ContextElement()->SvgAttributeBaseValChanged(attribute_name_);
} }
} // namespace blink } // namespace blink
...@@ -56,7 +56,7 @@ class SVGPropertyTearOffBase : public ScriptWrappable { ...@@ -56,7 +56,7 @@ class SVGPropertyTearOffBase : public ScriptWrappable {
virtual void CommitChange(); virtual void CommitChange();
SVGElement* contextElement() const { return context_element_; } SVGElement* ContextElement() const { return context_element_; }
const QualifiedName& AttributeName() { return attribute_name_; } const QualifiedName& AttributeName() { return attribute_name_; }
...@@ -99,7 +99,7 @@ class SVGPropertyTearOff : public SVGPropertyTearOffBase { ...@@ -99,7 +99,7 @@ class SVGPropertyTearOff : public SVGPropertyTearOffBase {
public: public:
Property* Target() { Property* Target() {
if (IsAnimVal()) if (IsAnimVal())
contextElement()->EnsureAttributeAnimValUpdated(); ContextElement()->EnsureAttributeAnimValUpdated();
return target_.Get(); return target_.Get();
} }
......
...@@ -44,20 +44,20 @@ const SVGString* SVGAnimatedHref::CurrentValue() const { ...@@ -44,20 +44,20 @@ const SVGString* SVGAnimatedHref::CurrentValue() const {
} }
String SVGAnimatedHref::baseVal() { String SVGAnimatedHref::baseVal() {
UseCounter::Count(contextElement()->GetDocument(), UseCounter::Count(ContextElement()->GetDocument(),
WebFeature::kSVGHrefBaseVal); WebFeature::kSVGHrefBaseVal);
return BackingString()->SVGAnimatedString::baseVal(); return BackingString()->SVGAnimatedString::baseVal();
} }
void SVGAnimatedHref::setBaseVal(const String& value, void SVGAnimatedHref::setBaseVal(const String& value,
ExceptionState& exception_state) { ExceptionState& exception_state) {
UseCounter::Count(contextElement()->GetDocument(), UseCounter::Count(ContextElement()->GetDocument(),
WebFeature::kSVGHrefBaseVal); WebFeature::kSVGHrefBaseVal);
return BackingString()->SVGAnimatedString::setBaseVal(value, exception_state); return BackingString()->SVGAnimatedString::setBaseVal(value, exception_state);
} }
String SVGAnimatedHref::animVal() { String SVGAnimatedHref::animVal() {
UseCounter::Count(contextElement()->GetDocument(), UseCounter::Count(ContextElement()->GetDocument(),
WebFeature::kSVGHrefAnimVal); WebFeature::kSVGHrefAnimVal);
return BackingString()->SVGAnimatedString::animVal(); return BackingString()->SVGAnimatedString::animVal();
} }
......
...@@ -117,12 +117,12 @@ SVGLengthMode SVGLengthTearOff::UnitMode() { ...@@ -117,12 +117,12 @@ SVGLengthMode SVGLengthTearOff::UnitMode() {
} }
float SVGLengthTearOff::value(ExceptionState& exception_state) { float SVGLengthTearOff::value(ExceptionState& exception_state) {
if (Target()->IsRelative() && !CanResolveRelativeUnits(contextElement())) { if (Target()->IsRelative() && !CanResolveRelativeUnits(ContextElement())) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError, exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Could not resolve relative length."); "Could not resolve relative length.");
return 0; return 0;
} }
SVGLengthContext length_context(contextElement()); SVGLengthContext length_context(ContextElement());
return Target()->Value(length_context); return Target()->Value(length_context);
} }
...@@ -131,12 +131,12 @@ void SVGLengthTearOff::setValue(float value, ExceptionState& exception_state) { ...@@ -131,12 +131,12 @@ void SVGLengthTearOff::setValue(float value, ExceptionState& exception_state) {
ThrowReadOnly(exception_state); ThrowReadOnly(exception_state);
return; return;
} }
if (Target()->IsRelative() && !CanResolveRelativeUnits(contextElement())) { if (Target()->IsRelative() && !CanResolveRelativeUnits(ContextElement())) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError, exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Could not resolve relative length."); "Could not resolve relative length.");
return; return;
} }
SVGLengthContext length_context(contextElement()); SVGLengthContext length_context(ContextElement());
if (Target()->IsCalculated()) if (Target()->IsCalculated())
Target()->SetValueAsNumber(value); Target()->SetValueAsNumber(value);
else else
...@@ -227,12 +227,12 @@ void SVGLengthTearOff::convertToSpecifiedUnits( ...@@ -227,12 +227,12 @@ void SVGLengthTearOff::convertToSpecifiedUnits(
} }
if ((Target()->IsRelative() || if ((Target()->IsRelative() ||
CSSPrimitiveValue::IsRelativeUnit(ToCSSUnitType(unit_type))) && CSSPrimitiveValue::IsRelativeUnit(ToCSSUnitType(unit_type))) &&
!CanResolveRelativeUnits(contextElement())) { !CanResolveRelativeUnits(ContextElement())) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError, exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Could not resolve relative length."); "Could not resolve relative length.");
return; return;
} }
SVGLengthContext length_context(contextElement()); SVGLengthContext length_context(ContextElement());
Target()->ConvertToSpecifiedUnits(ToCSSUnitType(unit_type), length_context); Target()->ConvertToSpecifiedUnits(ToCSSUnitType(unit_type), length_context);
CommitChange(); CommitChange();
} }
......
...@@ -83,10 +83,10 @@ bool SVGStaticStringList::NeedsSynchronizeAttribute() { ...@@ -83,10 +83,10 @@ bool SVGStaticStringList::NeedsSynchronizeAttribute() {
} }
SVGStringListTearOff* SVGStaticStringList::TearOff() { SVGStringListTearOff* SVGStaticStringList::TearOff() {
if (!tear_off_) if (!tear_off_) {
tear_off_ = SVGStringListTearOff::Create( tear_off_ = SVGStringListTearOff::Create(
value_, contextElement(), kPropertyIsNotAnimVal, AttributeName()); value_, ContextElement(), kPropertyIsNotAnimVal, AttributeName());
}
return tear_off_.Get(); return tear_off_.Get();
} }
......
...@@ -122,8 +122,8 @@ class SVGCurrentTranslateTearOff : public SVGPointTearOff { ...@@ -122,8 +122,8 @@ class SVGCurrentTranslateTearOff : public SVGPointTearOff {
} }
void CommitChange() override { void CommitChange() override {
DCHECK(contextElement()); DCHECK(ContextElement());
ToSVGSVGElement(contextElement())->UpdateUserTransform(); ToSVGSVGElement(ContextElement())->UpdateUserTransform();
} }
private: private:
......
...@@ -59,7 +59,7 @@ class SVGAnimatedTextLength final : public SVGAnimatedLength { ...@@ -59,7 +59,7 @@ class SVGAnimatedTextLength final : public SVGAnimatedLength {
SVGLengthTearOff* baseVal() override { SVGLengthTearOff* baseVal() override {
SVGTextContentElement* text_content_element = SVGTextContentElement* text_content_element =
ToSVGTextContentElement(contextElement()); ToSVGTextContentElement(ContextElement());
if (!text_content_element->TextLengthIsSpecifiedByUser()) if (!text_content_element->TextLengthIsSpecifiedByUser())
BaseValue()->NewValueSpecifiedUnits( BaseValue()->NewValueSpecifiedUnits(
CSSPrimitiveValue::UnitType::kNumber, CSSPrimitiveValue::UnitType::kNumber,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment