nsIChromeRegistry.reloadChrome() leaves chrome in a state where access to XPConnect is denied

VERIFIED FIXED in M18

Status

()

Core
RDF
P3
normal
VERIFIED FIXED
18 years ago
17 years ago

People

(Reporter: Martijn Pieters, Assigned: David Hyatt)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta2-] [need info] [nsbeta3+])

Attachments

(3 attachments)

(Reporter)

Description

18 years ago
Calling nsIChromeRegistry.reloadChrome() to reload the chrome, causes the
reloaded chrome to have no access to XPConnect.
(Reporter)

Comment 1

18 years ago
Created attachment 6740 [details]
Testcase
(Reporter)

Comment 2

18 years ago
Created attachment 6741 [details]
Working testcase (how did that typo get there?)
(Reporter)

Comment 3

18 years ago
To reproduce:

1. save (second, correct) testcase in chrome/test/content/default/6741.xul
2. fire up mozilla -chrome chrome://test/content/6741.xul
3. click Test->Reload
4. Mozilla reloads chrome.
5. click Test->Reload
6. Console gives "JavaScript Error: uncaught exception: Access denied to
XPConnect service."

Expected mozilla to reload chrome again.

(Reporter)

Comment 4

18 years ago
Oops, additional info: moz build 2000030708
(Reporter)

Comment 5

18 years ago
Cancel that last comment, I use my own dail y build from the tip, and the build
number isn't updated... =/
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Whiteboard: no estimate
Target Milestone: --- → M17
(Assignee)

Updated

18 years ago
Target Milestone: M17 → M16

Comment 6

18 years ago
This bug needs to be fixed so enable dynamic locale switching
Blocks: 34145

Comment 7

18 years ago
nominating on nsbeta2
Keywords: nsbeta2, skins
QA Contact: nobody → jrgm

Comment 8

18 years ago
[nsbeta2-],please renominate if there are scenarios where a user could 
encounter this.
Whiteboard: no estimate → [nsbeta2-] no estimate

Comment 9

18 years ago
FYI, this function gets called in swiching locale providers on the fly.

Comment 10

18 years ago
movig from architecture to browser product
Product: Architecture → Browser
Version: 5.0 → other

Comment 11

18 years ago
Mass-moving nsbeta2- bugs to M20
Target Milestone: M16 → M20

Updated

18 years ago
Blocks: 42391

Comment 12

18 years ago
I found out that probably reloadChrome() doesn't cause problem itself, but
problem occurs when getService is evaluated twice

Comment 13

18 years ago
I think problem is in reloading of DOM window.
Access to XPConnect is only granted for pages with URL like:
chrome://xxx/content/page.xul
After loading this page, URL is translated to real filesystem path like:
file:///home/user/mozilla/dist/bin/chrome/packages/xxx/xxx/content/page.xul
That URL does not have access to XPConnect and that cause entire problem
probably.

Comment 14

18 years ago
need info: how would an NS6 user see this (steps to repro), and what exactly is
the state of the app once they do?  Time to either nominate for nsbeta3 (with a
compelling argument for fixing this rather than some other bug we've already
committed to fix), or retarget to Future.
Whiteboard: [nsbeta2-] no estimate → [nsbeta2-] [need info]

Comment 15

18 years ago
I think this is needed for:

1. dynamic switching locales when it will be hooked (according to Tao comments)
2. developers need this for debugging their UI

I don't know if this is important for nsbeta3, but now developers must disable
XUL cache when developing UI

Comment 16

18 years ago
I have fix for this bug...

mozilla/docshell/base/nsDocShell.cpp on line 3273
-aChannel->GetURI(getter_AddRefs(uri));
+aChannel->GetOriginalURI(getter_AddRefs(uri));

Not well tested at the moment.
Keywords: patch

Comment 17

18 years ago
[nsbeta3+] : Thank You, Jan Varga!
Whiteboard: [nsbeta2-] [need info] → [nsbeta2-] [need info] [nsbeta3+]
Target Milestone: M20 → Future

Comment 18

18 years ago
pulling '+' bug back from Future to M18 (as I believe was intended).
OS: Linux → All
Hardware: PC → All
Target Milestone: Future → M18
Adding nsbeta3 keyword to bugs which already have nsbeta3 status markings so 
the queries don't get all screwed up.
Keywords: nsbeta3

Comment 20

18 years ago
Created attachment 12628 [details] [diff] [review]
proposed patch
(Assignee)

Comment 21

18 years ago
Fixed.

Thanks Jan!
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 22

18 years ago
verified that the patch is in the tree in version 1.180.
Status: RESOLVED → VERIFIED

Updated

17 years ago
Keywords: skins
You need to log in before you can comment on or make changes to this bug.