Extract common text control selection code

The API for text control selection is the same for both <input> and
<textarea>:

https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#textFieldSelection

Before this change, they had similar but not identical implementations
with duplicate code. Now there is a common TextControl trait which
contains the implementation used by both. As a result, some previously
failing tests now pass.
This commit is contained in:
Jon Leighton 2017-11-17 21:34:35 +01:00
parent f290cacccd
commit 6beda3c761
5 changed files with 124 additions and 97 deletions

View file

@ -439,6 +439,7 @@ pub mod testrunner;
pub mod testworklet;
pub mod testworkletglobalscope;
pub mod text;
pub mod textcontrol;
pub mod textdecoder;
pub mod textencoder;
pub mod touch;