Because this change to the placeholder behavior was sugested and accepted, I'd like to request an option in the about:config that allows the firefox user to change the behavior as follows: 0 (default): Works like the way it works currently. (Only disappear the placeholder when there's user input text). 1: If the tag has an autofocus attribute and it is set to true, then do the same as 0, else do the same as 2. 2: Behave like the versions before the 15 branch, where the placeholder is removed from the form tag if the user selects the tag. If such system already exists, then my apologies because I wasn't able to find it by searching.
5 years ago
I'm not strongly against that but I'm not sure if this is a very good idea. Our current behaviour is the default behaviour in most of our tier-1 platforms: Android, MacOS X, somehow Window (we should check W8) and Firefox OS . The only platform that clearly doesn't do that by default is GTK (Linux). I don't want to have such a preference if the general default behaviour becomes consistent. Actually, I might prefer changing the behaviour to match the platform's one instead of adding a spec. I feel like fighting against that behaviour when your platform has it is probably not worth it. Generally speaking, I'm afraid that we have to maintain these two code paths while one could be barely not used.  We want Firefox OS to behave like that because it is obviously better for mobile platforms.
I already know many firefox users that prefer it like it was. I strongly believe that it would be changed to a non default by a significant amount of firefox users (as long as this change, should it be made, is properly announced). Personally, I prefer the option 1 of my proposal but hardcoding that one is not a good idea at all. One of the best things of firefox is to have loads of tweaks that allows you to set it to behave exactly like you want it to. Hardcoding a something like this is against that policy. I hope they didn't change that policy of firefox...
Created attachment 679322 [details] [diff] [review] Patch After a bit of thinking I realized that it was quite easy to do by centralizing the placeholder visibility logic (bug 809584). Also, given that we moved to a pseudo-element, this patch becomes easy. With this patch, setting "dom.placeholder.show_on_focus" to "false" should do what you want.
Created attachment 679325 [details] [diff] [review] Patch Oups, I attached the patch without the test. That one has a test so we don't break that pref's behaviour too quickly.
Comment on attachment 679325 [details] [diff] [review] Patch I can't find UpdatePlaceholderVisibility. What does the argument to it mean?
Comment on attachment 679325 [details] [diff] [review] Patch Oh, bug 809584 and aNotify. r=me
(In reply to Boris Zbarsky (:bz) from comment #6) > Comment on attachment 679325 [details] [diff] [review] > Patch > > Oh, bug 809584 and aNotify. What do you mean by "and aNotify"?
I had two questions: 1) What is this function and 2) What does the argument to it mean? The answers are "bug 809584 and aNotify". ;)
It's not what I asked but the solution works for me, it's acceptable according to what I asked. From what I understood you implemented what I indicated of 0 and 2. So I don't thin kit is fixed, I think this is another solution but it works for me. Thanks for the patch, Mounir Lamouri and Ehsan Akhgari
WORKFORME is used when a bug can't be reproduced. The solution is indeed not the one you proposed but it is doing more or less what you asked and it matches the summary of the bug.
@Mounir Lamouri, I would strongly advise that you make the 2nd option the default ! Please, seriously, the disappear when starting to type is wrong and annoying. The user always expects the text to be removed before they start typing. You first click the area to type. Then you look at your keyboard to see the letters you want to type. Who cares that the text disappears or not when you look at your keyboard !? Why must the text be there till you start typing.. Why see the text till the point when you start typing...? Its not like you forget what it was written there ..... I really cannot see how on earth could the firefox developers be so silly including such a stupid feature in firefox. I am sure there must be at least thousands of users disturbed by this "improvement". Please consider my words........ https://bugzilla.mozilla.org/show_bug.cgi?id=758996
Adjusting summary to reflect what was changed here.