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

Side by Side Diff: Source/core/css/resolver/ViewportStyleResolver.cpp

Issue 18023018: @viewport lengths relative to initial font. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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) 2012 Intel Corporation. All rights reserved. 2 * Copyright (C) 2012 Intel Corporation. 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); 109 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id);
110 if (!value || !value->isPrimitiveValue()) 110 if (!value || !value->isPrimitiveValue())
111 return defaultValue; 111 return defaultValue;
112 112
113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); 113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
114 114
115 if (primitiveValue->isNumber() || primitiveValue->isPx()) 115 if (primitiveValue->isNumber() || primitiveValue->isPx())
116 return primitiveValue->getFloatValue(); 116 return primitiveValue->getFloatValue();
117 117
118 if (primitiveValue->isFontRelativeLength()) 118 if (primitiveValue->isFontRelativeLength())
119 return primitiveValue->getFloatValue() * m_document->documentElement()-> renderStyle()->fontDescription().computedSize(); 119 return primitiveValue->getFloatValue() * m_document->renderStyle()->font Description().computedSize();
120 120
121 if (primitiveValue->isPercentage()) { 121 if (primitiveValue->isPercentage()) {
122 float percentValue = primitiveValue->getFloatValue() / 100.0f; 122 float percentValue = primitiveValue->getFloatValue() / 100.0f;
123 switch (id) { 123 switch (id) {
124 case CSSPropertyMaxHeight: 124 case CSSPropertyMaxHeight:
125 case CSSPropertyMinHeight: 125 case CSSPropertyMinHeight:
126 ASSERT(m_document->initialViewportSize().height() > 0); 126 ASSERT(m_document->initialViewportSize().height() > 0);
127 return percentValue * m_document->initialViewportSize().height(); 127 return percentValue * m_document->initialViewportSize().height();
128 case CSSPropertyMaxWidth: 128 case CSSPropertyMaxWidth:
129 case CSSPropertyMinWidth: 129 case CSSPropertyMinWidth:
(...skipping 19 matching lines...) Expand all
149 case CSSValueZoom: 149 case CSSValueZoom:
150 return defaultValue; 150 return defaultValue;
151 case CSSValueFixed: 151 case CSSValueFixed:
152 return 0; 152 return 0;
153 default: 153 default:
154 return defaultValue; 154 return defaultValue;
155 } 155 }
156 } 156 }
157 157
158 } // namespace WebCore 158 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698