Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.preload.js

Issue 5715983079571456: Issue 309 - Don't use Shadow DOM in Chrome 32 (Closed)
Patch Set: Created April 17, 2014, 2:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -29,7 +29,7 @@
// Use Shadow DOM if available to don't mess with web pages that
// rely on the order of their own <style> tags. However
// the <shadow> element is broken in Chrome 32.0.1700 (#309)
- if ("webkitCreateShadowRoot" in document.documentElement && !/\bChrome\/32\.0\.1700\b/.test(navigator.userAgent))
+ if ("webkitCreateShadowRoot" in document.documentElement && !(/\bChrome\/32\.0\.(\d+)\b/.test(navigator.userAgent) && RegExp.$1 >= 1700))
Thomas Greiner 2014/04/17 15:55:57 RegExp.$1 is deprecated (see https://developer.moz
Thomas Greiner 2014/04/17 15:55:57 The match that you get from the regular expression
Sebastian Noack 2014/04/17 16:16:35 Done.
{
var shadow = document.documentElement.webkitCreateShadowRoot();
shadow.appendChild(document.createElement("shadow"));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld