GithubHelp home page GithubHelp logo

Comments (7)

mnoorenberghe avatar mnoorenberghe commented on May 19, 2024

Note that this issue was noticed in some other parts of the commit which added these tests but this specific usage of execCommand for the same purpose wasn't caught.

from wpt.

jgraham avatar jgraham commented on May 19, 2024

Pull #928 is supposed to address this. I didn't test it though.

from wpt.

jgraham avatar jgraham commented on May 19, 2024

Should be fixed now

from wpt.

xiaojunwu avatar xiaojunwu commented on May 19, 2024

Sorry for reply so late.
The spec says: Each input element has a boolean dirty value flag. When it is true, the element is said to have a dirty value. The dirty value flag must be initially set to false when the element is created, and must be set to true whenever the user interacts with the control in a way that changes the value.

I think it means that the dirty value must be set by user interaction, not by script.

We can find the 'user interaction' in the document interface. (http://www.w3.org/TR/html5/dom.html#the-document-object)
Those methods should simulate the user interaction although there is no explicit words or sentences in the spec.

from wpt.

xiaojunwu avatar xiaojunwu commented on May 19, 2024

Yes, the execCommand() requires that the edited element is editing host or editable. I think the input is editable in the default state although the designMode is not set to on. If my thought is not correct. I think below codes may fix the issue.

set_dirty: function(ctl) {
document.disgnMode = "on";
ctl.focus();
ctl.value += "a";
ctl.setSelectionRange(ctl.value.length, ctl.value.length);
document.execCommand("Delete");
document.disgnMode = "off";
},

from wpt.

rniwa avatar rniwa commented on May 19, 2024

No, execCommand never works inside text fields in IE and Firefox. That document.execCommand("Delete") doesn't do anything regardless of whether you're in the design mode or not (it may modify random text elsewhere though).

In general, execCommand is an unspec'ed feature and should not be used in testing until that status changes.

We need to fix this test case not to use execCommand. Also see issues #928 and #2181.

from wpt.

cvrebert avatar cvrebert commented on May 19, 2024

For posterity: X-Ref: https://bugs.webkit.org/show_bug.cgi?id=149911

from wpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.