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

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

Issue 1858163002: Rename inDocument() to inShadowIncludingDocument() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 || display == TABLE_COLUMN_GROUP || display == TABLE_COLUMN || display = = TABLE_CELL 142 || display == TABLE_COLUMN_GROUP || display == TABLE_COLUMN || display = = TABLE_CELL
143 || display == TABLE_CAPTION; 143 || display == TABLE_CAPTION;
144 144
145 return formIsTablePart; 145 return formIsTablePart;
146 } 146 }
147 147
148 Node::InsertionNotificationRequest HTMLFormElement::insertedInto(ContainerNode* insertionPoint) 148 Node::InsertionNotificationRequest HTMLFormElement::insertedInto(ContainerNode* insertionPoint)
149 { 149 {
150 HTMLElement::insertedInto(insertionPoint); 150 HTMLElement::insertedInto(insertionPoint);
151 logAddElementIfIsolatedWorldAndInDocument("form", methodAttr, actionAttr); 151 logAddElementIfIsolatedWorldAndInDocument("form", methodAttr, actionAttr);
152 if (insertionPoint->inDocument()) 152 if (insertionPoint->inShadowIncludingDocument())
153 this->document().didAssociateFormControl(this); 153 this->document().didAssociateFormControl(this);
154 return InsertionDone; 154 return InsertionDone;
155 } 155 }
156 156
157 template<class T> 157 template<class T>
158 void notifyFormRemovedFromTree(const T& elements, Node& root) 158 void notifyFormRemovedFromTree(const T& elements, Node& root)
159 { 159 {
160 for (const auto& element : elements) 160 for (const auto& element : elements)
161 element->formRemovedFromTree(root); 161 element->formRemovedFromTree(root);
162 } 162 }
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 // This function should be const conceptually. However we update some fields 598 // This function should be const conceptually. However we update some fields
599 // because of lazy evaluation. 599 // because of lazy evaluation.
600 const FormAssociatedElement::List& HTMLFormElement::associatedElements() const 600 const FormAssociatedElement::List& HTMLFormElement::associatedElements() const
601 { 601 {
602 if (!m_associatedElementsAreDirty) 602 if (!m_associatedElementsAreDirty)
603 return m_associatedElements; 603 return m_associatedElements;
604 HTMLFormElement* mutableThis = const_cast<HTMLFormElement*>(this); 604 HTMLFormElement* mutableThis = const_cast<HTMLFormElement*>(this);
605 Node* scope = mutableThis; 605 Node* scope = mutableThis;
606 if (m_hasElementsAssociatedByParser) 606 if (m_hasElementsAssociatedByParser)
607 scope = &NodeTraversal::highestAncestorOrSelf(*mutableThis); 607 scope = &NodeTraversal::highestAncestorOrSelf(*mutableThis);
608 if (inDocument() && m_hasElementsAssociatedByFormAttribute) 608 if (inShadowIncludingDocument() && m_hasElementsAssociatedByFormAttribute)
609 scope = &treeScope().rootNode(); 609 scope = &treeScope().rootNode();
610 ASSERT(scope); 610 ASSERT(scope);
611 collectAssociatedElements(*scope, mutableThis->m_associatedElements); 611 collectAssociatedElements(*scope, mutableThis->m_associatedElements);
612 mutableThis->m_associatedElementsAreDirty = false; 612 mutableThis->m_associatedElementsAreDirty = false;
613 return m_associatedElements; 613 return m_associatedElements;
614 } 614 }
615 615
616 void HTMLFormElement::collectImageElements(Node& root, HeapVector<Member<HTMLIma geElement>>& elements) 616 void HTMLFormElement::collectImageElements(Node& root, HeapVector<Member<HTMLIma geElement>>& elements)
617 { 617 {
618 elements.clear(); 618 elements.clear();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 { 832 {
833 for (const auto& control : associatedElements()) { 833 for (const auto& control : associatedElements()) {
834 if (!control->isFormControlElement()) 834 if (!control->isFormControlElement())
835 continue; 835 continue;
836 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 836 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
837 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 837 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
838 } 838 }
839 } 839 }
840 840
841 } // namespace blink 841 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698