Closed
Bug 212220
Opened 22 years ago
Closed 22 years ago
Form Autocomplete not working in Firebird 0705 onwards
Categories
(Firefox :: Address Bar, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: goi, Assigned: hewitt)
Details
Attachments
(3 files, 4 obsolete files)
|
2.83 KB,
patch
|
janv
:
review+
jag+mozilla
:
superreview+
|
Details | Diff | Splinter Review |
|
790 bytes,
patch
|
Details | Diff | Splinter Review | |
|
4.62 KB,
patch
|
hewitt
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030702 Mozilla Firebird/0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030705 Mozilla Firebird/0.6
Form Autocomplete isn't working at allsince Firebird 0705 builds onwards. Its as
if it has been disabled, and there's no drop down menu while filling in forms
whatsoever. I've tried it on the 0705, 0706 and 0709 builds, and they all do not
work. Reverting back to 0702 will make it work.
Reproducible: Always
Steps to Reproduce:
1. Type in a form field that has been visited before
Actual Results:
No drop down menu indicating past choices
Expected Results:
Autocomplete Drop down menu should appear
Comment 2•22 years ago
|
||
On the offchance that it's relevant.
Updated•22 years ago
|
Attachment #127444 -
Flags: superreview?(jaggernaut)
Attachment #127444 -
Flags: review?(varga)
Comment 3•22 years ago
|
||
Comment on attachment 127444 [details] [diff] [review]
Fix some assertions
I think this needs work.
clearResults() should probably call rowCountChanged with negative oldCount
if we can't figure out at what index we're adding new results in addResults
then we need to just call rowCountChanged(0, -rowCountBefore) and then
rowCountChanged(0, rowCountAfter). all wrapped in a batch
I didn't check the code around this diff, so I might miss something
Attachment #127444 -
Flags: review?(varga) → review-
Comment 4•22 years ago
|
||
I had to move the clearResults so that I could batch it.
Attachment #127444 -
Attachment is obsolete: true
Updated•22 years ago
|
Attachment #127459 -
Flags: superreview?(jaggernaut)
Attachment #127459 -
Flags: review?(varga)
Comment 5•22 years ago
|
||
Comment on attachment 127459 [details] [diff] [review]
Better fix
looks much better
Attachment #127459 -
Flags: review?(varga) → review+
Comment 6•22 years ago
|
||
Comment on attachment 127459 [details] [diff] [review]
Better fix
Hmm, in clearResults, could you avoid having to use |oldCount| if you moved the
rowCountChanged call up before you changed |this.mRowCount|? sr=jag either way.
Attachment #127459 -
Flags: superreview?(jaggernaut) → superreview+
Comment 8•22 years ago
|
||
I am not familiar with Mozilla or Firebird, but I seem to get autocomplete
working again by changing getter of maxRows in
toolkit/content/widgets/autocomplete.xml (which causes some errors to be
outputed to console)
Comment 9•22 years ago
|
||
i am not sure if i am doing the correct thing in this patch, but it seems to
make autocomplete works again in my build.
Comment 10•22 years ago
|
||
The problem here is that some code was added that does .getAttribute('maxRows')
on the autocomplete input, but that autocomplete input isn't necessarily a
content node. In this case, it's an nsFormFillController. This patch adds a
maxRows property on nsIAutoCompleteInput and uses that instead.
Updated•22 years ago
|
Attachment #127600 -
Flags: review?(blaker)
Comment 11•22 years ago
|
||
brian,
after applying your patch, i have got this error:
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "'[JavaScript Error: "too much recursion" {file:
"chrome://global/content/widgets/autocomplete.xml" line: 0}]' when calling
method: [nsIAutoCompleteInput::popupOpen]" nsresult: "0x80570021
(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "<unknown>" data: yes]
Is it because I have incorrectly applied the patch?
Comment 12•22 years ago
|
||
Hm, I'm not seeing anything like that.
Comment 13•22 years ago
|
||
Oops! i see the problem.
Updated•22 years ago
|
Attachment #127600 -
Flags: review?(blaker)
Comment 14•22 years ago
|
||
Fixed a bug that would cause infinite recursion.
Attachment #127600 -
Attachment is obsolete: true
Updated•22 years ago
|
Attachment #127606 -
Flags: review?(blaker)
Comment 15•22 years ago
|
||
brian,
another trivial thing, sometimes there is an error like this:
************************************************************
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "'[JavaScript Error: "this.mInput has no properties" {file:
"chrome://global/content/widgets/autocomplete.xml" line: 0}]' when calling
method: [nsIAutoCompletePopup::invalidate]" nsresult: "0x80570021
(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "<unknown>" data: yes]
************************************************************
I think
onget="var t = this.mInput.maxRows; return t ? t : 6;"/>
should check against this.mInput before accessing maxRows to avoid this warning.
(may be something like this from my previous patch?
onget="return (this.mInput && this.mInput.maxRows) ? this.mInput.maxRows
: 6"/>)
Comment 16•22 years ago
|
||
steps to reproduce the warning:
1. fireup Firebird
2. type something into location bar
Comment 17•22 years ago
|
||
Comment on attachment 127600 [details] [diff] [review]
suggested fix
>@@ -505,7 +506,7 @@
> </property>
>
> <property name="maxRows" readonly="true"
>- onget="var t = parseInt(this.mInput.getAttribute('maxrows')); return t ? t : 6;"/>
>+ onget="var t = this.mInput.maxRows; return t ? t : 6;"/>
That return should use JS's righteous (after Perl) || operator:
return t || 6;
returns the value of t if it converts to boolean true, else 6. It does not
convert its result to boolean.
Any other places to fix likewise?
/be
Comment 18•22 years ago
|
||
Comment on attachment 127606 [details] [diff] [review]
suggested fix
Of course, you should get rid of the single-use temporary var t when you switch
to use ||.
Note that || and && in JS follow C and short-circuit evaluation, but they
preserve the deciding operand's type and value, after Perl.
/be
Comment 19•22 years ago
|
||
brendan,
is checking the existance of this.mInput necessary? it seems that in some rare
occasions there will have an JavaScript error saying maxRows is not defined...
just want to know, the code will be
return (this.mInput && this.mInput.maxRows) || 6
if i want to check for this.mInput first?
Updated•22 years ago
|
Attachment #127606 -
Flags: review?(blaker)
Comment 20•22 years ago
|
||
incorporate suggestions from brendan and chu. Note that the "return (blah) ||
0" is to ensure that we return 0 instead of NaN.
Attachment #127606 -
Attachment is obsolete: true
Updated•22 years ago
|
Attachment #127635 -
Flags: review?(blaker)
Comment 21•22 years ago
|
||
Ok, I suck for attaching that last patch without testing it. && can't be used
unescaped in an attribute value. Rather than using && and making it
ugly, I just used a <getter>. This one works, I swear.
Attachment #127635 -
Attachment is obsolete: true
| Assignee | ||
Comment 22•22 years ago
|
||
Comment on attachment 127639 [details] [diff] [review]
oops
r=hewitt
Attachment #127639 -
Flags: review+
Comment 23•22 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 24•22 years ago
|
||
brian,
i have cvs updated toolkit/, and it seems to work correctly (no JavaScript
warning :))
however, there is an assertion at nsTreeBodyFrame.cpp, which attachment 127459 [details] [diff] [review]
seems to be fixing, should that patch goes in too?
the assertion:
###!!! ASSERTION: row count changed unexpectedly: 'mRowCount == rowCount', file
nsTreeBodyFrame.cpp, line 2198
Break: at file nsTreeBodyFrame.cpp, line 2198
Updated•22 years ago
|
Attachment #127635 -
Flags: review?(blake)
Updated•22 years ago
|
Attachment #127444 -
Flags: superreview?(jag)
You need to log in
before you can comment on or make changes to this bug.
Description
•