| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/css/MediaValues.h" | 6 #include "core/css/MediaValues.h" |
| 7 | 7 |
| 8 #include "core/css/CSSHelper.h" | 8 #include "core/css/CSSHelper.h" |
| 9 #include "core/css/MediaValuesCached.h" | 9 #include "core/css/MediaValuesCached.h" |
| 10 #include "core/css/MediaValuesDynamic.h" | 10 #include "core/css/MediaValuesDynamic.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // CSSToLengthConversionData::zoomedComputedPixels() more generic (to solve
both cases) without hurting performance. | 160 // CSSToLengthConversionData::zoomedComputedPixels() more generic (to solve
both cases) without hurting performance. |
| 161 | 161 |
| 162 // FIXME - Unite the logic here with CSSToLengthConversionData in a performa
nt way. | 162 // FIXME - Unite the logic here with CSSToLengthConversionData in a performa
nt way. |
| 163 double factor = 0; | 163 double factor = 0; |
| 164 switch (type) { | 164 switch (type) { |
| 165 case CSSPrimitiveValue::UnitType::Ems: | 165 case CSSPrimitiveValue::UnitType::Ems: |
| 166 case CSSPrimitiveValue::UnitType::Rems: | 166 case CSSPrimitiveValue::UnitType::Rems: |
| 167 factor = defaultFontSize; | 167 factor = defaultFontSize; |
| 168 break; | 168 break; |
| 169 case CSSPrimitiveValue::UnitType::Pixels: | 169 case CSSPrimitiveValue::UnitType::Pixels: |
| 170 case CSSPrimitiveValue::UnitType::UserUnits: |
| 170 factor = 1; | 171 factor = 1; |
| 171 break; | 172 break; |
| 172 case CSSPrimitiveValue::UnitType::Exs: | 173 case CSSPrimitiveValue::UnitType::Exs: |
| 173 // FIXME: We have a bug right now where the zoom will be applied twice t
o EX units. | 174 // FIXME: We have a bug right now where the zoom will be applied twice t
o EX units. |
| 174 // FIXME: We don't seem to be able to cache fontMetrics related values. | 175 // FIXME: We don't seem to be able to cache fontMetrics related values. |
| 175 // Trying to access them is triggering some sort of microtask. Serving t
he spec's default instead. | 176 // Trying to access them is triggering some sort of microtask. Serving t
he spec's default instead. |
| 176 factor = defaultFontSize / 2.0; | 177 factor = defaultFontSize / 2.0; |
| 177 break; | 178 break; |
| 178 case CSSPrimitiveValue::UnitType::Chs: | 179 case CSSPrimitiveValue::UnitType::Chs: |
| 179 // FIXME: We don't seem to be able to cache fontMetrics related values. | 180 // FIXME: We don't seem to be able to cache fontMetrics related values. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 218 } |
| 218 | 219 |
| 219 LocalFrame* MediaValues::frameFrom(Document& document) | 220 LocalFrame* MediaValues::frameFrom(Document& document) |
| 220 { | 221 { |
| 221 Document* executingDocument = document.importsController() ? document.import
sController()->master() : &document; | 222 Document* executingDocument = document.importsController() ? document.import
sController()->master() : &document; |
| 222 ASSERT(executingDocument); | 223 ASSERT(executingDocument); |
| 223 return executingDocument->frame(); | 224 return executingDocument->frame(); |
| 224 } | 225 } |
| 225 | 226 |
| 226 } // namespace | 227 } // namespace |
| OLD | NEW |