OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Motorola Mobility, Inc. All rights reserved. | 2 * Copyright (c) 2012 Motorola Mobility, 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 85 } |
86 | 86 |
87 bool RadioNodeList::checkElementMatchesRadioNodeListFilter(Element* testElement)
const | 87 bool RadioNodeList::checkElementMatchesRadioNodeListFilter(Element* testElement)
const |
88 { | 88 { |
89 ASSERT(testElement->hasTagName(objectTag) || testElement->isFormControlEleme
nt()); | 89 ASSERT(testElement->hasTagName(objectTag) || testElement->isFormControlEleme
nt()); |
90 if (ownerNode()->hasTagName(formTag)) { | 90 if (ownerNode()->hasTagName(formTag)) { |
91 HTMLFormElement* formElement = 0; | 91 HTMLFormElement* formElement = 0; |
92 if (testElement->hasTagName(objectTag)) | 92 if (testElement->hasTagName(objectTag)) |
93 formElement = static_cast<HTMLObjectElement*>(testElement)->form(); | 93 formElement = static_cast<HTMLObjectElement*>(testElement)->form(); |
94 else | 94 else |
95 formElement = static_cast<HTMLFormControlElement*>(testElement)->for
m(); | 95 formElement = toHTMLFormControlElement(testElement)->form(); |
96 if (!formElement || formElement != ownerNode()) | 96 if (!formElement || formElement != ownerNode()) |
97 return false; | 97 return false; |
98 } | 98 } |
99 | 99 |
100 return testElement->getIdAttribute() == m_name || testElement->getNameAttrib
ute() == m_name; | 100 return testElement->getIdAttribute() == m_name || testElement->getNameAttrib
ute() == m_name; |
101 } | 101 } |
102 | 102 |
103 bool RadioNodeList::nodeMatches(Element* testElement) const | 103 bool RadioNodeList::nodeMatches(Element* testElement) const |
104 { | 104 { |
105 if (!testElement->hasTagName(objectTag) && !testElement->isFormControlElemen
t()) | 105 if (!testElement->hasTagName(objectTag) && !testElement->isFormControlElemen
t()) |
106 return false; | 106 return false; |
107 | 107 |
108 if (testElement->hasTagName(inputTag) && toHTMLInputElement(testElement)->is
ImageButton()) | 108 if (testElement->hasTagName(inputTag) && toHTMLInputElement(testElement)->is
ImageButton()) |
109 return false; | 109 return false; |
110 | 110 |
111 return checkElementMatchesRadioNodeListFilter(testElement); | 111 return checkElementMatchesRadioNodeListFilter(testElement); |
112 } | 112 } |
113 | 113 |
114 } // namspace | 114 } // namspace |
115 | 115 |
OLD | NEW |