OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 PassRefPtrWillBeRawPtr<SearchFieldDecorationElement> SearchFieldDecorationElemen
t::create(Document& document) | 160 PassRefPtrWillBeRawPtr<SearchFieldDecorationElement> SearchFieldDecorationElemen
t::create(Document& document) |
161 { | 161 { |
162 RefPtrWillBeRawPtr<SearchFieldDecorationElement> element = adoptRefWillBeNoo
p(new SearchFieldDecorationElement(document)); | 162 RefPtrWillBeRawPtr<SearchFieldDecorationElement> element = adoptRefWillBeNoo
p(new SearchFieldDecorationElement(document)); |
163 element->setAttribute(idAttr, ShadowElementNames::searchDecoration()); | 163 element->setAttribute(idAttr, ShadowElementNames::searchDecoration()); |
164 return element.release(); | 164 return element.release(); |
165 } | 165 } |
166 | 166 |
167 const AtomicString& SearchFieldDecorationElement::shadowPseudoId() const | 167 const AtomicString& SearchFieldDecorationElement::shadowPseudoId() const |
168 { | 168 { |
169 DEFINE_STATIC_LOCAL(AtomicString, resultsDecorationId, ("-webkit-search-resu
lts-decoration", AtomicString::ConstructFromLiteral)); | 169 DEFINE_STATIC_LOCAL(AtomicString, resultsDecorationId, ("-webkit-search-resu
lts-decoration")); |
170 DEFINE_STATIC_LOCAL(AtomicString, decorationId, ("-webkit-search-decoration"
, AtomicString::ConstructFromLiteral)); | 170 DEFINE_STATIC_LOCAL(AtomicString, decorationId, ("-webkit-search-decoration"
)); |
171 Element* host = shadowHost(); | 171 Element* host = shadowHost(); |
172 if (!host) | 172 if (!host) |
173 return resultsDecorationId; | 173 return resultsDecorationId; |
174 if (isHTMLInputElement(*host)) { | 174 if (isHTMLInputElement(*host)) { |
175 if (toHTMLInputElement(host)->maxResults() < 0) | 175 if (toHTMLInputElement(host)->maxResults() < 0) |
176 return decorationId; | 176 return decorationId; |
177 return resultsDecorationId; | 177 return resultsDecorationId; |
178 } | 178 } |
179 return resultsDecorationId; | 179 return resultsDecorationId; |
180 } | 180 } |
(...skipping 21 matching lines...) Expand all Loading... |
202 | 202 |
203 inline SearchFieldCancelButtonElement::SearchFieldCancelButtonElement(Document&
document) | 203 inline SearchFieldCancelButtonElement::SearchFieldCancelButtonElement(Document&
document) |
204 : HTMLDivElement(document) | 204 : HTMLDivElement(document) |
205 , m_capturing(false) | 205 , m_capturing(false) |
206 { | 206 { |
207 } | 207 } |
208 | 208 |
209 PassRefPtrWillBeRawPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonEl
ement::create(Document& document) | 209 PassRefPtrWillBeRawPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonEl
ement::create(Document& document) |
210 { | 210 { |
211 RefPtrWillBeRawPtr<SearchFieldCancelButtonElement> element = adoptRefWillBeN
oop(new SearchFieldCancelButtonElement(document)); | 211 RefPtrWillBeRawPtr<SearchFieldCancelButtonElement> element = adoptRefWillBeN
oop(new SearchFieldCancelButtonElement(document)); |
212 element->setShadowPseudoId(AtomicString("-webkit-search-cancel-button", Atom
icString::ConstructFromLiteral)); | 212 element->setShadowPseudoId(AtomicString("-webkit-search-cancel-button")); |
213 element->setAttribute(idAttr, ShadowElementNames::clearButton()); | 213 element->setAttribute(idAttr, ShadowElementNames::clearButton()); |
214 return element.release(); | 214 return element.release(); |
215 } | 215 } |
216 | 216 |
217 void SearchFieldCancelButtonElement::detach(const AttachContext& context) | 217 void SearchFieldCancelButtonElement::detach(const AttachContext& context) |
218 { | 218 { |
219 if (m_capturing) { | 219 if (m_capturing) { |
220 if (LocalFrame* frame = document().frame()) | 220 if (LocalFrame* frame = document().frame()) |
221 frame->eventHandler().setCapturingMouseEventsNode(nullptr); | 221 frame->eventHandler().setCapturingMouseEventsNode(nullptr); |
222 } | 222 } |
(...skipping 26 matching lines...) Expand all Loading... |
249 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() | 249 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() |
250 { | 250 { |
251 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); | 251 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); |
252 if (input && !input->isDisabledOrReadOnly()) | 252 if (input && !input->isDisabledOrReadOnly()) |
253 return true; | 253 return true; |
254 | 254 |
255 return HTMLDivElement::willRespondToMouseClickEvents(); | 255 return HTMLDivElement::willRespondToMouseClickEvents(); |
256 } | 256 } |
257 | 257 |
258 } // namespace blink | 258 } // namespace blink |
OLD | NEW |