You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The remaining are not PHP behavior because these values only exist in this exact form in JavaScript
261
-
elseif(typeofval==='undefined'){
262
-
ret='undefined';
263
-
}elseif(typeofval==='function'){
264
-
varfuncLines=val.toString().split('\n');
265
-
ret='';
266
-
for(vari=0,fll=funcLines.length;i<fll;i++){
267
-
ret+=(i!==0 ? '\n'+thick_pad : '')+funcLines[i];
268
-
}
269
-
}elseif(valinstanceofDate){
270
-
ret='Date('+val+')';
271
-
}elseif(valinstanceofRegExp){
272
-
ret='RegExp('+val+')';
273
-
}elseif(val.nodeName){// Different than PHP's DOMElement
274
-
switch(val.nodeType){
275
-
case1:
276
-
if(typeofval.namespaceURI==='undefined'||val.namespaceURI==='http://www.w3.org/1999/xhtml'){// Undefined namespace could be plain XML, but namespaceURI not widely supported
// Follows the DOM 3 Load and Save standard, but not
420
-
// implemented in browsers at present; HTML5 is to standardize on innerHTML, but not for XML (though
421
-
// possibly will also standardize with DOMParser); in the meantime, to ensure fullest browser support, could
422
-
// attach http://svn2.assembla.com/svn/brettz9/DOMToString/DOM3.js (see http://svn2.assembla.com/svn/brettz9/DOMToString/DOM3.xhtml for a simple test file)
423
-
varlsInput=dils.createLSInput();
424
-
// If we're in XHTML, we'll try to allow the XHTML namespace to be available by default
425
-
lsInput.stringData=stringContainer;
426
-
varlsParser=dils.createLSParser(1,null);// synchronous, no schema type
427
-
returnlsParser.parse(lsInput).firstChild;
428
-
}elseif(dp){
429
-
// If we're in XHTML, we'll try to allow the XHTML namespace to be available by default
// Document fragment did not work with innerHTML, so we create a temporary element holder
454
-
// If we're in XHTML, we'll try to allow the XHTML namespace to be available by default
455
-
//if (d.createElementNS && (d.contentType && d.contentType !== 'text/html')) { // Don't create namespaced elements if we're being served as HTML (currently only Mozilla supports this detection in true XHTML-supporting browsers, but Safari and Opera should work with the above DOMParser anyways, and IE doesn't support createElementNS anyways)
456
-
if(d.createElementNS&&// Browser supports the method
457
-
(d.documentElement.namespaceURI||// We can use if the document is using a namespace
458
-
d.documentElement.nodeName.toLowerCase()!=='html'||// We know it's not HTML4 or less, if the tag is not HTML (even if the root namespace is null)
459
-
(d.contentType&&d.contentType!=='text/html')// We know it's not regular HTML4 or less if this is Mozilla (only browser supporting the attribute) and the content type is something other than text/html; other HTML5 roots (like svg) still have a namespace
460
-
)){// Don't create namespaced elements if we're being served as HTML (currently only Mozilla supports this detection in true XHTML-supporting browsers, but Safari and Opera should work with the above DOMParser anyways, and IE doesn't support createElementNS anyways); last test is for the sake of being in a pure XML document
461
-
holder=d.createElementNS(ns,container);
462
-
}else{
463
-
holder=d.createElement(container);// Document fragment did not work with innerHTML
464
-
}
465
-
holder.innerHTML=str;
466
-
while(holder.firstChild){
467
-
parent.appendChild(holder.firstChild);
468
-
}
469
-
returnfalse;
470
-
// throw 'Your browser does not support DOM parsing as required by echo()';
// We assume for now that embedded variables do not have dollar sign; to add a dollar sign, you currently must use {$$var} (We might change this, however.)
496
-
// Doesn't cover all cases yet: see http://php.net/manual/en/language.types.string.php#language.types.string.syntax.double
if(!phpjs.flushing&&obs&&obs.length){// If flushing we output, but otherwise presence of a buffer means caching output
515
-
obs[obs.length-1].buffer+=arg;
516
-
continue;
517
-
}
518
-
519
-
if(d.appendChild){
520
-
if(d.body){
521
-
if(win.navigator.appName==='Microsoft Internet Explorer'){// We unfortunately cannot use feature detection, since this is an IE bug with cloneNode nodes being appended
522
-
d.body.appendChild(stringToDOM(ieFix(arg)));
523
-
}else{
524
-
varunappendedLeft=stringToDOM(arg,d.body,ns_xhtml,'div').cloneNode(true);// We will not actually append the div tag (just using for providing XHTML namespace by default)
525
-
if(unappendedLeft){
526
-
d.body.appendChild(unappendedLeft);
527
-
}
528
-
}
529
-
}else{
530
-
d.documentElement.appendChild(stringToDOM(arg,d.documentElement,ns_xul,'description'));// We will not actually append the description tag (just using for providing XUL namespace by default)
531
-
}
532
-
}elseif(d.write){
533
-
d.write(arg);
534
-
}
535
-
/* else { // This could recurse if we ever add print!
0 commit comments