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

Projects
None yet
4 participants
@emanchado
Copy link
Contributor

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 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 Mar 3, 2018

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots 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:

Add first batch of tests for selection update
These tests already show differences between eg. Firefox and
Chrome, and show what seems to be browser bugs.

@emanchado emanchado force-pushed the emanchado:selection-and-cursor-processing-input-textarea branch from cc82a4e to b41ea1e Mar 4, 2018

@domenic

domenic approved these changes Mar 6, 2018

Copy link
Member

domenic left a comment

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

This comment has been minimized.

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@emanchado emanchado deleted the emanchado:selection-and-cursor-processing-input-textarea branch Mar 6, 2018

@emanchado

This comment has been minimized.

Copy link
Contributor Author

emanchado commented Mar 6, 2018

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

This comment has been minimized.

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
You can’t perform that action at this time.