| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool WebElement::hasTagName(const WebString& tagName) const | 62 bool WebElement::hasTagName(const WebString& tagName) const |
| 63 { | 63 { |
| 64 return equalIgnoringCase(constUnwrap<Element>()->tagName(), | 64 return equalIgnoringCase(constUnwrap<Element>()->tagName(), |
| 65 tagName.operator String()); | 65 tagName.operator String()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool WebElement::hasHTMLTagName(const WebString& tagName) const | 68 bool WebElement::hasHTMLTagName(const WebString& tagName) const |
| 69 { | 69 { |
| 70 // How to create class nodeName localName |
| 71 // createElement('input') HTMLInputElement INPUT input |
| 72 // createElement('INPUT') HTMLInputElement INPUT input |
| 73 // createElementNS(xhtmlNS, 'input') HTMLInputElement INPUT input |
| 74 // createElementNS(xhtmlNS, 'INPUT') HTMLUnknownElement INPUT INPUT |
| 70 const Element* element = constUnwrap<Element>(); | 75 const Element* element = constUnwrap<Element>(); |
| 71 return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && equalIgnor
ingCase(element->tagName(), String(tagName)); | 76 return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && element->l
ocalName() == String(tagName).lower(); |
| 72 } | 77 } |
| 73 | 78 |
| 74 bool WebElement::hasAttribute(const WebString& attrName) const | 79 bool WebElement::hasAttribute(const WebString& attrName) const |
| 75 { | 80 { |
| 76 return constUnwrap<Element>()->hasAttribute(attrName); | 81 return constUnwrap<Element>()->hasAttribute(attrName); |
| 77 } | 82 } |
| 78 | 83 |
| 79 WebString WebElement::getAttribute(const WebString& attrName) const | 84 WebString WebElement::getAttribute(const WebString& attrName) const |
| 80 { | 85 { |
| 81 return constUnwrap<Element>()->getAttribute(attrName); | 86 return constUnwrap<Element>()->getAttribute(attrName); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 m_private = elem; | 151 m_private = elem; |
| 147 return *this; | 152 return *this; |
| 148 } | 153 } |
| 149 | 154 |
| 150 WebElement::operator PassRefPtr<Element>() const | 155 WebElement::operator PassRefPtr<Element>() const |
| 151 { | 156 { |
| 152 return static_cast<Element*>(m_private.get()); | 157 return static_cast<Element*>(m_private.get()); |
| 153 } | 158 } |
| 154 | 159 |
| 155 } // namespace WebKit | 160 } // namespace WebKit |
| OLD | NEW |