| OLD | NEW |
| 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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| 11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
| 12 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
| 13 * | 13 * |
| 14 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Library General Public License for more details. | 17 * Library General Public License for more details. |
| 18 * | 18 * |
| 19 * You should have received a copy of the GNU Library General Public License | 19 * You should have received a copy of the GNU Library General Public License |
| 20 * along with this library; see the file COPYING.LIB. If not, write to | 20 * along with this library; see the file COPYING.LIB. If not, write to |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 * | 23 * |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/html/HTMLFormElement.h" | 26 #include "core/html/HTMLFormElement.h" |
| 27 | 27 |
| 28 #include <limits> |
| 28 #include "bindings/core/v8/RadioNodeListOrElement.h" | 29 #include "bindings/core/v8/RadioNodeListOrElement.h" |
| 29 #include "bindings/core/v8/ScriptController.h" | 30 #include "bindings/core/v8/ScriptController.h" |
| 30 #include "bindings/core/v8/ScriptEventListener.h" | 31 #include "bindings/core/v8/ScriptEventListener.h" |
| 31 #include "core/HTMLNames.h" | 32 #include "core/HTMLNames.h" |
| 32 #include "core/dom/Attribute.h" | 33 #include "core/dom/Attribute.h" |
| 33 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 34 #include "core/dom/ElementTraversal.h" | 35 #include "core/dom/ElementTraversal.h" |
| 35 #include "core/dom/NodeListsNodeData.h" | 36 #include "core/dom/NodeListsNodeData.h" |
| 36 #include "core/events/Event.h" | 37 #include "core/events/Event.h" |
| 37 #include "core/events/ScopedEventQueue.h" | 38 #include "core/events/ScopedEventQueue.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 #include "core/layout/LayoutObject.h" | 53 #include "core/layout/LayoutObject.h" |
| 53 #include "core/loader/FormSubmission.h" | 54 #include "core/loader/FormSubmission.h" |
| 54 #include "core/loader/FrameLoader.h" | 55 #include "core/loader/FrameLoader.h" |
| 55 #include "core/loader/FrameLoaderClient.h" | 56 #include "core/loader/FrameLoaderClient.h" |
| 56 #include "core/loader/MixedContentChecker.h" | 57 #include "core/loader/MixedContentChecker.h" |
| 57 #include "core/loader/NavigationScheduler.h" | 58 #include "core/loader/NavigationScheduler.h" |
| 58 #include "platform/UserGestureIndicator.h" | 59 #include "platform/UserGestureIndicator.h" |
| 59 #include "public/platform/WebInsecureRequestPolicy.h" | 60 #include "public/platform/WebInsecureRequestPolicy.h" |
| 60 #include "wtf/AutoReset.h" | 61 #include "wtf/AutoReset.h" |
| 61 #include "wtf/text/AtomicString.h" | 62 #include "wtf/text/AtomicString.h" |
| 62 #include <limits> | |
| 63 | 63 |
| 64 namespace blink { | 64 namespace blink { |
| 65 | 65 |
| 66 using namespace HTMLNames; | 66 using namespace HTMLNames; |
| 67 | 67 |
| 68 HTMLFormElement::HTMLFormElement(Document& document) | 68 HTMLFormElement::HTMLFormElement(Document& document) |
| 69 : HTMLElement(formTag, document), | 69 : HTMLElement(formTag, document), |
| 70 m_listedElementsAreDirty(false), | 70 m_listedElementsAreDirty(false), |
| 71 m_imageElementsAreDirty(false), | 71 m_imageElementsAreDirty(false), |
| 72 m_hasElementsAssociatedByParser(false), | 72 m_hasElementsAssociatedByParser(false), |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 for (const auto& element : listedElements()) { | 295 for (const auto& element : listedElements()) { |
| 296 if (element->isFormControlElement() && | 296 if (element->isFormControlElement() && |
| 297 toHTMLFormControlElement(element)->blocksFormSubmission()) { | 297 toHTMLFormControlElement(element)->blocksFormSubmission()) { |
| 298 UseCounter::count(document(), | 298 UseCounter::count(document(), |
| 299 UseCounter::FormSubmittedWithUnclosedFormControl); | 299 UseCounter::FormSubmittedWithUnclosedFormControl); |
| 300 if (RuntimeEnabledFeatures::unclosedFormControlIsInvalidEnabled()) { | 300 if (RuntimeEnabledFeatures::unclosedFormControlIsInvalidEnabled()) { |
| 301 String tagName = toHTMLFormControlElement(element)->tagName(); | 301 String tagName = toHTMLFormControlElement(element)->tagName(); |
| 302 document().addConsoleMessage(ConsoleMessage::create( | 302 document().addConsoleMessage(ConsoleMessage::create( |
| 303 SecurityMessageSource, ErrorMessageLevel, | 303 SecurityMessageSource, ErrorMessageLevel, |
| 304 "Form submission failed, as the <" + tagName + "> element named " | 304 "Form submission failed, as the <" + tagName + "> element named " |
| 305 "'" + element->name() + "' was implicitly closed by reaching " | 305 "'" + |
| 306 element->name() + |
| 307 "' was implicitly closed by reaching " |
| 306 "the end of the file. Please add an explicit end tag " | 308 "the end of the file. Please add an explicit end tag " |
| 307 "('</" + tagName + ">')")); | 309 "('</" + |
| 310 tagName + ">')")); |
| 308 dispatchEvent(Event::create(EventTypeNames::error)); | 311 dispatchEvent(Event::create(EventTypeNames::error)); |
| 309 return; | 312 return; |
| 310 } | 313 } |
| 311 } | 314 } |
| 312 } | 315 } |
| 313 | 316 |
| 314 bool skipValidation = !document().page() || noValidate(); | 317 bool skipValidation = !document().page() || noValidate(); |
| 315 DCHECK(event); | 318 DCHECK(event); |
| 316 if (submitButton && submitButton->formNoValidate()) | 319 if (submitButton && submitButton->formNoValidate()) |
| 317 skipValidation = true; | 320 skipValidation = true; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 for (const auto& control : listedElements()) { | 829 for (const auto& control : listedElements()) { |
| 827 if (!control->isFormControlElement()) | 830 if (!control->isFormControlElement()) |
| 828 continue; | 831 continue; |
| 829 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) | 832 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) |
| 830 toHTMLFormControlElement(control)->pseudoStateChanged( | 833 toHTMLFormControlElement(control)->pseudoStateChanged( |
| 831 CSSSelector::PseudoDefault); | 834 CSSSelector::PseudoDefault); |
| 832 } | 835 } |
| 833 } | 836 } |
| 834 | 837 |
| 835 } // namespace blink | 838 } // namespace blink |
| OLD | NEW |