[Webkit-unassigned] [Bug 149911] New: document.execCommand() should not count as a "user edit" for the purposes of ValidityState.tooLong

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 7 20:29:06 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=149911

            Bug ID: 149911
           Summary: document.execCommand() should not count as a "user
                    edit" for the purposes of ValidityState.tooLong
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: webkit at chrisrebert.com

Steps to reproduce the problem:
1. Open http://jsfiddle.net/cvrebert/vdy3emx2/ in WebKit Nightly
2. Look at the console output.

What is the expected behavior?
The console output should be:
> Before script edit: false
> After script edit: false

Quoting from https://html.spec.whatwg.org/multipage/forms.html#attr-fe-maxlength

> Constraint validation: If an element has a maximum allowed value length, its dirty value flag is true, its value was last changed by a user edit (as opposed to a change made by a script), and the code-unit length of the element's value is greater than the element's maximum allowed value length, then the element is suffering from being too long.

Since the <input>'s value was last changed by script unbiddenly invoking document.execCommand(), which should count as a script edit, not a user edit, the <input>'s validity.tooLong boolean should remain false because the "its value was last changed by a user edit (as opposed to a change made by a script)" condition has not been satisfied.

What went wrong?
The actual console output is:
> Before script edit: false
> After script edit: true

Which indicates that document.execCommand() is being treated as a "user edit", thus causing input.validity.tooLong to become true.


This bug is causing some test failures in
http://w3c-test.org/html/semantics/forms/constraints/form-validation-validity-tooLong.html
(AKA https://github.com/w3c/web-platform-tests/blob/master/html/semantics/forms/constraints/form-validation-validity-tooLong.html )

Analogous Chrome bug: https://code.google.com/p/chromium/issues/detail?id=540978

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151008/6a04e9ed/attachment.html>


More information about the webkit-unassigned mailing list