From 160ddc8567c60493ea077033aa44e1f4139fec41 Mon Sep 17 00:00:00 2001 From: remi-filament <30716308+remi-filament@users.noreply.github.com> Date: Mon, 5 Feb 2018 20:21:45 +0100 Subject: [FIX] web_editor: correct check of property 'rules' Port of PR #22603 from v9 to v10 See Issue #22517 (#22679) --- addons/web_editor/static/src/js/transcoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/js/transcoder.js') diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 6b42e028b3a..265ca5ab3f0 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -9,7 +9,7 @@ var getMatchedCSSRules = function (a) { var sheets = document.styleSheets; for(var i = sheets.length-1; i >= 0 ; i--) { var rules; - if (sheets[i].rules) { + if (sheets[i].hasOwnProperty('rules')) { rules = sheets[i].rules; } else { //try...catch because Firefox not able to enumerate document.styleSheets[].cssRules[] for cross-domain stylesheets. -- cgit v1.2.3