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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ASSERT(!m_popup); | 74 ASSERT(!m_popup); |
75 } | 75 } |
76 | 76 |
77 RenderObject* CalendarPickerElement::createRenderer(RenderArena* arena, RenderSt
yle*) | 77 RenderObject* CalendarPickerElement::createRenderer(RenderArena* arena, RenderSt
yle*) |
78 { | 78 { |
79 return new (arena) RenderDetailsMarker(this); | 79 return new (arena) RenderDetailsMarker(this); |
80 } | 80 } |
81 | 81 |
82 inline HTMLInputElement* CalendarPickerElement::hostInput() | 82 inline HTMLInputElement* CalendarPickerElement::hostInput() |
83 { | 83 { |
84 ASSERT(shadowAncestorNode()); | 84 // JavaScript code can't create CalendarPickerElement objects. This is |
85 ASSERT(shadowAncestorNode()->hasTagName(inputTag)); | 85 // always in shadow of <input>. |
86 return static_cast<HTMLInputElement*>(shadowAncestorNode()); | 86 ASSERT(shadowHost()); |
| 87 ASSERT(shadowHost()->hasTagName(inputTag)); |
| 88 return static_cast<HTMLInputElement*>(shadowHost()); |
87 } | 89 } |
88 | 90 |
89 void CalendarPickerElement::defaultEventHandler(Event* event) | 91 void CalendarPickerElement::defaultEventHandler(Event* event) |
90 { | 92 { |
91 if (!renderer()) | 93 if (!renderer()) |
92 return; | 94 return; |
93 HTMLInputElement* input = hostInput(); | 95 HTMLInputElement* input = hostInput(); |
94 if (input->readOnly() || input->disabled()) | 96 if (input->readOnly() || input->disabled()) |
95 return; | 97 return; |
96 | 98 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 254 } |
253 | 255 |
254 void CalendarPickerElement::didClosePopup() | 256 void CalendarPickerElement::didClosePopup() |
255 { | 257 { |
256 m_popup = 0; | 258 m_popup = 0; |
257 } | 259 } |
258 | 260 |
259 } | 261 } |
260 | 262 |
261 #endif | 263 #endif |
OLD | NEW |