-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
<textarea>
should have useful cloning steps
#1233
Comments
Per https://bugs.webkit.org/show_bug.cgi?id=156637 WebKit removed this. Paging @cdumez and @rniwa. |
Hmm. Or never had it; I thought I had tested Safari, but clearly I screwed it up somehow, since it definitely doesn't copy the value when I test right now. Given that, I'm less worried about the compat aspect, but it might still make sense to do this from a developer sanity point of view... I don't feel nearly as strongly about that, though. |
We did not remove anything, we merely chose not to change our behavior considering it matched the spec and Chrome. AFAIK, we never copied the value when copying a TextArea. |
So it seems to me that Firefox, WebKit and the spec are in agreement. That is not to say that textarea shouldn't have more useful cloning steps though, especially if Chrome already implements this. @rniwa may have an opinion on this. |
So only Chrome clones? Might be an @RByers matter then. |
Edge clones the value as well; I'm pretty sure I didn't mess up testing that. I didn't check IE11, but I could if that would be useful. |
Chrome also didn't copy the value until last year: https://bugs.chromium.org/p/chromium/issues/detail?id=487352 |
So right now we have:
It would have been really nice if Chrome had notified the standards community about their change so we could have had a cross-vendor discussion... I guess it was probably accidental, as per https://bugs.chromium.org/p/chromium/issues/detail?id=487352#c33. I tend to agree it's more user-friendly to copy the textarea value like we copy other input values. Would Firefox and WebKit be interested in implementing such cloning steps, if we added them to the spec (and web-platform-tests)? Would they be opposed to adding them? |
I don't think I would be opposed. It's pretty simple to implement .... modulo that issue with raw value vs api value... |
/cc @tkent-google |
It seems I approved the TEXTAREA changes without checking the specification. I'm sorry for that! IMO, cloning no TEXTAREA value is very inconsistent with cloning INPUT value, and cloning TEXTAREA value will help web authors. We should have cloning steps for all of stateful form controls. |
This makes textarea cloning work like input cloning, and matches Edge and Chrome. Closes #1233.
On further testing it looks like Edge does not clone the textarea value: http://jsbin.com/jenaniciro/edit?html,output This brings us to only 1/4 browsers cloning. Should we go for the shortest path to interop, and remove the cloning steps from Chrome? Or should we go for consistency and helpfulness to web authors, and add cloning steps? |
Maybe one reason why it might be weird to copy the raw value while cloning is that that de-synchronizes the DOM tree from the raw value. That is, it makes it possible to have a textarea with no children, but with a raw value. I don't think it's possible to have that scenario otherwise. |
It... depends. I was sure I hadn't screwed up testing edge on the testcase in https://bugzilla.mozilla.org/show_bug.cgi?id=230307, so I wrote more testcases. Compare http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4471 and http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4472 -- looks like Edge will clone the value (not just the default value, which is, of course, cloned in this case) if the clone is deep but not if the clone is shallow.
This is the normal state of being for a textarea that had no initial value and then had its value modified, no? |
That just seems really bad. Let's not introduce "deep cloning steps".
Ah, you're of course right; default value vs. value confusion strikes again. So yeah, I guess I see two approaches still: add cloning steps (Chrome), or have none (Firefox, Safari). In either case Edge will have to change, either to add cloning steps for shallow clones too, or to remove them for deep clones. |
I agree with @tkent-google that we should just make |
Yes, I'd be willing to help aligning WebKit. |
This makes textarea cloning work like input cloning, and matches Chrome. Safari and Firefox have indicated they are willing to move in this direction as well, as it is more developer-friendly for textarea to behave the same as input. Closes #1233.
|
The patch to align WebKit has landed: |
This makes textarea cloning work like input cloning, and matches Chrome. Safari and Firefox have indicated they are willing to move in this direction as well, as it is more developer-friendly for textarea to behave the same as input. Closes whatwg#1233.
See https://bugzilla.mozilla.org/show_bug.cgi?id=230307#c14: everyone except Gecko copies the value and presumably dirty value flag. I have not tested whether it's the raw value that gets copied or whether the raw value on the clone gets set to the API value on the original.
The text was updated successfully, but these errors were encountered: