| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "core/dom/ClientRectList.h" | 45 #include "core/dom/ClientRectList.h" |
| 46 #include "core/dom/ElementDataCache.h" | 46 #include "core/dom/ElementDataCache.h" |
| 47 #include "core/dom/ElementRareData.h" | 47 #include "core/dom/ElementRareData.h" |
| 48 #include "core/dom/ElementTraversal.h" | 48 #include "core/dom/ElementTraversal.h" |
| 49 #include "core/dom/ExceptionCode.h" | 49 #include "core/dom/ExceptionCode.h" |
| 50 #include "core/dom/MutationObserverInterestGroup.h" | 50 #include "core/dom/MutationObserverInterestGroup.h" |
| 51 #include "core/dom/MutationRecord.h" | 51 #include "core/dom/MutationRecord.h" |
| 52 #include "core/dom/NamedNodeMap.h" | 52 #include "core/dom/NamedNodeMap.h" |
| 53 #include "core/dom/NodeRenderStyle.h" | 53 #include "core/dom/NodeRenderStyle.h" |
| 54 #include "core/dom/RenderTreeBuilder.h" | 54 #include "core/dom/RenderTreeBuilder.h" |
| 55 #include "core/dom/ScriptableDocumentParser.h" | |
| 56 #include "core/dom/SelectorQuery.h" | 55 #include "core/dom/SelectorQuery.h" |
| 57 #include "core/dom/StyleEngine.h" | 56 #include "core/dom/StyleEngine.h" |
| 58 #include "core/dom/Text.h" | 57 #include "core/dom/Text.h" |
| 59 #include "core/dom/custom/CustomElement.h" | 58 #include "core/dom/custom/CustomElement.h" |
| 60 #include "core/dom/custom/CustomElementRegistrationContext.h" | 59 #include "core/dom/custom/CustomElementRegistrationContext.h" |
| 61 #include "core/dom/shadow/InsertionPoint.h" | 60 #include "core/dom/shadow/InsertionPoint.h" |
| 62 #include "core/dom/shadow/ShadowRoot.h" | 61 #include "core/dom/shadow/ShadowRoot.h" |
| 63 #include "core/editing/FrameSelection.h" | 62 #include "core/editing/FrameSelection.h" |
| 64 #include "core/editing/TextIterator.h" | 63 #include "core/editing/TextIterator.h" |
| 65 #include "core/editing/htmlediting.h" | 64 #include "core/editing/htmlediting.h" |
| 66 #include "core/editing/markup.h" | 65 #include "core/editing/markup.h" |
| 67 #include "core/events/EventDispatcher.h" | 66 #include "core/events/EventDispatcher.h" |
| 68 #include "core/events/FocusEvent.h" | 67 #include "core/events/FocusEvent.h" |
| 69 #include "core/frame/FrameView.h" | 68 #include "core/frame/FrameView.h" |
| 70 #include "core/frame/LocalFrame.h" | 69 #include "core/frame/LocalFrame.h" |
| 71 #include "core/frame/Settings.h" | 70 #include "core/frame/Settings.h" |
| 72 #include "core/frame/UseCounter.h" | 71 #include "core/frame/UseCounter.h" |
| 73 #include "core/html/ClassList.h" | 72 #include "core/html/ClassList.h" |
| 74 #include "core/html/HTMLCanvasElement.h" | 73 #include "core/html/HTMLCanvasElement.h" |
| 75 #include "core/html/HTMLDocument.h" | 74 #include "core/html/HTMLDocument.h" |
| 76 #include "core/html/HTMLElement.h" | 75 #include "core/html/HTMLElement.h" |
| 77 #include "core/html/HTMLTemplateElement.h" | 76 #include "core/html/HTMLTemplateElement.h" |
| 77 #include "core/html/parser/HTMLDocumentParser.h" |
| 78 #include "core/html/parser/HTMLParserIdioms.h" | 78 #include "core/html/parser/HTMLParserIdioms.h" |
| 79 #include "core/page/Chrome.h" | 79 #include "core/page/Chrome.h" |
| 80 #include "core/page/ChromeClient.h" | 80 #include "core/page/ChromeClient.h" |
| 81 #include "core/page/FocusController.h" | 81 #include "core/page/FocusController.h" |
| 82 #include "core/page/Page.h" | 82 #include "core/page/Page.h" |
| 83 #include "core/rendering/RenderLayer.h" | 83 #include "core/rendering/RenderLayer.h" |
| 84 #include "core/rendering/RenderView.h" | 84 #include "core/rendering/RenderView.h" |
| 85 #include "core/rendering/compositing/RenderLayerCompositor.h" | 85 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 86 #include "platform/EventDispatchForbiddenScope.h" | 86 #include "platform/EventDispatchForbiddenScope.h" |
| 87 #include "platform/RuntimeEnabledFeatures.h" | 87 #include "platform/RuntimeEnabledFeatures.h" |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 return createMarkup(this, ChildrenOnly); | 1546 return createMarkup(this, ChildrenOnly); |
| 1547 } | 1547 } |
| 1548 | 1548 |
| 1549 String Element::outerHTML() const | 1549 String Element::outerHTML() const |
| 1550 { | 1550 { |
| 1551 return createMarkup(this); | 1551 return createMarkup(this); |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 void Element::setInnerHTML(const String& html, ExceptionState& exceptionState) | 1554 void Element::setInnerHTML(const String& html, ExceptionState& exceptionState) |
| 1555 { | 1555 { |
| 1556 if (RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOu
terHTML(html, this, AllowScriptingContent, "innerHTML", exceptionState)) { | 1556 if (RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOu
terHTML(html, this, "innerHTML", exceptionState)) { |
| 1557 ContainerNode* container = this; | 1557 ContainerNode* container = this; |
| 1558 if (isHTMLTemplateElement(*this)) | 1558 if (isHTMLTemplateElement(*this)) |
| 1559 container = toHTMLTemplateElement(this)->content(); | 1559 container = toHTMLTemplateElement(this)->content(); |
| 1560 replaceChildrenWithFragment(container, fragment.release(), exceptionStat
e); | 1560 replaceChildrenWithFragment(container, fragment.release(), exceptionStat
e); |
| 1561 } | 1561 } |
| 1562 } | 1562 } |
| 1563 | 1563 |
| 1564 void Element::setOuterHTML(const String& html, ExceptionState& exceptionState) | 1564 void Element::setOuterHTML(const String& html, ExceptionState& exceptionState) |
| 1565 { | 1565 { |
| 1566 Node* p = parentNode(); | 1566 Node* p = parentNode(); |
| 1567 if (!p) { | 1567 if (!p) { |
| 1568 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt has no parent node."); | 1568 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt has no parent node."); |
| 1569 return; | 1569 return; |
| 1570 } | 1570 } |
| 1571 if (!p->isElementNode()) { | 1571 if (!p->isElementNode()) { |
| 1572 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt's parent is of type '" + p->nodeName() + "', which is not an element node."); | 1572 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt's parent is of type '" + p->nodeName() + "', which is not an element node."); |
| 1573 return; | 1573 return; |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 RefPtrWillBeRawPtr<Element> parent = toElement(p); | 1576 RefPtrWillBeRawPtr<Element> parent = toElement(p); |
| 1577 RefPtrWillBeRawPtr<Node> prev = previousSibling(); | 1577 RefPtrWillBeRawPtr<Node> prev = previousSibling(); |
| 1578 RefPtrWillBeRawPtr<Node> next = nextSibling(); | 1578 RefPtrWillBeRawPtr<Node> next = nextSibling(); |
| 1579 | 1579 |
| 1580 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(html, parent.get(), AllowScriptingContent, "outerHTML", exceptionState); | 1580 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(html, parent.get(), "outerHTML", exceptionState); |
| 1581 if (exceptionState.hadException()) | 1581 if (exceptionState.hadException()) |
| 1582 return; | 1582 return; |
| 1583 | 1583 |
| 1584 parent->replaceChild(fragment.release(), this, exceptionState); | 1584 parent->replaceChild(fragment.release(), this, exceptionState); |
| 1585 RefPtrWillBeRawPtr<Node> node = next ? next->previousSibling() : 0; | 1585 RefPtrWillBeRawPtr<Node> node = next ? next->previousSibling() : 0; |
| 1586 if (!exceptionState.hadException() && node && node->isTextNode()) | 1586 if (!exceptionState.hadException() && node && node->isTextNode()) |
| 1587 mergeWithNextTextNode(toText(node.get()), exceptionState); | 1587 mergeWithNextTextNode(toText(node.get()), exceptionState); |
| 1588 | 1588 |
| 1589 if (!exceptionState.hadException() && prev && prev->isTextNode()) | 1589 if (!exceptionState.hadException() && prev && prev->isTextNode()) |
| 1590 mergeWithNextTextNode(toText(prev.get()), exceptionState); | 1590 mergeWithNextTextNode(toText(prev.get()), exceptionState); |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 { | 2213 { |
| 2214 #if ENABLE(OILPAN) | 2214 #if ENABLE(OILPAN) |
| 2215 if (hasRareData()) | 2215 if (hasRareData()) |
| 2216 visitor->trace(elementRareData()); | 2216 visitor->trace(elementRareData()); |
| 2217 visitor->trace(m_elementData); | 2217 visitor->trace(m_elementData); |
| 2218 #endif | 2218 #endif |
| 2219 ContainerNode::trace(visitor); | 2219 ContainerNode::trace(visitor); |
| 2220 } | 2220 } |
| 2221 | 2221 |
| 2222 } // namespace blink | 2222 } // namespace blink |
| OLD | NEW |