If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Status

()

Core
JavaScript Engine
P3
normal
VERIFIED DUPLICATE of bug 38215
17 years ago
16 years ago

People

(Reporter: Chris Pimlott, Assigned: brendan)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
Found an instance in which the with statement fails to operate correctly.  
Given the following page:

<html>

<head>
<title>JavaScript with text</title>
<script type="text/javascript">
<!--
function with_test() {
  alert('image src is ' + document.images['wait'].src);
  alert('image src length is ' + document.images['wait'].src.length);
  with (document.images['wait']) {
    alert('image src is ' + src);
    alert('image src length is ' + src.length);
  }
}
// -->
</script>
</head>

<body>
<img src="mozilla.jpg" name=wait>
<form action="#">
<input type=button onClick="with_test()" value="Test">
</form>
</body>

</html>

When with_test is called the first two alert statements will work fine and the 
next two within the with { } statement will both fail with the message "src is 
not defined".

Comment 1

17 years ago
Sending to Brendan because this is so similar to bug 38215.
Is it in fact a duplicate?
Assignee: rogerl → brendan
(Assignee)

Comment 2

17 years ago
This is the same class of bugs as 38215, and could be combined.  Apparently, the
src property of image objects (and only that property) is handled only by the
underlying C++ object's GetProperty routine, which uses an inefficient string
compare to specialize its behavior for "src".  This is the same raw deal as in
bug 38215, just for image.src rather than for location.href.

There are probably other specific bugs of this class.  I would say let's combine
bugs under the general class "DOM must use resolve, not getProperty, to be lazy"
(or similar words).

/be
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 3

17 years ago

*** This bug has been marked as a duplicate of 38215 ***
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE

Comment 4

17 years ago
Verifying duplicate -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.