Changeset 771


Ignore:
Timestamp:
03/12/07 23:03:08 (12 years ago)
Author:
ray
Message:

Ticket #981 No doctype in iframe content document/ editor always in quirks mode

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r768 r771  
    24032403  if ( !editor.config.fullPage ) 
    24042404  { 
    2405     html = "<html>\n"; 
     2405    html += this.doctype ? this.doctype : Xinha.getDoctype(document) + "\n"; 
     2406    html += "<html>\n"; 
    24062407    html += "<head>\n"; 
    24072408    html += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" + editor.config.charSet + "\">\n"; 
     
    24412442    { 
    24422443      editor.setDoctype(RegExp.$1); 
    2443       html = html.replace(Xinha.RE_doctype, ""); 
     2444      //html = html.replace(Xinha.RE_doctype, ""); 
    24442445    } 
    24452446     
     
    25472548  { 
    25482549    this.setDoctype(RegExp.$1); 
    2549     html = html.replace(Xinha.RE_doctype, ""); 
     2550   // html = html.replace(Xinha.RE_doctype, ""); 
    25502551  } 
    25512552  RegExp.multiline = save_multiline; 
  • trunk/modules/Gecko/Gecko.js

    r754 r771  
    739739   
    740740  return result; 
    741 } 
     741}; 
     742 
     743/** Return the doctype of a document, if set 
     744 *  
     745 * @param doc DOM element document 
     746 * @returns string the actual doctype 
     747 */ 
     748Xinha.getDoctype = function (doc) 
     749{ 
     750  var d = ''; 
     751  if (doc.doctype) 
     752  { 
     753    d += '<!DOCTYPE ' + doc.doctype.name + " PUBLIC "; 
     754    d +=  doc.doctype.publicId ? '"' + doc.doctype.publicId + '"' : '';   
     755    d +=  doc.doctype.systemId ? ' "'+ doc.doctype.systemId + '"' : '';  
     756    d += ">"; 
     757  } 
     758  return d; 
     759}; 
  • trunk/modules/InternetExplorer/InternetExplorer.js

    r737 r771  
    458458  if ( target == 'textarea' ) this._textArea.focus(); 
    459459}; 
     460 
     461/** Return a doctype or empty string depending on whether the document is in Qirksmode or Standards Compliant Mode 
     462 *  It's hardly possible to detect the actual doctype without unreasonable effort, so we set HTML 4.01 just to trigger the rendering mode 
     463 *  
     464 * @param doc DOM element document 
     465 * @returns string doctype || empty 
     466 */ 
     467Xinha.getDoctype = function (doc) 
     468{ 
     469  return (doc.compatMode == "CSS1Compat") ? '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' : ''; 
     470}; 
Note: See TracChangeset for help on using the changeset viewer.