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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageSetValue.cpp

Issue 2203773002: Add support for "image-set" Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 m_cachedImage = StyleInvalidImage::create(image.imageURL); 124 m_cachedImage = StyleInvalidImage::create(image.imageURL);
125 m_cachedScaleFactor = deviceScaleFactor; 125 m_cachedScaleFactor = deviceScaleFactor;
126 } 126 }
127 127
128 return m_cachedImage.get(); 128 return m_cachedImage.get();
129 } 129 }
130 130
131 String CSSImageSetValue::customCSSText() const 131 String CSSImageSetValue::customCSSText() const
132 { 132 {
133 StringBuilder result; 133 StringBuilder result;
134 result.append("-webkit-image-set("); 134 result.append("image-set(");
135 135
136 size_t length = this->length(); 136 size_t length = this->length();
137 size_t i = 0; 137 size_t i = 0;
138 while (i < length) { 138 while (i < length) {
139 if (i > 0) 139 if (i > 0)
140 result.append(", "); 140 result.append(", ");
141 141
142 const CSSValue& imageValue = item(i); 142 const CSSValue& imageValue = item(i);
143 result.append(imageValue.cssText()); 143 result.append(imageValue.cssText());
144 result.append(' '); 144 result.append(' ');
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() 176 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute()
177 { 177 {
178 CSSImageSetValue* value = CSSImageSetValue::create(); 178 CSSImageSetValue* value = CSSImageSetValue::create();
179 for (auto& item : *this) 179 for (auto& item : *this)
180 item->isImageValue() ? value->append(*toCSSImageValue(*item).valueWithUR LMadeAbsolute()) : value->append(*item); 180 item->isImageValue() ? value->append(*toCSSImageValue(*item).valueWithUR LMadeAbsolute()) : value->append(*item);
181 return value; 181 return value;
182 } 182 }
183 183
184 184
185 } // namespace blink 185 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698