Changeset 240215 in webkit
- Timestamp:
- Jan 20, 2019 12:37:30 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240213 r240215 1 2019-01-20 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 Unreviewed, rolling out r238275. 4 5 Regressed css3/shapes/shape-outside/shape-image/shape- 6 image-025.html 7 8 Reverted changeset: 9 10 "ScalableImageDecoder: don't forcefully decode image data when 11 querying frame completeness, duration" 12 https://bugs.webkit.org/show_bug.cgi?id=191354 13 https://trac.webkit.org/changeset/238275 14 1 15 2019-01-19 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp
r239549 r240215 173 173 { 174 174 LockHolder lockHolder(m_mutex); 175 if (index >= m_frameBufferCache.size())176 return false;177 178 auto & frame = m_frameBufferCache[index];179 return frame.isComplete();175 // FIXME(176089): asking whether enough data has been appended for a decode 176 // operation to succeed should not require decoding the entire frame. 177 // This function should be implementable in a way that allows const. 178 auto* buffer = const_cast<ScalableImageDecoder*>(this)->frameBufferAtIndex(index); 179 return buffer && buffer->isComplete(); 180 180 } 181 181 … … 185 185 if (m_frameBufferCache.size() <= index) 186 186 return true; 187 188 auto& frame = m_frameBufferCache[index]; 189 if (!frame.isComplete()) 190 return true; 191 return frame.hasAlpha(); 187 if (m_frameBufferCache[index].isComplete()) 188 return m_frameBufferCache[index].hasAlpha(); 189 return true; 192 190 } 193 191 … … 204 202 { 205 203 LockHolder lockHolder(m_mutex); 206 if (index >= m_frameBufferCache.size()) 204 // FIXME(176089): asking for the duration of a sub-image should not require decoding 205 // the entire frame. This function should be implementable in a way that 206 // allows const. 207 auto* buffer = const_cast<ScalableImageDecoder*>(this)->frameBufferAtIndex(index); 208 if (!buffer || buffer->isInvalid()) 207 209 return 0_s; 208 209 auto& frame = m_frameBufferCache[index]; 210 if (!frame.isComplete()) 211 return 0_s; 212 210 213 211 // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 214 212 // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify 215 213 // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082> 216 214 // for more information. 217 auto duration = frame.duration(); 218 if (duration < 11_ms) 215 if (buffer->duration() < 11_ms) 219 216 return 100_ms; 220 return duration;217 return buffer->duration(); 221 218 } 222 219
Note: See TracChangeset
for help on using the changeset viewer.