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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 HTMLFormElement* formElement = toHTMLElement(testElement).formOwner(); | 98 HTMLFormElement* formElement = toHTMLElement(testElement).formOwner(); |
99 if (!formElement || formElement != ownerNode()) | 99 if (!formElement || formElement != ownerNode()) |
100 return false; | 100 return false; |
101 } | 101 } |
102 | 102 |
103 return testElement.getIdAttribute() == m_name || testElement.getNameAttribut
e() == m_name; | 103 return testElement.getIdAttribute() == m_name || testElement.getNameAttribut
e() == m_name; |
104 } | 104 } |
105 | 105 |
106 bool RadioNodeList::elementMatches(const Element& element) const | 106 bool RadioNodeList::elementMatches(const Element& element) const |
107 { | 107 { |
108 if (m_onlyMatchImgElements) | 108 if (m_onlyMatchImgElements) { |
109 return isHTMLImageElement(element); | 109 if (!isHTMLImageElement(element)) |
| 110 return false; |
| 111 return toHTMLElement(element).formOwner() == ownerNode(); |
| 112 } |
110 | 113 |
111 if (!isHTMLObjectElement(element) && !element.isFormControlElement()) | 114 if (!isHTMLObjectElement(element) && !element.isFormControlElement()) |
112 return false; | 115 return false; |
113 | 116 |
114 if (isHTMLInputElement(element) && toHTMLInputElement(element).isImageButton
()) | 117 if (isHTMLInputElement(element) && toHTMLInputElement(element).isImageButton
()) |
115 return false; | 118 return false; |
116 | 119 |
117 return checkElementMatchesRadioNodeListFilter(element); | 120 return checkElementMatchesRadioNodeListFilter(element); |
118 } | 121 } |
119 | 122 |
120 } // namespace | 123 } // namespace |
121 | |
OLD | NEW |