Make FormControlRange containers null and use element-based creation API [chromium/src : main]

0 views
Skip to first unread message

Stephanie Zhang (Gerrit)

unread,
Jan 7, 2026, 12:49:00 PMJan 7
to Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Stephanie Zhang

Message from Stephanie Zhang

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • Stephanie Zhang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
Gerrit-Change-Number: 7409955
Gerrit-PatchSet: 2
Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Comment-Date: Wed, 07 Jan 2026 17:48:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stephanie Zhang (Gerrit)

unread,
Jan 7, 2026, 12:49:13 PMJan 7
to Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org

Stephanie Zhang added 1 comment

File third_party/blink/renderer/core/dom/form_control_range_test.cc
Line 83, Patchset 1 (Parent):TEST_F(FormControlRangeTest, InvalidOffsetPreservesState) {
SetBodyContent("<textarea>Hello</textarea>");
auto* textarea = GetDocument().body()->firstElementChild();
auto* range = FormControlRange::Create(GetDocument());

// First set up a valid range.
DummyExceptionStateForTesting valid_exception_state;
range->setFormControlRange(textarea, 1, 4, valid_exception_state);
EXPECT_FALSE(valid_exception_state.HadException());
EXPECT_EQ(range->toString(), "ell");
EXPECT_EQ(range->startOffset(), 1u);
EXPECT_EQ(range->endOffset(), 4u);

// Setting out-of-bounds offsets should fail and preserve previous state.
DummyExceptionStateForTesting invalid_exception_state;
range->setFormControlRange(textarea, 10, 15, invalid_exception_state);
EXPECT_TRUE(invalid_exception_state.HadException());
EXPECT_EQ(invalid_exception_state.CodeAs<DOMExceptionCode>(),
DOMExceptionCode::kIndexSizeError);
EXPECT_EQ(range->toString(), "ell");
EXPECT_EQ(range->startOffset(), 1u);
EXPECT_EQ(range->endOffset(), 4u);
EXPECT_EQ(range->startContainer(), textarea);
EXPECT_EQ(range->endContainer(), textarea);
}

TEST_F(FormControlRangeTest, BackwardsRangesAutoCollapse) {
SetBodyContent("<textarea>Hello</textarea>");
auto* textarea = GetDocument().body()->firstElementChild();
auto* range = FormControlRange::Create(GetDocument());

// Backwards range should auto-collapse to [start, start].
DummyExceptionStateForTesting exception_state;
range->setFormControlRange(textarea, 4, 1, exception_state);
EXPECT_FALSE(exception_state.HadException());
EXPECT_EQ(range->startOffset(), 4u);
EXPECT_EQ(range->endOffset(), 4u);
EXPECT_TRUE(range->collapsed());
EXPECT_EQ(range->toString(), "");
}

class FormControlRangeElementTest
: public FormControlRangeTest,
public testing::WithParamInterface<std::tuple<const char*, bool>> {};

TEST_P(FormControlRangeElementTest, SetFormControlRangeElements) {
const auto& [html, should_be_valid] = GetParam();
SetBodyContent(html);
auto* element = GetDocument().body()->firstElementChild();
auto* range = FormControlRange::Create(GetDocument());

DummyExceptionStateForTesting exception_state;
range->setFormControlRange(element, 0, 4, exception_state);

EXPECT_EQ(exception_state.HadException(), !should_be_valid);
if (should_be_valid) {
EXPECT_FALSE(exception_state.HadException());
EXPECT_EQ(range->startContainer(), element);
EXPECT_EQ(range->endContainer(), element);
EXPECT_EQ(range->startOffset(), 0u);
EXPECT_EQ(range->endOffset(), 4u);
EXPECT_FALSE(range->collapsed());
EXPECT_EQ(range->toString(), "Test");
} else {
EXPECT_EQ(exception_state.CodeAs<DOMExceptionCode>(),
DOMExceptionCode::kNotSupportedError);
}
}

