| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 CSSImageSetValue::~CSSImageSetValue() {} | 49 CSSImageSetValue::~CSSImageSetValue() {} |
| 50 | 50 |
| 51 void CSSImageSetValue::fillImageSet() { | 51 void CSSImageSetValue::fillImageSet() { |
| 52 size_t length = this->length(); | 52 size_t length = this->length(); |
| 53 size_t i = 0; | 53 size_t i = 0; |
| 54 while (i < length) { | 54 while (i < length) { |
| 55 const CSSImageValue& imageValue = toCSSImageValue(item(i)); | 55 const CSSImageValue& imageValue = toCSSImageValue(item(i)); |
| 56 String imageURL = imageValue.url(); | 56 String imageURL = imageValue.url(); |
| 57 | 57 |
| 58 ++i; | 58 ++i; |
| 59 ASSERT_WITH_SECURITY_IMPLICATION(i < length); | 59 SECURITY_DCHECK(i < length); |
| 60 const CSSValue& scaleFactorValue = item(i); | 60 const CSSValue& scaleFactorValue = item(i); |
| 61 float scaleFactor = toCSSPrimitiveValue(scaleFactorValue).getFloatValue(); | 61 float scaleFactor = toCSSPrimitiveValue(scaleFactorValue).getFloatValue(); |
| 62 | 62 |
| 63 ImageWithScale image; | 63 ImageWithScale image; |
| 64 image.imageURL = imageURL; | 64 image.imageURL = imageURL; |
| 65 image.referrer = SecurityPolicy::generateReferrer( | 65 image.referrer = SecurityPolicy::generateReferrer( |
| 66 imageValue.referrer().referrerPolicy, KURL(ParsedURLString, imageURL), | 66 imageValue.referrer().referrerPolicy, KURL(ParsedURLString, imageURL), |
| 67 imageValue.referrer().referrer); | 67 imageValue.referrer().referrer); |
| 68 image.scaleFactor = scaleFactor; | 68 image.scaleFactor = scaleFactor; |
| 69 m_imagesInSet.append(image); | 69 m_imagesInSet.append(image); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 size_t i = 0; | 140 size_t i = 0; |
| 141 while (i < length) { | 141 while (i < length) { |
| 142 if (i > 0) | 142 if (i > 0) |
| 143 result.append(", "); | 143 result.append(", "); |
| 144 | 144 |
| 145 const CSSValue& imageValue = item(i); | 145 const CSSValue& imageValue = item(i); |
| 146 result.append(imageValue.cssText()); | 146 result.append(imageValue.cssText()); |
| 147 result.append(' '); | 147 result.append(' '); |
| 148 | 148 |
| 149 ++i; | 149 ++i; |
| 150 ASSERT_WITH_SECURITY_IMPLICATION(i < length); | 150 SECURITY_DCHECK(i < length); |
| 151 const CSSValue& scaleFactorValue = item(i); | 151 const CSSValue& scaleFactorValue = item(i); |
| 152 result.append(scaleFactorValue.cssText()); | 152 result.append(scaleFactorValue.cssText()); |
| 153 // FIXME: Eventually the scale factor should contain it's own unit | 153 // FIXME: Eventually the scale factor should contain it's own unit |
| 154 // http://wkb.ug/100120. | 154 // http://wkb.ug/100120. |
| 155 // For now 'x' is hard-coded in the parser, so we hard-code it here too. | 155 // For now 'x' is hard-coded in the parser, so we hard-code it here too. |
| 156 result.append('x'); | 156 result.append('x'); |
| 157 | 157 |
| 158 ++i; | 158 ++i; |
| 159 } | 159 } |
| 160 | 160 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 178 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() { | 178 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() { |
| 179 CSSImageSetValue* value = CSSImageSetValue::create(); | 179 CSSImageSetValue* value = CSSImageSetValue::create(); |
| 180 for (auto& item : *this) | 180 for (auto& item : *this) |
| 181 item->isImageValue() | 181 item->isImageValue() |
| 182 ? value->append(*toCSSImageValue(*item).valueWithURLMadeAbsolute()) | 182 ? value->append(*toCSSImageValue(*item).valueWithURLMadeAbsolute()) |
| 183 : value->append(*item); | 183 : value->append(*item); |
| 184 return value; | 184 return value; |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace blink | 187 } // namespace blink |
| OLD | NEW |