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

Unified Diff: Source/core/svg/SVGUseElement.cpp

Issue 262413002: Remove instance and shadow tree debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGUseElement.cpp
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index 57cd5748eeccf71927da4826c511363787b67fbd..cdb277c033d1fc467a8d29f2b34f37f3188f3baa 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -43,12 +43,6 @@
#include "core/svg/SVGSVGElement.h"
#include "core/xml/parser/XMLDocumentParser.h"
-// Dump SVGElementInstance object tree - useful to debug instanceRoot problems
-// #define DUMP_INSTANCE_TREE
-
-// Dump the deep-expanded shadow tree (where the renderers are built from)
-// #define DUMP_SHADOW_TREE
-
namespace WebCore {
inline SVGUseElement::SVGUseElement(Document& document, bool wasInsertedByParser)
@@ -266,58 +260,6 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
ASSERT_NOT_REACHED();
}
-#ifdef DUMP_INSTANCE_TREE
-static void dumpInstanceTree(unsigned& depth, String& text, SVGElementInstance* targetInstance)
-{
- SVGElement* element = targetInstance->correspondingElement();
- ASSERT(element);
-
- if (isSVGUseElement(*element) && toSVGUseElement(*element).resourceIsStillLoading())
- return;
-
- SVGElement* shadowTreeElement = targetInstance->shadowTreeElement();
- ASSERT(shadowTreeElement);
-
- SVGUseElement* directUseElement = targetInstance->directUseElement();
- String directUseElementName = directUseElement ? directUseElement->nodeName() : "null";
-
- String elementId = element->getIdAttribute();
- String elementNodeName = element->nodeName();
- String shadowTreeElementNodeName = shadowTreeElement->nodeName();
- String parentNodeName = element->parentNode() ? element->parentNode()->nodeName() : "null";
- String firstChildNodeName = element->firstChild() ? element->firstChild()->nodeName() : "null";
-
- for (unsigned i = 0; i < depth; ++i)
- text += " ";
-
- text += String::format("SVGElementInstance this=%p, (parentNode=%s (%p), firstChild=%s (%p), correspondingElement=%s (%p), directUseElement=%s (%p), shadowTreeElement=%s (%p), id=%s)\n",
- targetInstance, parentNodeName.latin1().data(), element->parentNode(), firstChildNodeName.latin1().data(), element->firstChild(),
- elementNodeName.latin1().data(), element, directUseElementName.latin1().data(), directUseElement, shadowTreeElementNodeName.latin1().data(), shadowTreeElement, elementId.latin1().data());
-
- for (unsigned i = 0; i < depth; ++i)
- text += " ";
-
- const HashSet<SVGElementInstance*>& elementInstances = element->instancesForElement();
- text += "Corresponding element is associated with " + String::number(elementInstances.size()) + " instance(s):\n";
-
- const HashSet<SVGElementInstance*>::const_iterator end = elementInstances.end();
- for (HashSet<SVGElementInstance*>::const_iterator it = elementInstances.begin(); it != end; ++it) {
- for (unsigned i = 0; i < depth; ++i)
- text += " ";
-
- text += String::format(" -> SVGElementInstance this=%p, (refCount: %i, shadowTreeElement in document? %i)\n",
- *it, (*it)->refCount(), (*it)->shadowTreeElement()->inDocument());
- }
-
- ++depth;
-
- for (SVGElementInstance* instance = targetInstance->firstChild(); instance; instance = instance->nextSibling())
- dumpInstanceTree(depth, text, instance);
-
- --depth;
-}
-#endif
-
static bool isDisallowedElement(Node* node)
{
// Spec: "Any 'svg', 'symbol', 'g', graphics element or other 'use' is potentially a template object that can be re-used
@@ -515,22 +457,6 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement* target)
// Update relative length information.
updateRelativeLengthsInformation();
-
- // Eventually dump instance tree
-#ifdef DUMP_INSTANCE_TREE
- String text;
- unsigned depth = 0;
-
- dumpInstanceTree(depth, text, m_targetElementInstance.get());
- fprintf(stderr, "\nDumping <use> instance tree:\n%s\n", text.latin1().data());
-#endif
-
- // Eventually dump shadow tree
-#ifdef DUMP_SHADOW_TREE
- RefPtr<XMLSerializer> serializer = XMLSerializer::create();
- String markup = serializer->serializeToString(shadowTreeRootElement, ASSERT_NO_EXCEPTION);
- fprintf(stderr, "Dumping <use> shadow tree markup:\n%s\n", markup.latin1().data());
-#endif
}
RenderObject* SVGUseElement::createRenderer(RenderStyle*)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698