-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Blink] Move FormControlType enum to //third_party/blink/public/common
Before this CL, HTMLFormControlElement::FormControlType() returned an AtomicString and WebFormControlElement::FormControlType() mapped that string an enum defined in web_form_control_element.h. This CL moves the enum to //third_party/blink/public/common. The main goal is to make the enum visible in ContextMenuData and other context-menu-related classes. This CL also eliminates the large if-statement in WebFormControlElement::FormControlType() and instead returns an enum in HTMLFormControlElement::FormControlType(). Bug: 1491569, 1482526, 1484810 Change-Id: I6075445059cfcdd8b60286ecd6507a9a6d0ed6e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4927529 Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Commit-Queue: Christoph Schwering <schwering@google.com> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1209345}
- Loading branch information
Showing
75 changed files
with
393 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_FORMS_FORM_CONTROL_TYPE_H_ | ||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_FORMS_FORM_CONTROL_TYPE_H_ | ||
|
||
#include <cstdint> | ||
|
||
namespace blink { | ||
|
||
// An enum representation of the values of the `type` attribute of form control | ||
// elements. This list is exhaustive. | ||
enum class FormControlType : uint8_t { | ||
// https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type | ||
kButtonButton, | ||
kButtonSubmit, | ||
kButtonReset, | ||
kButtonSelectList, | ||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-fieldset-type | ||
kFieldset, | ||
// https://html.spec.whatwg.org/multipage/input.html#attr-input-type | ||
kInputButton, | ||
kInputCheckbox, | ||
kInputColor, | ||
kInputDate, | ||
kInputDatetimeLocal, | ||
kInputEmail, | ||
kInputFile, | ||
kInputHidden, | ||
kInputImage, | ||
kInputMonth, | ||
kInputNumber, | ||
kInputPassword, | ||
kInputRadio, | ||
kInputRange, | ||
kInputReset, | ||
kInputSearch, | ||
kInputSubmit, | ||
kInputTelephone, | ||
kInputText, | ||
kInputTime, | ||
kInputUrl, | ||
kInputWeek, | ||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-output-type | ||
kOutput, | ||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-type | ||
kSelectOne, | ||
kSelectMultiple, | ||
kSelectList, | ||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-type | ||
kTextArea, | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_FORMS_FORM_CONTROL_TYPE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.