Changeset 239402 in webkit
- Timestamp:
- Dec 19, 2018, 3:51:03 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
svg/SVGUseElement.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r239398 r239402 1 2018-12-18 Ryosuke Niwa <rniwa@webkit.org> 2 3 SVGUseElement::findTarget should return nullptr when there is a cycle 4 https://bugs.webkit.org/show_bug.cgi?id=192840 5 6 Reviewed by Tim Horton. 7 8 r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target. 9 Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when 10 the SVG use element itself had a corresponding element. 11 12 No new tests since there should be no behavioral change. 13 14 * svg/SVGUseElement.cpp: 15 (WebCore::SVGUseElement::updateShadowTree): 16 (WebCore::SVGUseElement::findTarget const): 17 1 18 2018-12-19 Myles C. Maxfield <mmaxfield@apple.com> 2 19 -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r238524 r239402 245 245 } 246 246 247 if (isDescendantOf(target)) 248 return; 249 247 RELEASE_ASSERT(!isDescendantOf(target)); 250 248 { 251 249 auto& shadowRoot = ensureUserAgentShadowRoot(); … … 424 422 return nullptr; 425 423 426 // Reject any target that has already been cloned to create one of the ancestors of this element,427 // already in the shadow tree. This is sufficient to prevent cycles.428 424 if (correspondingElement) { 429 425 for (auto& ancestor : lineageOfType<SVGElement>(*this)) { … … 431 427 return nullptr; 432 428 } 429 } else { 430 if (target.contains(this)) 431 return nullptr; 432 // Target should only refer to a node in the same tree or a node in another document. 433 ASSERT(!isDescendantOrShadowDescendantOf(&target)); 433 434 } 434 435
Note:
See TracChangeset
for help on using the changeset viewer.