Changeset 178363 in webkit
- Timestamp:
- Jan 13, 2015 8:59:49 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r178362 r178363 1 2015-01-13 Andreas Kling <akling@apple.com> 2 3 Element::normalizeAttributes() needs to handle arbitrary JS executing between loop iterations. 4 <https://webkit.org/b/140379> 5 <rdar://problem/19446901> 6 7 Reviewed by Benjamin Poulain. 8 9 * fast/dom/Element/normalize-crash2-expected.txt: Added. 10 * fast/dom/Element/normalize-crash2.html: Added. 11 1 12 2015-01-13 Andrzej Badowski <a.badowski@samsung.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r178349 r178363 1 2015-01-13 Andreas Kling <akling@apple.com> 2 3 Element::normalizeAttributes() needs to handle arbitrary JS executing between loop iterations. 4 <https://webkit.org/b/140379> 5 <rdar://problem/19446901> 6 7 Reviewed by Benjamin Poulain. 8 9 Since DOM mutation events may arise below the call to Node::normalize(), 10 have the loop in Element::normalizeAttributes() make a copy of the Attr nodes 11 beforehand, to guard against mutations. 12 13 Based on a patch by Chris "Chris Dumez" Dumez. 14 15 Test: fast/dom/Element/normalize-crash2.html 16 17 * dom/Element.cpp: 18 (WebCore::Element::normalizeAttributes): 19 1 20 2015-01-13 Shivakumar JM <shiva.jm@samsung.com> 2 21 -
trunk/Source/WebCore/dom/Element.cpp
r178048 r178363 2314 2314 if (!hasAttributes()) 2315 2315 return; 2316 for (const Attribute& attribute : attributesIterator()) { 2317 if (RefPtr<Attr> attr = attrIfExists(attribute.name())) 2318 attr->normalize(); 2319 } 2316 2317 auto* attrNodeList = attrNodeListForElement(*this); 2318 if (!attrNodeList) 2319 return; 2320 2321 // Copy the Attr Vector because Node::normalize() can fire synchronous JS 2322 // events (e.g. DOMSubtreeModified) and a JS listener could add / remove 2323 // attributes while we are iterating. 2324 auto copyOfAttrNodeList = *attrNodeList; 2325 for (auto& attrNode : copyOfAttrNodeList) 2326 attrNode->normalize(); 2320 2327 } 2321 2328
Note: See TracChangeset
for help on using the changeset viewer.