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

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

Powered by Google App Engine
This is Rietveld 408576698