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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGElement.cpp

Issue 2548573003: Drop SVGElement::accessDocumentSVGExtensions() (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
3 * <zimmermann@kde.org> 3 * <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
5 * Copyright (C) 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 6 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // notification. 533 // notification.
534 if (hadRelativeLengths == currentElement.hasRelativeLengths()) 534 if (hadRelativeLengths == currentElement.hasRelativeLengths())
535 return; 535 return;
536 536
537 clientElement = &currentElement; 537 clientElement = &currentElement;
538 clientHasRelativeLengths = clientElement->hasRelativeLengths(); 538 clientHasRelativeLengths = clientElement->hasRelativeLengths();
539 } 539 }
540 540
541 // Register root SVG elements for top level viewport change notifications. 541 // Register root SVG elements for top level viewport change notifications.
542 if (isSVGSVGElement(*clientElement)) { 542 if (isSVGSVGElement(*clientElement)) {
543 SVGDocumentExtensions& svgExtensions = accessDocumentSVGExtensions(); 543 SVGDocumentExtensions& svgExtensions = document().accessSVGExtensions();
544 if (clientElement->hasRelativeLengths()) 544 if (clientElement->hasRelativeLengths())
545 svgExtensions.addSVGRootWithRelativeLengthDescendents( 545 svgExtensions.addSVGRootWithRelativeLengthDescendents(
546 toSVGSVGElement(clientElement)); 546 toSVGSVGElement(clientElement));
547 else 547 else
548 svgExtensions.removeSVGRootWithRelativeLengthDescendents( 548 svgExtensions.removeSVGRootWithRelativeLengthDescendents(
549 toSVGSVGElement(clientElement)); 549 toSVGSVGElement(clientElement));
550 } 550 }
551 } 551 }
552 552
553 void SVGElement::invalidateRelativeLengthClients( 553 void SVGElement::invalidateRelativeLengthClients(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 while (n) { 596 while (n) {
597 if (isSVGSVGElement(*n) || isSVGImageElement(*n) || isSVGSymbolElement(*n)) 597 if (isSVGSVGElement(*n) || isSVGImageElement(*n) || isSVGSymbolElement(*n))
598 return toSVGElement(n); 598 return toSVGElement(n);
599 599
600 n = n->parentOrShadowHostNode(); 600 n = n->parentOrShadowHostNode();
601 } 601 }
602 602
603 return nullptr; 603 return nullptr;
604 } 604 }
605 605
606 SVGDocumentExtensions& SVGElement::accessDocumentSVGExtensions() {
607 // This function is provided for use by SVGAnimatedProperty to avoid
608 // global inclusion of core/dom/Document.h in SVG code.
609 return document().accessSVGExtensions();
610 }
611
612 void SVGElement::mapInstanceToElement(SVGElement* instance) { 606 void SVGElement::mapInstanceToElement(SVGElement* instance) {
613 ASSERT(instance); 607 ASSERT(instance);
614 ASSERT(instance->inUseShadowTree()); 608 ASSERT(instance->inUseShadowTree());
615 609
616 HeapHashSet<WeakMember<SVGElement>>& instances = 610 HeapHashSet<WeakMember<SVGElement>>& instances =
617 ensureSVGRareData()->elementInstances(); 611 ensureSVGRareData()->elementInstances();
618 ASSERT(!instances.contains(instance)); 612 ASSERT(!instances.contains(instance));
619 613
620 instances.add(instance); 614 instances.add(instance);
621 } 615 }
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 visitor->trace(m_className); 1303 visitor->trace(m_className);
1310 Element::trace(visitor); 1304 Element::trace(visitor);
1311 } 1305 }
1312 1306
1313 const AtomicString& SVGElement::eventParameterName() { 1307 const AtomicString& SVGElement::eventParameterName() {
1314 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt")); 1308 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
1315 return evtString; 1309 return evtString;
1316 } 1310 }
1317 1311
1318 } // namespace blink 1312 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698