Closed Bug 1540632 Opened 7 months ago Closed 7 months ago

Fix WPT failures for changing `type` of `<input> element (testing/web-platform/tests/html/semantics/forms/the-input-element/type-change-state.html)

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: mbrodesser, Assigned: mbrodesser)

Details

Attachments

(1 file)

testing/web-platform/tests/html/semantics/forms/the-input-element/type-change-state.html currently has expected failures in testing/web-platform/meta/html/semantics/forms/the-input-element/type-change-state.html.ini. The code needs to be fixed, so that the expected failures can be removed.

Assignee: nobody → mbrodesser
Priority: -- → P2

Update of findings up to now:

  1. Throw NS_ERROR_DOM_INVALID_STATE_ERR instead of NS_ERROR_DOM_SECURITY_ERR in HTMLInputElement.cpp to respect the spec.
  2. The test-suite itself could hide problems because it uses the same input field for the sequence of all tests.
  3. One problem is that the cursor isn't moved to the beginning (instead, it's moved to the end).
    -- nsTextEditorState::SetValue is potentially buggy, the caching used there could be problematic too.
    -- Potentially a fix is to pass a new flag nsTextEditorState::eSetValue_MoveCursorToBegin in HTMLInputElement::HandleTypeChange to HTMLInputElement::SetValueInternal.

Try run for the review: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f9d9deb8445c1b38ba96a57484a95ca79d76b728&selectedJob=238347600. The few failures are unrelated to this change. Requesting check-in.

Keywords: checkin-needed

Pushed by opoprus@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/732f41524a76
change exception and correct setting selectionStart/End/Direction for type change of '<input>' element r=smaug

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.