| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // Quirks - quirks mode emulates WinIE and NS4. CSS parsing is also relaxed in | 449 // Quirks - quirks mode emulates WinIE and NS4. CSS parsing is also relaxed in |
| 450 // this mode, e.g., unit types can be omitted from numbers. | 450 // this mode, e.g., unit types can be omitted from numbers. |
| 451 // Limited Quirks - This mode is identical to no-quirks mode except for its | 451 // Limited Quirks - This mode is identical to no-quirks mode except for its |
| 452 // treatment of line-height in the inline box model. | 452 // treatment of line-height in the inline box model. |
| 453 // No Quirks - no quirks apply. Web pages will obey the specifications to the | 453 // No Quirks - no quirks apply. Web pages will obey the specifications to the |
| 454 // letter. | 454 // letter. |
| 455 | 455 |
| 456 // Check for Quirks Mode. | 456 // Check for Quirks Mode. |
| 457 if (name != "html" || | 457 if (name != "html" || |
| 458 publicId.startsWith("+//Silmaril//dtd html Pro v0r11 19970101//", | 458 publicId.startsWith("+//Silmaril//dtd html Pro v0r11 19970101//", |
| 459 TextCaseInsensitive) || | 459 TextCaseASCIIInsensitive) || |
| 460 publicId.startsWith( | 460 publicId.startsWith( |
| 461 "-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//", | 461 "-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//", |
| 462 TextCaseInsensitive) || | 462 TextCaseASCIIInsensitive) || |
| 463 publicId.startsWith("-//AS//DTD HTML 3.0 asWedit + extensions//", | 463 publicId.startsWith("-//AS//DTD HTML 3.0 asWedit + extensions//", |
| 464 TextCaseInsensitive) || | 464 TextCaseASCIIInsensitive) || |
| 465 publicId.startsWith("-//IETF//DTD HTML 2.0 Level 1//", | 465 publicId.startsWith("-//IETF//DTD HTML 2.0 Level 1//", |
| 466 TextCaseInsensitive) || | 466 TextCaseASCIIInsensitive) || |
| 467 publicId.startsWith("-//IETF//DTD HTML 2.0 Level 2//", | 467 publicId.startsWith("-//IETF//DTD HTML 2.0 Level 2//", |
| 468 TextCaseInsensitive) || | 468 TextCaseASCIIInsensitive) || |
| 469 publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 1//", | 469 publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 1//", |
| 470 TextCaseInsensitive) || | 470 TextCaseASCIIInsensitive) || |
| 471 publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 2//", | 471 publicId.startsWith("-//IETF//DTD HTML 2.0 Strict Level 2//", |
| 472 TextCaseInsensitive) || | 472 TextCaseASCIIInsensitive) || |
| 473 publicId.startsWith("-//IETF//DTD HTML 2.0 Strict//", | 473 publicId.startsWith("-//IETF//DTD HTML 2.0 Strict//", |
| 474 TextCaseInsensitive) || | 474 TextCaseASCIIInsensitive) || |
| 475 publicId.startsWith("-//IETF//DTD HTML 2.0//", TextCaseInsensitive) || | 475 publicId.startsWith("-//IETF//DTD HTML 2.0//", |
| 476 publicId.startsWith("-//IETF//DTD HTML 2.1E//", TextCaseInsensitive) || | 476 TextCaseASCIIInsensitive) || |
| 477 publicId.startsWith("-//IETF//DTD HTML 3.0//", TextCaseInsensitive) || | 477 publicId.startsWith("-//IETF//DTD HTML 2.1E//", |
| 478 TextCaseASCIIInsensitive) || |
| 479 publicId.startsWith("-//IETF//DTD HTML 3.0//", |
| 480 TextCaseASCIIInsensitive) || |
| 478 publicId.startsWith("-//IETF//DTD HTML 3.2 Final//", | 481 publicId.startsWith("-//IETF//DTD HTML 3.2 Final//", |
| 479 TextCaseInsensitive) || | 482 TextCaseASCIIInsensitive) || |
| 480 publicId.startsWith("-//IETF//DTD HTML 3.2//", TextCaseInsensitive) || | 483 publicId.startsWith("-//IETF//DTD HTML 3.2//", |
| 481 publicId.startsWith("-//IETF//DTD HTML 3//", TextCaseInsensitive) || | 484 TextCaseASCIIInsensitive) || |
| 482 publicId.startsWith("-//IETF//DTD HTML Level 0//", TextCaseInsensitive) || | 485 publicId.startsWith("-//IETF//DTD HTML 3//", TextCaseASCIIInsensitive) || |
| 483 publicId.startsWith("-//IETF//DTD HTML Level 1//", TextCaseInsensitive) || | 486 publicId.startsWith("-//IETF//DTD HTML Level 0//", |
| 484 publicId.startsWith("-//IETF//DTD HTML Level 2//", TextCaseInsensitive) || | 487 TextCaseASCIIInsensitive) || |
| 485 publicId.startsWith("-//IETF//DTD HTML Level 3//", TextCaseInsensitive) || | 488 publicId.startsWith("-//IETF//DTD HTML Level 1//", |
| 489 TextCaseASCIIInsensitive) || |
| 490 publicId.startsWith("-//IETF//DTD HTML Level 2//", |
| 491 TextCaseASCIIInsensitive) || |
| 492 publicId.startsWith("-//IETF//DTD HTML Level 3//", |
| 493 TextCaseASCIIInsensitive) || |
| 486 publicId.startsWith("-//IETF//DTD HTML Strict Level 0//", | 494 publicId.startsWith("-//IETF//DTD HTML Strict Level 0//", |
| 487 TextCaseInsensitive) || | 495 TextCaseASCIIInsensitive) || |
| 488 publicId.startsWith("-//IETF//DTD HTML Strict Level 1//", | 496 publicId.startsWith("-//IETF//DTD HTML Strict Level 1//", |
| 489 TextCaseInsensitive) || | 497 TextCaseASCIIInsensitive) || |
| 490 publicId.startsWith("-//IETF//DTD HTML Strict Level 2//", | 498 publicId.startsWith("-//IETF//DTD HTML Strict Level 2//", |
| 491 TextCaseInsensitive) || | 499 TextCaseASCIIInsensitive) || |
| 492 publicId.startsWith("-//IETF//DTD HTML Strict Level 3//", | 500 publicId.startsWith("-//IETF//DTD HTML Strict Level 3//", |
| 493 TextCaseInsensitive) || | 501 TextCaseASCIIInsensitive) || |
| 494 publicId.startsWith("-//IETF//DTD HTML Strict//", TextCaseInsensitive) || | 502 publicId.startsWith("-//IETF//DTD HTML Strict//", |
| 495 publicId.startsWith("-//IETF//DTD HTML//", TextCaseInsensitive) || | 503 TextCaseASCIIInsensitive) || |
| 504 publicId.startsWith("-//IETF//DTD HTML//", TextCaseASCIIInsensitive) || |
| 496 publicId.startsWith("-//Metrius//DTD Metrius Presentational//", | 505 publicId.startsWith("-//Metrius//DTD Metrius Presentational//", |
| 497 TextCaseInsensitive) || | 506 TextCaseASCIIInsensitive) || |
| 498 publicId.startsWith( | 507 publicId.startsWith( |
| 499 "-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//", | 508 "-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//", |
| 500 TextCaseInsensitive) || | 509 TextCaseASCIIInsensitive) || |
| 501 publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 HTML//", | 510 publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 HTML//", |
| 502 TextCaseInsensitive) || | 511 TextCaseASCIIInsensitive) || |
| 503 publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 Tables//", | 512 publicId.startsWith("-//Microsoft//DTD Internet Explorer 2.0 Tables//", |
| 504 TextCaseInsensitive) || | 513 TextCaseASCIIInsensitive) || |
| 505 publicId.startsWith( | 514 publicId.startsWith( |
| 506 "-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//", | 515 "-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//", |
| 507 TextCaseInsensitive) || | 516 TextCaseASCIIInsensitive) || |
| 508 publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 HTML//", | 517 publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 HTML//", |
| 509 TextCaseInsensitive) || | 518 TextCaseASCIIInsensitive) || |
| 510 publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 Tables//", | 519 publicId.startsWith("-//Microsoft//DTD Internet Explorer 3.0 Tables//", |
| 511 TextCaseInsensitive) || | 520 TextCaseASCIIInsensitive) || |
| 512 publicId.startsWith("-//Netscape Comm. Corp.//DTD HTML//", | 521 publicId.startsWith("-//Netscape Comm. Corp.//DTD HTML//", |
| 513 TextCaseInsensitive) || | 522 TextCaseASCIIInsensitive) || |
| 514 publicId.startsWith("-//Netscape Comm. Corp.//DTD Strict HTML//", | 523 publicId.startsWith("-//Netscape Comm. Corp.//DTD Strict HTML//", |
| 515 TextCaseInsensitive) || | 524 TextCaseASCIIInsensitive) || |
| 516 publicId.startsWith("-//O'Reilly and Associates//DTD HTML 2.0//", | 525 publicId.startsWith("-//O'Reilly and Associates//DTD HTML 2.0//", |
| 517 TextCaseInsensitive) || | 526 TextCaseASCIIInsensitive) || |
| 518 publicId.startsWith("-//O'Reilly and Associates//DTD HTML Extended 1.0//", | 527 publicId.startsWith("-//O'Reilly and Associates//DTD HTML Extended 1.0//", |
| 519 TextCaseInsensitive) || | 528 TextCaseASCIIInsensitive) || |
| 520 publicId.startsWith( | 529 publicId.startsWith( |
| 521 "-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//", | 530 "-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//", |
| 522 TextCaseInsensitive) || | 531 TextCaseASCIIInsensitive) || |
| 523 publicId.startsWith("-//SoftQuad Software//DTD HoTMetaL PRO " | 532 publicId.startsWith("-//SoftQuad Software//DTD HoTMetaL PRO " |
| 524 "6.0::19990601::extensions to HTML 4.0//", | 533 "6.0::19990601::extensions to HTML 4.0//", |
| 525 TextCaseInsensitive) || | 534 TextCaseASCIIInsensitive) || |
| 526 publicId.startsWith("-//SoftQuad//DTD HoTMetaL PRO " | 535 publicId.startsWith("-//SoftQuad//DTD HoTMetaL PRO " |
| 527 "4.0::19971010::extensions to HTML 4.0//", | 536 "4.0::19971010::extensions to HTML 4.0//", |
| 528 TextCaseInsensitive) || | 537 TextCaseASCIIInsensitive) || |
| 529 publicId.startsWith("-//Spyglass//DTD HTML 2.0 Extended//", | 538 publicId.startsWith("-//Spyglass//DTD HTML 2.0 Extended//", |
| 530 TextCaseInsensitive) || | 539 TextCaseASCIIInsensitive) || |
| 531 publicId.startsWith("-//SQ//DTD HTML 2.0 HoTMetaL + extensions//", | 540 publicId.startsWith("-//SQ//DTD HTML 2.0 HoTMetaL + extensions//", |
| 532 TextCaseInsensitive) || | 541 TextCaseASCIIInsensitive) || |
| 533 publicId.startsWith("-//Sun Microsystems Corp.//DTD HotJava HTML//", | 542 publicId.startsWith("-//Sun Microsystems Corp.//DTD HotJava HTML//", |
| 534 TextCaseInsensitive) || | 543 TextCaseASCIIInsensitive) || |
| 535 publicId.startsWith( | 544 publicId.startsWith( |
| 536 "-//Sun Microsystems Corp.//DTD HotJava Strict HTML//", | 545 "-//Sun Microsystems Corp.//DTD HotJava Strict HTML//", |
| 537 TextCaseInsensitive) || | 546 TextCaseASCIIInsensitive) || |
| 538 publicId.startsWith("-//W3C//DTD HTML 3 1995-03-24//", | 547 publicId.startsWith("-//W3C//DTD HTML 3 1995-03-24//", |
| 539 TextCaseInsensitive) || | 548 TextCaseASCIIInsensitive) || |
| 540 publicId.startsWith("-//W3C//DTD HTML 3.2 Draft//", | 549 publicId.startsWith("-//W3C//DTD HTML 3.2 Draft//", |
| 541 TextCaseInsensitive) || | 550 TextCaseASCIIInsensitive) || |
| 542 publicId.startsWith("-//W3C//DTD HTML 3.2 Final//", | 551 publicId.startsWith("-//W3C//DTD HTML 3.2 Final//", |
| 543 TextCaseInsensitive) || | 552 TextCaseASCIIInsensitive) || |
| 544 publicId.startsWith("-//W3C//DTD HTML 3.2//", TextCaseInsensitive) || | 553 publicId.startsWith("-//W3C//DTD HTML 3.2//", TextCaseASCIIInsensitive) || |
| 545 publicId.startsWith("-//W3C//DTD HTML 3.2S Draft//", | 554 publicId.startsWith("-//W3C//DTD HTML 3.2S Draft//", |
| 546 TextCaseInsensitive) || | 555 TextCaseASCIIInsensitive) || |
| 547 publicId.startsWith("-//W3C//DTD HTML 4.0 Frameset//", | 556 publicId.startsWith("-//W3C//DTD HTML 4.0 Frameset//", |
| 548 TextCaseInsensitive) || | 557 TextCaseASCIIInsensitive) || |
| 549 publicId.startsWith("-//W3C//DTD HTML 4.0 Transitional//", | 558 publicId.startsWith("-//W3C//DTD HTML 4.0 Transitional//", |
| 550 TextCaseInsensitive) || | 559 TextCaseASCIIInsensitive) || |
| 551 publicId.startsWith("-//W3C//DTD HTML Experimental 19960712//", | 560 publicId.startsWith("-//W3C//DTD HTML Experimental 19960712//", |
| 552 TextCaseInsensitive) || | 561 TextCaseASCIIInsensitive) || |
| 553 publicId.startsWith("-//W3C//DTD HTML Experimental 970421//", | 562 publicId.startsWith("-//W3C//DTD HTML Experimental 970421//", |
| 554 TextCaseInsensitive) || | 563 TextCaseASCIIInsensitive) || |
| 555 publicId.startsWith("-//W3C//DTD W3 HTML//", TextCaseInsensitive) || | 564 publicId.startsWith("-//W3C//DTD W3 HTML//", TextCaseASCIIInsensitive) || |
| 556 publicId.startsWith("-//W3O//DTD W3 HTML 3.0//", TextCaseInsensitive) || | 565 publicId.startsWith("-//W3O//DTD W3 HTML 3.0//", |
| 566 TextCaseASCIIInsensitive) || |
| 557 equalIgnoringCase(publicId, "-//W3O//DTD W3 HTML Strict 3.0//EN//") || | 567 equalIgnoringCase(publicId, "-//W3O//DTD W3 HTML Strict 3.0//EN//") || |
| 558 publicId.startsWith("-//WebTechs//DTD Mozilla HTML 2.0//", | 568 publicId.startsWith("-//WebTechs//DTD Mozilla HTML 2.0//", |
| 559 TextCaseInsensitive) || | 569 TextCaseASCIIInsensitive) || |
| 560 publicId.startsWith("-//WebTechs//DTD Mozilla HTML//", | 570 publicId.startsWith("-//WebTechs//DTD Mozilla HTML//", |
| 561 TextCaseInsensitive) || | 571 TextCaseASCIIInsensitive) || |
| 562 equalIgnoringCase(publicId, "-/W3C/DTD HTML 4.0 Transitional/EN") || | 572 equalIgnoringCase(publicId, "-/W3C/DTD HTML 4.0 Transitional/EN") || |
| 563 equalIgnoringCase(publicId, "HTML") || | 573 equalIgnoringCase(publicId, "HTML") || |
| 564 equalIgnoringCase( | 574 equalIgnoringCase( |
| 565 systemId, | 575 systemId, |
| 566 "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") || | 576 "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd") || |
| 567 (systemId.isEmpty() && | 577 (systemId.isEmpty() && |
| 568 publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", | 578 publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", |
| 569 TextCaseInsensitive)) || | 579 TextCaseASCIIInsensitive)) || |
| 570 (systemId.isEmpty() && | 580 (systemId.isEmpty() && |
| 571 publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", | 581 publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", |
| 572 TextCaseInsensitive))) { | 582 TextCaseASCIIInsensitive))) { |
| 573 setCompatibilityMode(Document::QuirksMode); | 583 setCompatibilityMode(Document::QuirksMode); |
| 574 return; | 584 return; |
| 575 } | 585 } |
| 576 | 586 |
| 577 // Check for Limited Quirks Mode. | 587 // Check for Limited Quirks Mode. |
| 578 if (publicId.startsWith("-//W3C//DTD XHTML 1.0 Frameset//", | 588 if (publicId.startsWith("-//W3C//DTD XHTML 1.0 Frameset//", |
| 579 TextCaseInsensitive) || | 589 TextCaseASCIIInsensitive) || |
| 580 publicId.startsWith("-//W3C//DTD XHTML 1.0 Transitional//", | 590 publicId.startsWith("-//W3C//DTD XHTML 1.0 Transitional//", |
| 581 TextCaseInsensitive) || | 591 TextCaseASCIIInsensitive) || |
| 582 (!systemId.isEmpty() && | 592 (!systemId.isEmpty() && |
| 583 publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", | 593 publicId.startsWith("-//W3C//DTD HTML 4.01 Frameset//", |
| 584 TextCaseInsensitive)) || | 594 TextCaseASCIIInsensitive)) || |
| 585 (!systemId.isEmpty() && | 595 (!systemId.isEmpty() && |
| 586 publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", | 596 publicId.startsWith("-//W3C//DTD HTML 4.01 Transitional//", |
| 587 TextCaseInsensitive))) { | 597 TextCaseASCIIInsensitive))) { |
| 588 setCompatibilityMode(Document::LimitedQuirksMode); | 598 setCompatibilityMode(Document::LimitedQuirksMode); |
| 589 return; | 599 return; |
| 590 } | 600 } |
| 591 | 601 |
| 592 // Otherwise we are No Quirks Mode. | 602 // Otherwise we are No Quirks Mode. |
| 593 setCompatibilityMode(Document::NoQuirksMode); | 603 setCompatibilityMode(Document::NoQuirksMode); |
| 594 } | 604 } |
| 595 | 605 |
| 596 void HTMLConstructionSite::processEndOfFile() { | 606 void HTMLConstructionSite::processEndOfFile() { |
| 597 ASSERT(currentNode()); | 607 ASSERT(currentNode()); |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 ASSERT(task.parent); | 1067 ASSERT(task.parent); |
| 1058 queueTask(task); | 1068 queueTask(task); |
| 1059 } | 1069 } |
| 1060 | 1070 |
| 1061 DEFINE_TRACE(HTMLConstructionSite::PendingText) { | 1071 DEFINE_TRACE(HTMLConstructionSite::PendingText) { |
| 1062 visitor->trace(parent); | 1072 visitor->trace(parent); |
| 1063 visitor->trace(nextChild); | 1073 visitor->trace(nextChild); |
| 1064 } | 1074 } |
| 1065 | 1075 |
| 1066 } // namespace blink | 1076 } // namespace blink |
| OLD | NEW |