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

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

Issue 2879063003: INPUT element: Stop saving/restoring values of input[type=hidden]. (Closed)
Patch Set: Created 3 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
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, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
9 * Copyright (C) 2010 Google Inc. All rights reserved. 9 * Copyright (C) 2010 Google Inc. All rights reserved.
10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 size_(kDefaultSize), 100 size_(kDefaultSize),
101 has_dirty_value_(false), 101 has_dirty_value_(false),
102 is_checked_(false), 102 is_checked_(false),
103 dirty_checkedness_(false), 103 dirty_checkedness_(false),
104 is_indeterminate_(false), 104 is_indeterminate_(false),
105 is_activated_submit_(false), 105 is_activated_submit_(false),
106 autocomplete_(kUninitialized), 106 autocomplete_(kUninitialized),
107 has_non_empty_list_(false), 107 has_non_empty_list_(false),
108 state_restored_(false), 108 state_restored_(false),
109 parsing_in_progress_(created_by_parser), 109 parsing_in_progress_(created_by_parser),
110 value_attribute_was_updated_after_parsing_(false),
111 can_receive_dropped_files_(false), 110 can_receive_dropped_files_(false),
112 should_reveal_password_(false), 111 should_reveal_password_(false),
113 needs_to_update_view_value_(true), 112 needs_to_update_view_value_(true),
114 is_placeholder_visible_(false), 113 is_placeholder_visible_(false),
115 // |m_inputType| is lazily created when constructed by the parser to avoid 114 // |m_inputType| is lazily created when constructed by the parser to avoid
116 // constructing unnecessarily a text inputType and its shadow subtree, 115 // constructing unnecessarily a text inputType and its shadow subtree,
117 // just to destroy them when the |type| attribute gets set by the parser 116 // just to destroy them when the |type| attribute gets set by the parser
118 // to something else than 'text'. 117 // to something else than 'text'.
119 input_type_(created_by_parser ? nullptr : InputType::CreateText(*this)), 118 input_type_(created_by_parser ? nullptr : InputType::CreateText(*this)),
120 input_type_view_(input_type_ ? input_type_->CreateView() : nullptr) { 119 input_type_view_(input_type_ ? input_type_->CreateView() : nullptr) {
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 if (!HasDirtyValue()) { 714 if (!HasDirtyValue()) {
716 if (input_type_->GetValueMode() == ValueMode::kValue) 715 if (input_type_->GetValueMode() == ValueMode::kValue)
717 non_attribute_value_ = SanitizeValue(value); 716 non_attribute_value_ = SanitizeValue(value);
718 UpdatePlaceholderVisibility(); 717 UpdatePlaceholderVisibility();
719 SetNeedsStyleRecalc( 718 SetNeedsStyleRecalc(
720 kSubtreeStyleChange, 719 kSubtreeStyleChange,
721 StyleChangeReasonForTracing::FromAttribute(valueAttr)); 720 StyleChangeReasonForTracing::FromAttribute(valueAttr));
722 } 721 }
723 needs_to_update_view_value_ = true; 722 needs_to_update_view_value_ = true;
724 SetNeedsValidityCheck(); 723 SetNeedsValidityCheck();
725 value_attribute_was_updated_after_parsing_ = !parsing_in_progress_;
726 input_type_->WarnIfValueIsInvalidAndElementIsVisible(value); 724 input_type_->WarnIfValueIsInvalidAndElementIsVisible(value);
727 input_type_->InRangeChanged(); 725 input_type_->InRangeChanged();
728 input_type_view_->ValueAttributeChanged(); 726 input_type_view_->ValueAttributeChanged();
729 } else if (name == checkedAttr) { 727 } else if (name == checkedAttr) {
730 // Another radio button in the same group might be checked by state 728 // Another radio button in the same group might be checked by state
731 // restore. We shouldn't call setChecked() even if this has the checked 729 // restore. We shouldn't call setChecked() even if this has the checked
732 // attribute. So, delay the setChecked() call until 730 // attribute. So, delay the setChecked() call until
733 // finishParsingChildren() is called if parsing is in progress. 731 // finishParsingChildren() is called if parsing is in progress.
734 if ((!parsing_in_progress_ || 732 if ((!parsing_in_progress_ ||
735 !GetDocument().GetFormController().HasFormStates()) && 733 !GetDocument().GetFormController().HasFormStates()) &&
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 1898
1901 bool HTMLInputElement::HasFallbackContent() const { 1899 bool HTMLInputElement::HasFallbackContent() const {
1902 return input_type_view_->HasFallbackContent(); 1900 return input_type_view_->HasFallbackContent();
1903 } 1901 }
1904 1902
1905 void HTMLInputElement::SetFilesFromPaths(const Vector<String>& paths) { 1903 void HTMLInputElement::SetFilesFromPaths(const Vector<String>& paths) {
1906 return input_type_->SetFilesFromPaths(paths); 1904 return input_type_->SetFilesFromPaths(paths);
1907 } 1905 }
1908 1906
1909 } // namespace blink 1907 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.h ('k') | third_party/WebKit/Source/core/html/forms/HiddenInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698