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

RESOLVED FIXED

Status

()

Toolkit
View Source
RESOLVED FIXED
11 years ago
10 years ago

People

(Reporter: florian, Assigned: florian)

Tracking

({regression})

Trunk
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

11 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.
Checkins:
http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=2006-03-07+03%3A00&maxdate=2006-03-07+14%3A00 
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 http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/components/viewsource/content/viewPartialSource.js&rev=1.13#199 (added to the vbox at http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/components/viewsource/content/viewPartialSource.xul&rev=1.26#184 ) 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 http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/components/viewsource/content/viewPartialSource.js&rev=1.13#199
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).
(Assignee)

Comment 6

11 years ago
Created attachment 252264 [details] [diff] [review]
move the listener from appcontent to content
Attachment #252264 - Flags: review?(gavin.sharp)
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?(gavin.sharp) → review+
Whiteboard: [checkin needed]

Updated

11 years ago
Assignee: nobody → f.qu

Comment 8

11 years ago
Landed on trunk:
toolkit/components/viewsource/content/viewPartialSource.js 1.1
Status: NEW → RESOLVED
Last Resolved: 11 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.