Title: [184734] trunk/Source/WebCore
Revision
184734
Author
jacob_niel...@apple.com
Date
2015-05-21 15:45:13 -0700 (Thu, 21 May 2015)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184733 => 184734)


--- trunk/Source/WebCore/ChangeLog	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/ChangeLog	2015-05-21 22:45:13 UTC (rev 184734)
@@ -1,3 +1,73 @@
+2015-05-21  Jake Nielsen  <jacob_niel...@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  <bfulg...@apple.com>
 
         Scroll-snap points needs to be updated during programmatic scrolls

Modified: trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -171,11 +171,12 @@
 #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;
             }

Modified: trunk/Source/WebCore/svg/SVGAnimatedPath.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGAnimatedPath.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGAnimatedPath.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -50,13 +50,15 @@
 
     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));
 }

Modified: trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.h (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.h	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.h	2015-05-21 22:45:13 UTC (rev 184734)
@@ -191,9 +191,10 @@
         // 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:

Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -167,8 +167,8 @@
         // 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;

Modified: trunk/Source/WebCore/svg/SVGCursorElement.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGCursorElement.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGCursorElement.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -58,8 +58,9 @@
 
 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)

Modified: trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGDocumentExtensions.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -101,14 +101,16 @@
 
 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 @@
     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 @@
     // 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 @@
     // 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 @@
 {
     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()

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -150,8 +150,8 @@
         &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 @@
         { 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 @@
         { 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 @@
 
     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;
         }
     }

Modified: trunk/Source/WebCore/svg/SVGFontData.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGFontData.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGFontData.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -161,17 +161,19 @@
     }
 
     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 @@
         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;
     }
 

Modified: trunk/Source/WebCore/svg/SVGFontElement.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGFontElement.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGFontElement.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -86,7 +86,10 @@
     // 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 @@
     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 @@
 
     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;
         }
     }

Modified: trunk/Source/WebCore/svg/SVGPathByteStream.h (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGPathByteStream.h	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGPathByteStream.h	2015-05-21 22:45:13 UTC (rev 184734)
@@ -58,10 +58,10 @@
     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(); }

Modified: trunk/Source/WebCore/svg/SVGPathUtilities.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/SVGPathUtilities.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/SVGPathUtilities.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -155,7 +155,7 @@
     parser->cleanup();
 
     if (ok)
-        result->append(*appendedByteStream);
+        result->append(appendedByteStream.get());
 
     return ok;
 }

Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -187,9 +187,11 @@
 #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 @@
         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 @@
             animationsToApply.append(resultElement);
     }
 
-    if (animationsToApply.isEmpty()) {
+    unsigned animationsToApplySize = animationsToApply.size();
+    if (!animationsToApplySize) {
 #ifndef NDEBUG
         m_preventScheduledAnimationsChanges = false;
 #endif
@@ -306,8 +311,8 @@
     }
 
     // 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;

Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -421,14 +421,14 @@
     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 @@
     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 @@
     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 @@
         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 @@
 {
     // 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!

Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -95,8 +95,10 @@
 
     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

Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h (184733 => 184734)


--- trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h	2015-05-21 22:45:13 UTC (rev 184734)
@@ -62,8 +62,9 @@
 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;

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -37,9 +37,10 @@
 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;
         }
     }

Modified: trunk/Source/WebCore/svg/properties/SVGListProperty.h (184733 => 184734)


--- trunk/Source/WebCore/svg/properties/SVGListProperty.h	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/properties/SVGListProperty.h	2015-05-21 22:45:13 UTC (rev 184734)
@@ -62,8 +62,9 @@
     {
         // 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();
         }
 

Modified: trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp (184733 => 184734)


--- trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp	2015-05-21 20:27:43 UTC (rev 184733)
+++ trunk/Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp	2015-05-21 22:45:13 UTC (rev 184734)
@@ -30,7 +30,9 @@
 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);
     }
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to