r184718 and r184725 caused four tests to begin crashing
authorjacob_nielsen@apple.com <jacob_nielsen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 22:45:13 +0000 (22:45 +0000)
committerjacob_nielsen@apple.com <jacob_nielsen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 22:45:13 +0000 (22:45 +0000)
Unreviewed rollback.

Tests that started crashing:

svg/carto.net/textbox.svg svg/custom/tref-clone-crash.html svg/custom/use-animation-in-fill.html svg/custom/use-multiple-on-nested-disallowed-font.html

* svg/SVGAnimateElementBase.cpp:
(WebCore::propertyTypesAreConsistent):
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::executeAction):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::parseAttribute):
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::~SVGCursorElement):
(WebCore::SVGCursorElement::isSupportedAttribute):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::pauseAnimations):
(WebCore::SVGDocumentExtensions::unpauseAnimations):
(WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements):
(WebCore::SVGDocumentExtensions::isElementWithPendingResources):
(WebCore::SVGDocumentExtensions::removeElementFromPendingResources):
(WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement):
(WebCore::SVGDocumentExtensions::rebuildElements):
* svg/SVGElement.cpp:
(WebCore::populateAttributeNameToCSSPropertyIDMap):
(WebCore::populateAttributeNameToAnimatedPropertyTypeMap):
(WebCore::attributeNameToAnimatedPropertyTypeMap):
(WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
(WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
(WebCore::hasLoadListener):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):
* svg/SVGFontElement.cpp:
(WebCore::SVGFontElement::registerLigaturesInGlyphCache):
(WebCore::SVGKerningMap::insert):
(WebCore::stringMatchesUnicodeRange):
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::begin):
(WebCore::SVGPathByteStream::end):
(WebCore::SVGPathByteStream::append):
(WebCore::SVGPathByteStream::clear):
(WebCore::SVGPathByteStream::isEmpty):
* svg/SVGPathUtilities.cpp:
(WebCore::appendSVGPathByteStreamFromSVGPathSeg):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::setElapsed):
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseBeginOrEnd):
(WebCore::SVGSMILElement::connectConditions):
(WebCore::SVGSMILElement::disconnectConditions):
(WebCore::SVGSMILElement::notifyDependentsIntervalChanged):
(WebCore::SVGSMILElement::createInstanceTimesFromSyncbase):
* svg/graphics/filters/SVGFilterBuilder.cpp:
(WebCore::SVGFilterBuilder::clearResultsRecursive):
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::addBuiltinEffects):
* svg/properties/SVGAnimatedProperty.cpp:
(WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::detachListWrappersAndResize):
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184734 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGAnimateElementBase.cpp
Source/WebCore/svg/SVGAnimatedPath.cpp
Source/WebCore/svg/SVGAnimatedTypeAnimator.h
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGCursorElement.cpp
Source/WebCore/svg/SVGDocumentExtensions.cpp
Source/WebCore/svg/SVGElement.cpp
Source/WebCore/svg/SVGFontData.cpp
Source/WebCore/svg/SVGFontElement.cpp
Source/WebCore/svg/SVGPathByteStream.h
Source/WebCore/svg/SVGPathUtilities.cpp
Source/WebCore/svg/animation/SMILTimeContainer.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp
Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h
Source/WebCore/svg/properties/SVGAnimatedProperty.cpp
Source/WebCore/svg/properties/SVGListProperty.h
Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp

