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

Side by Side Diff: Source/core/rendering/RenderButton.h

Issue 197283025: Use new is*Element() helper functions more in rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/RenderButton.cpp » ('j') | 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) 2005 Apple Computer 2 * Copyright (C) 2005 Apple Computer
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 * 18 *
19 */ 19 */
20 20
21 #ifndef RenderButton_h 21 #ifndef RenderButton_h
22 #define RenderButton_h 22 #define RenderButton_h
23 23
24 #include "HTMLNames.h" 24 #include "core/html/HTMLInputElement.h"
25 #include "core/rendering/RenderFlexibleBox.h" 25 #include "core/rendering/RenderFlexibleBox.h"
26 26
27 namespace WebCore { 27 namespace WebCore {
28 28
29 class RenderTextFragment; 29 class RenderTextFragment;
30 30
31 // RenderButtons are just like normal flexboxes except that they will generate a n anonymous block child. 31 // RenderButtons are just like normal flexboxes except that they will generate a n anonymous block child.
32 // For inputs, they will also generate an anonymous RenderText and keep its styl e and content up 32 // For inputs, they will also generate an anonymous RenderText and keep its styl e and content up
33 // to date as the button changes. 33 // to date as the button changes.
34 class RenderButton FINAL : public RenderFlexibleBox { 34 class RenderButton FINAL : public RenderFlexibleBox {
(...skipping 20 matching lines...) Expand all
55 virtual bool canHaveGeneratedChildren() const OVERRIDE; 55 virtual bool canHaveGeneratedChildren() const OVERRIDE;
56 virtual bool hasControlClip() const OVERRIDE { return true; } 56 virtual bool hasControlClip() const OVERRIDE { return true; }
57 virtual LayoutRect controlClipRect(const LayoutPoint&) const OVERRIDE; 57 virtual LayoutRect controlClipRect(const LayoutPoint&) const OVERRIDE;
58 58
59 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode) const OVERRIDE; 59 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode) const OVERRIDE;
60 60
61 private: 61 private:
62 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle) O VERRIDE; 62 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle) O VERRIDE;
63 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE; 63 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE;
64 64
65 virtual bool hasLineIfEmpty() const OVERRIDE { return node() && node()->hasT agName(HTMLNames::inputTag); } 65 virtual bool hasLineIfEmpty() const OVERRIDE { return isHTMLInputElement(nod e()); }
66 66
67 RenderBlock* m_inner; 67 RenderBlock* m_inner;
68 }; 68 };
69 69
70 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderButton, isRenderButton()); 70 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderButton, isRenderButton());
71 71
72 } // namespace WebCore 72 } // namespace WebCore
73 73
74 #endif // RenderButton_h 74 #endif // RenderButton_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/RenderButton.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698