WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
26602
Web Inspector: caret moves past prompt in javascript console
https://bugs.webkit.org/show_bug.cgi?id=26602
Summary
Web Inspector: caret moves past prompt in javascript console
Pavel Feldman
Reported
2009-06-22 02:47:56 PDT
1. Open javascript console 2. Start typing "document" until auto-complete shows up, but don't finish the word 3. Hold backspace What is the expected output? What do you see instead? The caret should stop at the prompt character ">" I'm seeing the caret jump past the prompt character. If you start typing it goes back to normal, but it's a little strange! (upstreaming
http://code.google.com/p/chromium/issues/detail?id=14710
).
Attachments
[PATCH] Proposed solution
(1.59 KB, patch)
2010-03-18 07:02 PDT
,
Alexander Pavlov (apavlov)
no flags
Details
Formatted Diff
Diff
[PATCH] Manual removal of empty Text nodes
(1.48 KB, patch)
2010-03-18 09:45 PDT
,
Alexander Pavlov (apavlov)
pfeldman
: review+
Details
Formatted Diff
Diff
[PATCH] Comments addressed, explanation added to ChangeLog
(2.51 KB, patch)
2010-03-18 10:14 PDT
,
Alexander Pavlov (apavlov)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2009-08-07 08:05:44 PDT
The style on the console-prompt is: -webkit-user-modify: read-write-plaintext-only; min-height: 16px; padding: 1px 22px 1px 24px; position: relative; white-space: pre-wrap; So there is always 24px of padding on the left. I'm guessing that the proprietary "-webkit-user-modify: read-write-plaintext-only" could be causing the problem by incorrectly working with backspace and padding? Attempting to change to margin-left didn't work either.
Timothy Hatcher
Comment 2
2009-08-07 14:41:20 PDT
This smells like an editing bug. I actually hit this today doing a demo.
Alexander Pavlov (apavlov)
Comment 3
2010-03-18 07:02:56 PDT
Created
attachment 51022
[details]
[PATCH] Proposed solution
Timothy Hatcher
Comment 4
2010-03-18 09:23:50 PDT
Can you explain how this fixes the bug in the ChangeLog?
Alexander Pavlov (apavlov)
Comment 5
2010-03-18 09:45:57 PDT
Created
attachment 51037
[details]
[PATCH] Manual removal of empty Text nodes
Timothy Hatcher
Comment 6
2010-03-18 09:52:27 PDT
Comment on
attachment 51037
[details]
[PATCH] Manual removal of empty Text nodes
> + var sibling = this.element.firstChild; > + while (sibling) { > + var nextSibling = sibling.nextSibling; > + if (sibling.nodeName === "#text" && sibling.nodeValue === "") > + sibling.parentNode.removeChild(sibling); > + sibling = nextSibling; > + } > + > prefixTextNode.parentNode.insertBefore(this.autoCompleteElement, prefixTextNode.nextSibling);
What prevent prefixTextNode from being one of the pruned nodes? Maybe this can be put into a helper function in utilities. Is this the only place it needs to be called?
Pavel Feldman
Comment 7
2010-03-18 09:54:05 PDT
Comment on
attachment 51037
[details]
[PATCH] Manual removal of empty Text nodes
> + if (sibling.nodeName === "#text" && sibling.nodeValue === "")
Use nodeType === Node.TEXT_NODE instead.
Alexander Pavlov (apavlov)
Comment 8
2010-03-18 10:14:27 PDT
Created
attachment 51042
[details]
[PATCH] Comments addressed, explanation added to ChangeLog
Alexander Pavlov (apavlov)
Comment 9
2010-03-18 10:16:41 PDT
(In reply to
comment #6
)
> (From update of
attachment 51037
[details]
) > > + var sibling = this.element.firstChild; > > + while (sibling) { > > + var nextSibling = sibling.nextSibling; > > + if (sibling.nodeName === "#text" && sibling.nodeValue === "") > > + sibling.parentNode.removeChild(sibling); > > + sibling = nextSibling; > > + } > > + > > prefixTextNode.parentNode.insertBefore(this.autoCompleteElement, prefixTextNode.nextSibling); > > What prevent prefixTextNode from being one of the pruned nodes? Maybe this can
(a) we never show completions for an empty prefix, (b) an empty prefix can either be there from the outset (which is not the case) or after a deletion of succeeding characters (which is the case we already sanitize)
> be put into a helper function in utilities.
A good idea, done.
> Is this the only place it needs to be called?
Added a pruning call next to the other deleteContents(), to be on the safe side.
WebKit Commit Bot
Comment 10
2010-03-19 16:07:13 PDT
Comment on
attachment 51042
[details]
[PATCH] Comments addressed, explanation added to ChangeLog Clearing flags on attachment: 51042 Committed
r56280
: <
http://trac.webkit.org/changeset/56280
>
WebKit Commit Bot
Comment 11
2010-03-19 16:07:18 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug