From db55e86e91fce79a49950bfef0d00eb24315f057 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Wed, 3 Jan 2018 14:05:33 +0100 Subject: [PATCH] fix(core): make all render3 tests pass in IE9 (#21279) PR Close #21279 --- packages/core/src/render3/instructions.ts | 5 +++-- packages/platform-browser/testing/src/browser_util.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/src/render3/instructions.ts b/packages/core/src/render3/instructions.ts index cd8f6b268d..35b24224be 100644 --- a/packages/core/src/render3/instructions.ts +++ b/packages/core/src/render3/instructions.ts @@ -596,8 +596,9 @@ export function elementAttribute(index: number, attrName: string, value: any): v element.native.removeAttribute(attrName); } else { (renderer as ProceduralRenderer3).setAttribute ? - (renderer as ProceduralRenderer3).setAttribute(element.native, attrName, value) : - element.native.setAttribute(attrName, value); + (renderer as ProceduralRenderer3) + .setAttribute(element.native, attrName, stringify(value)) : + element.native.setAttribute(attrName, stringify(value)); } } } diff --git a/packages/platform-browser/testing/src/browser_util.ts b/packages/platform-browser/testing/src/browser_util.ts index 875e378d56..221c924fe9 100644 --- a/packages/platform-browser/testing/src/browser_util.ts +++ b/packages/platform-browser/testing/src/browser_util.ts @@ -104,10 +104,11 @@ export function stringifyElement(el: any /** TODO #9100 */): string { for (let i = 0; i < keys.length; i++) { const key = keys[i]; const attValue = attributeMap.get(key); + const lowerCaseKey = key.toLowerCase(); if (typeof attValue !== 'string') { - result += ` ${key}`; + result += ` ${lowerCaseKey}`; } else { - result += ` ${key}="${attValue}"`; + result += ` ${lowerCaseKey}="${attValue}"`; } } result += '>';