OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 inline HTMLInputElement* CalendarPickerElement::hostInput() | 82 inline HTMLInputElement* CalendarPickerElement::hostInput() |
83 { | 83 { |
84 ASSERT(shadowAncestorNode()); | 84 ASSERT(shadowAncestorNode()); |
85 ASSERT(shadowAncestorNode()->hasTagName(inputTag)); | 85 ASSERT(shadowAncestorNode()->hasTagName(inputTag)); |
86 return static_cast<HTMLInputElement*>(shadowAncestorNode()); | 86 return static_cast<HTMLInputElement*>(shadowAncestorNode()); |
87 } | 87 } |
88 | 88 |
89 void CalendarPickerElement::defaultEventHandler(Event* event) | 89 void CalendarPickerElement::defaultEventHandler(Event* event) |
90 { | 90 { |
| 91 if (!renderer()) |
| 92 return; |
91 HTMLInputElement* input = hostInput(); | 93 HTMLInputElement* input = hostInput(); |
92 if (input->readOnly() || input->disabled()) | 94 if (input->readOnly() || input->disabled()) |
93 return; | 95 return; |
94 | 96 |
95 if (event->type() == eventNames().clickEvent) { | 97 if (event->type() == eventNames().clickEvent) { |
96 openPopup(); | 98 openPopup(); |
97 event->setDefaultHandled(); | 99 event->setDefaultHandled(); |
98 } | 100 } |
99 | 101 |
100 if (!event->defaultHandled()) | 102 if (!event->defaultHandled()) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 252 } |
251 | 253 |
252 void CalendarPickerElement::didClosePopup() | 254 void CalendarPickerElement::didClosePopup() |
253 { | 255 { |
254 m_popup = 0; | 256 m_popup = 0; |
255 } | 257 } |
256 | 258 |
257 } | 259 } |
258 | 260 |
259 #endif | 261 #endif |
OLD | NEW |