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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 341273006: Protect an element while removing an attribute. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: RefPtr->RefPtrWillBeRawPtr 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@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 2843 matching lines...) Expand 10 before | Expand all | Expand 10 after
2854 2854
2855 void Element::didModifyAttribute(const QualifiedName& name, const AtomicString& value) 2855 void Element::didModifyAttribute(const QualifiedName& name, const AtomicString& value)
2856 { 2856 {
2857 attributeChanged(name, value); 2857 attributeChanged(name, value);
2858 InspectorInstrumentation::didModifyDOMAttr(this, name.localName(), value); 2858 InspectorInstrumentation::didModifyDOMAttr(this, name.localName(), value);
2859 // Do not dispatch a DOMSubtreeModified event here; see bug 81141. 2859 // Do not dispatch a DOMSubtreeModified event here; see bug 81141.
2860 } 2860 }
2861 2861
2862 void Element::didRemoveAttribute(const QualifiedName& name) 2862 void Element::didRemoveAttribute(const QualifiedName& name)
2863 { 2863 {
2864 RefPtrWillBeRawPtr<Element> protect(this);
2864 attributeChanged(name, nullAtom); 2865 attributeChanged(name, nullAtom);
2865 InspectorInstrumentation::didRemoveDOMAttr(this, name.localName()); 2866 InspectorInstrumentation::didRemoveDOMAttr(this, name.localName());
2866 dispatchSubtreeModifiedEvent(); 2867 dispatchSubtreeModifiedEvent();
2867 } 2868 }
2868 2869
2869 static bool needsURLResolutionForInlineStyle(const Element& element, const Docum ent& oldDocument, const Document& newDocument) 2870 static bool needsURLResolutionForInlineStyle(const Element& element, const Docum ent& oldDocument, const Document& newDocument)
2870 { 2871 {
2871 if (oldDocument == newDocument) 2872 if (oldDocument == newDocument)
2872 return false; 2873 return false;
2873 if (oldDocument.baseURL() == newDocument.baseURL()) 2874 if (oldDocument.baseURL() == newDocument.baseURL())
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
3325 3326
3326 void Element::trace(Visitor* visitor) 3327 void Element::trace(Visitor* visitor)
3327 { 3328 {
3328 if (hasRareData()) 3329 if (hasRareData())
3329 visitor->trace(elementRareData()); 3330 visitor->trace(elementRareData());
3330 3331
3331 ContainerNode::trace(visitor); 3332 ContainerNode::trace(visitor);
3332 } 3333 }
3333 3334
3334 } // namespace WebCore 3335 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698