Closed
Bug 675587
Opened 13 years ago
Closed 13 years ago
document.location.hash="" executed as the first thing in the DOM doesn't work
Categories
(Core :: DOM: Navigation, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla8
People
(Reporter: sebastian.razola, Assigned: bzbarsky)
Details
Attachments
(2 files)
284 bytes,
text/plain
|
Details | |
3.27 KB,
patch
|
justin.lebar+bug
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
Steps to reproduce:
Visit the page below with #anything added to the URL
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Hash test</title>
<script type="text/javascript">
document.location.hash="";
</script>
</head>
<body>
<p>The hash won't be set to <b>#</b> in Firefox. (At least in Firefox 5.0.1)</p>
</body>
</html>
Actual results:
The stuff after the hash was not removed.
Expected results:
The URL should be stripped of everything after the hash. That's how it works in all other browsers I've tested and strangely also in Firefox, if I move the script tag to the bottom of the body.
Try visiting http://www.sebastianrazola.com/test.html#thisshouldberemoved
Comment 1•13 years ago
|
||
Doesn't behave as expected in Firefox Nightly either (8.0a1 (2011-07-31), OS X 10.6)
Comment 2•13 years ago
|
||
This is the change to the html referred to above that makes the document.location.hash work as in other browsers.
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Updated•13 years ago
|
Component: DOM → Document Navigation
QA Contact: general → docshell
Assignee | ||
Comment 3•13 years ago
|
||
I have a fix for this; just testing it now.
Assignee: nobody → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #549794 -
Flags: review?(justin.lebar+bug)
Comment 5•13 years ago
|
||
Comment on attachment 549794 [details] [diff] [review]
Change the location on hash changes even if we cna't scroll right then.
r=me with typo in commit message fixed.
Attachment #549794 -
Flags: review?(justin.lebar+bug) → review+
Assignee | ||
Comment 6•13 years ago
|
||
Yeah, I actually caught that right after posting the patch.
Whiteboard: [need landing]
Comment 7•13 years ago
|
||
Jens, thank you for reporting this bug!
Comment 8•13 years ago
|
||
The credit for finding and reporting it goes to Sebastian.
Thanks for the quick response and fix.
Assignee | ||
Comment 9•13 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need landing]
Target Milestone: --- → mozilla8
Comment 10•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•