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

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

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
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 26 matching lines...) Expand all
37 : HTMLFormControlElement(tagName, doc, f) 37 : HTMLFormControlElement(tagName, doc, f)
38 { 38 {
39 } 39 }
40 40
41 HTMLFormControlElementWithState::~HTMLFormControlElementWithState() 41 HTMLFormControlElementWithState::~HTMLFormControlElementWithState()
42 { 42 {
43 } 43 }
44 44
45 Node::InsertionNotificationRequest HTMLFormControlElementWithState::insertedInto (ContainerNode* insertionPoint) 45 Node::InsertionNotificationRequest HTMLFormControlElementWithState::insertedInto (ContainerNode* insertionPoint)
46 { 46 {
47 if (insertionPoint->inShadowIncludingDocument() && !containingShadowRoot()) 47 if (insertionPoint->isConnected() && !containingShadowRoot())
48 document().formController().registerStatefulFormControl(*this); 48 document().formController().registerStatefulFormControl(*this);
49 return HTMLFormControlElement::insertedInto(insertionPoint); 49 return HTMLFormControlElement::insertedInto(insertionPoint);
50 } 50 }
51 51
52 void HTMLFormControlElementWithState::removedFrom(ContainerNode* insertionPoint) 52 void HTMLFormControlElementWithState::removedFrom(ContainerNode* insertionPoint)
53 { 53 {
54 if (insertionPoint->inShadowIncludingDocument() && !containingShadowRoot() & & !insertionPoint->containingShadowRoot()) 54 if (insertionPoint->isConnected() && !containingShadowRoot() && !insertionPo int->containingShadowRoot())
55 document().formController().unregisterStatefulFormControl(*this); 55 document().formController().unregisterStatefulFormControl(*this);
56 HTMLFormControlElement::removedFrom(insertionPoint); 56 HTMLFormControlElement::removedFrom(insertionPoint);
57 } 57 }
58 58
59 bool HTMLFormControlElementWithState::shouldAutocomplete() const 59 bool HTMLFormControlElementWithState::shouldAutocomplete() const
60 { 60 {
61 if (!form()) 61 if (!form())
62 return true; 62 return true;
63 return form()->shouldAutocomplete(); 63 return form()->shouldAutocomplete();
64 } 64 }
65 65
66 void HTMLFormControlElementWithState::notifyFormStateChanged() 66 void HTMLFormControlElementWithState::notifyFormStateChanged()
67 { 67 {
68 // This can be called during fragment parsing as a result of option 68 // This can be called during fragment parsing as a result of option
69 // selection before the document is active (or even in a frame). 69 // selection before the document is active (or even in a frame).
70 if (!document().isActive()) 70 if (!document().isActive())
71 return; 71 return;
72 document().frame()->loader().client()->didUpdateCurrentHistoryItem(); 72 document().frame()->loader().client()->didUpdateCurrentHistoryItem();
73 } 73 }
74 74
75 bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() con st 75 bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() con st
76 { 76 {
77 // We don't save/restore control state in a form with autocomplete=off. 77 // We don't save/restore control state in a form with autocomplete=off.
78 return inShadowIncludingDocument() && shouldAutocomplete(); 78 return isConnected() && shouldAutocomplete();
79 } 79 }
80 80
81 FormControlState HTMLFormControlElementWithState::saveFormControlState() const 81 FormControlState HTMLFormControlElementWithState::saveFormControlState() const
82 { 82 {
83 return FormControlState(); 83 return FormControlState();
84 } 84 }
85 85
86 void HTMLFormControlElementWithState::finishParsingChildren() 86 void HTMLFormControlElementWithState::finishParsingChildren()
87 { 87 {
88 HTMLFormControlElement::finishParsingChildren(); 88 HTMLFormControlElement::finishParsingChildren();
89 document().formController().restoreControlStateFor(*this); 89 document().formController().restoreControlStateFor(*this);
90 } 90 }
91 91
92 bool HTMLFormControlElementWithState::isFormControlElementWithState() const 92 bool HTMLFormControlElementWithState::isFormControlElementWithState() const
93 { 93 {
94 return true; 94 return true;
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698