| 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 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2086 if (document().focusedElement() == this) | 2086 if (document().focusedElement() == this) |
| 2087 return; | 2087 return; |
| 2088 | 2088 |
| 2089 if (!document().isActive()) | 2089 if (!document().isActive()) |
| 2090 return; | 2090 return; |
| 2091 | 2091 |
| 2092 document().updateLayoutIgnorePendingStylesheets(); | 2092 document().updateLayoutIgnorePendingStylesheets(); |
| 2093 if (!isFocusable()) | 2093 if (!isFocusable()) |
| 2094 return; | 2094 return; |
| 2095 | 2095 |
| 2096 RefPtr<Node> protect(this); | 2096 RefPtrWillBeRawPtr<Node> protect(this); |
| 2097 if (!document().page()->focusController().setFocusedElement(this, document()
.frame(), type)) | 2097 if (!document().page()->focusController().setFocusedElement(this, document()
.frame(), type)) |
| 2098 return; | 2098 return; |
| 2099 | 2099 |
| 2100 // Setting the focused node above might have invalidated the layout due to s
cripts. | 2100 // Setting the focused node above might have invalidated the layout due to s
cripts. |
| 2101 document().updateLayoutIgnorePendingStylesheets(); | 2101 document().updateLayoutIgnorePendingStylesheets(); |
| 2102 if (!isFocusable()) | 2102 if (!isFocusable()) |
| 2103 return; | 2103 return; |
| 2104 | 2104 |
| 2105 cancelFocusAppearanceUpdate(); | 2105 cancelFocusAppearanceUpdate(); |
| 2106 updateFocusAppearance(restorePreviousSelection); | 2106 updateFocusAppearance(restorePreviousSelection); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2234 if (!p) { | 2234 if (!p) { |
| 2235 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt has no parent node."); | 2235 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt has no parent node."); |
| 2236 return; | 2236 return; |
| 2237 } | 2237 } |
| 2238 if (!p->isElementNode()) { | 2238 if (!p->isElementNode()) { |
| 2239 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt's parent is of type '" + p->nodeName() + "', which is not an element node."); | 2239 exceptionState.throwDOMException(NoModificationAllowedError, "This eleme
nt's parent is of type '" + p->nodeName() + "', which is not an element node."); |
| 2240 return; | 2240 return; |
| 2241 } | 2241 } |
| 2242 | 2242 |
| 2243 RefPtrWillBeRawPtr<Element> parent = toElement(p); | 2243 RefPtrWillBeRawPtr<Element> parent = toElement(p); |
| 2244 RefPtr<Node> prev = previousSibling(); | 2244 RefPtrWillBeRawPtr<Node> prev = previousSibling(); |
| 2245 RefPtr<Node> next = nextSibling(); | 2245 RefPtrWillBeRawPtr<Node> next = nextSibling(); |
| 2246 | 2246 |
| 2247 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(html, parent.get(), AllowScriptingContent, "outerHTML", exceptionState); | 2247 RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOuterH
TML(html, parent.get(), AllowScriptingContent, "outerHTML", exceptionState); |
| 2248 if (exceptionState.hadException()) | 2248 if (exceptionState.hadException()) |
| 2249 return; | 2249 return; |
| 2250 | 2250 |
| 2251 parent->replaceChild(fragment.release(), this, exceptionState); | 2251 parent->replaceChild(fragment.release(), this, exceptionState); |
| 2252 RefPtr<Node> node = next ? next->previousSibling() : 0; | 2252 RefPtrWillBeRawPtr<Node> node = next ? next->previousSibling() : 0; |
| 2253 if (!exceptionState.hadException() && node && node->isTextNode()) | 2253 if (!exceptionState.hadException() && node && node->isTextNode()) |
| 2254 mergeWithNextTextNode(node.release(), exceptionState); | 2254 mergeWithNextTextNode(node.release(), exceptionState); |
| 2255 | 2255 |
| 2256 if (!exceptionState.hadException() && prev && prev->isTextNode()) | 2256 if (!exceptionState.hadException() && prev && prev->isTextNode()) |
| 2257 mergeWithNextTextNode(prev.release(), exceptionState); | 2257 mergeWithNextTextNode(prev.release(), exceptionState); |
| 2258 } | 2258 } |
| 2259 | 2259 |
| 2260 Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionStat
e& exceptionState) | 2260 Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionStat
e& exceptionState) |
| 2261 { | 2261 { |
| 2262 if (equalIgnoringCase(where, "beforeBegin")) { | 2262 if (equalIgnoringCase(where, "beforeBegin")) { |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3310 | 3310 |
| 3311 void Element::trace(Visitor* visitor) | 3311 void Element::trace(Visitor* visitor) |
| 3312 { | 3312 { |
| 3313 if (hasRareData()) | 3313 if (hasRareData()) |
| 3314 visitor->trace(elementRareData()); | 3314 visitor->trace(elementRareData()); |
| 3315 | 3315 |
| 3316 ContainerNode::trace(visitor); | 3316 ContainerNode::trace(visitor); |
| 3317 } | 3317 } |
| 3318 | 3318 |
| 3319 } // namespace WebCore | 3319 } // namespace WebCore |
| OLD | NEW |