[Webkit-unassigned] [Bug 54443] Textarea maxlength doesn't account for newlines

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 14 01:35:07 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=54443





--- Comment #13 from Naoki Takano <takano.naoki at gmail.com>  2011-03-14 01:35:07 PST ---
Niwa-san,

Thank you for your review.

But I cannot understand what is "open typing command".

Could you tell me what kind of situation it happens?

(In reply to comment #12)
> (From update of attachment 85609 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=85609&action=review
> 
> > LayoutTests/fast/forms/script-tests/textarea-maxlength.js:96
> > +document.execCommand('insertLineBreak'); // This linebreak should be ignored because limitation up to 3 characters.
> 
> You didn't realize about the bug I spotted below because your previous 3 calls have instantiated an open TypingCommand.
> 
> > Source/WebCore/editing/TypingCommand.cpp:227
> > +            // Check if we can insert new line break with \n(line feed) string.
> > +            ExceptionCode ec = 0;
> > +            RefPtr<BeforeTextInsertedEvent> evt = BeforeTextInsertedEvent::create(String("\n"));
> > +            root->dispatchEvent(evt, ec);
> > +
> > +            if (evt->text().length()) {
> > +                lastTypingCommand->setShouldRetainAutocorrectionIndicator(options & RetainAutocorrectionIndicator);
> > +                lastTypingCommand->insertLineBreak();
> > +            }
> 
> I don't think this is the right place to put this code.  I don't see any reason this fix should be restricted to the line breaks inserted after the user had typed something else (i.e. there is an open typing command).  r- because of this.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list