Closed
Bug 246964
Opened 21 years ago
Closed 21 years ago
Special-case 'if (document.all)...'-style object detection in JSClass.resolve
Categories
(Core :: JavaScript Engine, defect, P3)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.8alpha2
People
(Reporter: brendan, Assigned: brendan)
Details
(Keywords: fixed-aviary1.0, fixed1.7.5, js1.5)
Attachments
(2 files)
(deleted),
patch
|
shaver
:
review+
roc
:
approval1.7.5+
|
Details | Diff | Splinter Review |
(deleted),
text/plain
|
Details |
To handle IE content that uses document.all without testing for it, we could add a mode to resolve, signaled by JSRESOLVE_DETECTING being set in JSNewREsolveOp's flags argument, that the unresolved property reference is the condition of an if or ?: condition (possibly parenthesized). Thus, we could fail to resolve when pages are object-detecting document.all, but willingly resolve when pages use document.all[id]. I do not propose to handle &&, ||, or ! combinations. Comments? /be
Comment 1•21 years ago
|
||
Worth a shot, definately. I can hack up the other side of this once you've got the flag for me to use...
Assignee | ||
Comment 3•21 years ago
|
||
Comment on attachment 150885 [details] [diff] [review] proposed enhancement jst, feel free to try this and take advantage of it in dom code.... /be
Attachment #150885 -
Flags: review?(shaver)
Assignee | ||
Comment 4•21 years ago
|
||
jst: probably want to insist on JSRESOLVE_QUALIFIED in order to even consider resolving document.all, but then bail on the resolution (return with null in *objp) if JSRESOLVE_DETECTING is set. /be
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.8alpha2
Comment 5•21 years ago
|
||
This is an interesting approach which might be helpful for cases where an App is written solely for MSIE without impacting us in cases where the author has coded for both MSIE and us. It is not clear to me how much this will get you without supporting more of the MSIE DOM especially MSIE's exposure of elements w/ID as global vars. jst, will you do just document.all and not HTMLElement.all ? How much of the other parts like indexing, tags, item, etc? I can run some scans to see how this plays out when you have a preliminary patch.
Comment 6•21 years ago
|
||
(In reply to comment #5) > It is not clear to me how much this will get you without > supporting more of the MSIE DOM especially MSIE's exposure of elements w/ID as > global vars. doesn't MSIE also have a global |event| variable, contrary to mozilla, which pages often use?
Comment 7•21 years ago
|
||
(In reply to comment #6) > > doesn't MSIE also have a global |event| variable, contrary to mozilla, which > pages often use? yes.
Comment 8•21 years ago
|
||
I think the best approach here is to make incremental changes and test and see how far it gets us, if we find that doing document.all gets us far, but taking one more step would get a significant improvement, then lets think about that, separately for each case we run into.
Comment on attachment 150885 [details] [diff] [review] proposed enhancement r=shaver
Attachment #150885 -
Flags: review?(shaver) → review+
Assignee | ||
Comment 10•21 years ago
|
||
Fix is in. jst, can you file the DOM followup bug? /be
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
![]() |
||
Comment 12•20 years ago
|
||
I assume that with this patch something like: var isIE = document.all; if (isIE) { } will continue to test false in Gecko?
Assignee | ||
Comment 13•20 years ago
|
||
bz: yes, as close reading of bug 248549 should make clear (bug 248549 comment 3 says so directly, and bug 248549 comment 17 says more). /be
Assignee | ||
Comment 14•20 years ago
|
||
I should have said that this bug's patch doesn do what bz wants, but the second attachment in bug 248549 does. /be
Attachment #150885 -
Flags: approval1.7.3+
Updated•20 years ago
|
Keywords: fixed1.7.5
Comment 16•20 years ago
|
||
Thanks to Brendan, Boris and Steve. See bug 248549, 253150, 259935. Steve, with your permission this will be included in the javascript test library.
Updated•20 years ago
|
Flags: testcase+
You need to log in
before you can comment on or make changes to this bug.
Description
•