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 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2270 } | 2270 } |
2271 | 2271 |
2272 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + wher
e + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.")
; | 2272 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + wher
e + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.")
; |
2273 return 0; | 2273 return 0; |
2274 } | 2274 } |
2275 | 2275 |
2276 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() | 2276 // Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml() |
2277 static Element* contextElementForInsertion(const String& where, Element* element
, ExceptionState& exceptionState) | 2277 static Element* contextElementForInsertion(const String& where, Element* element
, ExceptionState& exceptionState) |
2278 { | 2278 { |
2279 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft
erEnd")) { | 2279 if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "aft
erEnd")) { |
2280 ContainerNode* parent = element->parentNode(); | 2280 Element* parent = element->parentElement(); |
2281 if (!parent || !parent->isElementNode()) { | 2281 if (!parent) { |
2282 exceptionState.throwDOMException(NoModificationAllowedError, "The el
ement has no parent."); | 2282 exceptionState.throwDOMException(NoModificationAllowedError, "The el
ement has no parent."); |
2283 return 0; | 2283 return 0; |
2284 } | 2284 } |
2285 return toElement(parent); | 2285 return parent; |
2286 } | 2286 } |
2287 if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "befo
reEnd")) | 2287 if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "befo
reEnd")) |
2288 return element; | 2288 return element; |
2289 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + wher
e + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.")
; | 2289 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + wher
e + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.")
; |
2290 return 0; | 2290 return 0; |
2291 } | 2291 } |
2292 | 2292 |
2293 Element* Element::insertAdjacentElement(const String& where, Element* newChild,
ExceptionState& exceptionState) | 2293 Element* Element::insertAdjacentElement(const String& where, Element* newChild,
ExceptionState& exceptionState) |
2294 { | 2294 { |
2295 if (!newChild) { | 2295 if (!newChild) { |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3248 { | 3248 { |
3249 #if ENABLE(OILPAN) | 3249 #if ENABLE(OILPAN) |
3250 if (hasRareData()) | 3250 if (hasRareData()) |
3251 visitor->trace(elementRareData()); | 3251 visitor->trace(elementRareData()); |
3252 visitor->trace(m_elementData); | 3252 visitor->trace(m_elementData); |
3253 #endif | 3253 #endif |
3254 ContainerNode::trace(visitor); | 3254 ContainerNode::trace(visitor); |
3255 } | 3255 } |
3256 | 3256 |
3257 } // namespace blink | 3257 } // namespace blink |
OLD | NEW |