Bug 29815 - REGRESSION (r48698): Cannot enter text in Facebook message content field
Summary: REGRESSION (r48698): Cannot enter text in Facebook message content field
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Evangelism (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P1 Critical
Assignee: Nobody
URL: http://www.facebook.com/
Keywords: InRadar, Regression
: 29922 30046 30056 30058 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-28 10:50 PDT by mitz
Modified: 2009-10-28 03:04 PDT (History)
14 users (show)

See Also:


Attachments
Reduction (1.80 KB, text/html)
2009-09-30 17:34 PDT, Mark Rowe (bdash)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2009-09-28 10:50:17 PDT
The Message text field in the Facebook Compose Message box does not accept text entry.

Steps to reproduce:
1. Log in to Facebook
2. Choose Inbox > Compose New Message
3. Click in the Message text field
4. Type some text

Result:
No text appears in the Message text field

Regression:
This is a regression from <http://trac.webkit.org/changeset/48698>
Comment 1 mitz 2009-09-28 10:50:46 PDT
<rdar://problem/7258171>
Comment 2 Kent Tamura 2009-09-28 17:30:37 PDT
I have confirmed I couldn't type anything into a textarea.
However, this <textarea> element actually had maxlength="0" according to the inspector.  So, this is an expected behavior and a Facebook's bug.

What should we do in such case?
Comment 3 Kent Tamura 2009-09-28 17:43:44 PDT
> However, this <textarea> element actually had maxlength="0" according to the
> inspector.  So, this is an expected behavior and a Facebook's bug.

It doesn't have maxlength="0" in an HTML text.  The code seems to call "textarea.maxLength = 0" and it makes a maxlength="0" attribute.
Comment 4 Kent Tamura 2009-09-28 18:33:33 PDT
I took a look at a Facebook JS code.
I guess TextInputControl class in it does something like the following:
  textarea.maxLength = textarea.maxLength;

If maxlength= HTML attribute is missing, .maxLength is 0 according to older HTML5 draft, so the new .maxLength becomes 0, of course.

Maybe this bug will be fixed if Bug#29796 is fixed.  I'll check it soon.
Comment 5 Kent Tamura 2009-09-28 19:30:29 PDT
(In reply to comment #4)
> I took a look at a Facebook JS code.
> I guess TextInputControl class in it does something like the following:
>   textarea.maxLength = textarea.maxLength;

My guess was wrong.  Returning -1 for .maxLength didn't help.
Comment 6 Kent Tamura 2009-09-28 20:40:05 PDT
I understand the Facebook code.
In the definition of TextInpuTcontrol.prototype:
    setMaxLength:function(maxlength){
	this.maxLength=maxlength;
	this.getRoot().maxLength=this.maxLength||null;
	return this;
    },

This code is called by UIComposer.prototype.initializeTextarea() like:
    initializeTextarea:function(maxLength,initialHeight){
	new TextAreaControl(this.input)
	.setMaxLength(maxLength)
	.setOriginalHeight(initialHeight)
	.setAutogrow(true)
	.onfocus();
	this.input.onfocus='';
    },
where the maxLength parameter is 0.


>	this.getRoot().maxLength=this.maxLength||null;
this.getRoot() is a <textarea> element.  In the case of maxLength==0, null is set. null is converted to 0.  So textarea.maxLength becomes 0.
Comment 7 Kent Tamura 2009-09-28 20:54:15 PDT
I reported this issue to Facebook.
Comment 8 Mark Rowe (bdash) 2009-09-30 17:07:15 PDT
I just CCd all of the facebook.com folks with Bugzilla accounts on this bug to hopefully get this some attention.  If this requires a fix on the Facebook side it would be nice to get an ETA for the fix.
Comment 9 Mark Rowe (bdash) 2009-09-30 17:11:09 PDT
*** Bug 29922 has been marked as a duplicate of this bug. ***
Comment 10 Mark Rowe (bdash) 2009-09-30 17:34:04 PDT
Created attachment 40410 [details]
Reduction

I've attached a reduction that demonstrates that Facebook is relying on behavior that works in Firefox but is incorrect per the HTML 5 specification.
Comment 11 Michael 2009-10-01 11:25:42 PDT
I want to confirm this bug.  Unable to insert text in response box on facebook's "inbox"
Comment 12 Ben Mathews 2009-10-01 22:12:10 PDT
I've fixed this in our trunk;  the fix will go out on Tuesday afternoon.
Comment 13 Mark Rowe (bdash) 2009-10-01 22:19:16 PDT
Thanks for the info, Ben!
Comment 14 mitz 2009-10-03 10:33:02 PDT
*** Bug 30046 has been marked as a duplicate of this bug. ***
Comment 15 Mark Rowe (bdash) 2009-10-04 03:52:31 PDT
*** Bug 30056 has been marked as a duplicate of this bug. ***
Comment 16 Mark Rowe (bdash) 2009-10-04 13:23:33 PDT
*** Bug 30058 has been marked as a duplicate of this bug. ***
Comment 17 Kent Tamura 2009-10-28 03:04:09 PDT
I confirmed Facebook's code has no problem now.