| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 WebString WebElement::getAttribute(const WebString& attrName) const | 94 WebString WebElement::getAttribute(const WebString& attrName) const |
| 95 { | 95 { |
| 96 return constUnwrap<Element>()->getAttribute(attrName); | 96 return constUnwrap<Element>()->getAttribute(attrName); |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool WebElement::setAttribute(const WebString& attrName, const WebString& attrVa
lue) | 99 bool WebElement::setAttribute(const WebString& attrName, const WebString& attrVa
lue) |
| 100 { | 100 { |
| 101 // TODO: Custom element callbacks need to be called on WebKit API methods th
at | 101 // TODO: Custom element callbacks need to be called on WebKit API methods th
at |
| 102 // mutate the DOM in any way. | 102 // mutate the DOM in any way. |
| 103 CustomElementCallbackDispatcher::CallbackDeliveryScope deliverCustomElementC
allbacks; | 103 CustomElementCallbackDispatcher::CallbackDeliveryScope deliverCustomElementC
allbacks; |
| 104 TrackExceptionState es; | 104 TrackExceptionState exceptionState; |
| 105 unwrap<Element>()->setAttribute(attrName, attrValue, es); | 105 unwrap<Element>()->setAttribute(attrName, attrValue, exceptionState); |
| 106 return !es.hadException(); | 106 return !exceptionState.hadException(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 unsigned WebElement::attributeCount() const | 109 unsigned WebElement::attributeCount() const |
| 110 { | 110 { |
| 111 if (!constUnwrap<Element>()->hasAttributes()) | 111 if (!constUnwrap<Element>()->hasAttributes()) |
| 112 return 0; | 112 return 0; |
| 113 return constUnwrap<Element>()->attributeCount(); | 113 return constUnwrap<Element>()->attributeCount(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 WebNode WebElement::shadowRoot() const | 116 WebNode WebElement::shadowRoot() const |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 m_private = elem; | 181 m_private = elem; |
| 182 return *this; | 182 return *this; |
| 183 } | 183 } |
| 184 | 184 |
| 185 WebElement::operator PassRefPtr<Element>() const | 185 WebElement::operator PassRefPtr<Element>() const |
| 186 { | 186 { |
| 187 return toElement(m_private.get()); | 187 return toElement(m_private.get()); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace blink | 190 } // namespace blink |
| OLD | NEW |