Skip to content

Commit

Permalink
Remove unused WebInputElement::SetEditingValue()
Browse files Browse the repository at this point in the history
BUG=777850

Change-Id: Ief2c03c3bbaac724c9c2d60725a8c5602d04e912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4197995
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1097718}
  • Loading branch information
pkotwicz authored and Chromium LUCI CQ committed Jan 27, 2023
1 parent ce2afd6 commit bdd5954
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 75 deletions.
6 changes: 0 additions & 6 deletions third_party/blink/public/web/web_input_element.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ class BLINK_EXPORT WebInputElement final : public WebFormControlElement {
void SetChecked(bool,
bool send_events = false,
WebAutofillState = WebAutofillState::kNotFilled);
// Sets the value inside the text field without being sanitized. Can't be
// used if a renderer doesn't exist or on a non text field type. Caret will
// be moved to the end.
// TODO(crbug.com/777850): Remove all references to SetEditingValue, as it's
// not used anymore.
void SetEditingValue(const WebString&);
bool IsValidValue(const WebString&) const;
bool IsChecked() const;
bool IsMultiple() const;
Expand Down
4 changes: 0 additions & 4 deletions third_party/blink/renderer/core/exported/web_input_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ int WebInputElement::size() const {
return ConstUnwrap<HTMLInputElement>()->size();
}

void WebInputElement::SetEditingValue(const WebString& value) {
Unwrap<HTMLInputElement>()->SetEditingValue(value);
}

bool WebInputElement::IsValidValue(const WebString& value) const {
return ConstUnwrap<HTMLInputElement>()->IsValidValue(value);
}
Expand Down
11 changes: 0 additions & 11 deletions third_party/blink/renderer/core/html/forms/html_input_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1205,17 +1205,6 @@ void HTMLInputElement::SetSuggestedValue(const String& value) {
input_type_view_->UpdateView();
}

void HTMLInputElement::SetEditingValue(const String& value) {
if (!GetLayoutObject() || !IsTextField())
return;
SetInnerEditorValue(value);
SubtreeHasChanged();

unsigned max = value.length();
SetSelectionRange(max, max);
DispatchInputEvent();
}

void HTMLInputElement::SetInnerEditorValue(const String& value) {
TextControlElement::SetInnerEditorValue(value);
needs_to_update_view_value_ = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ class CORE_EXPORT HTMLInputElement
// WebAutofillState::kNotFilled otherwise.
void SetSuggestedValue(const String& value) override;

void SetEditingValue(const String&);

ScriptValue valueAsDate(ScriptState* script_state) const;
void setValueAsDate(ScriptState* script_state,
const ScriptValue& value,
Expand Down
14 changes: 0 additions & 14 deletions third_party/blink/renderer/core/testing/internals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1808,20 +1808,6 @@ void Internals::setAutofilledValue(Element* element,
}
}

void Internals::setEditingValue(Element* element,
const String& value,
ExceptionState& exception_state) {
DCHECK(element);
auto* html_input_element = DynamicTo<HTMLInputElement>(element);
if (!html_input_element) {
exception_state.ThrowDOMException(DOMExceptionCode::kInvalidNodeTypeError,
"The element provided is not an INPUT.");
return;
}

html_input_element->SetEditingValue(value);
}

void Internals::setAutofilled(Element* element,
bool enabled,
ExceptionState& exception_state) {
Expand Down
1 change: 0 additions & 1 deletion third_party/blink/renderer/core/testing/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ class Internals final : public ScriptWrappable {
String suggestedValue(Element*, ExceptionState&);
void setSuggestedValue(Element*, const String&, ExceptionState&);
void setAutofilledValue(Element*, const String&, ExceptionState&);
void setEditingValue(Element* input_element, const String&, ExceptionState&);
void setAutofilled(Element*, bool enabled, ExceptionState&);
void setSelectionRangeForNumberType(Element* input_element,
uint32_t start,
Expand Down
1 change: 0 additions & 1 deletion third_party/blink/renderer/core/testing/internals.idl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
[RaisesException] DOMString suggestedValue(Element inputElement);
[RaisesException] void setSuggestedValue(Element inputElement, DOMString value);
[RaisesException] void setAutofilledValue(Element inputElement, DOMString value);
[RaisesException] void setEditingValue(Element inputElement, DOMString value);
[RaisesException] void setAutofilled(Element inputElement, boolean enabled);
[RaisesException] void setSelectionRangeForNumberType(Element inputElement, unsigned long start, unsigned long end);

Expand Down
36 changes: 0 additions & 36 deletions third_party/blink/web_tests/fast/forms/editing-value.html

This file was deleted.

0 comments on commit bdd5954

Please sign in to comment.