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

Side by Side Diff: Source/core/html/shadow/TextFieldDecorationElement.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 toHTMLElement(existingRoot->firstChild())->setInlineStyleProperty(CSSPropert yWebkitFlexGrow, 1.0, CSSPrimitiveValue::CSS_NUMBER); 117 toHTMLElement(existingRoot->firstChild())->setInlineStyleProperty(CSSPropert yWebkitFlexGrow, 1.0, CSSPrimitiveValue::CSS_NUMBER);
118 box->appendChild(HTMLShadowElement::create(HTMLNames::shadowTag, input->docu ment())); 118 box->appendChild(HTMLShadowElement::create(HTMLNames::shadowTag, input->docu ment()));
119 setInlineStyleProperty(CSSPropertyDisplay, visible ? CSSValueBlock : CSSValu eNone); 119 setInlineStyleProperty(CSSPropertyDisplay, visible ? CSSValueBlock : CSSValu eNone);
120 box->appendChild(this); 120 box->appendChild(this);
121 } 121 }
122 122
123 inline HTMLInputElement* TextFieldDecorationElement::hostInput() 123 inline HTMLInputElement* TextFieldDecorationElement::hostInput()
124 { 124 {
125 // TextFieldDecorationElement is created only by C++ code, and it is always 125 // TextFieldDecorationElement is created only by C++ code, and it is always
126 // in <input> shadow. 126 // in <input> shadow.
127 ASSERT_WITH_SECURITY_IMPLICATION(!shadowHost() || shadowHost()->hasTagName(i nputTag)); 127 return toHTMLInputElement(shadowHost());
128 return static_cast<HTMLInputElement*>(shadowHost());
129 } 128 }
130 129
131 bool TextFieldDecorationElement::isTextFieldDecoration() const 130 bool TextFieldDecorationElement::isTextFieldDecoration() const
132 { 131 {
133 return true; 132 return true;
134 } 133 }
135 134
136 void TextFieldDecorationElement::updateImage() 135 void TextFieldDecorationElement::updateImage()
137 { 136 {
138 if (!renderer() || !renderer()->isImage()) 137 if (!renderer() || !renderer()->isImage())
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 bool TextFieldDecorationElement::willRespondToMouseClickEvents() 227 bool TextFieldDecorationElement::willRespondToMouseClickEvents()
229 { 228 {
230 const HTMLInputElement* input = hostInput(); 229 const HTMLInputElement* input = hostInput();
231 if (!input->isDisabledOrReadOnly()) 230 if (!input->isDisabledOrReadOnly())
232 return true; 231 return true;
233 232
234 return HTMLDivElement::willRespondToMouseClickEvents(); 233 return HTMLDivElement::willRespondToMouseClickEvents();
235 } 234 }
236 235
237 } // namespace WebCore 236 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/shadow/TextControlInnerElements.cpp ('k') | Source/core/loader/FormSubmission.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698