Skip to content

Ensure the value attribute for HTMLInputElement matches the spec #9455

Closed

Description

@KiChjang

#9407 uncovered the fact that our current implementation does not match the behaviour outlined by the spec. It also discovered that whenever the value attribute is removed by the RemoveAttribute method on an HTMLElement, the HTMLInputElement is not notified of the changes, since there are actually two containers for the value attribute - one is the attrs field in the Element struct, and the other textinput field in the HTMLInputElement struct. This may or may not be intentional, as the spec defines different modes that the value attribute can be in, yet currently our implementation does not implement the concept of these modes.

Code: components/script/dom/htmlinputelement.rs
Spec: https://html.spec.whatwg.org/multipage/forms.html#dom-input-value
Test: tests/wpt/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html (and many more, but this is a good indicator whether the issue is fixed)

Activity

  1. added
    A-content/dom
    I-wrong
    I-refactor
    E-more-complex
    on Jan 29, 2016
  2. g-k commented on Jan 30, 2016

    @g-k
    Contributor

    I can give this a shot.

  3. KiChjang commented on Jan 30, 2016

    @KiChjang
    ContributorAuthor

    Ok, be mindful that I expect this to be more difficult than the E-Easy issues that you've handled before. If you're stuck and require clarifications, please don't hesistate to ping us at #servo on irc.mozilla.org!

  4. added
    C-assigned
    on Jan 30, 2016
  5. g-k commented on Feb 3, 2016

    @g-k
    Contributor

    OK, I pushed a branch that sets and gets value on Element and gets the last radio node list test passing: https://github.com/servo/servo/compare/master...g-k:html-input-value?expand=1

    I'll run the rest of the wpt tests later, but I'm not sure if this is a good approach or what to do about RemoveAttribute, the value sanitization algorithms, and syncing attrs.value and textinput in HTMLInputElement.

  6. KiChjang commented on Feb 3, 2016

    @KiChjang
    ContributorAuthor

    @g-k I left some comments on your commit, nice work so far!

  7. added 3 commits that reference this issue on Feb 26, 2016
    b9698bf
    f30fb64
    0d7a2ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domC-assignedE-more-complexI-refactorI-wrong

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions