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

Unified Diff: Source/core/dom/Document.cpp

Issue 341273006: Protect an element while removing an attribute. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move the RefPtr to Document::adoptNode Created 6 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 365e290fc1a94714532c9ed034b6ea318519f9da..f681ab799f311d89ac3a7dee424d65f1fd1e3661 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1023,8 +1023,8 @@ PassRefPtrWillBeRawPtr<Node> Document::adoptNode(PassRefPtrWillBeRawPtr<Node> so
return nullptr;
case ATTRIBUTE_NODE: {
Attr* attr = toAttr(source.get());
- if (attr->ownerElement())
- attr->ownerElement()->removeAttributeNode(attr, exceptionState);
+ if (RefPtrWillBeRawPtr<Element> ownerElement = attr->ownerElement())
+ ownerElement->removeAttributeNode(attr, exceptionState);
break;
}
default:
« no previous file with comments | « LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698