INSTANTIATE_TEST_SUITE_P(
FormControlElements,
FormControlRangeElementTest,
testing::Values(
std::make_tuple("<textarea>Test</textarea>", true),
std::make_tuple("<input type='text' value='Test'>", true),
std::make_tuple("<input type='search' value='Test'>", true),
std::make_tuple("<input type='password' value='Test'>", true),
std::make_tuple("<input type='url' value='Test'>", true),
std::make_tuple("<input type='tel' value='Test'>", true),
std::make_tuple("<div>Test</div>", false),
std::make_tuple("<div contenteditable>Test</div>", false),
std::make_tuple("<input type='checkbox'>", false),
std::make_tuple("<input type='radio'>", false),
std::make_tuple("<input type='submit'>", false),
std::make_tuple("<input type='button'>", false),
std::make_tuple("<select><option>Test</option></select>", false)));

struct OffsetTestCase {
unsigned start_offset;
unsigned end_offset;
bool should_be_valid;
std::optional<const char*> expected_text;
std::optional<unsigned> expected_start;
std::optional<unsigned> expected_end;
std::optional<bool> expected_collapsed;
};

class FormControlRangeOffsetTest
: public FormControlRangeTest,
public testing::WithParamInterface<OffsetTestCase> {};

TEST_P(FormControlRangeOffsetTest, OffsetValidation) {
SetBodyContent("<textarea>Hello</textarea>");
auto* textarea = GetDocument().body()->firstElementChild();
auto* range = FormControlRange::Create(GetDocument());

DummyExceptionStateForTesting exception_state;
range->setFormControlRange(textarea, GetParam().start_offset,
GetParam().end_offset, exception_state);

EXPECT_EQ(exception_state.HadException(), !GetParam().should_be_valid);

if (GetParam().should_be_valid) {
EXPECT_FALSE(exception_state.HadException());
if (GetParam().expected_text.has_value()) {
EXPECT_EQ(range->toString(), GetParam().expected_text.value());
}
if (GetParam().expected_start.has_value()) {
EXPECT_EQ(range->startOffset(), GetParam().expected_start.value());
}
if (GetParam().expected_end.has_value()) {
EXPECT_EQ(range->endOffset(), GetParam().expected_end.value());
}
if (GetParam().expected_collapsed.has_value()) {
EXPECT_EQ(range->collapsed(), GetParam().expected_collapsed.value());
}
} else {
EXPECT_TRUE(exception_state.HadException());
EXPECT_EQ(exception_state.CodeAs<DOMExceptionCode>(),
DOMExceptionCode::kIndexSizeError);
}
}

INSTANTIATE_TEST_SUITE_P(
OffsetCombinations,
FormControlRangeOffsetTest,
testing::Values(
// Valid forward ranges with expected text.
OffsetTestCase{0, 5, true, "Hello", 0, 5, false},
OffsetTestCase{0, 0, true, "", 0, 0, true},
OffsetTestCase{5, 5, true, "", 5, 5, true},
OffsetTestCase{1, 4, true, "ell", 1, 4, false},
OffsetTestCase{0, 1, true, "H", 0, 1, false},

// Backwards ranges that should auto-collapse but not throw.
OffsetTestCase{5, 2, true, "", 5, 5, true},
OffsetTestCase{4, 1, true, "", 4, 4, true},
OffsetTestCase{3, 0, true, "", 3, 3, true},

// Invalid cases - out of bounds.
OffsetTestCase{0, 10, false}, // end > value length.
OffsetTestCase{10, 15, false}, // both offsets > value length.
OffsetTestCase{6, 6, false}, // start at boundary but > value length.
OffsetTestCase{3, 8, false}, // start valid but end > value length.
OffsetTestCase{7, 10, false} // both start and end > value length.
));
Stephanie Zhang . resolved

