本文整理汇总了C++中DocumentType::name方法的典型用法代码示例。如果您正苦于以下问题:C++ DocumentType::name方法的具体用法?C++ DocumentType::name怎么用?C++ DocumentType::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentType
的用法示例。
在下文中一共展示了DocumentType::name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCompatibilityModeFromDoctype
void HTMLDocument::setCompatibilityModeFromDoctype()
{
// There are three possible compatibility modes:
// Quirks - quirks mode emulates WinIE and NS4. CSS parsing is also relaxed in this mode, e.g., unit types can
// be omitted from numbers.
// Limited Quirks - This mode is identical to no-quirks mode except for its treatment of line-height in the inline box model.
// No Quirks - no quirks apply. Web pages will obey the specifications to the letter.
DocumentType* docType = doctype();
if (!docType)
return;
// Check for Quirks Mode.
const String& publicId = docType->publicId();
if (docType->name() != "html"
|| publicId.startsWith("+//Silmaril//dtd html Pro v0r11 19970101//", false)
|| publicId.startsWith("-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//", false)
|| publicId.startsWith("-//AS//DTD HTML 3.0 asWedit + extensions//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.0 Level 1//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.0 Level 2//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 1//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 2//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.0 Strict//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.0//", false)
|| publicId.startsWith("-//IETF//DTD HTML 2.1E//", false)
|| publicId.startsWith("-//IETF//DTD HTML 3.0//", false)
|| publicId.startsWith("-//IETF//DTD HTML 3.2 Final//", false)
|| publicId.startsWith("-//IETF//DTD HTML 3.2//", false)
|| publicId.startsWith("-//IETF//DTD HTML 3//", false)
|| publicId.startsWith("-//IETF//DTD HTML Level 0//", false)
|| publicId.startsWith("-//IETF//DTD HTML Level 1//", false)
|| publicId.startsWith("-//IETF//DTD HTML Level 2//", false)
|| publicId.startsWith("-//IETF//DTD HTML Level 3//", false)
|| publicId.startsWith("-//IETF//DTD HTML Strict Level 0//", false)
|| publicId.startsWith("-//IETF//DTD HTML Strict Level 1//", false)
|| publicId.startsWith("-//IETF//DTD HTML Strict Level 2//", false)
|| publicId.startsWith("-//IETF//DTD HTML Strict Level 3//", false)
|| publicId.startsWith("-//IETF//DTD HTML Strict//", false)
|| publicId.startsWith("-//IETF//DTD HTML//", false)
|| publicId.startsWith("-//Metrius//DTD Metrius Presentational//", false)
|| publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//", false)
|| publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 HTML//", false)
|| publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 Tables//", false)
|| publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//", false)
|| publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 HTML//", false)
|| publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 Tables//", false)
|| publicId.startsWith("-//Netscape Comm. Corp.//DTD HTML//", false)
|| publicId.startsWith("-//Netscape Comm. Corp.//DTD Strict HTML//", false)
|| publicId.startsWith("-//O'Reilly and Associates//DTD HTML 2.0//", false)
|| publicId.startsWith("-//O'Reilly and Associates//DTD HTML Extended 1.0//", false)
|| publicId.startsWith("-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//", false)
|| publicId.startsWith("-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//", false)
|| publicId.startsWith("-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//", false)
|| publicId.startsWith("-//Spyglass//DTD HTML 2.0 Extended//", false)
|| publicId.startsWith("-//SQ//DTD HTML 2.0 HoTMetaL + extensions//", false)
|| publicId.startsWith("-//Sun Microsystems Corp.//DTD HotJava HTML//", false)
|| publicId.startsWith("-//Sun Microsystems Corp.//DTD HotJava Strict HTML//", false)
|| publicId.startsWith("-//W3C//DTD HTML 3 1995-03-24//", false)
|| publicId.startsWith("-//W3C//DTD HTML 3.2 Draft//", false)
|| publicId.startsWith("-//W3C//DTD HTML 3.2 Final//", false)
|| publicId.startsWith("-//W3C//DTD HTML 3.2//", false)
|| publicId.startsWith("-//W3C//DTD HTML 3.2S Draft//", false)
|| publicId.startsWith("-//W3C//DTD HTML 4.0 Frameset//", false)
|| publicId.startsWith("-//W3C//DTD HTML 4.0 Transitional//", false)
|| publicId.startsWith("-//W3C//DTD HTML Experimental 19960712//", false)
|| publicId.startsWith("-//W3C//DTD HTML Experimental 970421//", false)
|| publicId.startsWith("-//W3C//DTD W3 HTML//", false)
|| publicId.startsWith("-//W3O//DTD W3 HTML 3.0//", false)
|| equalIgnoringCase(publicId, "-//W3O//DTD W3 HTML Strict 3.0//EN//")
|| publicId.startsWith("-//WebTechs//DTD Mozilla HTML 2.0//", false)
|| publicId.startsWith("-//WebTechs//DTD Mozilla HTML//", false)
|| equalIgnoringCase(publicId, "-/W3C/DTD HTML 4.0 Transitional/EN")
|| equalIgnoringCase(publicId, "HTML")
|| equalIgnoringCase(docType->systemId(), "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd")
|| (docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", false))
|| (docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", false))) {
setCompatibilityMode(QuirksMode);
return;
}
// Check for Limited Quirks Mode.
if (publicId.startsWith("-//W3C//DTD XHTML 1.0 Frameset//", false)
|| publicId.startsWith("-//W3C//DTD XHTML 1.0 Transitional//", false)
|| (!docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", false))
|| (!docType->systemId().isEmpty() && publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", false))) {
setCompatibilityMode(LimitedQuirksMode);
return;
}
// Otherwise we are No Quirks Mode.
setCompatibilityMode(NoQuirksMode);
return;
}