Closed
Bug 465263
Opened 16 years ago
Closed 16 years ago
[FIX]When location.hash equals empty, setting it as empty caused unexpected page reload
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b3
People
(Reporter: adonis.cuhk, Assigned: bzbarsky)
Details
(Keywords: fixed1.9.1)
Attachments
(2 files)
378 bytes,
text/html
|
Details | |
3.01 KB,
patch
|
jst
:
review+
jst
:
superreview+
beltzner
:
approval1.9.1+
beltzner
:
approval1.9.1b2-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4 Tested also under: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081116 Minefield/3.1b2pre At page page.html, setting document.location.hash = '' caused page reload. It should be considered as nothing changed before and after javascript execution since document.location.hash is always empty, but the page still reloads. Reproducible: Always Steps to Reproduce: 1. Go to https://bugzilla.mozilla.org/attachment.cgi?id=348507 2. Click on the only button 3. Notice that there comes the 2nd alert (attached to onload) after clicking the button Actual Results: Page reloaded unexpectedly Expected Results: Page doesn't reload, i.e. no second prompt in the testcase submitted All of the major browsers including Internet Explorer 6 & 7, Safari 3.1.2, Opera 9.62 and Chrome 0.3.154.9 (latest stable versions at the moment) follow the above expected behavior. changes to document.location.hash should not cause any page reload anyway, nothing to mention nothing changed.
![]() |
Assignee | |
Comment 1•16 years ago
|
||
Er, the |x = ...| should be |global.x = ...|. Not that this affects the testcase.
![]() |
Assignee | |
Comment 3•16 years ago
|
||
Confirming. I'll just do what Opera/IE do here.
Assignee: nobody → bzbarsky
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → general
Summary: When location.hash equals empty, setting it as empty caused unexpected page reload (similar to 273158??) → [FIX]When location.hash equals empty, setting it as empty caused unexpected page reload
![]() |
Assignee | |
Comment 4•16 years ago
|
||
So the key is that IE/Opera treat hash='' the same as hash='#'. We should just do the same, and this problem goes away.
![]() |
Assignee | |
Comment 5•16 years ago
|
||
The test just tests for the right final URL. The reloading behavior will need to be tested in the tests for bug 273158 and bug 280215 once those exist.
Attachment #348651 -
Flags: superreview?(jst)
Attachment #348651 -
Flags: review?(jst)
Reporter | ||
Comment 6•16 years ago
|
||
FYI, just tested also in latest versions of Chrome and Safari which behave differently. Both browsers (may be just one) never append # after URL regardless of hash=='' or hash=='#'. This could affect whether reloading is needed under some situations. The problem is safari/chrome needs another round of "click here" to refresh when going from test.html#abc to test.html. It's better to fire this as a bug to safari/chrome instead. For IE/Opera, yes they make hash='' equiv as hash='#'. And I favor this way better than that of safari/chrome. in fact, this bug crashed my app. thanks a lot, bz. you responded really fast!!
Updated•16 years ago
|
Attachment #348651 -
Flags: superreview?(jst)
Attachment #348651 -
Flags: superreview+
Attachment #348651 -
Flags: review?(jst)
Attachment #348651 -
Flags: review+
![]() |
Assignee | |
Comment 7•16 years ago
|
||
Comment on attachment 348651 [details] [diff] [review] Fix Probably best to get beta baking on this....
Attachment #348651 -
Flags: approval1.9.1b2?
Comment 8•16 years ago
|
||
Comment on attachment 348651 [details] [diff] [review] Fix Let's get this after beta 2 closes down ...
Attachment #348651 -
Flags: approval1.9.1b2?
Attachment #348651 -
Flags: approval1.9.1b2-
Attachment #348651 -
Flags: approval1.9.1?
![]() |
Assignee | |
Updated•16 years ago
|
Attachment #348651 -
Flags: approval1.9.1?
![]() |
Assignee | |
Updated•16 years ago
|
Attachment #348651 -
Flags: approval1.9.1?
Comment 9•16 years ago
|
||
Comment on attachment 348651 [details] [diff] [review] Fix a191=beltzner
Attachment #348651 -
Flags: approval1.9.1? → approval1.9.1+
![]() |
Assignee | |
Comment 10•16 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/9a8b28bbed23
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
![]() |
Assignee | |
Updated•16 years ago
|
Target Milestone: --- → mozilla1.9.1b3
![]() |
Assignee | |
Updated•16 years ago
|
Keywords: fixed1.9.1
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•