Deleted tests that were redundant with the wpt tests ([previous CL feedback](https://chromium-review.googlesource.com/c/chromium/src/+/6876353/comment/62bb7551_b5a360f4/))

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
Gerrit-Change-Number: 7409955
Gerrit-PatchSet: 2
Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Comment-Date: Wed, 07 Jan 2026 17:49:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Stephanie Zhang (Gerrit)

unread,
Feb 3, 2026, 4:48:14 PM (8 days ago) Feb 3
to Ana Sollano Kim, Dan Clark, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Ana Sollano Kim and Dan Clark

Stephanie Zhang added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Stephanie Zhang . resolved

PTAL - thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Ana Sollano Kim
  • Dan Clark
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
Gerrit-Change-Number: 7409955
Gerrit-PatchSet: 7
Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
Gerrit-Attention: Dan Clark <dan...@microsoft.com>
Gerrit-Comment-Date: Tue, 03 Feb 2026 21:48:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ana Sollano Kim (Gerrit)

unread,
Feb 3, 2026, 7:38:31 PM (8 days ago) Feb 3
to Stephanie Zhang, Dan Clark, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Dan Clark and Stephanie Zhang

Ana Sollano Kim added 2 comments

File third_party/blink/renderer/core/dom/form_control_range.cc
Line 173, Patchset 7 (Latest): // TODO: Aggregate text when it spans multiple nodes.
Ana Sollano Kim . unresolved

Not a change in this patch but do you think it's worth having an open task to track this work?

File third_party/blink/renderer/core/html/forms/html_input_element.cc
Line 2231, Patchset 7 (Latest): if (!InputSupportsSelectionAPI()) {
Ana Sollano Kim . unresolved

Should we also check that the feature is enabled?

Open in Gerrit

Related details

Attention is currently required from:
  • Dan Clark
  • Stephanie Zhang
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
    Gerrit-Change-Number: 7409955
    Gerrit-PatchSet: 7
    Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
    Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
    Gerrit-Attention: Dan Clark <dan...@microsoft.com>
    Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 00:38:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dan Clark (Gerrit)

    unread,
    Feb 6, 2026, 1:34:39 PM (5 days ago) Feb 6
    to Stephanie Zhang, Ana Sollano Kim, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Stephanie Zhang

    Dan Clark added 14 comments

    Patchset-level comments
    Dan Clark . resolved

    I like this API shape much better. Mostly just had small things/nitpicks.

    File third_party/blink/renderer/core/dom/abstract_range.idl
    Line 6, Patchset 7 (Latest):
    Dan Clark . unresolved

    It'd be good to have a comment here linking to the crbug for this feature that explains why this interface no longer aligns with the spec.

    File third_party/blink/renderer/core/dom/form_control_range.h
    Line 21, Patchset 7 (Latest):// A live range over a text-control element (<input>, <textarea>) or custom
    Dan Clark . unresolved

    nit: I wouldn't say "or custom element" yet, until that's something we actually support.

    File third_party/blink/renderer/core/dom/form_control_range.cc
    Line 37, Patchset 7 (Latest): CHECK(element);
    Dan Clark . unresolved

    This is a subjective nitpick that you are welcome to ignore: I find not-null `CHECK`s in scenarios like this redundant. By using `element` on the next line without a null-check we're already implying that we expect it to never be null, and if it ever were null that line would crash safely. So the `CHECK` doesn't really add anything either semantically or for runtime safety.

    Line 173, Patchset 7 (Latest): // TODO: Aggregate text when it spans multiple nodes.
    Ana Sollano Kim . unresolved

    Not a change in this patch but do you think it's worth having an open task to track this work?

    Dan Clark

    Is adding support for non-form elements currently planned, or just something that we're future-proofing the API shape to potentially let us do in the future? If we're not actively planning to work on it, I wouldn't add this TODO at all.

    If we're definitely planning to work on it though then I agree with Ana's suggestion to track in a bug/task.

    File third_party/blink/renderer/core/html/forms/html_input_element.cc
    Line 2231, Patchset 7 (Latest): if (!InputSupportsSelectionAPI()) {
    Ana Sollano Kim . unresolved

    Should we also check that the feature is enabled?

    Dan Clark

    +1, `CHECK(RuntimeEnabledFeatures::FormControlRangeEnabled())` is reasonable here.

    File third_party/blink/renderer/core/html/forms/text_control_element.cc
    Line 1336, Patchset 7 (Latest): if (!RuntimeEnabledFeatures::FormControlRangeEnabled()) {
    Dan Clark . unresolved

    Instead let's `CHECK(RuntimeEnabledFeatures::FormControlRangeEnabled())`, since the `RuntimeEnabled=FormControlRange` the IDL will protect against this case.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-geometry-complexity-and-visibility.html
    Line 42, Patchset 7 (Latest):function setupFormControlRange(element, startOffset, endOffset) {
    Dan Clark . unresolved

    Consider getting rid of this helper. It doesn't shorten anything now; the caller can just do `element.getValueRange(startOffset, endOffset)` directly.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-geometry-multiline-and-mutations.html
    Line 30, Patchset 7 (Latest):function setupFormControlRange(element, startOffset, endOffset){
    Dan Clark . unresolved

    Helper can be removed, caller can just call this directly.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-interactive-basic.html
    Line 27, Patchset 7 (Latest): return element.getValueRange(start, end);
    Dan Clark . unresolved

    Helper can be removed, caller can just call this directly.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-interactive-overlap-and-selection.html
    Line 27, Patchset 7 (Latest): return element.getValueRange(start, end);
    Dan Clark . unresolved

    Helper can be removed, caller can just call this directly.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-programmatic-updates.html
    Line 26, Patchset 7 (Latest): return element.getValueRange(start, end);
    Dan Clark . unresolved

    Helper can be removed, caller can just call this directly.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-unsupported-elements.html
    Line 35, Patchset 7 (Latest): const div = document.createElement('div');
    Dan Clark . unresolved

    This subtest could be improved to check this for all of `HTML5_ELEMENTS` (skipping `<input>`/`<textarea>`).

    Alternatively, just delete this subtest; I don't think a test that the method doesn't exist on arbitrary interfaces is particularly useful.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-update-event-order.html
    Line 29, Patchset 7 (Latest): return element.getValueRange(start, end);
    Dan Clark . unresolved

    Helper can be removed, caller can just call this directly.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Stephanie Zhang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
    Gerrit-Change-Number: 7409955
    Gerrit-PatchSet: 7
    Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
    Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
    Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
    Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
    Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
    Gerrit-Comment-Date: Fri, 06 Feb 2026 18:34:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Ana Sollano Kim <anso...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Stephanie Zhang (Gerrit)

    unread,
    Feb 6, 2026, 6:05:29 PM (5 days ago) Feb 6
    to Ana Sollano Kim, Dan Clark, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Ana Sollano Kim and Dan Clark

    Stephanie Zhang added 13 comments

    File third_party/blink/renderer/core/dom/abstract_range.idl
    Line 6, Patchset 7:
    Dan Clark . resolved

    It'd be good to have a comment here linking to the crbug for this feature that explains why this interface no longer aligns with the spec.

    Stephanie Zhang

    Done

    File third_party/blink/renderer/core/dom/form_control_range.h
    Line 21, Patchset 7:// A live range over a text-control element (<input>, <textarea>) or custom
    Dan Clark . resolved

    nit: I wouldn't say "or custom element" yet, until that's something we actually support.

    Stephanie Zhang

    Done

    File third_party/blink/renderer/core/dom/form_control_range.cc
    Line 37, Patchset 7: CHECK(element);
    Dan Clark . resolved

    This is a subjective nitpick that you are welcome to ignore: I find not-null `CHECK`s in scenarios like this redundant. By using `element` on the next line without a null-check we're already implying that we expect it to never be null, and if it ever were null that line would crash safely. So the `CHECK` doesn't really add anything either semantically or for runtime safety.

    Stephanie Zhang

    Good point - removed.

    Line 173, Patchset 7: // TODO: Aggregate text when it spans multiple nodes.
    Ana Sollano Kim . resolved

    Not a change in this patch but do you think it's worth having an open task to track this work?

    Dan Clark

    Is adding support for non-form elements currently planned, or just something that we're future-proofing the API shape to potentially let us do in the future? If we're not actively planning to work on it, I wouldn't add this TODO at all.

    If we're definitely planning to work on it though then I agree with Ana's suggestion to track in a bug/task.

    Stephanie Zhang

    This TODO is about a different issue that Mason flagged in this CL (https://chromium-review.googlesource.com/c/chromium/src/+/7013433/comment/5c8ae0e5_3dca3756/): the inner editor can have multiple text nodes, but we only use the first one for geometry.
    Added crbug.com/482337697 to track it.

    File third_party/blink/renderer/core/html/forms/html_input_element.cc
    Line 2231, Patchset 7: if (!InputSupportsSelectionAPI()) {
    Ana Sollano Kim . resolved

    Should we also check that the feature is enabled?

    Dan Clark

    +1, `CHECK(RuntimeEnabledFeatures::FormControlRangeEnabled())` is reasonable here.

    Stephanie Zhang

    Good call - done.

    File third_party/blink/renderer/core/html/forms/text_control_element.cc
    Line 1336, Patchset 7: if (!RuntimeEnabledFeatures::FormControlRangeEnabled()) {
    Dan Clark . resolved

    Instead let's `CHECK(RuntimeEnabledFeatures::FormControlRangeEnabled())`, since the `RuntimeEnabled=FormControlRange` the IDL will protect against this case.

    Stephanie Zhang

    Done

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-geometry-complexity-and-visibility.html
    Line 42, Patchset 7:function setupFormControlRange(element, startOffset, endOffset) {
    Dan Clark . resolved

    Consider getting rid of this helper. It doesn't shorten anything now; the caller can just do `element.getValueRange(startOffset, endOffset)` directly.

    Stephanie Zhang

    Done

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-geometry-multiline-and-mutations.html
    Line 30, Patchset 7:function setupFormControlRange(element, startOffset, endOffset){
    Dan Clark . resolved

    Helper can be removed, caller can just call this directly.

    Stephanie Zhang

    Done

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-interactive-basic.html
    Line 27, Patchset 7: return element.getValueRange(start, end);
    Dan Clark . resolved

    Helper can be removed, caller can just call this directly.

    Stephanie Zhang

    Done

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-interactive-overlap-and-selection.html
    Line 27, Patchset 7: return element.getValueRange(start, end);
    Dan Clark . resolved

    Helper can be removed, caller can just call this directly.

    Stephanie Zhang

    Done

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-programmatic-updates.html
    Line 26, Patchset 7: return element.getValueRange(start, end);
    Dan Clark . resolved

    Helper can be removed, caller can just call this directly.

    Stephanie Zhang

    Done

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-unsupported-elements.html
    Line 35, Patchset 7: const div = document.createElement('div');
    Dan Clark . resolved

    This subtest could be improved to check this for all of `HTML5_ELEMENTS` (skipping `<input>`/`<textarea>`).

    Alternatively, just delete this subtest; I don't think a test that the method doesn't exist on arbitrary interfaces is particularly useful.

    Stephanie Zhang

    Agreed - deleted the subtest.

    File third_party/blink/web_tests/external/wpt/dom/ranges/tentative/FormControlRange-update-event-order.html
    Line 29, Patchset 7: return element.getValueRange(start, end);
    Dan Clark . resolved

    Helper can be removed, caller can just call this directly.

    Stephanie Zhang

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Ana Sollano Kim
    • Dan Clark
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
      Gerrit-Change-Number: 7409955
      Gerrit-PatchSet: 8
      Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Attention: Dan Clark <dan...@microsoft.com>
      Gerrit-Comment-Date: Fri, 06 Feb 2026 23:05:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Ana Sollano Kim <anso...@microsoft.com>
      Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Stephanie Zhang (Gerrit)

      unread,
      Feb 6, 2026, 6:06:01 PM (5 days ago) Feb 6
      to Mason Freed, Ana Sollano Kim, Dan Clark, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Ana Sollano Kim, Dan Clark and Mason Freed

      Stephanie Zhang added 1 comment

      Patchset-level comments
      File-level comment, Patchset 8 (Latest):
      Stephanie Zhang . resolved

      PTAL - thank you!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ana Sollano Kim
      • Dan Clark
      • Mason Freed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
      Gerrit-Change-Number: 7409955
      Gerrit-PatchSet: 8
      Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Attention: Dan Clark <dan...@microsoft.com>
      Gerrit-Comment-Date: Fri, 06 Feb 2026 23:05:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dan Clark (Gerrit)

      unread,
      Feb 6, 2026, 6:39:05 PM (5 days ago) Feb 6
      to Stephanie Zhang, Mason Freed, Ana Sollano Kim, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Ana Sollano Kim, Mason Freed and Stephanie Zhang

      Dan Clark voted and added 2 comments

      Votes added by Dan Clark

      Code-Review+1

      2 comments

      Patchset-level comments
      Dan Clark . resolved

      LGTM

      File third_party/blink/renderer/core/dom/form_control_range.cc
      Line 173, Patchset 7: // TODO: Aggregate text when it spans multiple nodes.
      Ana Sollano Kim . resolved

      Not a change in this patch but do you think it's worth having an open task to track this work?

      Dan Clark

      Is adding support for non-form elements currently planned, or just something that we're future-proofing the API shape to potentially let us do in the future? If we're not actively planning to work on it, I wouldn't add this TODO at all.

      If we're definitely planning to work on it though then I agree with Ana's suggestion to track in a bug/task.

      Stephanie Zhang

      This TODO is about a different issue that Mason flagged in this CL (https://chromium-review.googlesource.com/c/chromium/src/+/7013433/comment/5c8ae0e5_3dca3756/): the inner editor can have multiple text nodes, but we only use the first one for geometry.
      Added crbug.com/482337697 to track it.

      Dan Clark

      Ah, I see! Thanks for filing that and linking the bug.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Ana Sollano Kim
      • Mason Freed
      • Stephanie Zhang
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
      Gerrit-Change-Number: 7409955
      Gerrit-PatchSet: 8
      Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
      Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
      Gerrit-Comment-Date: Fri, 06 Feb 2026 23:38:56 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ana Sollano Kim <anso...@microsoft.com>
      Comment-In-Reply-To: Dan Clark <dan...@microsoft.com>
      Comment-In-Reply-To: Stephanie Zhang <stephan...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Ana Sollano Kim (Gerrit)

      unread,
      Feb 6, 2026, 6:46:54 PM (5 days ago) Feb 6
      to Stephanie Zhang, Dan Clark, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Mason Freed and Stephanie Zhang

      Ana Sollano Kim voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      • Stephanie Zhang
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
        Gerrit-Change-Number: 7409955
        Gerrit-PatchSet: 8
        Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
        Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
        Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
        Gerrit-Comment-Date: Fri, 06 Feb 2026 23:46:43 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        Feb 10, 2026, 12:53:12 PM (yesterday) Feb 10
        to Stephanie Zhang, Ana Sollano Kim, Dan Clark, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Stephanie Zhang

        Mason Freed added 5 comments

        Patchset-level comments
        Mason Freed . resolved

        Looks good to me. But with `setFormControlRange` removed, I think there might be a big tree of code that can also be deleted. Correct me if I'm wrong!

        File third_party/blink/renderer/core/dom/abstract_range.idl
        Line 8, Patchset 8 (Latest):// to hide internal DOM structure.
        Mason Freed . unresolved

        Perhaps add that it only does that when the feature flag is enabled?

        File third_party/blink/renderer/core/html/forms/html_input_element.idl
        Line 100, Patchset 8 (Latest): [RaisesException, RuntimeEnabled=FormControlRange]
        FormControlRange getValueRange(unsigned long start, unsigned long end);
        File third_party/blink/renderer/core/html/forms/text_control_element.h
        Line 364, Patchset 8 (Latest): // Holds FormControlRange instances that observe this text control.
        HeapVector<Member<FormControlRange>> form_control_ranges_;
        Mason Freed . unresolved

        ditto - still used somewhere? (Other than tests?)

        Line 198, Patchset 8 (Latest): // Register/unregister ranges that need to be notified of value changes.
        void RegisterFormControlRange(FormControlRange* range);
        void UnregisterFormControlRange(FormControlRange* range);
        Mason Freed . unresolved

        Are these called by anyone now?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Stephanie Zhang
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
          Gerrit-Change-Number: 7409955
          Gerrit-PatchSet: 8
          Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
          Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
          Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
          Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
          Gerrit-Comment-Date: Tue, 10 Feb 2026 17:53:02 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Stephanie Zhang (Gerrit)

          unread,
          Feb 10, 2026, 2:36:42 PM (yesterday) Feb 10
          to Ana Sollano Kim, Dan Clark, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
          Attention needed from Ana Sollano Kim, Dan Clark and Mason Freed

          Stephanie Zhang added 4 comments

          File third_party/blink/renderer/core/dom/abstract_range.idl
          Line 8, Patchset 8:// to hide internal DOM structure.
          Mason Freed . resolved

          Perhaps add that it only does that when the feature flag is enabled?

          Stephanie Zhang

          Done

          File third_party/blink/renderer/core/html/forms/html_input_element.idl
          Line 100, Patchset 8: [RaisesException, RuntimeEnabled=FormControlRange]

          FormControlRange getValueRange(unsigned long start, unsigned long end);
          Mason Freed . resolved
          Stephanie Zhang

          Added in `form_control_range.idl`- thanks!

          File third_party/blink/renderer/core/html/forms/text_control_element.h
          Line 364, Patchset 8: // Holds FormControlRange instances that observe this text control.
          HeapVector<Member<FormControlRange>> form_control_ranges_;
          Mason Freed . resolved

          ditto - still used somewhere? (Other than tests?)

          Stephanie Zhang

          Since Register/UnregisterFormControlRange() is being kept, it's still needed.

          Line 198, Patchset 8: // Register/unregister ranges that need to be notified of value changes.

          void RegisterFormControlRange(FormControlRange* range);
          void UnregisterFormControlRange(FormControlRange* range);
          Mason Freed . resolved

          Are these called by anyone now?

          Stephanie Zhang

          RegisterFormControlRange is still being used in the FormControlRange constructor to add the range to the element's set of associated ranges. UnregisterFormControlRange will be used in a follow-up CL implementing element removing steps (still ongoing spec discussions).

          Added unregistering/detaching ranges to the CL description as a follow-up CL.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ana Sollano Kim
          • Dan Clark
          • Mason Freed
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
            Gerrit-Change-Number: 7409955
            Gerrit-PatchSet: 10
            Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
            Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
            Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
            Gerrit-Attention: Mason Freed <mas...@chromium.org>
            Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
            Gerrit-Attention: Dan Clark <dan...@microsoft.com>
            Gerrit-Comment-Date: Tue, 10 Feb 2026 19:36:33 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Mason Freed (Gerrit)

            unread,
            4:24 PM (7 hours ago) 4:24 PM
            to Stephanie Zhang, Ana Sollano Kim, Dan Clark, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
            Attention needed from Ana Sollano Kim, Dan Clark and Stephanie Zhang

            Mason Freed voted and added 2 comments

            Votes added by Mason Freed

            Code-Review+1

            2 comments

            Patchset-level comments
            File-level comment, Patchset 11 (Latest):
            Mason Freed . resolved

            LGTM, thanks!

            File third_party/blink/renderer/core/html/forms/text_control_element.h
            Line 198, Patchset 8: // Register/unregister ranges that need to be notified of value changes.
            void RegisterFormControlRange(FormControlRange* range);
            void UnregisterFormControlRange(FormControlRange* range);
            Mason Freed . resolved

            Are these called by anyone now?

            Stephanie Zhang

            RegisterFormControlRange is still being used in the FormControlRange constructor to add the range to the element's set of associated ranges. UnregisterFormControlRange will be used in a follow-up CL implementing element removing steps (still ongoing spec discussions).

            Added unregistering/detaching ranges to the CL description as a follow-up CL.

            Mason Freed

            Ack - thanks.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ana Sollano Kim
            • Dan Clark
            • Stephanie Zhang
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I199588ea45dea5269c349d4d1e2f372ab0d53847
            Gerrit-Change-Number: 7409955
            Gerrit-PatchSet: 11
            Gerrit-Owner: Stephanie Zhang <stephan...@microsoft.com>
            Gerrit-Reviewer: Ana Sollano Kim <anso...@microsoft.com>
            Gerrit-Reviewer: Dan Clark <dan...@microsoft.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Stephanie Zhang <stephan...@microsoft.com>
            Gerrit-Attention: Ana Sollano Kim <anso...@microsoft.com>
            Gerrit-Attention: Dan Clark <dan...@microsoft.com>
            Gerrit-Attention: Stephanie Zhang <stephan...@microsoft.com>
            Gerrit-Comment-Date: Wed, 11 Feb 2026 21:24:14 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
            Comment-In-Reply-To: Stephanie Zhang <stephan...@microsoft.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages