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() {
}
bool SVGAnimatedPropertyBase::IsSpecified() const {
return IsAnimating() || contextElement()->hasAttribute(AttributeName());
return IsAnimating() || ContextElement()->hasAttribute(AttributeName());
}
} // namespace blink
......@@ -62,7 +62,7 @@ class SVGAnimatedPropertyBase : public GarbageCollectedMixin {
return static_cast<AnimatedPropertyType>(type_);
}
SVGElement* contextElement() const { return context_element_; }
SVGElement* ContextElement() const { return context_element_; }
const QualifiedName& AttributeName() const { return attribute_name_; }
......@@ -191,12 +191,12 @@ class SVGAnimatedProperty : public SVGAnimatedPropertyCommon<Property> {
base_value_updated_ = true;
DCHECK(this->AttributeName() != QualifiedName::Null());
this->contextElement()->InvalidateSVGAttributes();
this->contextElement()->SvgAttributeBaseValChanged(this->AttributeName());
this->ContextElement()->InvalidateSVGAttributes();
this->ContextElement()->SvgAttributeBaseValChanged(this->AttributeName());
}
PrimitiveType animVal() {
this->contextElement()->EnsureAttributeAnimValUpdated();
this->ContextElement()->EnsureAttributeAnimValUpdated();
return this->CurrentValue()->Value();
}
......@@ -255,7 +255,7 @@ class SVGAnimatedProperty<Property, TearOffType, void>
virtual TearOffType* baseVal() {
if (!base_val_tear_off_) {
base_val_tear_off_ =
TearOffType::Create(this->BaseValue(), this->contextElement(),
TearOffType::Create(this->BaseValue(), this->ContextElement(),
kPropertyIsNotAnimVal, this->AttributeName());
}
return base_val_tear_off_;
......@@ -264,7 +264,7 @@ class SVGAnimatedProperty<Property, TearOffType, void>
TearOffType* animVal() {
if (!anim_val_tear_off_) {
anim_val_tear_off_ =
TearOffType::Create(this->CurrentValue(), this->contextElement(),
TearOffType::Create(this->CurrentValue(), this->ContextElement(),
kPropertyIsAnimVal, this->AttributeName());
}
return anim_val_tear_off_;
......
......@@ -55,7 +55,7 @@ class ListItemPropertyTraits {
// the same values as newItem and this item is inserted into the list.
// Otherwise, newItem itself is inserted into the list.
if (new_item->IsImmutable() || new_item->Target()->OwnerList() ||
new_item->contextElement()) {
new_item->ContextElement()) {
// We have to copy the incoming |newItem|,
// Otherwise we'll end up having two tearoffs that operate on the same
// SVGProperty. Consider the example below: SVGRectElements
......@@ -195,7 +195,7 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> {
ItemPropertyType* GetValueForInsertionFromTearOff(ItemTearOffType* new_item) {
return ItemTraits::GetValueForInsertionFromTearOff(
new_item, ToDerived()->contextElement(), ToDerived()->AttributeName());
new_item, ToDerived()->ContextElement(), ToDerived()->AttributeName());
}
ItemTearOffType* CreateItemTearOff(ItemPropertyType* value) {
......@@ -203,7 +203,7 @@ class SVGListPropertyTearOffHelper : public SVGPropertyTearOff<ListProperty> {
return nullptr;
if (value->OwnerList() == ToDerived()->Target())
return ItemTraits::CreateTearOff(value, ToDerived()->contextElement(),
return ItemTraits::CreateTearOff(value, ToDerived()->ContextElement(),
ToDerived()->PropertyIsAnimVal(),
ToDerived()->AttributeName());
......
......@@ -44,11 +44,11 @@ void SVGPropertyTearOffBase::ThrowReadOnly(ExceptionState& exception_state) {
void SVGPropertyTearOffBase::CommitChange() {
DCHECK(!IsImmutable());
if (!contextElement() || IsAnimVal())
if (!ContextElement() || IsAnimVal())
return;
DCHECK(attribute_name_ != QualifiedName::Null());
contextElement()->InvalidateSVGAttributes();
contextElement()->SvgAttributeBaseValChanged(attribute_name_);
ContextElement()->InvalidateSVGAttributes();
ContextElement()->SvgAttributeBaseValChanged(attribute_name_);
}
} // namespace blink
......@@ -56,7 +56,7 @@ class SVGPropertyTearOffBase : public ScriptWrappable {
virtual void CommitChange();
SVGElement* contextElement() const { return context_element_; }
SVGElement* ContextElement() const { return context_element_; }
const QualifiedName& AttributeName() { return attribute_name_; }
......@@ -99,7 +99,7 @@ class SVGPropertyTearOff : public SVGPropertyTearOffBase {
public:
Property* Target() {
if (IsAnimVal())
contextElement()->EnsureAttributeAnimValUpdated();
ContextElement()->EnsureAttributeAnimValUpdated();
return target_.Get();
}
......
......@@ -44,20 +44,20 @@ const SVGString* SVGAnimatedHref::CurrentValue() const {
}
String SVGAnimatedHref::baseVal() {
UseCounter::Count(contextElement()->GetDocument(),
UseCounter::Count(ContextElement()->GetDocument(),
WebFeature::kSVGHrefBaseVal);
return BackingString()->SVGAnimatedString::baseVal();
}
void SVGAnimatedHref::setBaseVal(const String& value,
ExceptionState& exception_state) {
UseCounter::Count(contextElement()->GetDocument(),
UseCounter::Count(ContextElement()->GetDocument(),
WebFeature::kSVGHrefBaseVal);
return BackingString()->SVGAnimatedString::setBaseVal(value, exception_state);
}
String SVGAnimatedHref::animVal() {
UseCounter::Count(contextElement()->GetDocument(),
UseCounter::Count(ContextElement()->GetDocument(),
WebFeature::kSVGHrefAnimVal);
return BackingString()->SVGAnimatedString::animVal();
}
......
......@@ -117,12 +117,12 @@ SVGLengthMode SVGLengthTearOff::UnitMode() {
}
float SVGLengthTearOff::value(ExceptionState& exception_state) {
if (Target()->IsRelative() && !CanResolveRelativeUnits(contextElement())) {
if (Target()->IsRelative() && !CanResolveRelativeUnits(ContextElement())) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Could not resolve relative length.");
return 0;
}
SVGLengthContext length_context(contextElement());
SVGLengthContext length_context(ContextElement());
return Target()->Value(length_context);
}
......@@ -131,12 +131,12 @@ void SVGLengthTearOff::setValue(float value, ExceptionState& exception_state) {
ThrowReadOnly(exception_state);
return;
}
if (Target()->IsRelative() && !CanResolveRelativeUnits(contextElement())) {
if (Target()->IsRelative() && !CanResolveRelativeUnits(ContextElement())) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Could not resolve relative length.");
return;
}
SVGLengthContext length_context(contextElement());
SVGLengthContext length_context(ContextElement());
if (Target()->IsCalculated())
Target()->SetValueAsNumber(value);
else
......@@ -227,12 +227,12 @@ void SVGLengthTearOff::convertToSpecifiedUnits(
}
if ((Target()->IsRelative() ||
CSSPrimitiveValue::IsRelativeUnit(ToCSSUnitType(unit_type))) &&
!CanResolveRelativeUnits(contextElement())) {
!CanResolveRelativeUnits(ContextElement())) {
exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
"Could not resolve relative length.");
return;
}
SVGLengthContext length_context(contextElement());
SVGLengthContext length_context(ContextElement());
Target()->ConvertToSpecifiedUnits(ToCSSUnitType(unit_type), length_context);
CommitChange();
}
......
......@@ -83,10 +83,10 @@ bool SVGStaticStringList::NeedsSynchronizeAttribute() {
}
SVGStringListTearOff* SVGStaticStringList::TearOff() {
if (!tear_off_)
if (!tear_off_) {
tear_off_ = SVGStringListTearOff::Create(
value_, contextElement(), kPropertyIsNotAnimVal, AttributeName());
value_, ContextElement(), kPropertyIsNotAnimVal, AttributeName());
}
return tear_off_.Get();
}
......
......@@ -122,8 +122,8 @@ class SVGCurrentTranslateTearOff : public SVGPointTearOff {
}
void CommitChange() override {
DCHECK(contextElement());
ToSVGSVGElement(contextElement())->UpdateUserTransform();
DCHECK(ContextElement());
ToSVGSVGElement(ContextElement())->UpdateUserTransform();
}
private:
......
......@@ -59,7 +59,7 @@ class SVGAnimatedTextLength final : public SVGAnimatedLength {
SVGLengthTearOff* baseVal() override {
SVGTextContentElement* text_content_element =
ToSVGTextContentElement(contextElement());
ToSVGTextContentElement(ContextElement());
if (!text_content_element->TextLengthIsSpecifiedByUser())
BaseValue()->NewValueSpecifiedUnits(
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