@wavemaker/angular-app 11.14.1-21.64739 → 11.14.1-21.64741
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dependencies/pipe-provider.cjs.js +1158 -628
- package/dependencies/transpilation-web.cjs.js +579 -314
- package/dependency-report.html +1 -1
- package/npm-shrinkwrap.json +929 -774
- package/package-lock.json +929 -774
- package/package.json +5 -5
|
@@ -37843,14 +37843,14 @@ function requireDom () {
|
|
|
37843
37843
|
ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
|
|
37844
37844
|
var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
|
|
37845
37845
|
ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
|
|
37846
|
-
ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
|
|
37846
|
+
var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
|
|
37847
37847
|
ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
|
|
37848
37848
|
ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
|
|
37849
37849
|
var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
|
|
37850
37850
|
ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
|
|
37851
37851
|
var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
|
|
37852
37852
|
//level2
|
|
37853
|
-
ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
|
|
37853
|
+
var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
|
|
37854
37854
|
ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
|
|
37855
37855
|
ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
|
|
37856
37856
|
ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
|
|
@@ -37900,9 +37900,10 @@ function requireDom () {
|
|
|
37900
37900
|
item: function(index) {
|
|
37901
37901
|
return index >= 0 && index < this.length ? this[index] : null;
|
|
37902
37902
|
},
|
|
37903
|
-
toString:function(isHTML,nodeFilter){
|
|
37903
|
+
toString:function(isHTML,nodeFilter,options){
|
|
37904
|
+
var requireWellFormed = !!options && !!options.requireWellFormed;
|
|
37904
37905
|
for(var buf = [], i = 0;i<this.length;i++){
|
|
37905
|
-
serializeToString(this[i],buf,isHTML,nodeFilter);
|
|
37906
|
+
serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
|
|
37906
37907
|
}
|
|
37907
37908
|
return buf.join('');
|
|
37908
37909
|
},
|
|
@@ -38147,13 +38148,28 @@ function requireDom () {
|
|
|
38147
38148
|
/**
|
|
38148
38149
|
* Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
|
|
38149
38150
|
*
|
|
38150
|
-
* __This
|
|
38151
|
+
* __This implementation differs from the specification:__
|
|
38151
38152
|
* - this implementation is not validating names or qualified names
|
|
38152
38153
|
* (when parsing XML strings, the SAX parser takes care of that)
|
|
38153
38154
|
*
|
|
38155
|
+
* Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
|
|
38156
|
+
* Creation-time validation of `publicId`, `systemId` is not enforced.
|
|
38157
|
+
* The serializer-level check covers all mutation vectors, including direct property writes.
|
|
38158
|
+
* `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
|
|
38159
|
+
* absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
|
|
38160
|
+
* silently omitted from the serialized output.
|
|
38161
|
+
*
|
|
38154
38162
|
* @param {string} qualifiedName
|
|
38155
38163
|
* @param {string} [publicId]
|
|
38164
|
+
* The external subset public identifier. Stored verbatim including surrounding quotes.
|
|
38165
|
+
* When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
|
|
38166
|
+
* throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
|
|
38167
|
+
* not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
|
|
38156
38168
|
* @param {string} [systemId]
|
|
38169
|
+
* The external subset system identifier. Stored verbatim including surrounding quotes.
|
|
38170
|
+
* When serialized with `requireWellFormed: true`, throws `DOMException` with code
|
|
38171
|
+
* `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
|
|
38172
|
+
* production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
|
|
38157
38173
|
* @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
|
|
38158
38174
|
* or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
|
|
38159
38175
|
*
|
|
@@ -38219,18 +38235,44 @@ function requireDom () {
|
|
|
38219
38235
|
return cloneNode(this.ownerDocument||this,this,deep);
|
|
38220
38236
|
},
|
|
38221
38237
|
// Modified in DOM Level 2:
|
|
38222
|
-
|
|
38223
|
-
|
|
38224
|
-
|
|
38225
|
-
|
|
38226
|
-
|
|
38227
|
-
|
|
38228
|
-
|
|
38229
|
-
|
|
38230
|
-
|
|
38231
|
-
|
|
38232
|
-
|
|
38233
|
-
|
|
38238
|
+
/**
|
|
38239
|
+
* Puts the specified node and all of its subtree into a "normalized" form. In a normalized
|
|
38240
|
+
* subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
|
|
38241
|
+
*
|
|
38242
|
+
* Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
|
|
38243
|
+
* is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
|
|
38244
|
+
* nodes.
|
|
38245
|
+
*
|
|
38246
|
+
* This method iteratively traverses all child nodes to normalize all descendant nodes within
|
|
38247
|
+
* the subtree.
|
|
38248
|
+
*
|
|
38249
|
+
* @throws {DOMException}
|
|
38250
|
+
* May throw a DOMException if operations within removeChild or appendData (which are
|
|
38251
|
+
* potentially invoked in this method) do not meet their specific constraints.
|
|
38252
|
+
* @see {@link Node.removeChild}
|
|
38253
|
+
* @see {@link CharacterData.appendData}
|
|
38254
|
+
* @see ../docs/walk-dom.md.
|
|
38255
|
+
*/
|
|
38256
|
+
normalize: function () {
|
|
38257
|
+
walkDOM(this, null, {
|
|
38258
|
+
enter: function (node) {
|
|
38259
|
+
// Merge adjacent text children of node before walkDOM schedules them.
|
|
38260
|
+
// walkDOM reads lastChild/previousSibling after enter returns, so the
|
|
38261
|
+
// surviving post-merge children are what it descends into.
|
|
38262
|
+
var child = node.firstChild;
|
|
38263
|
+
while (child) {
|
|
38264
|
+
var next = child.nextSibling;
|
|
38265
|
+
if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
|
|
38266
|
+
node.removeChild(next);
|
|
38267
|
+
child.appendData(next.data);
|
|
38268
|
+
// Do not advance child: re-check new nextSibling for another text run
|
|
38269
|
+
} else {
|
|
38270
|
+
child = next;
|
|
38271
|
+
}
|
|
38272
|
+
}
|
|
38273
|
+
return true; // descend into surviving children
|
|
38274
|
+
},
|
|
38275
|
+
});
|
|
38234
38276
|
},
|
|
38235
38277
|
// Introduced in DOM Level 2:
|
|
38236
38278
|
isSupported:function(feature, version){
|
|
@@ -38306,21 +38348,103 @@ function requireDom () {
|
|
|
38306
38348
|
copy(NodeType,Node.prototype);
|
|
38307
38349
|
|
|
38308
38350
|
/**
|
|
38309
|
-
* @param
|
|
38310
|
-
*
|
|
38351
|
+
* @param {Node} node
|
|
38352
|
+
* Root of the subtree to visit.
|
|
38353
|
+
* @param {function(Node): boolean} callback
|
|
38354
|
+
* Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
|
|
38355
|
+
* @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
|
|
38311
38356
|
*/
|
|
38312
|
-
function _visitNode(node,callback){
|
|
38313
|
-
|
|
38314
|
-
return true;
|
|
38315
|
-
}
|
|
38316
|
-
if(node = node.firstChild){
|
|
38317
|
-
do{
|
|
38318
|
-
if(_visitNode(node,callback)){return true}
|
|
38319
|
-
}while(node=node.nextSibling)
|
|
38320
|
-
}
|
|
38357
|
+
function _visitNode(node, callback) {
|
|
38358
|
+
return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
|
|
38321
38359
|
}
|
|
38322
38360
|
|
|
38361
|
+
/**
|
|
38362
|
+
* Depth-first pre/post-order DOM tree walker.
|
|
38363
|
+
*
|
|
38364
|
+
* Visits every node in the subtree rooted at `node`. For each node:
|
|
38365
|
+
*
|
|
38366
|
+
* 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
|
|
38367
|
+
* return value becomes the `context` passed to each child's `enter` call and to the matching
|
|
38368
|
+
* `exit` call.
|
|
38369
|
+
* 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
|
|
38370
|
+
* sibling traversal continues normally.
|
|
38371
|
+
* 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
|
|
38372
|
+
* further `enter` or `exit` calls are made.
|
|
38373
|
+
* 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
|
|
38374
|
+
* safely modify the node's own child list before the walker descends. Modifying siblings of
|
|
38375
|
+
* the current node or any other part of the tree produces unpredictable results: nodes already
|
|
38376
|
+
* queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
|
|
38377
|
+
* the current child list are never visited.
|
|
38378
|
+
* 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
|
|
38379
|
+
* been visited, passing the same `context` that `enter`
|
|
38380
|
+
* returned for that node.
|
|
38381
|
+
*
|
|
38382
|
+
* This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
|
|
38383
|
+
* deep trees.
|
|
38384
|
+
*
|
|
38385
|
+
* @param {Node} node
|
|
38386
|
+
* Root of the subtree to walk.
|
|
38387
|
+
* @param {*} context
|
|
38388
|
+
* Initial context value passed to the root node's `enter`.
|
|
38389
|
+
* @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
|
|
38390
|
+
* @returns {void | walkDOM.STOP}
|
|
38391
|
+
* @see ../docs/walk-dom.md.
|
|
38392
|
+
*/
|
|
38393
|
+
function walkDOM(node, context, callbacks) {
|
|
38394
|
+
// Each stack frame is {node, context, phase}:
|
|
38395
|
+
// walkDOM.ENTER — call enter, then push children
|
|
38396
|
+
// walkDOM.EXIT — call exit
|
|
38397
|
+
var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
|
|
38398
|
+
while (stack.length > 0) {
|
|
38399
|
+
var frame = stack.pop();
|
|
38400
|
+
if (frame.phase === walkDOM.ENTER) {
|
|
38401
|
+
var childContext = callbacks.enter(frame.node, frame.context);
|
|
38402
|
+
if (childContext === walkDOM.STOP) {
|
|
38403
|
+
return walkDOM.STOP;
|
|
38404
|
+
}
|
|
38405
|
+
// Push exit frame before children so it fires after all children are processed (Last In First Out)
|
|
38406
|
+
stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
|
|
38407
|
+
if (childContext === null || childContext === undefined) {
|
|
38408
|
+
continue; // skip children
|
|
38409
|
+
}
|
|
38410
|
+
// lastChild is read after enter returns, so enter may modify the child list.
|
|
38411
|
+
var child = frame.node.lastChild;
|
|
38412
|
+
// Traverse from lastChild backwards so that pushing onto the stack
|
|
38413
|
+
// naturally yields firstChild on top (processed first).
|
|
38414
|
+
while (child) {
|
|
38415
|
+
stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
|
|
38416
|
+
child = child.previousSibling;
|
|
38417
|
+
}
|
|
38418
|
+
} else {
|
|
38419
|
+
// frame.phase === walkDOM.EXIT
|
|
38420
|
+
if (callbacks.exit) {
|
|
38421
|
+
callbacks.exit(frame.node, frame.context);
|
|
38422
|
+
}
|
|
38423
|
+
}
|
|
38424
|
+
}
|
|
38425
|
+
}
|
|
38323
38426
|
|
|
38427
|
+
/**
|
|
38428
|
+
* Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
|
|
38429
|
+
* immediately.
|
|
38430
|
+
*
|
|
38431
|
+
* @type {symbol}
|
|
38432
|
+
*/
|
|
38433
|
+
walkDOM.STOP = Symbol('walkDOM.STOP');
|
|
38434
|
+
/**
|
|
38435
|
+
* Phase constant for a stack frame that has not yet been visited.
|
|
38436
|
+
* The `enter` callback is called and children are scheduled.
|
|
38437
|
+
*
|
|
38438
|
+
* @type {number}
|
|
38439
|
+
*/
|
|
38440
|
+
walkDOM.ENTER = 0;
|
|
38441
|
+
/**
|
|
38442
|
+
* Phase constant for a stack frame whose subtree has been fully visited.
|
|
38443
|
+
* The `exit` callback is called.
|
|
38444
|
+
*
|
|
38445
|
+
* @type {number}
|
|
38446
|
+
*/
|
|
38447
|
+
walkDOM.EXIT = 1;
|
|
38324
38448
|
|
|
38325
38449
|
function Document(){
|
|
38326
38450
|
this.ownerDocument = this;
|
|
@@ -38924,12 +39048,44 @@ function requireDom () {
|
|
|
38924
39048
|
node.appendData(data);
|
|
38925
39049
|
return node;
|
|
38926
39050
|
},
|
|
39051
|
+
/**
|
|
39052
|
+
* Returns a new CDATASection node whose data is `data`.
|
|
39053
|
+
*
|
|
39054
|
+
* __This implementation differs from the specification:__
|
|
39055
|
+
* - calling this method on an HTML document does not throw `NotSupportedError`.
|
|
39056
|
+
*
|
|
39057
|
+
* @param {string} data
|
|
39058
|
+
* @returns {CDATASection}
|
|
39059
|
+
* @throws DOMException with code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
|
|
39060
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
|
|
39061
|
+
* @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
|
|
39062
|
+
*/
|
|
38927
39063
|
createCDATASection : function(data){
|
|
39064
|
+
if (data.indexOf(']]>') !== -1) {
|
|
39065
|
+
throw new DOMException(INVALID_CHARACTER_ERR, 'data contains "]]>"');
|
|
39066
|
+
}
|
|
38928
39067
|
var node = new CDATASection();
|
|
38929
39068
|
node.ownerDocument = this;
|
|
38930
39069
|
node.appendData(data);
|
|
38931
39070
|
return node;
|
|
38932
39071
|
},
|
|
39072
|
+
/**
|
|
39073
|
+
* Returns a ProcessingInstruction node whose target is target and data is data.
|
|
39074
|
+
*
|
|
39075
|
+
* __This implementation differs from the specification:__
|
|
39076
|
+
* - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
|
|
39077
|
+
*
|
|
39078
|
+
* Note: When the resulting document is serialized with `requireWellFormed: true`, the
|
|
39079
|
+
* serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
|
|
39080
|
+
* §3.2.1.7). Without that option the data is emitted verbatim.
|
|
39081
|
+
*
|
|
39082
|
+
* @param {string} target
|
|
39083
|
+
* @param {string} data
|
|
39084
|
+
* @returns {ProcessingInstruction}
|
|
39085
|
+
* @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
|
|
39086
|
+
* @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
|
|
39087
|
+
* @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
|
|
39088
|
+
*/
|
|
38933
39089
|
createProcessingInstruction : function(target,data){
|
|
38934
39090
|
var node = new ProcessingInstruction();
|
|
38935
39091
|
node.ownerDocument = this;
|
|
@@ -39155,6 +39311,19 @@ function requireDom () {
|
|
|
39155
39311
|
_extends(CDATASection,CharacterData);
|
|
39156
39312
|
|
|
39157
39313
|
|
|
39314
|
+
/**
|
|
39315
|
+
* Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
|
|
39316
|
+
*
|
|
39317
|
+
* `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
|
|
39318
|
+
* xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
|
|
39319
|
+
* direct property writes succeed silently. Values are serialized verbatim when
|
|
39320
|
+
* `requireWellFormed` is false (the default). When the serializer is invoked with
|
|
39321
|
+
* `requireWellFormed: true` (via the 4th-parameter options object), it validates each
|
|
39322
|
+
* field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
|
|
39323
|
+
*
|
|
39324
|
+
* @class
|
|
39325
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
|
|
39326
|
+
*/
|
|
39158
39327
|
function DocumentType() {
|
|
39159
39328
|
} DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
|
|
39160
39329
|
_extends(DocumentType,Node);
|
|
@@ -39182,11 +39351,48 @@ function requireDom () {
|
|
|
39182
39351
|
ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
|
|
39183
39352
|
_extends(ProcessingInstruction,Node);
|
|
39184
39353
|
function XMLSerializer(){}
|
|
39185
|
-
|
|
39186
|
-
|
|
39354
|
+
/**
|
|
39355
|
+
* Returns the result of serializing `node` to XML.
|
|
39356
|
+
*
|
|
39357
|
+
* When `options.requireWellFormed` is `true`, the serializer throws for content that would
|
|
39358
|
+
* produce ill-formed XML.
|
|
39359
|
+
*
|
|
39360
|
+
* __This implementation differs from the specification:__
|
|
39361
|
+
* - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
|
|
39362
|
+
* at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
|
|
39363
|
+
* default behaviour) unless `requireWellFormed` is `true`.
|
|
39364
|
+
* - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
|
|
39365
|
+
* is only thrown to prevent injection vectors, not for all the spec mandated checks.
|
|
39366
|
+
*
|
|
39367
|
+
* @param {Node} node
|
|
39368
|
+
* @param {boolean} [isHtml]
|
|
39369
|
+
* @param {function} [nodeFilter]
|
|
39370
|
+
* @param {Object} [options]
|
|
39371
|
+
* @param {boolean} [options.requireWellFormed=false]
|
|
39372
|
+
* When `true`, throws for content that would produce ill-formed XML.
|
|
39373
|
+
* @returns {string}
|
|
39374
|
+
* @throws {DOMException}
|
|
39375
|
+
* With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
|
|
39376
|
+
* - a CDATASection node's data contains `"]]>"`,
|
|
39377
|
+
* - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
|
|
39378
|
+
* - a ProcessingInstruction's data contains `"?>"`,
|
|
39379
|
+
* - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
|
|
39380
|
+
* production,
|
|
39381
|
+
* - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
|
|
39382
|
+
* production, or
|
|
39383
|
+
* - a DocumentType's `internalSubset` contains `"]>"`.
|
|
39384
|
+
* Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
|
|
39385
|
+
* writes succeed and are covered by the serializer-level checks above.
|
|
39386
|
+
* @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
|
|
39387
|
+
* @see https://w3c.github.io/DOM-Parsing/#xml-serialization
|
|
39388
|
+
* @see https://github.com/w3c/DOM-Parsing/issues/84
|
|
39389
|
+
*/
|
|
39390
|
+
XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
|
|
39391
|
+
return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
|
|
39187
39392
|
};
|
|
39188
39393
|
Node.prototype.toString = nodeSerializeToString;
|
|
39189
|
-
function nodeSerializeToString(isHtml,nodeFilter){
|
|
39394
|
+
function nodeSerializeToString(isHtml,nodeFilter,options){
|
|
39395
|
+
var requireWellFormed = !!options && !!options.requireWellFormed;
|
|
39190
39396
|
var buf = [];
|
|
39191
39397
|
var refNode = this.nodeType == 9 && this.documentElement || this;
|
|
39192
39398
|
var prefix = refNode.prefix;
|
|
@@ -39203,7 +39409,7 @@ function requireDom () {
|
|
|
39203
39409
|
];
|
|
39204
39410
|
}
|
|
39205
39411
|
}
|
|
39206
|
-
serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
|
|
39412
|
+
serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
|
|
39207
39413
|
//console.log('###',this.nodeType,uri,prefix,buf.join(''))
|
|
39208
39414
|
return buf.join('');
|
|
39209
39415
|
}
|
|
@@ -39252,271 +39458,323 @@ function requireDom () {
|
|
|
39252
39458
|
buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
|
|
39253
39459
|
}
|
|
39254
39460
|
|
|
39255
|
-
function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
|
|
39461
|
+
function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
|
|
39256
39462
|
if (!visibleNamespaces) {
|
|
39257
39463
|
visibleNamespaces = [];
|
|
39258
39464
|
}
|
|
39259
|
-
|
|
39260
|
-
|
|
39261
|
-
|
|
39262
|
-
|
|
39263
|
-
|
|
39264
|
-
|
|
39265
|
-
|
|
39266
|
-
|
|
39267
|
-
|
|
39268
|
-
|
|
39269
|
-
|
|
39270
|
-
//buf.sort.apply(attrs, attributeSorter);
|
|
39271
|
-
}
|
|
39272
|
-
|
|
39273
|
-
switch(node.nodeType){
|
|
39274
|
-
case ELEMENT_NODE:
|
|
39275
|
-
var attrs = node.attributes;
|
|
39276
|
-
var len = attrs.length;
|
|
39277
|
-
var child = node.firstChild;
|
|
39278
|
-
var nodeName = node.tagName;
|
|
39279
|
-
|
|
39280
|
-
isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
|
|
39281
|
-
|
|
39282
|
-
var prefixedNodeName = nodeName;
|
|
39283
|
-
if (!isHTML && !node.prefix && node.namespaceURI) {
|
|
39284
|
-
var defaultNS;
|
|
39285
|
-
// lookup current default ns from `xmlns` attribute
|
|
39286
|
-
for (var ai = 0; ai < attrs.length; ai++) {
|
|
39287
|
-
if (attrs.item(ai).name === 'xmlns') {
|
|
39288
|
-
defaultNS = attrs.item(ai).value;
|
|
39289
|
-
break
|
|
39290
|
-
}
|
|
39291
|
-
}
|
|
39292
|
-
if (!defaultNS) {
|
|
39293
|
-
// lookup current default ns in visibleNamespaces
|
|
39294
|
-
for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
|
|
39295
|
-
var namespace = visibleNamespaces[nsi];
|
|
39296
|
-
if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
|
|
39297
|
-
defaultNS = namespace.namespace;
|
|
39298
|
-
break
|
|
39465
|
+
walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
|
|
39466
|
+
enter: function (n, ctx) {
|
|
39467
|
+
var ns = ctx.ns;
|
|
39468
|
+
var html = ctx.isHTML;
|
|
39469
|
+
|
|
39470
|
+
if (nodeFilter) {
|
|
39471
|
+
n = nodeFilter(n);
|
|
39472
|
+
if (n) {
|
|
39473
|
+
if (typeof n == 'string') {
|
|
39474
|
+
buf.push(n);
|
|
39475
|
+
return null;
|
|
39299
39476
|
}
|
|
39477
|
+
} else {
|
|
39478
|
+
return null;
|
|
39300
39479
|
}
|
|
39301
39480
|
}
|
|
39302
|
-
|
|
39303
|
-
|
|
39304
|
-
|
|
39305
|
-
|
|
39306
|
-
|
|
39307
|
-
|
|
39481
|
+
|
|
39482
|
+
switch (n.nodeType) {
|
|
39483
|
+
case ELEMENT_NODE:
|
|
39484
|
+
var attrs = n.attributes;
|
|
39485
|
+
var len = attrs.length;
|
|
39486
|
+
var nodeName = n.tagName;
|
|
39487
|
+
|
|
39488
|
+
html = NAMESPACE.isHTML(n.namespaceURI) || html;
|
|
39489
|
+
|
|
39490
|
+
var prefixedNodeName = nodeName;
|
|
39491
|
+
if (!html && !n.prefix && n.namespaceURI) {
|
|
39492
|
+
var defaultNS;
|
|
39493
|
+
// lookup current default ns from `xmlns` attribute
|
|
39494
|
+
for (var ai = 0; ai < attrs.length; ai++) {
|
|
39495
|
+
if (attrs.item(ai).name === 'xmlns') {
|
|
39496
|
+
defaultNS = attrs.item(ai).value;
|
|
39497
|
+
break;
|
|
39498
|
+
}
|
|
39499
|
+
}
|
|
39500
|
+
if (!defaultNS) {
|
|
39501
|
+
// lookup current default ns in visibleNamespaces
|
|
39502
|
+
for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
|
|
39503
|
+
var nsEntry = ns[nsi];
|
|
39504
|
+
if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
|
|
39505
|
+
defaultNS = nsEntry.namespace;
|
|
39506
|
+
break;
|
|
39507
|
+
}
|
|
39508
|
+
}
|
|
39509
|
+
}
|
|
39510
|
+
if (defaultNS !== n.namespaceURI) {
|
|
39511
|
+
for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
|
|
39512
|
+
var nsEntry = ns[nsi];
|
|
39513
|
+
if (nsEntry.namespace === n.namespaceURI) {
|
|
39514
|
+
if (nsEntry.prefix) {
|
|
39515
|
+
prefixedNodeName = nsEntry.prefix + ':' + nodeName;
|
|
39516
|
+
}
|
|
39517
|
+
break;
|
|
39518
|
+
}
|
|
39519
|
+
}
|
|
39308
39520
|
}
|
|
39309
|
-
break
|
|
39310
39521
|
}
|
|
39311
|
-
}
|
|
39312
|
-
}
|
|
39313
|
-
}
|
|
39314
39522
|
|
|
39315
|
-
|
|
39523
|
+
buf.push('<', prefixedNodeName);
|
|
39524
|
+
|
|
39525
|
+
// Build a fresh namespace snapshot for this element's children.
|
|
39526
|
+
// The slice prevents sibling elements from inheriting each other's declarations.
|
|
39527
|
+
var childNs = ns.slice();
|
|
39528
|
+
for (var i = 0; i < len; i++) {
|
|
39529
|
+
var attr = attrs.item(i);
|
|
39530
|
+
if (attr.prefix == 'xmlns') {
|
|
39531
|
+
childNs.push({ prefix: attr.localName, namespace: attr.value });
|
|
39532
|
+
} else if (attr.nodeName == 'xmlns') {
|
|
39533
|
+
childNs.push({ prefix: '', namespace: attr.value });
|
|
39534
|
+
}
|
|
39535
|
+
}
|
|
39316
39536
|
|
|
39317
|
-
|
|
39318
|
-
|
|
39319
|
-
|
|
39320
|
-
|
|
39321
|
-
|
|
39322
|
-
|
|
39323
|
-
|
|
39324
|
-
|
|
39325
|
-
|
|
39537
|
+
for (var i = 0; i < len; i++) {
|
|
39538
|
+
var attr = attrs.item(i);
|
|
39539
|
+
if (needNamespaceDefine(attr, html, childNs)) {
|
|
39540
|
+
var attrPrefix = attr.prefix || '';
|
|
39541
|
+
var uri = attr.namespaceURI;
|
|
39542
|
+
addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
|
|
39543
|
+
childNs.push({ prefix: attrPrefix, namespace: uri });
|
|
39544
|
+
}
|
|
39545
|
+
// Apply nodeFilter and serialize the attribute.
|
|
39546
|
+
var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
|
|
39547
|
+
if (filteredAttr) {
|
|
39548
|
+
if (typeof filteredAttr === 'string') {
|
|
39549
|
+
buf.push(filteredAttr);
|
|
39550
|
+
} else {
|
|
39551
|
+
addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
|
|
39552
|
+
}
|
|
39553
|
+
}
|
|
39554
|
+
}
|
|
39326
39555
|
|
|
39327
|
-
|
|
39328
|
-
|
|
39329
|
-
|
|
39330
|
-
|
|
39331
|
-
|
|
39332
|
-
|
|
39333
|
-
|
|
39334
|
-
}
|
|
39335
|
-
serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
|
|
39336
|
-
}
|
|
39556
|
+
// add namespace for current node
|
|
39557
|
+
if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
|
|
39558
|
+
var nodePrefix = n.prefix || '';
|
|
39559
|
+
var uri = n.namespaceURI;
|
|
39560
|
+
addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
|
|
39561
|
+
childNs.push({ prefix: nodePrefix, namespace: uri });
|
|
39562
|
+
}
|
|
39337
39563
|
|
|
39338
|
-
|
|
39339
|
-
|
|
39340
|
-
|
|
39341
|
-
|
|
39342
|
-
|
|
39343
|
-
|
|
39344
|
-
|
|
39564
|
+
var child = n.firstChild;
|
|
39565
|
+
if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
|
|
39566
|
+
buf.push('>');
|
|
39567
|
+
if (html && /^script$/i.test(nodeName)) {
|
|
39568
|
+
// Inline serialization for <script> children; return null to skip walkDOM descent.
|
|
39569
|
+
while (child) {
|
|
39570
|
+
if (child.data) {
|
|
39571
|
+
buf.push(child.data);
|
|
39572
|
+
} else {
|
|
39573
|
+
serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
|
|
39574
|
+
}
|
|
39575
|
+
child = child.nextSibling;
|
|
39576
|
+
}
|
|
39577
|
+
buf.push('</', nodeName, '>');
|
|
39578
|
+
return null;
|
|
39579
|
+
}
|
|
39580
|
+
// Return child context; walkDOM descends and exit emits the closing tag.
|
|
39581
|
+
return { ns: childNs, isHTML: html, tag: prefixedNodeName };
|
|
39582
|
+
} else {
|
|
39583
|
+
buf.push('/>');
|
|
39584
|
+
return null;
|
|
39585
|
+
}
|
|
39345
39586
|
|
|
39346
|
-
|
|
39347
|
-
|
|
39348
|
-
|
|
39349
|
-
|
|
39350
|
-
|
|
39351
|
-
|
|
39352
|
-
|
|
39353
|
-
|
|
39354
|
-
|
|
39587
|
+
case DOCUMENT_NODE:
|
|
39588
|
+
case DOCUMENT_FRAGMENT_NODE:
|
|
39589
|
+
// Descend into children; exit is a no-op (tag is null).
|
|
39590
|
+
return { ns: ns.slice(), isHTML: html, tag: null };
|
|
39591
|
+
|
|
39592
|
+
case ATTRIBUTE_NODE:
|
|
39593
|
+
addSerializedAttribute(buf, n.name, n.value);
|
|
39594
|
+
return null;
|
|
39595
|
+
|
|
39596
|
+
case TEXT_NODE:
|
|
39597
|
+
/**
|
|
39598
|
+
* The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
|
|
39599
|
+
* except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
|
|
39600
|
+
* If they are needed elsewhere, they must be escaped using either numeric character references or the strings
|
|
39601
|
+
* `&` and `<` respectively.
|
|
39602
|
+
* The right angle bracket (>) may be represented using the string " > ", and must, for compatibility,
|
|
39603
|
+
* be escaped using either `>` or a character reference when it appears in the string `]]>` in content,
|
|
39604
|
+
* when that string is not marking the end of a CDATA section.
|
|
39605
|
+
*
|
|
39606
|
+
* In the content of elements, character data is any string of characters
|
|
39607
|
+
* which does not contain the start-delimiter of any markup
|
|
39608
|
+
* and does not include the CDATA-section-close delimiter, `]]>`.
|
|
39609
|
+
*
|
|
39610
|
+
* @see https://www.w3.org/TR/xml/#NT-CharData
|
|
39611
|
+
* @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
|
|
39612
|
+
*/
|
|
39613
|
+
buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
|
|
39614
|
+
return null;
|
|
39615
|
+
|
|
39616
|
+
case CDATA_SECTION_NODE:
|
|
39617
|
+
if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
|
|
39618
|
+
throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
|
|
39355
39619
|
}
|
|
39356
|
-
|
|
39357
|
-
|
|
39358
|
-
|
|
39359
|
-
|
|
39360
|
-
|
|
39361
|
-
|
|
39362
|
-
|
|
39363
|
-
|
|
39364
|
-
|
|
39365
|
-
|
|
39366
|
-
|
|
39367
|
-
|
|
39368
|
-
|
|
39369
|
-
|
|
39370
|
-
|
|
39371
|
-
|
|
39372
|
-
|
|
39373
|
-
|
|
39374
|
-
|
|
39375
|
-
|
|
39376
|
-
|
|
39377
|
-
|
|
39378
|
-
|
|
39379
|
-
|
|
39380
|
-
|
|
39381
|
-
|
|
39382
|
-
|
|
39383
|
-
|
|
39384
|
-
|
|
39385
|
-
|
|
39386
|
-
|
|
39387
|
-
|
|
39388
|
-
|
|
39389
|
-
|
|
39390
|
-
|
|
39391
|
-
|
|
39392
|
-
|
|
39393
|
-
|
|
39394
|
-
|
|
39395
|
-
|
|
39396
|
-
|
|
39397
|
-
|
|
39398
|
-
|
|
39399
|
-
|
|
39400
|
-
|
|
39401
|
-
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39410
|
-
|
|
39411
|
-
|
|
39412
|
-
|
|
39413
|
-
|
|
39620
|
+
buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
|
|
39621
|
+
return null;
|
|
39622
|
+
|
|
39623
|
+
case COMMENT_NODE:
|
|
39624
|
+
if (requireWellFormed && n.data.indexOf('-->') !== -1) {
|
|
39625
|
+
throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
|
|
39626
|
+
}
|
|
39627
|
+
buf.push('<!--', n.data, '-->');
|
|
39628
|
+
return null;
|
|
39629
|
+
|
|
39630
|
+
case DOCUMENT_TYPE_NODE:
|
|
39631
|
+
if (requireWellFormed) {
|
|
39632
|
+
if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
|
|
39633
|
+
throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
|
|
39634
|
+
}
|
|
39635
|
+
if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
|
|
39636
|
+
throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
|
|
39637
|
+
}
|
|
39638
|
+
if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
|
|
39639
|
+
throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
|
|
39640
|
+
}
|
|
39641
|
+
}
|
|
39642
|
+
var pubid = n.publicId;
|
|
39643
|
+
var sysid = n.systemId;
|
|
39644
|
+
buf.push('<!DOCTYPE ', n.name);
|
|
39645
|
+
if (pubid) {
|
|
39646
|
+
buf.push(' PUBLIC ', pubid);
|
|
39647
|
+
if (sysid && sysid != '.') {
|
|
39648
|
+
buf.push(' ', sysid);
|
|
39649
|
+
}
|
|
39650
|
+
buf.push('>');
|
|
39651
|
+
} else if (sysid && sysid != '.') {
|
|
39652
|
+
buf.push(' SYSTEM ', sysid, '>');
|
|
39653
|
+
} else {
|
|
39654
|
+
var sub = n.internalSubset;
|
|
39655
|
+
if (sub) {
|
|
39656
|
+
buf.push(' [', sub, ']');
|
|
39657
|
+
}
|
|
39658
|
+
buf.push('>');
|
|
39659
|
+
}
|
|
39660
|
+
return null;
|
|
39661
|
+
|
|
39662
|
+
case PROCESSING_INSTRUCTION_NODE:
|
|
39663
|
+
if (requireWellFormed && n.data.indexOf('?>') !== -1) {
|
|
39664
|
+
throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
|
|
39665
|
+
}
|
|
39666
|
+
buf.push('<?', n.target, ' ', n.data, '?>');
|
|
39667
|
+
return null;
|
|
39668
|
+
|
|
39669
|
+
case ENTITY_REFERENCE_NODE:
|
|
39670
|
+
buf.push('&', n.nodeName, ';');
|
|
39671
|
+
return null;
|
|
39672
|
+
|
|
39673
|
+
//case ENTITY_NODE:
|
|
39674
|
+
//case NOTATION_NODE:
|
|
39675
|
+
default:
|
|
39676
|
+
buf.push('??', n.nodeName);
|
|
39677
|
+
return null;
|
|
39414
39678
|
}
|
|
39415
|
-
|
|
39416
|
-
|
|
39417
|
-
|
|
39418
|
-
|
|
39419
|
-
var sub = node.internalSubset;
|
|
39420
|
-
if(sub){
|
|
39421
|
-
buf.push(" [",sub,"]");
|
|
39679
|
+
},
|
|
39680
|
+
exit: function (n, childCtx) {
|
|
39681
|
+
if (childCtx && childCtx.tag) {
|
|
39682
|
+
buf.push('</', childCtx.tag, '>');
|
|
39422
39683
|
}
|
|
39423
|
-
|
|
39424
|
-
|
|
39425
|
-
return;
|
|
39426
|
-
case PROCESSING_INSTRUCTION_NODE:
|
|
39427
|
-
return buf.push( "<?",node.target," ",node.data,"?>");
|
|
39428
|
-
case ENTITY_REFERENCE_NODE:
|
|
39429
|
-
return buf.push( '&',node.nodeName,';');
|
|
39430
|
-
//case ENTITY_NODE:
|
|
39431
|
-
//case NOTATION_NODE:
|
|
39432
|
-
default:
|
|
39433
|
-
buf.push('??',node.nodeName);
|
|
39434
|
-
}
|
|
39684
|
+
},
|
|
39685
|
+
});
|
|
39435
39686
|
}
|
|
39436
|
-
|
|
39437
|
-
|
|
39438
|
-
|
|
39439
|
-
|
|
39440
|
-
|
|
39441
|
-
|
|
39442
|
-
|
|
39443
|
-
|
|
39444
|
-
|
|
39445
|
-
|
|
39446
|
-
|
|
39447
|
-
|
|
39448
|
-
|
|
39449
|
-
|
|
39450
|
-
|
|
39451
|
-
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
|
|
39455
|
-
|
|
39456
|
-
|
|
39457
|
-
|
|
39458
|
-
|
|
39459
|
-
|
|
39460
|
-
|
|
39461
|
-
|
|
39462
|
-
|
|
39463
|
-
|
|
39464
|
-
|
|
39465
|
-
|
|
39466
|
-
|
|
39467
|
-
|
|
39468
|
-
|
|
39469
|
-
|
|
39470
|
-
|
|
39471
|
-
|
|
39472
|
-
|
|
39473
|
-
var child = node.firstChild;
|
|
39474
|
-
while(child){
|
|
39475
|
-
node2.appendChild(importNode(doc,child,deep));
|
|
39476
|
-
child = child.nextSibling;
|
|
39477
|
-
}
|
|
39478
|
-
}
|
|
39479
|
-
return node2;
|
|
39687
|
+
/**
|
|
39688
|
+
* Imports a node from a different document into `doc`, creating a new copy.
|
|
39689
|
+
* Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
|
|
39690
|
+
* stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
|
|
39691
|
+
* Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
|
|
39692
|
+
* always forced to `true`
|
|
39693
|
+
* because an attribute's value lives in a child text node.
|
|
39694
|
+
*
|
|
39695
|
+
* @param {Document} doc
|
|
39696
|
+
* The document that will own the imported node.
|
|
39697
|
+
* @param {Node} node
|
|
39698
|
+
* The node to import.
|
|
39699
|
+
* @param {boolean} deep
|
|
39700
|
+
* If `true`, descendants are imported recursively.
|
|
39701
|
+
* @returns {Node}
|
|
39702
|
+
* The newly imported node, now owned by `doc`.
|
|
39703
|
+
*/
|
|
39704
|
+
function importNode(doc, node, deep) {
|
|
39705
|
+
var destRoot;
|
|
39706
|
+
walkDOM(node, null, {
|
|
39707
|
+
enter: function (srcNode, destParent) {
|
|
39708
|
+
// Shallow-clone the node and stamp it into the target document.
|
|
39709
|
+
var destNode = srcNode.cloneNode(false);
|
|
39710
|
+
destNode.ownerDocument = doc;
|
|
39711
|
+
destNode.parentNode = null;
|
|
39712
|
+
// capture as the root of the imported subtree or attach to parent.
|
|
39713
|
+
if (destParent === null) {
|
|
39714
|
+
destRoot = destNode;
|
|
39715
|
+
} else {
|
|
39716
|
+
destParent.appendChild(destNode);
|
|
39717
|
+
}
|
|
39718
|
+
// ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
|
|
39719
|
+
var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
|
|
39720
|
+
return shouldDeep ? destNode : null;
|
|
39721
|
+
},
|
|
39722
|
+
});
|
|
39723
|
+
return destRoot;
|
|
39480
39724
|
}
|
|
39481
39725
|
//
|
|
39482
39726
|
//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
|
|
39483
39727
|
// attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
|
|
39484
|
-
function cloneNode(doc,node,deep){
|
|
39485
|
-
var
|
|
39486
|
-
|
|
39487
|
-
|
|
39488
|
-
|
|
39489
|
-
|
|
39490
|
-
|
|
39491
|
-
|
|
39728
|
+
function cloneNode(doc, node, deep) {
|
|
39729
|
+
var destRoot;
|
|
39730
|
+
walkDOM(node, null, {
|
|
39731
|
+
enter: function (srcNode, destParent) {
|
|
39732
|
+
// 1. Create a blank node of the same type and copy all scalar own properties.
|
|
39733
|
+
var destNode = new srcNode.constructor();
|
|
39734
|
+
for (var n in srcNode) {
|
|
39735
|
+
if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
|
|
39736
|
+
var v = srcNode[n];
|
|
39737
|
+
if (typeof v != 'object') {
|
|
39738
|
+
if (v != destNode[n]) {
|
|
39739
|
+
destNode[n] = v;
|
|
39740
|
+
}
|
|
39741
|
+
}
|
|
39492
39742
|
}
|
|
39493
39743
|
}
|
|
39494
|
-
|
|
39495
|
-
|
|
39496
|
-
|
|
39497
|
-
|
|
39498
|
-
|
|
39499
|
-
|
|
39500
|
-
|
|
39501
|
-
|
|
39502
|
-
|
|
39503
|
-
|
|
39504
|
-
|
|
39505
|
-
|
|
39506
|
-
|
|
39507
|
-
|
|
39508
|
-
|
|
39509
|
-
|
|
39510
|
-
|
|
39511
|
-
|
|
39512
|
-
|
|
39513
|
-
|
|
39514
|
-
|
|
39515
|
-
|
|
39516
|
-
|
|
39517
|
-
|
|
39518
|
-
|
|
39519
|
-
|
|
39744
|
+
if (srcNode.childNodes) {
|
|
39745
|
+
destNode.childNodes = new NodeList();
|
|
39746
|
+
}
|
|
39747
|
+
destNode.ownerDocument = doc;
|
|
39748
|
+
// 2. Handle node-type-specific setup.
|
|
39749
|
+
// Attributes are not DOM children, so they are cloned inline here
|
|
39750
|
+
// rather than by walkDOM descent.
|
|
39751
|
+
// ATTRIBUTE_NODE forces deep=true so its own children are walked.
|
|
39752
|
+
var shouldDeep = deep;
|
|
39753
|
+
switch (destNode.nodeType) {
|
|
39754
|
+
case ELEMENT_NODE:
|
|
39755
|
+
var attrs = srcNode.attributes;
|
|
39756
|
+
var attrs2 = (destNode.attributes = new NamedNodeMap());
|
|
39757
|
+
var len = attrs.length;
|
|
39758
|
+
attrs2._ownerElement = destNode;
|
|
39759
|
+
for (var i = 0; i < len; i++) {
|
|
39760
|
+
destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
|
|
39761
|
+
}
|
|
39762
|
+
break;
|
|
39763
|
+
case ATTRIBUTE_NODE:
|
|
39764
|
+
shouldDeep = true;
|
|
39765
|
+
}
|
|
39766
|
+
// 3. Attach to parent, or capture as the root of the cloned subtree.
|
|
39767
|
+
if (destParent !== null) {
|
|
39768
|
+
destParent.appendChild(destNode);
|
|
39769
|
+
} else {
|
|
39770
|
+
destRoot = destNode;
|
|
39771
|
+
}
|
|
39772
|
+
// 4. Return destNode as the context for children (causes walkDOM to descend),
|
|
39773
|
+
// or null to skip children (shallow clone).
|
|
39774
|
+
return shouldDeep ? destNode : null;
|
|
39775
|
+
},
|
|
39776
|
+
});
|
|
39777
|
+
return destRoot;
|
|
39520
39778
|
}
|
|
39521
39779
|
|
|
39522
39780
|
function __set__(object,key,value){
|
|
@@ -39532,49 +39790,55 @@ function requireDom () {
|
|
|
39532
39790
|
}
|
|
39533
39791
|
});
|
|
39534
39792
|
|
|
39535
|
-
|
|
39536
|
-
|
|
39537
|
-
|
|
39793
|
+
/**
|
|
39794
|
+
* The text content of this node and its descendants.
|
|
39795
|
+
*
|
|
39796
|
+
* Setting `textContent` on an element or document fragment replaces all child nodes with a
|
|
39797
|
+
* single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
|
|
39798
|
+
*
|
|
39799
|
+
* @type {string | null}
|
|
39800
|
+
* @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
|
|
39801
|
+
*/
|
|
39802
|
+
Object.defineProperty(Node.prototype, 'textContent', {
|
|
39803
|
+
get: function () {
|
|
39804
|
+
if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
|
|
39805
|
+
var buf = [];
|
|
39806
|
+
walkDOM(this, null, {
|
|
39807
|
+
enter: function (n) {
|
|
39808
|
+
if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
|
|
39809
|
+
return true; // enter children
|
|
39810
|
+
}
|
|
39811
|
+
if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
|
|
39812
|
+
return null; // excluded from text content
|
|
39813
|
+
}
|
|
39814
|
+
buf.push(n.nodeValue);
|
|
39815
|
+
},
|
|
39816
|
+
});
|
|
39817
|
+
return buf.join('');
|
|
39818
|
+
}
|
|
39819
|
+
return this.nodeValue;
|
|
39538
39820
|
},
|
|
39539
39821
|
|
|
39540
|
-
set:function(data){
|
|
39541
|
-
switch(this.nodeType){
|
|
39542
|
-
|
|
39543
|
-
|
|
39544
|
-
|
|
39545
|
-
|
|
39546
|
-
|
|
39547
|
-
|
|
39548
|
-
|
|
39549
|
-
|
|
39550
|
-
|
|
39822
|
+
set: function (data) {
|
|
39823
|
+
switch (this.nodeType) {
|
|
39824
|
+
case ELEMENT_NODE:
|
|
39825
|
+
case DOCUMENT_FRAGMENT_NODE:
|
|
39826
|
+
while (this.firstChild) {
|
|
39827
|
+
this.removeChild(this.firstChild);
|
|
39828
|
+
}
|
|
39829
|
+
if (data || String(data)) {
|
|
39830
|
+
this.appendChild(this.ownerDocument.createTextNode(data));
|
|
39831
|
+
}
|
|
39832
|
+
break;
|
|
39551
39833
|
|
|
39552
|
-
|
|
39553
|
-
|
|
39554
|
-
|
|
39555
|
-
|
|
39834
|
+
default:
|
|
39835
|
+
this.data = data;
|
|
39836
|
+
this.value = data;
|
|
39837
|
+
this.nodeValue = data;
|
|
39556
39838
|
}
|
|
39557
|
-
}
|
|
39839
|
+
},
|
|
39558
39840
|
});
|
|
39559
39841
|
|
|
39560
|
-
function getTextContent(node){
|
|
39561
|
-
switch(node.nodeType){
|
|
39562
|
-
case ELEMENT_NODE:
|
|
39563
|
-
case DOCUMENT_FRAGMENT_NODE:
|
|
39564
|
-
var buf = [];
|
|
39565
|
-
node = node.firstChild;
|
|
39566
|
-
while(node){
|
|
39567
|
-
if(node.nodeType!==7 && node.nodeType !==8){
|
|
39568
|
-
buf.push(getTextContent(node));
|
|
39569
|
-
}
|
|
39570
|
-
node = node.nextSibling;
|
|
39571
|
-
}
|
|
39572
|
-
return buf.join('');
|
|
39573
|
-
default:
|
|
39574
|
-
return node.nodeValue;
|
|
39575
|
-
}
|
|
39576
|
-
}
|
|
39577
|
-
|
|
39578
39842
|
__set__ = function(object,key,value){
|
|
39579
39843
|
//console.log(value)
|
|
39580
39844
|
object['$$'+key] = value;
|
|
@@ -39590,6 +39854,7 @@ function requireDom () {
|
|
|
39590
39854
|
dom.Element = Element;
|
|
39591
39855
|
dom.Node = Node;
|
|
39592
39856
|
dom.NodeList = NodeList;
|
|
39857
|
+
dom.walkDOM = walkDOM;
|
|
39593
39858
|
dom.XMLSerializer = XMLSerializer;
|
|
39594
39859
|
//}
|
|
39595
39860
|
return dom;
|
|
@@ -42380,7 +42645,7 @@ function requireSax () {
|
|
|
42380
42645
|
function parseInstruction(source,start,domBuilder){
|
|
42381
42646
|
var end = source.indexOf('?>',start);
|
|
42382
42647
|
if(end){
|
|
42383
|
-
var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)
|
|
42648
|
+
var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
|
|
42384
42649
|
if(match){
|
|
42385
42650
|
match[0].length;
|
|
42386
42651
|
domBuilder.processingInstruction(match[1], match[2]) ;
|
|
@@ -49267,7 +49532,7 @@ function requireMomentTimezone () {
|
|
|
49267
49532
|
hasRequiredMomentTimezone = 1;
|
|
49268
49533
|
(function (module) {
|
|
49269
49534
|
//! moment-timezone.js
|
|
49270
|
-
//! version : 0.6.
|
|
49535
|
+
//! version : 0.6.1
|
|
49271
49536
|
//! Copyright (c) JS Foundation and other contributors
|
|
49272
49537
|
//! license : MIT
|
|
49273
49538
|
//! github.com/moment/moment-timezone
|
|
@@ -49293,7 +49558,7 @@ function requireMomentTimezone () {
|
|
|
49293
49558
|
// return moment;
|
|
49294
49559
|
// }
|
|
49295
49560
|
|
|
49296
|
-
var VERSION = "0.6.
|
|
49561
|
+
var VERSION = "0.6.1",
|
|
49297
49562
|
zones = {},
|
|
49298
49563
|
links = {},
|
|
49299
49564
|
countries = {},
|