Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 2534873004: Avoid unchecked casts in UA shadow DOM. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann
3 * <zimmermann@kde.org> 3 * <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
5 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
6 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 6 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
7 * Copyright (C) 2012 University of Szeged 7 * Copyright (C) 2012 University of Szeged
8 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> 8 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org>
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 444
445 // Expand all <use> elements in the shadow tree. 445 // Expand all <use> elements in the shadow tree.
446 // Expand means: replace the actual <use> element by what it references. 446 // Expand means: replace the actual <use> element by what it references.
447 if (!expandUseElementsInShadowTree()) { 447 if (!expandUseElementsInShadowTree()) {
448 clearShadowTree(); 448 clearShadowTree();
449 return; 449 return;
450 } 450 }
451 451
452 // If the instance root was a <use>, it could have been replaced now, so 452 // If the instance root was a <use>, it could have been replaced now, so
453 // reset |m_targetElementInstance|. 453 // reset |m_targetElementInstance|.
454 m_targetElementInstance = toSVGElement(shadowTreeRootElement->firstChild()); 454 m_targetElementInstance =
455 toSVGElementOrDie(shadowTreeRootElement->firstChild());
455 ASSERT(m_targetElementInstance->parentNode() == shadowTreeRootElement); 456 ASSERT(m_targetElementInstance->parentNode() == shadowTreeRootElement);
456 457
457 // Update relative length information. 458 // Update relative length information.
458 updateRelativeLengthsInformation(); 459 updateRelativeLengthsInformation();
459 } 460 }
460 461
461 LayoutObject* SVGUseElement::createLayoutObject(const ComputedStyle&) { 462 LayoutObject* SVGUseElement::createLayoutObject(const ComputedStyle&) {
462 return new LayoutSVGTransformableContainer(this); 463 return new LayoutSVGTransformableContainer(this);
463 } 464 }
464 465
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 730
730 if (m_resource) 731 if (m_resource)
731 m_resource->removeClient(this); 732 m_resource->removeClient(this);
732 733
733 m_resource = resource; 734 m_resource = resource;
734 if (m_resource) 735 if (m_resource)
735 m_resource->addClient(this); 736 m_resource->addClient(this);
736 } 737 }
737 738
738 } // namespace blink 739 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp ('k') | third_party/WebKit/Source/wtf/Assertions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698