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

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

Issue 192093002: Drop SVGElement::isSVGSVGElement() virtual function (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGLengthContext.cpp » ('j') | 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 <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 // If the relative length state hasn't changed, we can stop propagating the notification. 471 // If the relative length state hasn't changed, we can stop propagating the notification.
472 if (hadRelativeLengths == currentElement->hasRelativeLengths()) 472 if (hadRelativeLengths == currentElement->hasRelativeLengths())
473 return; 473 return;
474 474
475 clientElement = currentElement; 475 clientElement = currentElement;
476 clientHasRelativeLengths = clientElement->hasRelativeLengths(); 476 clientHasRelativeLengths = clientElement->hasRelativeLengths();
477 } 477 }
478 478
479 // Register root SVG elements for top level viewport change notifications. 479 // Register root SVG elements for top level viewport change notifications.
480 if (clientElement->isSVGSVGElement()) { 480 if (isSVGSVGElement(*clientElement)) {
481 SVGDocumentExtensions& svgExtensions = accessDocumentSVGExtensions(); 481 SVGDocumentExtensions& svgExtensions = accessDocumentSVGExtensions();
482 if (clientElement->hasRelativeLengths()) 482 if (clientElement->hasRelativeLengths())
483 svgExtensions.addSVGRootWithRelativeLengthDescendents(toSVGSVGElemen t(clientElement)); 483 svgExtensions.addSVGRootWithRelativeLengthDescendents(toSVGSVGElemen t(clientElement));
484 else 484 else
485 svgExtensions.removeSVGRootWithRelativeLengthDescendents(toSVGSVGEle ment(clientElement)); 485 svgExtensions.removeSVGRootWithRelativeLengthDescendents(toSVGSVGEle ment(clientElement));
486 } 486 }
487 } 487 }
488 488
489 void SVGElement::invalidateRelativeLengthClients(SubtreeLayoutScope* layoutScope ) 489 void SVGElement::invalidateRelativeLengthClients(SubtreeLayoutScope* layoutScope )
490 { 490 {
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 } 860 }
861 861
862 void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents) 862 void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
863 { 863 {
864 RefPtr<SVGElement> currentTarget = this; 864 RefPtr<SVGElement> currentTarget = this;
865 while (currentTarget && currentTarget->haveLoadedRequiredResources()) { 865 while (currentTarget && currentTarget->haveLoadedRequiredResources()) {
866 RefPtr<Element> parent; 866 RefPtr<Element> parent;
867 if (sendParentLoadEvents) 867 if (sendParentLoadEvents)
868 parent = currentTarget->parentOrShadowHostElement(); // save the nex t parent to dispatch too incase dispatching the event changes the tree 868 parent = currentTarget->parentOrShadowHostElement(); // save the nex t parent to dispatch too incase dispatching the event changes the tree
869 if (hasLoadListener(currentTarget.get()) 869 if (hasLoadListener(currentTarget.get())
870 && (currentTarget->isStructurallyExternal() || currentTarget->isSVGS VGElement())) 870 && (currentTarget->isStructurallyExternal() || isSVGSVGElement(*curr entTarget)))
871 currentTarget->dispatchEvent(Event::create(EventTypeNames::load)); 871 currentTarget->dispatchEvent(Event::create(EventTypeNames::load));
872 currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast <SVGElement>(parent) : RefPtr<SVGElement>(); 872 currentTarget = (parent && parent->isSVGElement()) ? static_pointer_cast <SVGElement>(parent) : RefPtr<SVGElement>();
873 SVGElement* element = currentTarget.get(); 873 SVGElement* element = currentTarget.get();
874 if (!element || !element->isOutermostSVGSVGElement()) 874 if (!element || !element->isOutermostSVGSVGElement())
875 continue; 875 continue;
876 876
877 // Consider <svg onload="foo()"><image xlink:href="foo.png" externalReso urcesRequired="true"/></svg>. 877 // Consider <svg onload="foo()"><image xlink:href="foo.png" externalReso urcesRequired="true"/></svg>.
878 // If foo.png is not yet loaded, the first SVGLoad event will go to the <svg> element, sent through 878 // If foo.png is not yet loaded, the first SVGLoad event will go to the <svg> element, sent through
879 // Document::implicitClose(). Then the SVGLoad event will fire for <imag e>, once its loaded. 879 // Document::implicitClose(). Then the SVGLoad event will fire for <imag e>, once its loaded.
880 ASSERT(sendParentLoadEvents); 880 ASSERT(sendParentLoadEvents);
(...skipping 25 matching lines...) Expand all
906 void SVGElement::finishParsingChildren() 906 void SVGElement::finishParsingChildren()
907 { 907 {
908 Element::finishParsingChildren(); 908 Element::finishParsingChildren();
909 909
910 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp atchWindowLoadEvent. 910 // The outermost SVGSVGElement SVGLoad event is fired through Document::disp atchWindowLoadEvent.
911 if (isOutermostSVGSVGElement()) 911 if (isOutermostSVGSVGElement())
912 return; 912 return;
913 913
914 // finishParsingChildren() is called when the close tag is reached for an el ement (e.g. </svg>) 914 // finishParsingChildren() is called when the close tag is reached for an el ement (e.g. </svg>)
915 // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish 915 // we send SVGLoad events here if we can, otherwise they'll be sent when any required loads finish
916 if (isSVGSVGElement()) 916 if (isSVGSVGElement(*this))
917 sendSVGLoadEventIfPossible(); 917 sendSVGLoadEventIfPossible();
918 } 918 }
919 919
920 void SVGElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason) 920 void SVGElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason)
921 { 921 {
922 Element::attributeChanged(name, newValue); 922 Element::attributeChanged(name, newValue);
923 923
924 if (isIdAttributeName(name)) 924 if (isIdAttributeName(name))
925 document().accessSVGExtensions().rebuildAllElementReferencesForTarget(th is); 925 document().accessSVGExtensions().rebuildAllElementReferencesForTarget(th is);
926 926
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 animatableAttributes.add(SVGNames::zAttr); 1133 animatableAttributes.add(SVGNames::zAttr);
1134 } 1134 }
1135 1135
1136 if (name == classAttr) 1136 if (name == classAttr)
1137 return true; 1137 return true;
1138 1138
1139 return animatableAttributes.contains(name); 1139 return animatableAttributes.contains(name);
1140 } 1140 }
1141 #endif 1141 #endif
1142 } 1142 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGLengthContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698