Discussion:
Issue 304455 in chromium: Value and innerText of HTMLInputElement [type=number] return empty string when not empty
c***@googlecode.com
2013-10-07 01:13:24 UTC
Permalink
Updates:
Labels: -Cr-Content-JavaScript -OS-Mac Cr-Blink-Forms OS-All

Comment #2 on issue 304455 by ***@chromium.org: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

Is testability the only problem? We can test badInput with the following
ways:

Set invalid string:
var input = document.getElementById('number-input');
input.focus();
document.execCommad('inserttext', false, 'not-a-number');
// input.validity.badInput becomes true.

Get an invalid string:
document.execCommand('selectall', false, '');
var userInput = window.getSelection().toString();
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2013-10-07 01:17:15 UTC
Permalink
Comment #3 on issue 304455 by ***@gmail.com: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

The problem is that we need to differentiate between "valid" empty strings
and "invalid" empty strings (where there is actually inputted invalid text,
we just can't see it).

I've sort of hacked a way around this problem, but it's not perfect --- and
from studying the spec, I'm not too clear on the purpose of clearing the
value in the first place. It seems to defeat the purpose of constraint
validation. I'd love to hear the justification for it (it looks like it
came from the original implementation in WebKit).

Anyways, it seems to introduce a lot of quirks which are sort of difficult
to circumvent perfectly / effectively.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2013-10-07 01:30:15 UTC
Permalink
Comment #4 on issue 304455 by ***@gmail.com: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

Err, this differentiation is sort of made more complex/buggy because of the
structure of the angular form validation pipeline. It could probably be
fixed up, but it still doesn't seem useful to hide the inner text from the
script context, for this reason.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2013-10-07 10:40:06 UTC
Permalink
Updates:
Cc: ***@chromium.org
Labels: Needs-Feedback

Comment #5 on issue 304455 by ***@chromium.org: Value and innerText
of HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

@caitpotter88, Can you please provide a sample html file so that it would
be helpful for QA team to reproduce the issue.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2013-10-13 19:50:29 UTC
Permalink
Comment #6 on issue 304455 by ***@gmail.com: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

For demonstrating the particular issue using Angular, I've created a plunk:

http://plnkr.co/edit/MPHrHprL8mwjOHl51yQ3?p=preview

I've submitted a patch to try to work around this issue by checking for
changes to ValidityState if it is available, and there's a demo of this at

http://plnkr.co/edit/WNCgzqx7n843i20LrDZn?p=preview

However, this patch introduces some other problems, and it sort of feels
like it isn't totally helpful to completely hide the text value from
Javascript, for exactly these reasons.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2013-10-13 20:01:22 UTC
Permalink
Comment #7 on issue 304455 by ***@gmail.com: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

So just to clarify, this works great for people who are exclusively using
HTML5 constraints to validate their forms, but often we're using JS
frameworks on top of pure HTML, and making the text input value of an input
element empty during constraint validation sort of creates issues for
frameworks. Yes, we can often look at the ValidityState, and maybe we'll be
doing this in the future, but I just think exposing the text value to us
would make life a bit easier.

It's not really a "bug" per se, it's just a sort "makes life harder" issue,
I guess.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2013-10-18 05:29:34 UTC
Permalink
Updates:
Status: WontFix
Labels: -Needs-Feedback

Comment #8 on issue 304455 by ***@chromium.org: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

You had better talk to the standard body, not browser vendors.

Actually, I proposed a way to get a raw text in WHATWG last year. But
feedbacks were negative.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-06-01 23:43:38 UTC
Permalink
Updates:
Status: Duplicate
Mergedinto: 178437

Comment #9 on issue 304455 by ***@chromium.org: Value and innerText of
HTMLInputElement [type=number] return empty string when not empty
http://code.google.com/p/chromium/issues/detail?id=304455

(No comment was entered for this change.)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
Loading...