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

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

Issue 26454004: Fix alignment of <input> elements with overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « LayoutTests/fast/forms/input-baseline-overflow-expected.html ('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) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 static bool hasValidAvgCharWidth(AtomicString family); 57 static bool hasValidAvgCharWidth(AtomicString family);
58 virtual float getAvgCharWidth(AtomicString family); 58 virtual float getAvgCharWidth(AtomicString family);
59 virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const = 0; 59 virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const = 0;
60 virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, Layout Unit nonContentHeight) const = 0; 60 virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, Layout Unit nonContentHeight) const = 0;
61 virtual RenderStyle* textBaseStyle() const = 0; 61 virtual RenderStyle* textBaseStyle() const = 0;
62 62
63 virtual void updateFromElement(); 63 virtual void updateFromElement();
64 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const OVERRIDE; 64 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic alTop, LogicalExtentComputedValues&) const OVERRIDE;
65 virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren, Subt reeLayoutScope&); 65 virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren, Subt reeLayoutScope&);
66 66
67 // We need to override this function because we don't want overflow:hidden o n an <input>
68 // to affect the baseline calculation. This is necessary because we are an i nline-block
69 // element as an implementation detail which would normally be affected by t his.
70 virtual int inlineBlockBaseline(LineDirectionMode direction) const OVERRIDE { return lastLineBoxBaseline(direction); }
71
67 private: 72 private:
68 virtual const char* renderName() const { return "RenderTextControl"; } 73 virtual const char* renderName() const { return "RenderTextControl"; }
69 virtual bool isTextControl() const { return true; } 74 virtual bool isTextControl() const { return true; }
70 virtual bool supportsPartialLayout() const OVERRIDE { return false; } 75 virtual bool supportsPartialLayout() const OVERRIDE { return false; }
71 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const OVERRIDE; 76 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const OVERRIDE;
72 virtual void computePreferredLogicalWidths() OVERRIDE; 77 virtual void computePreferredLogicalWidths() OVERRIDE;
73 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } 78 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { }
74 virtual bool avoidsFloats() const { return true; } 79 virtual bool avoidsFloats() const { return true; }
75 virtual bool canHaveGeneratedChildren() const OVERRIDE { return false; } 80 virtual bool canHaveGeneratedChildren() const OVERRIDE { return false; }
76 virtual bool canBeReplacedWithInlineRunIn() const OVERRIDE; 81 virtual bool canBeReplacedWithInlineRunIn() const OVERRIDE;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 121 }
117 virtual int firstLineBoxBaseline() const OVERRIDE { return RenderBlock::firs tLineBoxBaseline(); } 122 virtual int firstLineBoxBaseline() const OVERRIDE { return RenderBlock::firs tLineBoxBaseline(); }
118 virtual int inlineBlockBaseline(LineDirectionMode direction) const OVERRIDE { return lastLineBoxBaseline(direction); } 123 virtual int inlineBlockBaseline(LineDirectionMode direction) const OVERRIDE { return lastLineBoxBaseline(direction); }
119 virtual bool supportsPartialLayout() const OVERRIDE { return false; } 124 virtual bool supportsPartialLayout() const OVERRIDE { return false; }
120 }; 125 };
121 126
122 127
123 } // namespace WebCore 128 } // namespace WebCore
124 129
125 #endif // RenderTextControl_h 130 #endif // RenderTextControl_h
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/input-baseline-overflow-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698