| 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 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1658 RefPtr<Element> newElement = m_tree.createHTMLElementFromElementReco
rd(node); | 1658 RefPtr<Element> newElement = m_tree.createHTMLElementFromElementReco
rd(node); |
| 1659 HTMLFormattingElementList::Entry* nodeEntry = m_tree.activeFormattin
gElements()->find(node->element()); | 1659 HTMLFormattingElementList::Entry* nodeEntry = m_tree.activeFormattin
gElements()->find(node->element()); |
| 1660 nodeEntry->replaceElement(newElement.get()); | 1660 nodeEntry->replaceElement(newElement.get()); |
| 1661 node->replaceElement(newElement.release()); | 1661 node->replaceElement(newElement.release()); |
| 1662 // 6.4 -- Intentionally out of order to handle the case where node | 1662 // 6.4 -- Intentionally out of order to handle the case where node |
| 1663 // was replaced in 6.5. | 1663 // was replaced in 6.5. |
| 1664 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10096 | 1664 // http://www.w3.org/Bugs/Public/show_bug.cgi?id=10096 |
| 1665 if (lastNode == furthestBlock) | 1665 if (lastNode == furthestBlock) |
| 1666 bookmark.moveToAfter(nodeEntry); | 1666 bookmark.moveToAfter(nodeEntry); |
| 1667 // 6.6 | 1667 // 6.6 |
| 1668 if (Element* parent = lastNode->element()->parentElement()) | 1668 if (ContainerNode* parent = lastNode->element()->parentNode()) |
| 1669 parent->parserRemoveChild(lastNode->element()); | 1669 parent->parserRemoveChild(lastNode->element()); |
| 1670 node->element()->parserAddChild(lastNode->element()); | 1670 node->element()->parserAddChild(lastNode->element()); |
| 1671 if (lastNode->element()->parentElement()->attached() && !lastNode->e
lement()->attached()) | 1671 if (lastNode->element()->parentElement()->attached() && !lastNode->e
lement()->attached()) |
| 1672 lastNode->element()->lazyAttach(); | 1672 lastNode->element()->lazyAttach(); |
| 1673 // 6.7 | 1673 // 6.7 |
| 1674 lastNode = node; | 1674 lastNode = node; |
| 1675 } | 1675 } |
| 1676 // 7 | 1676 // 7 |
| 1677 const AtomicString& commonAncestorTag = commonAncestor->localName(); | 1677 const AtomicString& commonAncestorTag = commonAncestor->localName(); |
| 1678 if (Element* parent = lastNode->element()->parentElement()) | 1678 if (ContainerNode* parent = lastNode->element()->parentNode()) |
| 1679 parent->parserRemoveChild(lastNode->element()); | 1679 parent->parserRemoveChild(lastNode->element()); |
| 1680 // FIXME: If this moves to HTMLConstructionSite, this check should use | 1680 // FIXME: If this moves to HTMLConstructionSite, this check should use |
| 1681 // causesFosterParenting(tagName) instead. | 1681 // causesFosterParenting(tagName) instead. |
| 1682 if (commonAncestorTag == tableTag | 1682 if (commonAncestorTag == tableTag |
| 1683 || commonAncestorTag == trTag | 1683 || commonAncestorTag == trTag |
| 1684 || isTableBodyContextTag(commonAncestorTag)) | 1684 || isTableBodyContextTag(commonAncestorTag)) |
| 1685 m_tree.fosterParent(lastNode->element()); | 1685 m_tree.fosterParent(lastNode->element()); |
| 1686 else { | 1686 else { |
| 1687 commonAncestor->parserAddChild(lastNode->element()); | 1687 commonAncestor->parserAddChild(lastNode->element()); |
| 1688 ASSERT(lastNode->node()->isElementNode()); | 1688 ASSERT(lastNode->node()->isElementNode()); |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2837 } | 2837 } |
| 2838 | 2838 |
| 2839 bool HTMLTreeBuilder::pluginsEnabled(Frame* frame) | 2839 bool HTMLTreeBuilder::pluginsEnabled(Frame* frame) |
| 2840 { | 2840 { |
| 2841 if (!frame) | 2841 if (!frame) |
| 2842 return false; | 2842 return false; |
| 2843 return frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiate
Plugin); | 2843 return frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiate
Plugin); |
| 2844 } | 2844 } |
| 2845 | 2845 |
| 2846 } | 2846 } |
| OLD | NEW |