Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: Source/core/html/RadioNodeList.cpp

Issue 354813004: Add missing owner check to form's "named property retrieval" over images. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Shorten out single-use local binding; no change in functionality. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/forms/form-radio-img-node-list-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/form-radio-img-node-list-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698