Find again 'eats' some characters in View selection source.




12 years ago
11 years ago


(Reporter: florian, Assigned: florian)




Firefox Tracking Flags

(Not tracked)



(1 attachment)



12 years ago
Steps to reproduce:
 - View Selection Source (in the context menu when something isselected in the page).
 - Press F3. Notice that some text disappeared.

You can also use Ctrl F and find some text. Press F3 many time. Each time "Reached end of page, continued from top" is displayed, some text will disappear.

There are errors in the console. For example:
Error: [Exception... "Index or size is negative or greater than the allowed amount"  code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"  location: "chrome://global/content/viewPartialSource.js Line: 259"]
Source File: chrome://global/content/viewPartialSource.js
Line: 259

Each time the problem appends, the function drawSelection is called.
It should only be called once when the window is opened, after the content has loaded.

Removing the eventlistener the first time drawSelection is called, or setting it directly on the browser tag can fix the visible problem, but that doesn't look like a good fix.
The regression range for this bug is 2006-03-07:04 - 2006-03-07:13.
Keywords: regression
OS: Linux → All
Hardware: PC → All
It looks like this is a regression from bug 234455. It seems like the event listener added at (added to the vbox at ) now fires multiple times when the findbar is opened (unhidden) for some reason. Is the expectation that it should fire only once wrong?
Why does
add the listener to 'appcontent', not to 'content'.
I guess the load event may occur now many times because the load event
of image elements propagates from <findbar> somehow.
(The event listener is added to listen 'capture' phase.)
What is the target of the load events? document or image element? Or something else?
And btw, it is the right thing to do to propagate the load event.
Ah, OK, so that listener should just be fixed (I have no idea why it's on appcontent rather than content, it seems to have been added in bug 122524).

Comment 6

12 years ago
Created attachment 252264 [details] [diff] [review]
move the listener from appcontent to content
Attachment #252264 - Flags: review?(
Comment on attachment 252264 [details] [diff] [review]
move the listener from appcontent to content

r=me, thanks for the patch. The SeaMonkey folks might want this too, though they're not currently affected because they have no findbar widget here.
Attachment #252264 - Flags: review?( → review+
Whiteboard: [checkin needed]


12 years ago
Assignee: nobody → f.qu

Comment 8

12 years ago
Landed on trunk:
toolkit/components/viewsource/content/viewPartialSource.js 1.1
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.