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

Side by Side Diff: Source/core/html/HTMLFormElement.cpp

Issue 235113002: Oilpan: Remove guardRef and guardDeref from TreeScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 6 years, 7 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
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document) 78 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document)
79 { 79 {
80 UseCounter::count(document, UseCounter::FormElement); 80 UseCounter::count(document, UseCounter::FormElement);
81 return adoptRef(new HTMLFormElement(document)); 81 return adoptRef(new HTMLFormElement(document));
82 } 82 }
83 83
84 HTMLFormElement::~HTMLFormElement() 84 HTMLFormElement::~HTMLFormElement()
85 { 85 {
86 #if !ENABLE(OILPAN)
87 // With Oilpan, either removedFrom is called or the document and
88 // form controller are dead as well and there is no need to remove
89 // this form element from it.
86 document().formController().willDeleteForm(this); 90 document().formController().willDeleteForm(this);
91 #endif
87 } 92 }
88 93
89 bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style) 94 bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style)
90 { 95 {
91 if (!m_wasDemoted) 96 if (!m_wasDemoted)
92 return HTMLElement::rendererIsNeeded(style); 97 return HTMLElement::rendererIsNeeded(style);
93 98
94 ContainerNode* node = parentNode(); 99 ContainerNode* node = parentNode();
95 if (!node || !node->renderer()) 100 if (!node || !node->renderer())
96 return HTMLElement::rendererIsNeeded(style); 101 return HTMLElement::rendererIsNeeded(style);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Vector<HTMLImageElement*> images(imageElements()); 158 Vector<HTMLImageElement*> images(imageElements());
154 notifyFormRemovedFromTree(images, root); 159 notifyFormRemovedFromTree(images, root);
155 } else { 160 } else {
156 Vector<HTMLImageElement*> images; 161 Vector<HTMLImageElement*> images;
157 collectImageElements(insertionPoint->highestAncestorOrSelf(), images ); 162 collectImageElements(insertionPoint->highestAncestorOrSelf(), images );
158 notifyFormRemovedFromTree(images, root); 163 notifyFormRemovedFromTree(images, root);
159 collectImageElements(root, images); 164 collectImageElements(root, images);
160 notifyFormRemovedFromTree(images, root); 165 notifyFormRemovedFromTree(images, root);
161 } 166 }
162 } 167 }
168 #if ENABLE(OILPAN)
169 document().formController().willDeleteForm(this);
170 #endif
163 HTMLElement::removedFrom(insertionPoint); 171 HTMLElement::removedFrom(insertionPoint);
164 } 172 }
165 173
166 void HTMLFormElement::handleLocalEvents(Event* event) 174 void HTMLFormElement::handleLocalEvents(Event* event)
167 { 175 {
168 Node* targetNode = event->target()->toNode(); 176 Node* targetNode = event->target()->toNode();
169 if (event->eventPhase() != Event::CAPTURING_PHASE && targetNode && targetNod e != this && (event->type() == EventTypeNames::submit || event->type() == EventT ypeNames::reset)) { 177 if (event->eventPhase() != Event::CAPTURING_PHASE && targetNode && targetNod e != this && (event->type() == EventTypeNames::submit || event->type() == EventT ypeNames::reset)) {
170 event->stopPropagation(); 178 event->stopPropagation();
171 return; 179 return;
172 } 180 }
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 } 770 }
763 771
764 void HTMLFormElement::setDemoted(bool demoted) 772 void HTMLFormElement::setDemoted(bool demoted)
765 { 773 {
766 if (demoted) 774 if (demoted)
767 UseCounter::count(document(), UseCounter::DemotedFormElement); 775 UseCounter::count(document(), UseCounter::DemotedFormElement);
768 m_wasDemoted = demoted; 776 m_wasDemoted = demoted;
769 } 777 }
770 778
771 } // namespace 779 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698