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