Closed Bug 295124 Opened 19 years ago Closed 19 years ago

[FIXr]dom.max_script_run_time kicks in to early for xbl content

Categories

(Core :: XBL, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta3

People

(Reporter: bernd_mozilla, Assigned: bzbarsky)

Details

Attachments

(6 files)

I will try to attach svg xbl testcase ( so you need either a svg enabled build
or a ff nightly). When the same script is used from a xml file it does not show
the warning.
Attached file reference xml file
Attached file binding
Attached file css for the ninding
Attachment #184250 - Attachment mime type: text/xml → text/text
Attachment #184250 - Attachment mime type: text/text → text/css
Attachment #184250 - Attachment mime type: text/css → text/xml
running the sample from a local disk makes the warning appear much earlier, so
that there will be confusion whether 5 sec elapsed or not
bernd, I can't reproduce this in my Mozilla build (from a week or two ago) or my
Firefox build (from this morning) -- the SVG shows properly, I get no dialog at all.
Attached image thats what I get
I get this with my debug build (from yesterday) and a recent ff nightly.
This happens usually at least on the second load.
Attached patch Proposed fixSplinter Review
I can definitely see the problem on reload.

The issue is that XBL constructors/destructors don't call ScriptEvaluated(), so
they never reset the mBranchCallbackTime on the nsJSContext to zero when
they're done.  They also never reset mBranchCallbackCount.  So on reload in
this case we put up the alert at 5 seconds minus the time the first load
took....

The fix is to just use the nsCxPusher helper to manage the JSContext stack for
us and handle calling ScriptEvaluated as needed.
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #184903 - Flags: superreview?(jst)
Attachment #184903 - Flags: review?(jst)
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Summary: dom.max_script_run_time kicks in to early for xbl content → [FIX]dom.max_script_run_time kicks in to early for xbl content
Target Milestone: --- → mozilla1.8beta3
Comment on attachment 184903 [details] [diff] [review]
Proposed fix

r+sr=jst
Attachment #184903 - Flags: superreview?(jst)
Attachment #184903 - Flags: superreview+
Attachment #184903 - Flags: review?(jst)
Attachment #184903 - Flags: review+
Comment on attachment 184903 [details] [diff] [review]
Proposed fix

Requesting 1.8b3 approval.  This makes us not put up the "slow script" alert
incorrectly when XBL is involved.
Attachment #184903 - Flags: approval1.8b3?
Summary: [FIX]dom.max_script_run_time kicks in to early for xbl content → [FIXr]dom.max_script_run_time kicks in to early for xbl content
Attachment #184903 - Flags: approval1.8b3? → approval1.8b3+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: