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

Side by Side Diff: Source/core/layout/LayoutTextControlMultiLine.cpp

Issue 1253543003: Cleanup LayoutTextControl and its subclasses. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
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 30 matching lines...) Expand all
41 { 41 {
42 if (!LayoutTextControl::nodeAtPoint(result, locationInContainer, accumulated Offset, hitTestAction)) 42 if (!LayoutTextControl::nodeAtPoint(result, locationInContainer, accumulated Offset, hitTestAction))
43 return false; 43 return false;
44 44
45 if (result.innerNode() == node() || result.innerNode() == innerEditorElement ()) 45 if (result.innerNode() == node() || result.innerNode() == innerEditorElement ())
46 hitInnerEditorElement(result, locationInContainer.point(), accumulatedOf fset); 46 hitInnerEditorElement(result, locationInContainer.point(), accumulatedOf fset);
47 47
48 return true; 48 return true;
49 } 49 }
50 50
51 float LayoutTextControlMultiLine::getAvgCharWidth(AtomicString family) 51 float LayoutTextControlMultiLine::getAvgCharWidth(const AtomicString& family) co nst
52 { 52 {
53 // Since Lucida Grande is the default font, we want this to match the width 53 // Since Lucida Grande is the default font, we want this to match the width
54 // of Courier New, the default font for textareas in IE, Firefox and Safari Win. 54 // of Courier New, the default font for textareas in IE, Firefox and Safari Win.
55 // 1229 is the avgCharWidth value in the OS/2 table for Courier New. 55 // 1229 is the avgCharWidth value in the OS/2 table for Courier New.
56 if (family == "Lucida Grande") 56 if (family == "Lucida Grande")
57 return scaleEmToUnits(1229); 57 return scaleEmToUnits(1229);
58 58
59 return LayoutTextControl::getAvgCharWidth(family); 59 return LayoutTextControl::getAvgCharWidth(family);
60 } 60 }
61 61
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return placeholderLayoutObject; 95 return placeholderLayoutObject;
96 LayoutBox* placeholderBox = toLayoutBox(placeholderLayoutObject); 96 LayoutBox* placeholderBox = toLayoutBox(placeholderLayoutObject);
97 placeholderBox->mutableStyleRef().setLogicalWidth(Length(contentLogicalWidth () - placeholderBox->borderAndPaddingLogicalWidth(), Fixed)); 97 placeholderBox->mutableStyleRef().setLogicalWidth(Length(contentLogicalWidth () - placeholderBox->borderAndPaddingLogicalWidth(), Fixed));
98 placeholderBox->layoutIfNeeded(); 98 placeholderBox->layoutIfNeeded();
99 placeholderBox->setX(borderLeft() + paddingLeft()); 99 placeholderBox->setX(borderLeft() + paddingLeft());
100 placeholderBox->setY(borderTop() + paddingTop()); 100 placeholderBox->setY(borderTop() + paddingTop());
101 return placeholderLayoutObject; 101 return placeholderLayoutObject;
102 } 102 }
103 103
104 } 104 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTextControlMultiLine.h ('k') | Source/core/layout/LayoutTextControlSingleLine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698