()
| 524 | } |
| 525 | |
| 526 | function createHTMLParser () { |
| 527 | var Parser = function () {}; |
| 528 | |
| 529 | { |
| 530 | if (shouldUseActiveX()) { |
| 531 | Parser.prototype.parseFromString = function (string) { |
| 532 | var doc = new window.ActiveXObject('htmlfile'); |
| 533 | doc.designMode = 'on'; // disable on-page scripts |
| 534 | doc.open(); |
| 535 | doc.write(string); |
| 536 | doc.close(); |
| 537 | return doc |
| 538 | }; |
| 539 | } else { |
| 540 | Parser.prototype.parseFromString = function (string) { |
| 541 | var doc = document.implementation.createHTMLDocument(''); |
| 542 | doc.open(); |
| 543 | doc.write(string); |
| 544 | doc.close(); |
| 545 | return doc |
| 546 | }; |
| 547 | } |
| 548 | } |
| 549 | return Parser |
| 550 | } |
| 551 | |
| 552 | function shouldUseActiveX () { |
| 553 | var useActiveX = false; |
no test coverage detected