OLD | NEW |
---|---|
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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1035 } | 1035 } |
1036 | 1036 |
1037 bool SVGElement::hasFocusEventListeners() const | 1037 bool SVGElement::hasFocusEventListeners() const |
1038 { | 1038 { |
1039 return hasEventListeners(EventTypeNames::focusin) || hasEventListeners(Event TypeNames::focusout) | 1039 return hasEventListeners(EventTypeNames::focusin) || hasEventListeners(Event TypeNames::focusout) |
1040 || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTy peNames::blur); | 1040 || hasEventListeners(EventTypeNames::focus) || hasEventListeners(EventTy peNames::blur); |
1041 } | 1041 } |
1042 | 1042 |
1043 void SVGElement::invalidateInstances() | 1043 void SVGElement::invalidateInstances() |
1044 { | 1044 { |
1045 if (!inDocument()) | |
1046 return; | |
1047 | |
1048 if (instanceUpdatesBlocked()) | 1045 if (instanceUpdatesBlocked()) |
1049 return; | 1046 return; |
1050 | 1047 |
1051 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& set = instance sForElement(); | 1048 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >& set = instance sForElement(); |
1052 if (set.isEmpty()) | 1049 if (set.isEmpty()) |
1053 return; | 1050 return; |
1054 | 1051 |
1052 // Take snapshot of the |set|, as it may be be modified from |invalidateShad owTree()|. | |
1053 WillBeHeapVector<RawPtrWillBeWeakMember<SVGElement> > snapshot; | |
1054 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = set.begin(), end = set.end(); it != end; ++it) { | |
1055 snapshot.append(*it); | |
esprehn
2014/05/23 04:38:17
I think you want copyToVector? Also these braces a
kouhei (in TOK)
2014/05/23 07:17:15
Done.
| |
1056 } | |
1057 | |
1055 // Mark all use elements referencing 'element' for rebuilding | 1058 // Mark all use elements referencing 'element' for rebuilding |
1056 const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator end = set.end(); | 1059 for (WillBeHeapVector<RawPtrWillBeWeakMember<SVGElement> >::const_iterator i t = snapshot.begin(), end = snapshot.end(); it != end; ++it) { |
1057 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement> >::const_iterator it = set.begin(); it != end; ++it) { | |
1058 (*it)->setCorrespondingElement(0); | 1060 (*it)->setCorrespondingElement(0); |
1059 | 1061 |
1060 if (SVGUseElement* element = (*it)->correspondingUseElement()) { | 1062 if (SVGUseElement* element = (*it)->correspondingUseElement()) { |
1061 ASSERT(element->inDocument()); | 1063 ASSERT(element->inDocument()); |
1062 element->invalidateShadowTree(); | 1064 element->invalidateShadowTree(); |
1063 } | 1065 } |
1064 } | 1066 } |
1065 | 1067 |
1066 document().updateRenderTreeIfNeeded(); | 1068 if (inDocument()) |
1069 document().updateUseShadowTreesIfNeeded(); | |
1067 } | 1070 } |
1068 | 1071 |
1069 SVGElement::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* targetEleme nt) | 1072 SVGElement::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* targetEleme nt) |
1070 : m_targetElement(targetElement) | 1073 : m_targetElement(targetElement) |
1071 { | 1074 { |
1072 if (m_targetElement) | 1075 if (m_targetElement) |
1073 m_targetElement->setInstanceUpdatesBlocked(true); | 1076 m_targetElement->setInstanceUpdatesBlocked(true); |
1074 } | 1077 } |
1075 | 1078 |
1076 SVGElement::InstanceUpdateBlocker::~InstanceUpdateBlocker() | 1079 SVGElement::InstanceUpdateBlocker::~InstanceUpdateBlocker() |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1179 animatableAttributes.add(SVGNames::zAttr); | 1182 animatableAttributes.add(SVGNames::zAttr); |
1180 } | 1183 } |
1181 | 1184 |
1182 if (name == classAttr) | 1185 if (name == classAttr) |
1183 return true; | 1186 return true; |
1184 | 1187 |
1185 return animatableAttributes.contains(name); | 1188 return animatableAttributes.contains(name); |
1186 } | 1189 } |
1187 #endif | 1190 #endif |
1188 } | 1191 } |
OLD | NEW |