| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2008 Holger Hans Peter Freyther | 7 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 #endif | 549 #endif |
| 550 | 550 |
| 551 if (isFirstElement && document()->frame()) | 551 if (isFirstElement && document()->frame()) |
| 552 document()->frame()->loader()->dispatchDocumentElementAvailable(); | 552 document()->frame()->loader()->dispatchDocumentElementAvailable(); |
| 553 } | 553 } |
| 554 | 554 |
| 555 void XMLDocumentParser::parseEndElement() | 555 void XMLDocumentParser::parseEndElement() |
| 556 { | 556 { |
| 557 exitText(); | 557 exitText(); |
| 558 | 558 |
| 559 Node* n = m_currentNode; | 559 RefPtr<ContainerNode> n = m_currentNode; |
| 560 n->finishParsingChildren(); | 560 n->finishParsingChildren(); |
| 561 | 561 |
| 562 if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode
() && toScriptElement(static_cast<Element*>(n))) { | 562 if (m_scriptingPermission == FragmentScriptingNotAllowed && n->isElementNode
() && toScriptElement(static_cast<Element*>(n.get()))) { |
| 563 popCurrentNode(); | 563 popCurrentNode(); |
| 564 ExceptionCode ec; | 564 ExceptionCode ec; |
| 565 n->remove(ec); | 565 n->remove(ec); |
| 566 return; | 566 return; |
| 567 } | 567 } |
| 568 | 568 |
| 569 if (!n->isElementNode() || !m_view) { | 569 if (!n->isElementNode() || !m_view) { |
| 570 if (!m_currentNodeStack.isEmpty()) | 570 if (!m_currentNodeStack.isEmpty()) |
| 571 popCurrentNode(); | 571 popCurrentNode(); |
| 572 return; | 572 return; |
| 573 } | 573 } |
| 574 | 574 |
| 575 Element* element = static_cast<Element*>(n); | 575 Element* element = static_cast<Element*>(n.get()); |
| 576 | 576 |
| 577 // The element's parent may have already been removed from document. | 577 // The element's parent may have already been removed from document. |
| 578 // Parsing continues in this case, but scripts aren't executed. | 578 // Parsing continues in this case, but scripts aren't executed. |
| 579 if (!element->inDocument()) { | 579 if (!element->inDocument()) { |
| 580 popCurrentNode(); | 580 popCurrentNode(); |
| 581 return; | 581 return; |
| 582 } | 582 } |
| 583 | 583 |
| 584 ScriptElement* scriptElement = toScriptElement(element); | 584 ScriptElement* scriptElement = toScriptElement(element); |
| 585 if (!scriptElement) { | 585 if (!scriptElement) { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 && publicId != QLatin1String("-//WAPFORUM//DTD WML 1.2//EN") | 725 && publicId != QLatin1String("-//WAPFORUM//DTD WML 1.2//EN") |
| 726 && publicId != QLatin1String("-//WAPFORUM//DTD WML 1.1//EN") | 726 && publicId != QLatin1String("-//WAPFORUM//DTD WML 1.1//EN") |
| 727 && publicId != QLatin1String("-//WAPFORUM//DTD WML 1.0//EN")) | 727 && publicId != QLatin1String("-//WAPFORUM//DTD WML 1.0//EN")) |
| 728 handleError(fatal, "Invalid DTD Public ID", lineNumber(), columnNumber()
); | 728 handleError(fatal, "Invalid DTD Public ID", lineNumber(), columnNumber()
); |
| 729 #endif | 729 #endif |
| 730 if (!m_parsingFragment) | 730 if (!m_parsingFragment) |
| 731 document()->parserAddChild(DocumentType::create(document(), name, public
Id, systemId)); | 731 document()->parserAddChild(DocumentType::create(document(), name, public
Id, systemId)); |
| 732 | 732 |
| 733 } | 733 } |
| 734 } | 734 } |
| OLD | NEW |