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 review comments. Created 6 years, 8 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 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 75 }
76 76
77 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document) 77 PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document& document)
78 { 78 {
79 UseCounter::count(document, UseCounter::FormElement); 79 UseCounter::count(document, UseCounter::FormElement);
80 return adoptRef(new HTMLFormElement(document)); 80 return adoptRef(new HTMLFormElement(document));
81 } 81 }
82 82
83 HTMLFormElement::~HTMLFormElement() 83 HTMLFormElement::~HTMLFormElement()
84 { 84 {
85 #if !ENABLE(OILPAN)
86 // With Oilpan, either removedFrom is called or the document and
87 // form controller are dead as well and there is no need to remove
88 // this form element from it.
85 document().formController().willDeleteForm(this); 89 document().formController().willDeleteForm(this);
wibling-chromium 2014/04/24 14:43:06 Perhaps augment the comment to say that in oilpan
Mads Ager (chromium) 2014/04/25 10:58:25 Yeah, I have moved this code to removedFrom. Based
90 #endif
86 } 91 }
87 92
88 bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style) 93 bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style)
89 { 94 {
90 if (!m_wasDemoted) 95 if (!m_wasDemoted)
91 return HTMLElement::rendererIsNeeded(style); 96 return HTMLElement::rendererIsNeeded(style);
92 97
93 ContainerNode* node = parentNode(); 98 ContainerNode* node = parentNode();
94 if (!node || !node->renderer()) 99 if (!node || !node->renderer())
95 return HTMLElement::rendererIsNeeded(style); 100 return HTMLElement::rendererIsNeeded(style);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 Vector<HTMLImageElement*> images(imageElements()); 157 Vector<HTMLImageElement*> images(imageElements());
153 notifyFormRemovedFromTree(images, root); 158 notifyFormRemovedFromTree(images, root);
154 } else { 159 } else {
155 Vector<HTMLImageElement*> images; 160 Vector<HTMLImageElement*> images;
156 collectImageElements(insertionPoint->highestAncestorOrSelf(), images ); 161 collectImageElements(insertionPoint->highestAncestorOrSelf(), images );
157 notifyFormRemovedFromTree(images, root); 162 notifyFormRemovedFromTree(images, root);
158 collectImageElements(root, images); 163 collectImageElements(root, images);
159 notifyFormRemovedFromTree(images, root); 164 notifyFormRemovedFromTree(images, root);
160 } 165 }
161 } 166 }
167 #if ENABLE(OILPAN)
168 document().formController().willDeleteForm(this);
169 #endif
162 HTMLElement::removedFrom(insertionPoint); 170 HTMLElement::removedFrom(insertionPoint);
163 } 171 }
164 172
165 void HTMLFormElement::handleLocalEvents(Event* event) 173 void HTMLFormElement::handleLocalEvents(Event* event)
166 { 174 {
167 Node* targetNode = event->target()->toNode(); 175 Node* targetNode = event->target()->toNode();
168 if (event->eventPhase() != Event::CAPTURING_PHASE && targetNode && targetNod e != this && (event->type() == EventTypeNames::submit || event->type() == EventT ypeNames::reset)) { 176 if (event->eventPhase() != Event::CAPTURING_PHASE && targetNode && targetNod e != this && (event->type() == EventTypeNames::submit || event->type() == EventT ypeNames::reset)) {
169 event->stopPropagation(); 177 event->stopPropagation();
170 return; 178 return;
171 } 179 }
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } 781 }
774 782
775 void HTMLFormElement::setDemoted(bool demoted) 783 void HTMLFormElement::setDemoted(bool demoted)
776 { 784 {
777 if (demoted) 785 if (demoted)
778 UseCounter::count(document(), UseCounter::DemotedFormElement); 786 UseCounter::count(document(), UseCounter::DemotedFormElement);
779 m_wasDemoted = demoted; 787 m_wasDemoted = demoted;
780 } 788 }
781 789
782 } // namespace 790 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698