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

Unified Diff: third_party/WebKit/Source/core/svg/SVGSVGElement.cpp

Issue 2537223006: Cleanup after removal of the SVGViewSpec interface (Closed)
Patch Set: Moar Created 4 years 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/svg/SVGSVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
index f49fb0848ea6df3310cf5f383ae6a093049e0d27..ab83f2cdb4f53fb7ed404d54a756fbed10b61b93 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -101,9 +101,9 @@ DEFINE_NODE_FACTORY(SVGSVGElement)
SVGSVGElement::~SVGSVGElement() {}
-SVGViewSpec* SVGSVGElement::currentView() {
+SVGViewSpec* SVGSVGElement::ensureViewSpec() {
if (!m_viewSpec)
- m_viewSpec = SVGViewSpec::create(this);
+ m_viewSpec = SVGViewSpec::create();
return m_viewSpec;
}
@@ -157,11 +157,10 @@ void SVGSVGElement::updateUserTransform() {
}
bool SVGSVGElement::zoomAndPanEnabled() const {
- const SVGZoomAndPan* currentViewSpec = this;
+ SVGZoomAndPanType zoomAndPan = this->zoomAndPan();
if (m_useCurrentView)
- currentViewSpec = m_viewSpec;
- DCHECK(currentViewSpec);
- return currentViewSpec->zoomAndPan() == SVGZoomAndPanMagnify;
+ zoomAndPan = m_viewSpec->zoomAndPan();
+ return zoomAndPan == SVGZoomAndPanMagnify;
}
void SVGSVGElement::parseAttribute(const QualifiedName& name,
@@ -600,7 +599,7 @@ bool SVGSVGElement::shouldSynthesizeViewBox() const {
FloatRect SVGSVGElement::currentViewBoxRect() const {
if (m_useCurrentView) {
DCHECK(m_viewSpec);
- return m_viewSpec->viewBox()->currentValue()->value();
+ return m_viewSpec->viewBox()->value();
}
FloatRect useViewBox = viewBox()->currentValue()->value();
@@ -625,7 +624,7 @@ FloatRect SVGSVGElement::currentViewBoxRect() const {
SVGPreserveAspectRatio* SVGSVGElement::currentPreserveAspectRatio() const {
if (m_useCurrentView) {
DCHECK(m_viewSpec);
- return m_viewSpec->preserveAspectRatio()->currentValue();
+ return m_viewSpec->preserveAspectRatio();
}
if (!viewBox()->currentValue()->isValid() && shouldSynthesizeViewBox()) {
// If no viewBox is specified and we're embedded through SVGImage, then
@@ -715,7 +714,7 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier,
if (fragmentIdentifier.startsWith("svgView(")) {
SVGViewSpec* view =
- currentView(); // Ensure the SVGViewSpec has been created.
+ ensureViewSpec(); // Ensure the SVGViewSpec has been created.
view->inheritViewAttributesFromElement(this);
@@ -763,7 +762,7 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier,
}
void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement) {
- SVGViewSpec* view = currentView();
+ SVGViewSpec* view = ensureViewSpec();
m_useCurrentView = true;
UseCounter::count(document(),
UseCounter::SVGSVGElementFragmentSVGViewElement);

Powered by Google App Engine
This is Rietveld 408576698