Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So we aren't using your lovely module and theme on a project of ours, because I heard about it after we'd started development. One issue we've come across is that any HTML5 tags that gets added via AJAX in IE6/7/8 will not get processed by modernizer, so they are unable to be styled it seems.
There are details of this issue here:
http://jdbartlett.github.com/innershiv/
Seems like a possible solution would be to swap out the core ajax methods to use this script, or fix jquery directly somehow.
Comment | File | Size | Author |
---|---|---|---|
#11 | 1180142-10-innerShiv-prefixed.patch | 4.15 KB | seutje |
#10 | 1180142-10-innerShiv.patch | 4.14 KB | seutje |
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedTo clarify further, this only occurs if you parse a HTML5 fragment outside of the document's DOM, e.g.:
Comment #2
Steven Jones CreditAttribution: Steven Jones commentedSo we (now) have some code that replaces the insert method with a version that supports HTML5 in IE 6/7/8:
I really don't have time for a patch, but here's what we're doing.
Comment #3
ericduran CreditAttribution: ericduran commentedHmm, Make sense,
Maybe we should also include the innershiv js.
I think now that there's a html5 d8 initiative we should pretty much back-port everything to this module.
Also this might be a good d8 issue.
Comment #4
stevetweeddale CreditAttribution: stevetweeddale commentedI might try and make a patch for html5 base to do this for d7. Or should this code live in html5tools? Not totally clear where the between them is on this.
And depending on the outcome of #1077878: Add HTML5shiv to core there may need to be a d8 core issue for it as well.
Comment #5
jide CreditAttribution: jide commentedSince we use JQuery in Drupal, we could safely remove the second parameter and return childNodes directly.
The WTFPL license is problematic, we should see if the author is likely to change the license if we use this technique.
A jQuery method that behaves like load() is also mentioned : https://gist.github.com/735829.
Comment #6
stevetweeddale CreditAttribution: stevetweeddale commentedYou've gotta enjoy the irony if there are indeed licensing issues. Does the WTFPL not mean we can just include it without attribution and under whatever license modules fall under?
"If you do not like the license terms, just relicense [sic] the work under another license." ...taken from the wtfpl license page
Comment #7
ericduran CreditAttribution: ericduran commentedWe could use that plugin. We'll just need to remove the license
Comment #8
ericduran CreditAttribution: ericduran commentedAlso tools seems more appropriate that base.
Comment #9
jide CreditAttribution: jide commentedHehe, did not take the time to check the WTFPL license terms :)
Comment #10
seutje CreditAttribution: seutje commentedThere seems to be a more advanced version of the innerShiv, which also strips script tags, fixes tables, handles XHTML properly and stuff...
the newer version also bails early on when it detects the browser to be able to render HTML5 elements created outside of the active DOM.
Attached patch assumes patch #82 in #1077878: Add HTML5shiv to core went in
Comment #11
seutje CreditAttribution: seutje commentedjust found out we are using prefixed patches nowadays, my apologies
Comment #12
inolen CreditAttribution: inolen commentedseutje: If you add the monkey patch into html5.js, you need to ensure that html5.js it loaded after ajax.js:
Comment #13
ericduran CreditAttribution: ericduran commentedWe shouldn't be patching the html5.js file being that this is for d7, we should include our own html5.js in tools instead.
Mind you tools is for 6 and 7. Not so much for 8 ;)
Comment #14
ericduran CreditAttribution: ericduran commentedComment #15
seutje CreditAttribution: seutje commentedoh, my bad
Comment #16
bleen CreditAttribution: bleen commenteddont forget if we cinlude our own html5.js we will likely need to make sure the core version isnt also loaded.
Comment #17
ericduran CreditAttribution: ericduran commentedWe don't really need to include a html5_tools specific js.
The scripts each have their own names they should stay that way.
We just need to provide the hook_libraries for the scripts.
Also if the html5.js makes it into core it'll be sometime before it gets in 7. Also I doubt there actually be a specific file name html5.js I think thats bad naming and we shouldn't name it that neither ;)
Comment #18
inolen CreditAttribution: inolen commentedSo, instead of monkey patching, I patched my local ajax.js to have the same fix by adding:
at the very top of Drupal.ajax.prototype.commands.insert, however, when using innerShiv this broke the AJAX framework when it attempts to insert scripts, because innerShiv strips out
tags. For now I've modified innerShiv to simply not strip them out (source available at https://github.com/jdbartlett/innershiv), but I'm sure it strips them out/doesn't process them for a good reason, so I doubt this is a good solution.Comment #19
ericduran CreditAttribution: ericduran commentedThis is possible without hacking core.
Comment #20
seutje CreditAttribution: seutje commented@inolen: https://github.com/jdbartlett/innershiv/issues/4#issuecomment-1051825
Comment #21
ericduran CreditAttribution: ericduran commentedOk, so the shiv is in this module for 7.x now we need to do the innershiv. I'm not totally sure on this one.
Any recommendations?
Comment #22
ericduran CreditAttribution: ericduran commentedOk, this is now fixed. I just monkey patch it as @seutje did.
So now the shiv and the innershiv are easily accesible in this module.
Thanks all.