index acbf9a1..daa1116 100644 (file)
@@ -1,3 +1,73 @@
+2015-05-21  Jake Nielsen  <jacob_nielsen@apple.com>
+
+        r184718 and r184725 caused four tests to begin crashing
+
+        Unreviewed rollback.
+
+        Tests that started crashing:
+
+        svg/carto.net/textbox.svg svg/custom/tref-clone-crash.html svg/custom/use-animation-in-fill.html svg/custom/use-multiple-on-nested-disallowed-font.html
+
+        * svg/SVGAnimateElementBase.cpp:
+        (WebCore::propertyTypesAreConsistent):
+        * svg/SVGAnimatedPath.cpp:
+        (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
+        * svg/SVGAnimatedTypeAnimator.h:
+        (WebCore::SVGAnimatedTypeAnimator::executeAction):
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::parseAttribute):
+        * svg/SVGCursorElement.cpp:
+        (WebCore::SVGCursorElement::~SVGCursorElement):
+        (WebCore::SVGCursorElement::isSupportedAttribute):
+        * svg/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::pauseAnimations):
+        (WebCore::SVGDocumentExtensions::unpauseAnimations):
+        (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements):
+        (WebCore::SVGDocumentExtensions::isElementWithPendingResources):
+        (WebCore::SVGDocumentExtensions::removeElementFromPendingResources):
+        (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement):
+        (WebCore::SVGDocumentExtensions::rebuildElements):
+        * svg/SVGElement.cpp:
+        (WebCore::populateAttributeNameToCSSPropertyIDMap):
+        (WebCore::populateAttributeNameToAnimatedPropertyTypeMap):
+        (WebCore::attributeNameToAnimatedPropertyTypeMap):
+        (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
+        (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
+        (WebCore::hasLoadListener):
+        * svg/SVGFontData.cpp:
+        (WebCore::SVGFontData::applySVGGlyphSelection):
+        * svg/SVGFontElement.cpp:
+        (WebCore::SVGFontElement::registerLigaturesInGlyphCache):
+        (WebCore::SVGKerningMap::insert):
+        (WebCore::stringMatchesUnicodeRange):
+        * svg/SVGPathByteStream.h:
+        (WebCore::SVGPathByteStream::begin):
+        (WebCore::SVGPathByteStream::end):
+        (WebCore::SVGPathByteStream::append):
+        (WebCore::SVGPathByteStream::clear):
+        (WebCore::SVGPathByteStream::isEmpty):
+        * svg/SVGPathUtilities.cpp:
+        (WebCore::appendSVGPathByteStreamFromSVGPathSeg):
+        * svg/animation/SMILTimeContainer.cpp:
+        (WebCore::SMILTimeContainer::setElapsed):
+        (WebCore::SMILTimeContainer::updateAnimations):
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::parseBeginOrEnd):
+        (WebCore::SVGSMILElement::connectConditions):
+        (WebCore::SVGSMILElement::disconnectConditions):
+        (WebCore::SVGSMILElement::notifyDependentsIntervalChanged):
+        (WebCore::SVGSMILElement::createInstanceTimesFromSyncbase):
+        * svg/graphics/filters/SVGFilterBuilder.cpp:
+        (WebCore::SVGFilterBuilder::clearResultsRecursive):
+        * svg/graphics/filters/SVGFilterBuilder.h:
+        (WebCore::SVGFilterBuilder::addBuiltinEffects):
+        * svg/properties/SVGAnimatedProperty.cpp:
+        (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
+        * svg/properties/SVGListProperty.h:
+        (WebCore::SVGListProperty::detachListWrappersAndResize):
+        * svg/properties/SVGPathSegListPropertyTearOff.cpp:
+        (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
+
 2015-05-21  Brent Fulgham  <bfulgham@apple.com>
 
         Scroll-snap points needs to be updated during programmatic scrolls
index 9f0b850..e5065ce 100644 (file)
@@ -171,11 +171,12 @@ bool SVGAnimateElementBase::calculateFromAndByValues(const String& fromString, c
 #ifndef NDEBUG
 static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes)
 {
-    for (auto& type : animatedTypes) {
-        for (auto& property : type.properties) {
-            if (expectedPropertyType != property->animatedPropertyType()) {
+    SVGElementAnimatedPropertyList::const_iterator end = animatedTypes.end();
+    for (SVGElementAnimatedPropertyList::const_iterator it = animatedTypes.begin(); it != end; ++it) {
+        for (size_t i = 0; i < it->properties.size(); ++i) {
+            if (expectedPropertyType != it->properties[i]->animatedPropertyType()) {
                 // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute.
-                if (expectedPropertyType == AnimatedAngle && property->animatedPropertyType() == AnimatedEnumeration)
+                if (expectedPropertyType == AnimatedAngle && it->properties[i]->animatedPropertyType() == AnimatedEnumeration)
                     return true;
                 return false;
             }
index 8097477..fba8a61 100644 (file)
@@ -50,13 +50,15 @@ std::unique_ptr<SVGAnimatedType> SVGAnimatedPathAnimator::startAnimValAnimation(
 
     Vector<RefPtr<SVGAnimatedPathSegListPropertyTearOff>> result;
 
-    for (auto& type : animatedTypes)
-        result.append(castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(type.properties[0].get()));
+    SVGElementAnimatedPropertyList::const_iterator end = animatedTypes.end();
+    for (SVGElementAnimatedPropertyList::const_iterator it = animatedTypes.begin(); it != end; ++it)
+        result.append(castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(it->properties[0].get()));
 
     SVGElement::InstanceUpdateBlocker blocker(*property->contextElement());
 
-    for (auto& segment : result)
-        segment->animationStarted(byteStream.get(), &baseValue);
+    size_t resultSize = result.size();
+    for (size_t i = 0; i < resultSize; ++i)
+        result[i]->animationStarted(byteStream.get(), &baseValue);
 
     return SVGAnimatedType::createPath(WTF::move(byteStream));
 }
index cbc3a62..752e9b2 100644 (file)
@@ -191,9 +191,10 @@ private:
         // FIXME: Can't use SVGElement::InstanceUpdateBlocker because of circular header dependency. Would be nice to untangle this.
         setInstanceUpdatesBlocked(*animatedTypes[0].element, true);
 
-        for (auto& animatedType : animatedTypes) {
-            ASSERT_WITH_SECURITY_IMPLICATION(whichProperty < animatedType.properties.size());
-            AnimValType* property = castAnimatedPropertyToActualType<AnimValType>(animatedType.properties[whichProperty].get());
+        SVGElementAnimatedPropertyList::const_iterator end = animatedTypes.end();
+        for (SVGElementAnimatedPropertyList::const_iterator it = animatedTypes.begin(); it != end; ++it) {
+            ASSERT_WITH_SECURITY_IMPLICATION(whichProperty < it->properties.size());
+            AnimValType* property = castAnimatedPropertyToActualType<AnimValType>(it->properties[whichProperty].get());
 
             switch (action) {
             case StartAnimationAction:
index 34628ad..5ba19bc 100644 (file)
@@ -167,8 +167,8 @@ void SVGAnimationElement::parseAttribute(const QualifiedName& name, const Atomic
         // and white space before and after semicolon separators, is allowed and will be ignored.
         // http://www.w3.org/TR/SVG11/animate.html#ValuesAttribute
         value.string().split(';', m_values);
-        for (auto& value : m_values)
-            value = value.stripWhiteSpace();
+        for (unsigned i = 0; i < m_values.size(); ++i)
+            m_values[i] = m_values[i].stripWhiteSpace();
 
         updateAnimationMode();
         return;
index 4bd43da..d54ec46 100644 (file)
@@ -58,8 +58,9 @@ Ref<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Doc
 
 SVGCursorElement::~SVGCursorElement()
 {
-    for (auto& client : m_clients)
-        client->cursorElementRemoved();
+    HashSet<SVGElement*>::iterator end = m_clients.end();
+    for (HashSet<SVGElement*>::iterator it = m_clients.begin(); it != end; ++it)
+        (*it)->cursorElementRemoved();
 }
 
 bool SVGCursorElement::isSupportedAttribute(const QualifiedName& attrName)
index ab29d21..a47add5 100644 (file)
@@ -101,14 +101,16 @@ void SVGDocumentExtensions::startAnimations()
 
 void SVGDocumentExtensions::pauseAnimations()
 {
-    for (auto& container : m_timeContainers)
-        container->pauseAnimations();
+    auto end = m_timeContainers.end();
+    for (auto it = m_timeContainers.begin(); it != end; ++it)
+        (*it)->pauseAnimations();
 }
 
 void SVGDocumentExtensions::unpauseAnimations()
 {
-    for (auto& container : m_timeContainers)
-        container->unpauseAnimations();
+    auto end = m_timeContainers.end();
+    for (auto it = m_timeContainers.begin(); it != end; ++it)
+        (*it)->unpauseAnimations();
 }
 
 void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
@@ -116,10 +118,12 @@ void SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()
     Vector<RefPtr<SVGSVGElement>> timeContainers;
     timeContainers.appendRange(m_timeContainers.begin(), m_timeContainers.end());
 
-    for (auto& container : m_timeContainers) {
-        if (!container->isOutermostSVGSVGElement())
+    auto end = timeContainers.end();
+    for (auto it = timeContainers.begin(); it != end; ++it) {
+        SVGSVGElement* outerSVG = (*it).get();
+        if (!outerSVG->isOutermostSVGSVGElement())
             continue;
-        container->sendSVGLoadEventIfPossible();
+        outerSVG->sendSVGLoadEventIfPossible();
     }
 }
 
@@ -167,7 +171,9 @@ bool SVGDocumentExtensions::isElementWithPendingResources(Element* element) cons
     // This algorithm takes time proportional to the number of pending resources and need not.
     // If performance becomes an issue we can keep a counted set of elements and answer the question efficiently.
     ASSERT(element);
-    for (auto& elements : m_pendingResources.values()) {
+    auto end = m_pendingResources.end();
+    for (auto it = m_pendingResources.begin(); it != end; ++it) {
+        PendingElements* elements = it->value.get();
         ASSERT(elements);
 
         if (elements->contains(element))
@@ -199,39 +205,43 @@ void SVGDocumentExtensions::removeElementFromPendingResources(Element* element)
     // Remove the element from pending resources.
     if (!m_pendingResources.isEmpty() && element->hasPendingResources()) {
         Vector<AtomicString> toBeRemoved;
-        for (auto& resource : m_pendingResources) {
-            PendingElements* elements = resource.value.get();
+        auto end = m_pendingResources.end();
+        for (auto it = m_pendingResources.begin(); it != end; ++it) {
+            PendingElements* elements = it->value.get();
             ASSERT(elements);
             ASSERT(!elements->isEmpty());
 
             elements->remove(element);
             if (elements->isEmpty())
-                toBeRemoved.append(resource.key);
+                toBeRemoved.append(it->key);
         }
 
         clearHasPendingResourcesIfPossible(element);
 
         // We use the removePendingResource function here because it deals with set lifetime correctly.
-        for (auto& resource : toBeRemoved)
-            removePendingResource(resource);
+        auto vectorEnd = toBeRemoved.end();
+        for (auto it = toBeRemoved.begin(); it != vectorEnd; ++it)
+            removePendingResource(*it);
     }
 
     // Remove the element from pending resources that were scheduled for removal.
     if (!m_pendingResourcesForRemoval.isEmpty()) {
         Vector<AtomicString> toBeRemoved;
-        for (auto& resource : m_pendingResourcesForRemoval) {
-            PendingElements* elements = resource.value.get();
+        auto end = m_pendingResourcesForRemoval.end();
+        for (auto it = m_pendingResourcesForRemoval.begin(); it != end; ++it) {
+            PendingElements* elements = it->value.get();
             ASSERT(elements);
             ASSERT(!elements->isEmpty());
 
             elements->remove(element);
             if (elements->isEmpty())
-                toBeRemoved.append(resource.key);
+                toBeRemoved.append(it->key);
         }
 
         // We use the removePendingResourceForRemoval function here because it deals with set lifetime correctly.
-        for (auto& resource : toBeRemoved)
-            removePendingResourceForRemoval(resource);
+        auto vectorEnd = toBeRemoved.end();
+        for (auto it = toBeRemoved.begin(); it != vectorEnd; ++it)
+            removePendingResourceForRemoval(*it);
     }
 }
 
@@ -307,16 +317,18 @@ void SVGDocumentExtensions::removeAllTargetReferencesForElement(SVGElement* refe
 {
     Vector<SVGElement*> toBeRemoved;
 
-    for (auto& dependency : m_elementDependencies) {
-        SVGElement* referencedElement = dependency.key;
-        HashSet<SVGElement*>& referencingElements = *dependency.value;
+    auto end = m_elementDependencies.end();
+    for (auto it = m_elementDependencies.begin(); it != end; ++it) {
+        SVGElement* referencedElement = it->key;
+        HashSet<SVGElement*>& referencingElements = *it->value;
         referencingElements.remove(referencingElement);
         if (referencingElements.isEmpty())
             toBeRemoved.append(referencedElement);
     }
 
-    for (auto& element : toBeRemoved)
-        m_elementDependencies.remove(element);
+    auto vectorEnd = toBeRemoved.end();
+    for (auto it = toBeRemoved.begin(); it != vectorEnd; ++it)
+        m_elementDependencies.remove(*it);
 }
 
 void SVGDocumentExtensions::rebuildElements()
index 4fc9ffe..d31b427 100644 (file)
@@ -150,8 +150,8 @@ static NEVER_INLINE void populateAttributeNameToCSSPropertyIDMap(HashMap<AtomicS
         &yAttr,
     };
 
-    for (auto& name : attributeNames) {
-        const AtomicString& localName = name->localName();
+    for (unsigned i = 0; i < WTF_ARRAY_LENGTH(attributeNames); ++i) {
+        const AtomicString& localName = attributeNames[i]->localName();
         map.add(localName.impl(), cssPropertyID(localName));
     }
 
@@ -229,8 +229,8 @@ static NEVER_INLINE void populateAttributeNameToAnimatedPropertyTypeMap(HashMap<
         { word_spacingAttr, AnimatedLength },
     };
 
-    for (auto& entry : table)
-        map.add(entry.attributeName.impl(), entry.type);
+    for (unsigned i = 0; i < WTF_ARRAY_LENGTH(table); ++i)
+        map.add(table[i].attributeName.impl(), table[i].type);
 }
 
 static inline HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType>& attributeNameToAnimatedPropertyTypeMap()
@@ -263,8 +263,8 @@ static NEVER_INLINE void populateCSSPropertyWithSVGDOMNameToAnimatedPropertyType
         { yAttr, AnimatedLength },
     };
 
-    for (auto& entry : table)
-        map.add(entry.attributeName.impl(), entry.type);
+    for (unsigned i = 0; i < WTF_ARRAY_LENGTH(table); ++i)
+        map.add(table[i].attributeName.impl(), table[i].type);
 }
 
 static inline HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType>& cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap()
@@ -639,8 +639,8 @@ static bool hasLoadListener(Element* element)
 
     for (element = element->parentOrShadowHostElement(); element; element = element->parentOrShadowHostElement()) {
         const EventListenerVector& entry = element->getEventListeners(eventNames().loadEvent);
-        for (auto& listener : entry) {
-            if (listener.useCapture)
+        for (size_t i = 0; i < entry.size(); ++i) {
+            if (entry[i].useCapture)
                 return true;
         }
     }
index 6104752..5289403 100644 (file)
@@ -161,17 +161,19 @@ bool SVGFontData::applySVGGlyphSelection(WidthIterator& iterator, GlyphData& gly
     }
 
     Vector<SVGGlyph> glyphs;
-    if (!altGlyphNames.isEmpty()) {
-        for (auto& name : altGlyphNames)
-            associatedFontElement->collectGlyphsForGlyphName(name, glyphs);
+    size_t altGlyphNamesSize = altGlyphNames.size();
+    if (altGlyphNamesSize) {
+        for (size_t index = 0; index < altGlyphNamesSize; ++index)
+            associatedFontElement->collectGlyphsForGlyphName(altGlyphNames[index], glyphs);
 
         // Assign the unicodeStringLength now that its known.
-        for (auto& glyph : glyphs)
-            glyph.unicodeStringLength = run.length();
+        size_t glyphsSize = glyphs.size();
+        for (size_t i = 0; i < glyphsSize; ++i)
+            glyphs[i].unicodeStringLength = run.length();
 
         // Do not check alt glyphs for compatibility. Just return the first one.
         // Later code will fail if we do not do this and the glyph is incompatible.
-        if (!glyphs.isEmpty()) {
+        if (glyphsSize) {
             SVGGlyph& svgGlyph = glyphs[0];
             iterator.setLastGlyphName(svgGlyph.glyphName);
             glyphData.glyph = svgGlyph.tableEntry;
@@ -189,14 +191,16 @@ bool SVGFontData::applySVGGlyphSelection(WidthIterator& iterator, GlyphData& gly
         associatedFontElement->collectGlyphsForString(remainingTextInRun, glyphs);
     }
 
-    for (auto& glyph : glyphs) {
-        if (glyph.isPartOfLigature)
+    size_t glyphsSize = glyphs.size();
+    for (size_t i = 0; i < glyphsSize; ++i) {
+        SVGGlyph& svgGlyph = glyphs[i];
+        if (svgGlyph.isPartOfLigature)
             continue;
-        if (!isCompatibleGlyph(glyph, isVerticalText, language, arabicForms, currentCharacter, currentCharacter + glyph.unicodeStringLength))
+        if (!isCompatibleGlyph(svgGlyph, isVerticalText, language, arabicForms, currentCharacter, currentCharacter + svgGlyph.unicodeStringLength))
             continue;
-        iterator.setLastGlyphName(glyph.glyphName);
-        glyphData.glyph = glyph.tableEntry;
-        advanceLength = glyph.unicodeStringLength;
+        iterator.setLastGlyphName(svgGlyph.glyphName);
+        glyphData.glyph = svgGlyph.tableEntry;
+        advanceLength = svgGlyph.unicodeStringLength;
         return true;
     }
 
index 1148812..1a06913 100644 (file)
@@ -86,7 +86,10 @@ void SVGFontElement::registerLigaturesInGlyphCache(Vector<String>& ligatures)
     // will not be able to find a glyph for "f", but handles the fallback
     // character substitution properly through glyphDataForCharacter().
     Vector<SVGGlyph> glyphs;
-    for (auto& unicode : ligatures) {
+    size_t ligaturesSize = ligatures.size();
+    for (size_t i = 0; i < ligaturesSize; ++i) {
+        const String& unicode = ligatures[i];
+
         unsigned unicodeLength = unicode.length();
         ASSERT(unicodeLength > 1);
 
@@ -171,23 +174,27 @@ void SVGKerningMap::insert(const SVGKerningPair& kerningPair)
     svgKerning.unicodeName2 = kerningPair.unicodeName2;
     svgKerning.glyphName2 = kerningPair.glyphName2;
 
-    for (auto& name : kerningPair.unicodeName1) {
-        if (unicodeMap.contains(name))
-            unicodeMap.get(name)->append(svgKerning);
+    HashSet<String>::const_iterator uIt = kerningPair.unicodeName1.begin();
+    const HashSet<String>::const_iterator uEnd = kerningPair.unicodeName1.end();
+    for (; uIt != uEnd; ++uIt) {
+        if (unicodeMap.contains(*uIt))
+            unicodeMap.get(*uIt)->append(svgKerning);
         else {
             auto newVector = std::make_unique<SVGKerningVector>();
             newVector->append(svgKerning);
-            unicodeMap.add(name, WTF::move(newVector));
+            unicodeMap.add(*uIt, WTF::move(newVector));
         }
     }
 
-    for (auto& name : kerningPair.glyphName1) {
-        if (glyphMap.contains(name))
-            glyphMap.get(name)->append(svgKerning);
+    HashSet<String>::const_iterator gIt = kerningPair.glyphName1.begin();
+    const HashSet<String>::const_iterator gEnd = kerningPair.glyphName1.end();
+    for (; gIt != gEnd; ++gIt) {
+        if (glyphMap.contains(*gIt))
+            glyphMap.get(*gIt)->append(svgKerning);
         else {
             auto newVector = std::make_unique<SVGKerningVector>();
             newVector->append(svgKerning);
-            glyphMap.add(name, WTF::move(newVector));
+            glyphMap.add(*gIt, WTF::move(newVector));
         }
     }
 
@@ -202,8 +209,9 @@ static inline bool stringMatchesUnicodeRange(const String& unicodeString, const
 
     if (!ranges.isEmpty()) {
         UChar firstChar = unicodeString[0];
-        for (auto& range : ranges) {
-            if (firstChar >= range.first && firstChar <= range.second)
+        const UnicodeRanges::const_iterator end = ranges.end();
+        for (UnicodeRanges::const_iterator it = ranges.begin(); it != end; ++it) {
+            if (firstChar >= it->first && firstChar <= it->second)
                 return true;
         }
     }
index a75ab46..9d9d2a2 100644 (file)
@@ -58,10 +58,10 @@ public:
     DataIterator begin() { return m_data.begin(); }
     DataIterator end() { return m_data.end(); }
     void append(unsigned char byte) { m_data.append(byte); }
-    void append(SVGPathByteStream& other)
+    void append(SVGPathByteStream* other)
     {
-        for (auto stream : other)
-            append(stream);
+        for (DataIterator it = other->begin(); it != other->end(); ++it)
+            append(*it);
     }
     void clear() { m_data.clear(); }
     bool isEmpty() const { return !m_data.size(); }
index 7106056..c323952 100644 (file)
@@ -155,7 +155,7 @@ bool appendSVGPathByteStreamFromSVGPathSeg(PassRefPtr<SVGPathSeg> pathSeg, SVGPa
     parser->cleanup();
 
     if (ok)
-        result->append(*appendedByteStream);
+        result->append(appendedByteStream.get());
 
     return ok;
 }
index 399ccb4..53268ad 100644 (file)
@@ -187,9 +187,11 @@ void SMILTimeContainer::setElapsed(SMILTime time)
 #ifndef NDEBUG
     m_preventScheduledAnimationsChanges = true;
 #endif
-    for (auto& animation : m_scheduledAnimations.values()) {
-        for (auto& element : *animation)
-            element->reset();
+    for (auto& it : m_scheduledAnimations) {
+        AnimationsVector* scheduled = it.value.get();
+        unsigned size = scheduled->size();
+        for (unsigned n = 0; n < size; n++)
+            scheduled->at(n)->reset();
     }
 #ifndef NDEBUG
     m_preventScheduledAnimationsChanges = false;
@@ -272,7 +274,9 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
         sortByPriority(*scheduled, elapsed);
 
         SVGSMILElement* resultElement = 0;
-        for (auto& animation : *scheduled) {
+        unsigned size = scheduled->size();
+        for (unsigned n = 0; n < size; n++) {
+            SVGSMILElement* animation = scheduled->at(n);
             ASSERT(animation->timeContainer() == this);
             ASSERT(animation->targetElement());
             ASSERT(animation->hasValidAttributeName());
@@ -297,7 +301,8 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
             animationsToApply.append(resultElement);
     }
 
-    if (animationsToApply.isEmpty()) {
+    unsigned animationsToApplySize = animationsToApply.size();
+    if (!animationsToApplySize) {
 #ifndef NDEBUG
         m_preventScheduledAnimationsChanges = false;
 #endif
@@ -306,8 +311,8 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
     }
 
     // Apply results to target elements.
-    for (auto& animation : animationsToApply)
-        animation->applyResultsToTarget();
+    for (unsigned i = 0; i < animationsToApplySize; ++i)
+        animationsToApply[i]->applyResultsToTarget();
 
 #ifndef NDEBUG
     m_preventScheduledAnimationsChanges = false;
index c990aaa..f5caf74 100644 (file)
@@ -421,14 +421,14 @@ void SVGSMILElement::parseBeginOrEnd(const String& parseString, BeginOrEnd begin
     if (beginOrEnd == End)
         m_hasEndEventConditions = false;
     HashSet<double> existing;
-    for (auto& time : timeList)
-        existing.add(time.time().value());
+    for (unsigned n = 0; n < timeList.size(); ++n)
+        existing.add(timeList[n].time().value());
     Vector<String> splitString;
     parseString.split(';', splitString);
-    for (auto& string : splitString) {
-        SMILTime value = parseClockValue(string);
+    for (unsigned n = 0; n < splitString.size(); ++n) {
+        SMILTime value = parseClockValue(splitString[n]);
         if (value.isUnresolved())
-            parseCondition(string, beginOrEnd);
+            parseCondition(splitString[n], beginOrEnd);
         else if (!existing.contains(value.value()))
             timeList.append(SMILTimeWithOrigin(value, SMILTimeWithOrigin::ParserOrigin));
     }
@@ -518,7 +518,8 @@ void SVGSMILElement::connectConditions()
     if (m_conditionsConnected)
         disconnectConditions();
     m_conditionsConnected = true;
-    for (auto& condition : m_conditions) {
+    for (unsigned n = 0; n < m_conditions.size(); ++n) {
+        Condition& condition = m_conditions[n];
         if (condition.m_type == Condition::EventBase) {
             ASSERT(!condition.m_syncbase);
             Element* eventBase = eventBaseFor(condition);
@@ -546,7 +547,8 @@ void SVGSMILElement::disconnectConditions()
     if (!m_conditionsConnected)
         return;
     m_conditionsConnected = false;
-    for (auto& condition : m_conditions) {
+    for (unsigned n = 0; n < m_conditions.size(); ++n) {
+        Condition& condition = m_conditions[n];
         if (condition.m_type == Condition::EventBase) {
             ASSERT(!condition.m_syncbase);
             if (!condition.m_eventListener)
@@ -1124,7 +1126,9 @@ void SVGSMILElement::notifyDependentsIntervalChanged(NewOrExistingInterval newOr
         return;
     loopBreaker.add(this);
     
-    for (auto& dependent : m_timeDependents) {
+    TimeDependentSet::iterator end = m_timeDependents.end();
+    for (TimeDependentSet::iterator it = m_timeDependents.begin(); it != end; ++it) {
+        SVGSMILElement* dependent = *it;
         dependent->createInstanceTimesFromSyncbase(this, newOrExisting);
     }
 
@@ -1135,7 +1139,8 @@ void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncbase, N
 {
     // FIXME: To be really correct, this should handle updating exising interval by changing 
     // the associated times instead of creating new ones.
-    for (auto& condition : m_conditions) {
+    for (unsigned n = 0; n < m_conditions.size(); ++n) {
+        Condition& condition = m_conditions[n];
         if (condition.m_type == Condition::Syncbase && condition.m_syncbase == syncbase) {
             ASSERT(condition.m_name == "begin" || condition.m_name == "end");
             // No nested time containers in SVG, no need for crazy time space conversions. Phew!
index 52ba4e9..4bb1a0a 100644 (file)
@@ -95,8 +95,10 @@ void SVGFilterBuilder::clearResultsRecursive(FilterEffect* effect)
 
     effect->clearResult();
 
-    for (auto& reference : effectReferences(effect))
-        clearResultsRecursive(reference);
+    HashSet<FilterEffect*>& effectReferences = this->effectReferences(effect);
+    HashSet<FilterEffect*>::iterator end = effectReferences.end();
+    for (HashSet<FilterEffect*>::iterator it = effectReferences.begin(); it != end; ++it)
+         clearResultsRecursive(*it);
 }
 
 } // namespace WebCore
index 0867d28..2b1dd2f 100644 (file)
@@ -62,8 +62,9 @@ public:
 private:
     inline void addBuiltinEffects()
     {
-        for (auto& effect : m_builtinEffects.values())
-            m_effectReferences.add(effect, FilterEffectSet());
+        HashMap<AtomicString, RefPtr<FilterEffect>>::iterator end = m_builtinEffects.end();
+        for (HashMap<AtomicString, RefPtr<FilterEffect>>::iterator iterator = m_builtinEffects.begin(); iterator != end; ++iterator)
+             m_effectReferences.add(iterator->value, FilterEffectSet());
     }
 
     HashMap<AtomicString, RefPtr<FilterEffect>> m_builtinEffects;
index ab114ab..49dc8fc 100644 (file)
@@ -37,9 +37,10 @@ SVGAnimatedProperty::SVGAnimatedProperty(SVGElement* contextElement, const Quali
 SVGAnimatedProperty::~SVGAnimatedProperty()
 {
     // Remove wrapper from cache.
-    for (auto& cache : *animatedPropertyCache()) {
-        if (cache.value == this) {
-            animatedPropertyCache()->remove(cache.key);
+    Cache& cache = *animatedPropertyCache();
+    for (auto it = cache.begin(), end = cache.end(); it != end; ++it) {
+        if (it->value == this) {
+            cache.remove(it);
             break;
         }
     }
index 77788e1..480884e 100644 (file)
@@ -62,8 +62,9 @@ public:
     {
         // See SVGPropertyTearOff::detachWrapper() for an explanation about what's happening here.
         ASSERT(wrappers);
-        for (auto& item : *wrappers) {
-            if (item)
+        unsigned size = wrappers->size();
+        for (unsigned i = 0; i < size; ++i) {
+            if (ListItemTearOff* item = wrappers->at(i).get())
                 item->detachWrapper();
         }
 
index 3992741..5117ce6 100644 (file)
@@ -30,7 +30,9 @@ namespace WebCore {
 void SVGPathSegListPropertyTearOff::clearContextAndRoles()
 {
     ASSERT(m_values);
-    for (auto& item : *m_values) {
+    unsigned size = m_values->size();
+    for (unsigned i = 0; i < size; ++i) {
+        ListItemType item = m_values->at(i);
         static_cast<SVGPathSegWithContext*>(item.get())->setContextAndRole(0, PathSegUndefinedRole);
     }
 }