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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextControl.h

Issue 2145903002: Add heuristic to LayoutTextControl::hasValidAvgCharWidth() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 52 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
53 53
54 void hitInnerEditorElement(HitTestResult&, const LayoutPoint& pointInContain er, const LayoutPoint& accumulatedOffset); 54 void hitInnerEditorElement(HitTestResult&, const LayoutPoint& pointInContain er, const LayoutPoint& accumulatedOffset);
55 55
56 int textBlockLogicalWidth() const; 56 int textBlockLogicalWidth() const;
57 int textBlockLogicalHeight() const; 57 int textBlockLogicalHeight() const;
58 58
59 float scaleEmToUnits(int x) const; 59 float scaleEmToUnits(int x) const;
60 60
61 static bool hasValidAvgCharWidth(const AtomicString& family); 61 static bool hasValidAvgCharWidth(const SimpleFontData*, const AtomicString& family);
62 virtual float getAvgCharWidth(const AtomicString& family) const; 62 virtual float getAvgCharWidth(const AtomicString& family) const;
63 virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const = 0; 63 virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const = 0;
64 virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, Layout Unit nonContentHeight) const = 0; 64 virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, Layout Unit nonContentHeight) const = 0;
65 65
66 void updateFromElement() override; 66 void updateFromElement() override;
67 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, L ogicalExtentComputedValues&) const override; 67 void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, L ogicalExtentComputedValues&) const override;
68 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren, SubtreeLayou tScope&) override; 68 LayoutObject* layoutSpecialExcludedChild(bool relayoutChildren, SubtreeLayou tScope&) override;
69 69
70 // We need to override this function because we don't want overflow:hidden o n an <input> 70 // We need to override this function because we don't want overflow:hidden o n an <input>
71 // to affect the baseline calculation. This is necessary because we are an i nline-block 71 // to affect the baseline calculation. This is necessary because we are an i nline-block
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 int firstLineBoxBaseline() const override { return LayoutBlock::firstLineBox Baseline(); } 105 int firstLineBoxBaseline() const override { return LayoutBlock::firstLineBox Baseline(); }
106 int inlineBlockBaseline(LineDirectionMode direction) const override { return LayoutBlock::inlineBlockBaseline(direction); } 106 int inlineBlockBaseline(LineDirectionMode direction) const override { return LayoutBlock::inlineBlockBaseline(direction); }
107 bool shouldIgnoreOverflowPropertyForInlineBlockBaseline() const override { r eturn true; } 107 bool shouldIgnoreOverflowPropertyForInlineBlockBaseline() const override { r eturn true; }
108 }; 108 };
109 109
110 110
111 } // namespace blink 111 } // namespace blink
112 112
113 #endif // LayoutTextControl_h 113 #endif // LayoutTextControl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698