OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 return m_font->fontMetrics().xHeight(); | 61 return m_font->fontMetrics().xHeight(); |
62 } | 62 } |
63 | 63 |
64 float CSSToLengthConversionData::FontSizes::ch() const | 64 float CSSToLengthConversionData::FontSizes::ch() const |
65 { | 65 { |
66 ASSERT(m_font); | 66 ASSERT(m_font); |
67 return m_font->fontMetrics().zeroWidth(); | 67 return m_font->fontMetrics().zeroWidth(); |
68 } | 68 } |
69 | 69 |
70 CSSToLengthConversionData::ViewportSize::ViewportSize(const LayoutView* layoutVi ew) | 70 CSSToLengthConversionData::ViewportSize::ViewportSize(const LayoutView* layoutVi ew) |
71 : m_width(layoutView ? layoutView->layoutViewportWidth() : 0) | 71 : m_size( |
jbroman
2016/01/20 16:50:25
DoubleSize can be constructed from the FloatSize,
bokan
2016/01/20 16:51:21
Ack, you're right. I'll up a new patch.
| |
72 , m_height(layoutView ? layoutView->layoutViewportHeight() : 0) | 72 layoutView ? layoutView->viewportSizeForViewportUnits().width() : 0, |
73 layoutView ? layoutView->viewportSizeForViewportUnits().height() : 0) | |
73 { | 74 { |
74 } | 75 } |
75 | 76 |
76 CSSToLengthConversionData::CSSToLengthConversionData(const ComputedStyle* style, const FontSizes& fontSizes, const ViewportSize& viewportSize, float zoom) | 77 CSSToLengthConversionData::CSSToLengthConversionData(const ComputedStyle* style, const FontSizes& fontSizes, const ViewportSize& viewportSize, float zoom) |
77 : m_style(style) | 78 : m_style(style) |
78 , m_fontSizes(fontSizes) | 79 , m_fontSizes(fontSizes) |
79 , m_viewportSize(viewportSize) | 80 , m_viewportSize(viewportSize) |
80 , m_zoom(clampTo<float>(zoom, std::numeric_limits<float>::denorm_min())) | 81 , m_zoom(clampTo<float>(zoom, std::numeric_limits<float>::denorm_min())) |
81 { | 82 { |
82 ASSERT(m_style); | 83 ASSERT(m_style); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 case CSSPrimitiveValue::UnitType::Chs: | 168 case CSSPrimitiveValue::UnitType::Chs: |
168 return value * chFontSize(); | 169 return value * chFontSize(); |
169 | 170 |
170 default: | 171 default: |
171 ASSERT_NOT_REACHED(); | 172 ASSERT_NOT_REACHED(); |
172 return 0; | 173 return 0; |
173 } | 174 } |
174 } | 175 } |
175 | 176 |
176 } // namespace blink | 177 } // namespace blink |
OLD | NEW |