mediawiki.jqueryMsg.js:1144 was blowing up on Node.TEXT_NODE
because window.Node is undefined in IE8. The exception was ignored
and this was causing a message containing {{PLURAL...}} or
{{GENDER...}} to be rendered as is.
Bug: T87118
Change-Id: I8c5c2ae74b68eeabd93bb5b81a3061bcb31f6549
'dependencies' => array(
'mediawiki.util',
'mediawiki.language',
+ 'dom-level2-shim',
),
'targets' => array( 'desktop', 'mobile' ),
),
'skipFunction' => 'resources/src/es5-skip.js',
),
+ /* dom-level2-shim */
+ // IE 8
+ 'dom-level2-shim' => array(
+ 'scripts' => 'resources/src/polyfill-nodeTypes.js',
+ 'targets' => array( 'desktop', 'mobile' ),
+ 'skipFunction' => 'resources/src/dom-level2-skip.js',
+ ),
+
/* OOjs */
'oojs' => array(
'scripts' => array(
--- /dev/null
+/*!
+ * Skip function for dom-level2-shim module.
+ *
+ * Tests for window.Node because that's the only thing that this shim is adding.
+ */
+return !!window.Node;
--- /dev/null
+/**
+ * Adds window.Node with node types according to:
+ * http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247
+ */
+
+window.Node = window.Node || {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+};