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

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

Issue 15556003: Auto-generate V8HTMLFormElement::namedPropertyGetter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Introduce DoNotCheckJSProperty Created 7 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
« no previous file with comments | « Source/core/html/HTMLFormElement.h ('k') | Source/core/html/HTMLFormElement.idl » ('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 16 matching lines...) Expand all
27 27
28 #include <limits> 28 #include <limits>
29 #include "HTMLNames.h" 29 #include "HTMLNames.h"
30 #include "bindings/v8/ScriptController.h" 30 #include "bindings/v8/ScriptController.h"
31 #include "bindings/v8/ScriptEventListener.h" 31 #include "bindings/v8/ScriptEventListener.h"
32 #include "core/dom/Attribute.h" 32 #include "core/dom/Attribute.h"
33 #include "core/dom/AutocompleteErrorEvent.h" 33 #include "core/dom/AutocompleteErrorEvent.h"
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/dom/Event.h" 35 #include "core/dom/Event.h"
36 #include "core/dom/EventNames.h" 36 #include "core/dom/EventNames.h"
37 #include "core/dom/NamedNodesCollection.h"
37 #include "core/dom/NodeRenderingContext.h" 38 #include "core/dom/NodeRenderingContext.h"
38 #include "core/dom/NodeTraversal.h" 39 #include "core/dom/NodeTraversal.h"
39 #include "core/fileapi/FileList.h" 40 #include "core/fileapi/FileList.h"
40 #include "core/html/DOMFormData.h" 41 #include "core/html/DOMFormData.h"
41 #include "core/html/FormController.h" 42 #include "core/html/FormController.h"
42 #include "core/html/FormDataList.h" 43 #include "core/html/FormDataList.h"
43 #include "core/html/HTMLCollection.h" 44 #include "core/html/HTMLCollection.h"
44 #include "core/html/HTMLDocument.h" 45 #include "core/html/HTMLDocument.h"
45 #include "core/html/HTMLImageElement.h" 46 #include "core/html/HTMLImageElement.h"
46 #include "core/html/HTMLInputElement.h" 47 #include "core/html/HTMLInputElement.h"
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 HTMLElement::finishParsingChildren(); 701 HTMLElement::finishParsingChildren();
701 document()->formController()->restoreControlStateIn(*this); 702 document()->formController()->restoreControlStateIn(*this);
702 } 703 }
703 704
704 void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc e) 705 void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc e)
705 { 706 {
706 m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted; 707 m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted;
707 HTMLElement::copyNonAttributePropertiesFromElement(source); 708 HTMLElement::copyNonAttributePropertiesFromElement(source);
708 } 709 }
709 710
711 void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, RefPtr<Node List>& returnValue1, RefPtr<Node>& returnValue2)
712 {
713 // Call getNamedElements twice, first time check if it has a value
714 // and let HTMLFormElement update its cache.
715 // See issue: 867404
716 {
717 Vector<RefPtr<Node> > elements;
718 getNamedElements(name, elements);
719 if (elements.isEmpty())
720 return;
721 }
722
723 // Second call may return different results from the first call,
724 // but if the first the size cannot be zero.
725 Vector<RefPtr<Node> > elements;
726 getNamedElements(name, elements);
727 ASSERT(!elements.isEmpty());
728
729 if (elements.size() == 1) {
730 returnValue2 = elements.at(0);
731 return;
732 }
733
734 returnValue1 = NamedNodesCollection::create(elements);
735 }
736
710 } // namespace 737 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormElement.h ('k') | Source/core/html/HTMLFormElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698