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

Side by Side Diff: Source/WebCore/html/shadow/CalendarPickerElement.cpp

Issue 10823003: Merge 123180 - Introduce Node::shadowHost() (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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 | « Source/WebCore/dom/Node.cpp ('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 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
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
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
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698