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 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 Node* p = parentNode(); | 2224 Node* p = parentNode(); |
2225 if (!p) { | 2225 if (!p) { |
2226 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt has no parent node."); | 2226 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt has no parent node."); |
2227 return; | 2227 return; |
2228 } | 2228 } |
2229 if (!p->isElementNode()) { | 2229 if (!p->isElementNode()) { |
2230 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt's parent is of type '" + p->nodeName() + "', which is not an element node."); | 2230 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt's parent is of type '" + p->nodeName() + "', which is not an element node."); |
2231 return; | 2231 return; |
2232 } | 2232 } |
2233 | 2233 |
2234 RefPtr<Element> parent = toElement(p); | 2234 RefPtrWillBeRawPtr<Element> parent = toElement(p); |
2235 RefPtr<Node> prev = previousSibling(); | 2235 RefPtr<Node> prev = previousSibling(); |
2236 RefPtr<Node> next = nextSibling(); | 2236 RefPtr<Node> next = nextSibling(); |
2237 | 2237 |
2238 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(html, parent.get(), AllowScriptingContent, "outerHTML", exceptionState); | 2238 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(html, parent.get(), AllowScriptingContent, "outerHTML", exceptionState); |
2239 if (exceptionState.hadException()) | 2239 if (exceptionState.hadException()) |
2240 return; | 2240 return; |
2241 | 2241 |
2242 parent->replaceChild(fragment.release(), this, exceptionState); | 2242 parent->replaceChild(fragment.release(), this, exceptionState); |
2243 RefPtr<Node> node = next ? next->previousSibling() : 0; | 2243 RefPtr<Node> node = next ? next->previousSibling() : 0; |
2244 if (!exceptionState.hadException() && node && node->isTextNode()) | 2244 if (!exceptionState.hadException() && node && node->isTextNode()) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 return toElement(returnValue); | 2311 return toElement(returnValue); |
2312 } | 2312 } |
2313 | 2313 |
2314 void Element::insertAdjacentText(const String& where, const String& text, Except
ionState& exceptionState) | 2314 void Element::insertAdjacentText(const String& where, const String& text, Except
ionState& exceptionState) |
2315 { | 2315 { |
2316 insertAdjacent(where, document().createTextNode(text).get(), exceptionState)
; | 2316 insertAdjacent(where, document().createTextNode(text).get(), exceptionState)
; |
2317 } | 2317 } |
2318 | 2318 |
2319 void Element::insertAdjacentHTML(const String& where, const String& markup, Exce
ptionState& exceptionState) | 2319 void Element::insertAdjacentHTML(const String& where, const String& markup, Exce
ptionState& exceptionState) |
2320 { | 2320 { |
2321 RefPtr<Element> contextElement = contextElementForInsertion(where, this, exc
eptionState); | 2321 RefPtrWillBeRawPtr<Element> contextElement = contextElementForInsertion(wher
e, this, exceptionState); |
2322 if (!contextElement) | 2322 if (!contextElement) |
2323 return; | 2323 return; |
2324 | 2324 |
2325 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", e
xceptionState); | 2325 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", e
xceptionState); |
2326 if (!fragment) | 2326 if (!fragment) |
2327 return; | 2327 return; |
2328 insertAdjacent(where, fragment.get(), exceptionState); | 2328 insertAdjacent(where, fragment.get(), exceptionState); |
2329 } | 2329 } |
2330 | 2330 |
2331 String Element::innerText() | 2331 String Element::innerText() |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 | 3301 |
3302 void Element::trace(Visitor* visitor) | 3302 void Element::trace(Visitor* visitor) |
3303 { | 3303 { |
3304 if (hasRareData()) | 3304 if (hasRareData()) |
3305 visitor->trace(elementRareData()); | 3305 visitor->trace(elementRareData()); |
3306 | 3306 |
3307 ContainerNode::trace(visitor); | 3307 ContainerNode::trace(visitor); |
3308 } | 3308 } |
3309 | 3309 |
3310 } // namespace WebCore | 3310 } // namespace WebCore |
OLD | NEW |