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

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

Issue 23785014: [SVG] Resources should be laid out in dependecy order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: text-layout-crash.html needs image result update. Created 7 years, 3 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 | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGElement.cpp
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index 7ee064323931e0ecd1c45508fbc3bf945acc778e..b25988dd455c210621c75f97e1cf3e4504cdc496 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -47,6 +47,8 @@
#include "core/svg/SVGSVGElement.h"
#include "core/svg/SVGUseElement.h"
+#include "wtf/TemporaryChange.h"
+
namespace WebCore {
// Animated property definitions
@@ -71,6 +73,9 @@ void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName
SVGElement::SVGElement(const QualifiedName& tagName, Document& document, ConstructionType constructionType)
: Element(tagName, &document, constructionType)
+#if !ASSERT_DISABLED
+ , m_inRelativeLengthClientsInvalidation(false)
+#endif
{
ScriptWrappable::init(this);
registerAnimatedPropertiesForSVGElement();
@@ -451,6 +456,7 @@ void SVGElement::updateRelativeLengthsInformation(bool clientHasRelativeLengths,
// Register the parent in the grandparents map, etc. Repeat procedure until the root of the SVG tree.
for (ContainerNode* currentNode = this; currentNode && currentNode->isSVGElement(); currentNode = currentNode->parentNode()) {
SVGElement* currentElement = toSVGElement(currentNode);
+ ASSERT(!currentElement->m_inRelativeLengthClientsInvalidation);
bool hadRelativeLengths = currentElement->hasRelativeLengths();
if (clientHasRelativeLengths)
@@ -467,6 +473,28 @@ void SVGElement::updateRelativeLengthsInformation(bool clientHasRelativeLengths,
}
}
+void SVGElement::invalidateRelativeLengthClients(SubtreeLayoutScope* layoutScope)
+{
+ if (!inDocument())
+ return;
+
+ ASSERT(!m_inRelativeLengthClientsInvalidation);
+#if !ASSERT_DISABLED
+ TemporaryChange<bool> inRelativeLengthClientsInvalidationChange(m_inRelativeLengthClientsInvalidation, true);
+#endif
+
+ HashSet<SVGElement*>::iterator end = m_elementsWithRelativeLengths.end();
+ for (HashSet<SVGElement*>::iterator it = m_elementsWithRelativeLengths.begin(); it != end; ++it) {
+ if (*it == this)
+ continue;
+
+ if ((*it)->renderer() && (*it)->selfHasRelativeLengths())
+ (*it)->renderer()->setNeedsLayout(MarkContainingBlockChain, layoutScope);
+
+ (*it)->invalidateRelativeLengthClients(layoutScope);
+ }
+}
+
SVGSVGElement* SVGElement::ownerSVGElement() const
{
ContainerNode* n = parentOrShadowHostNode();
« no previous file with comments | « Source/core/svg/SVGElement.h ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698