Closed Bug 577892 Opened 10 years ago Closed 6 years ago
6.33 KB, patch
|Details | Diff | Splinter Review|
4.39 KB, patch
|Details | Diff | Splinter Review|
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:22.214.171.124) Gecko/20100625 Firefox/3.6.6 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:126.96.36.199) Gecko/20100625 Firefox/3.6.6 ive created a test page to reproduce this behavior. youd except icon would change after button click, but it doesnt. the href attribute changes. when i drag a panel into a new firefox window, new icon is already shown, so i guess its problem with user interface rendering. <html> <head> <title>Test</title> <link rel="icon" href="calm.png"/> </head> <body> <button onclick="document.getElementsByTagName('link').href='hot.png';">Simulate Event</button> </body> </html> Reproducible: Always Steps to Reproduce: try the example code in description Actual Results: icon doesnt invalidate Expected Results: icon should change to a new one
Reporter, Firefox 4.0.1 has been released, and it features significant improvements over previous releases. Can you please update to Firefox 4.0.1 or later, and retest your bug? Please also create a fresh profile ( http://support.mozilla.com/kb/Managing+profiles), update your plugins (Flash, Java, Quicktime, Reader, etc) and update your graphics driver and Operating system to the latest versions available. If you still continue to see this issue, please comment. If you do not, please close this bug as RESOLVED > WORKSFORME filter: prefirefox4uncobugs
it still doesnt work.
You can make this work by removing the <link> node from the DOM, and then reinserting it... See updateFavicon() in the source of http://isthetreegreen.com The browser UI deals with the favicon by listening for "DOMLinkAdded" events from content. There are no events fired (that I know of) when link attributes change. Other than adding a mutation observer (which is bad for perf),I don't think this is currently possible. Perhaps we could special case this by adding a DOMLinkChanged event?
Status: UNCONFIRMED → NEW
Ever confirmed: true
yes i already found out it was possible to create new instance of link node and delete the old one, and started using it. but i thought, it would be nice if it was possible to use the easier and more elegant way, by editing href attribute. like when you change image source with src attribute, but i understand link is not an image and mostly it's used for nonvisual content (stylesheets for example) so it makes sense that icon does not invaldiate immediately.
So this works (testcase: http://gijsk.com/mozilla/testcases/icons.html ). AIUI from bug 481688 these events shouldn't be visible to content either way, so adding another one doesn't seem like a big deal. For the browser part, note that while I've updated some terminology, 'addicon' already really meant 'seticon'. This wasn't the case for feeds and search (note how we don't do anything when these elements get removed, either...), and so I've just added guards so that we don't change behaviour here. I'm happy to remove one or both of those, but this seemed the safest bet.
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Component: General → Tabbed Browser
OS: Windows XP → All
Hardware: x86 → All
Version: 3.6 Branch → Trunk
Marco, can you add this?
Iteration: --- → 33.2
Points: --- → 3
Added to Iteration 33.2
QA Whiteboard: [qa?]
Comment on attachment 8450547 [details] [diff] [review] allow icons to change when href attribute is set directly, r=me on the DOM bits
Attachment #8450547 - Flags: review?(bzbarsky) → review+
Annnnnd a test. Try: https://tbpl.mozilla.org/?tree=Try&rev=b983579b20d2
Attachment #8450934 - Flags: review?(dolske)
Hi Gijs, can you mark this bug as [qa+] or [qa-].
Iteration: 33.2 → 33.3
There's an automated test, so I don't think this needs QA attention.
QA Whiteboard: [qa?] → [qa-]
Attachment #8450547 - Flags: review?(dolske) → review+
Comment on attachment 8450934 [details] [diff] [review] add test for dynamic favicon changes through altering a favicon's href, Review of attachment 8450934 [details] [diff] [review]: ----------------------------------------------------------------- rs=me
Attachment #8450934 - Flags: review?(dolske) → review+
folded before landing as: remote: https://hg.mozilla.org/integration/fx-team/rev/1829aad143e2
Whiteboard: [parity-Chrome][parity-IE] → [parity-Chrome][parity-IE][fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [parity-Chrome][parity-IE][fixed-in-fx-team] → [parity-Chrome][parity-IE]
Target Milestone: --- → Firefox 33
You need to log in before you can comment on or make changes to this bug.