Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first batch of tests for content change selection update #9799

Conversation

emanchado
Copy link
Contributor

@emanchado emanchado commented Mar 3, 2018

This is a first batch of tests for selection updates triggered by content changes. It doesn't cover all cases mentioned in whatwg/html#2424, but covers some of the most common.

Questions:

  1. Should we test setting the dirty flag in any way that isn't setting the value?
  2. How to simulate users typing?
  3. How to simulate browser autofill, clipboard operations, and others mentioned in selectionStart/selectionEnd behavior needs to be specified whatwg/html#2424 (comment)?

@wpt-pr-bot wpt-pr-bot added the html label Mar 3, 2018
@wpt-pr-bot wpt-pr-bot requested review from ayg, jdm, jgraham and zqzhang March 3, 2018 17:16
@ghost
Copy link

ghost commented Mar 3, 2018

Build PASSED

Started: 2018-03-04 18:50:22
Finished: 2018-03-04 18:54:40

View more information about this build on:

These tests already show differences between eg. Firefox and
Chrome, and show what seems to be browser bugs.
@emanchado emanchado force-pushed the selection-and-cursor-processing-input-textarea branch from cc82a4e to b41ea1e Compare March 4, 2018 18:49
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look amazing to me. Some specific feedback, which we can do in a followup:

  • Probably should test selectionDirection too? I introduced some relevant helpers in emanchado@9c585b4#diff-efe3ff105e161015b02223f18dc2399e.
  • "How to simulate users typing?" This won't be possible, but a manual test would be a good idea anyway. For examples, search for files with "-manual" in their name.
  • Similarly, the other cases won't really be possible without manual tests, at least until we get better web driver-style automation.

I'll go ahead and merge these since they're a great start.

@domenic
Copy link
Member

domenic commented Mar 6, 2018

Oh, and I wasn't sure exactly what you meant by this:

Should we test setting the dirty flag in any way that isn't setting the value?

Did you mean the dirty value flag? If so that isn't terribly related here, right?

@domenic domenic merged commit 05d6e35 into web-platform-tests:master Mar 6, 2018
@emanchado emanchado deleted the selection-and-cursor-processing-input-textarea branch March 6, 2018 18:18
@emanchado
Copy link
Contributor Author

Ah, I didn't think of selectionDirection. Thanks for the pointer, somehow I assumed every test was automated.

Re: the dirty flag, I meant because of your comment whatwg/html#2424 (comment) ("depending on the dirty value flag"). If it doesn't always behave the same way, it would be nice to test both cases, no?

@domenic
Copy link
Member

domenic commented Mar 7, 2018

Ah, right. No, I think since we're only testing changing the control's "relevant value", we can just use one mechanism of entangling relevant value and defaultValue/textContent. In other words, we can assume the UA implements the dirty value flag correctly, and just test its consequences that are relevant to this sphere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants