Changeset 47042 in webkit
- Timestamp:
- Aug 11, 2009 12:00:05 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r47039 r47042 1 2009-08-07 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Eric Seidel. 4 5 https://bugs.webkit.org/show_bug.cgi?id=28073 6 Treat icons with no bit count and no color count as 256-color for 7 purposes of quality ranking. 8 9 * fast/images/icon-0colors.html: Added. 10 * fast/images/resources/0colors.ico: Added. 11 1 12 2009-08-11 Dmitry Titov <dimich@chromium.org> 2 13 -
trunk/WebCore/ChangeLog
r47036 r47042 1 2009-08-07 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Eric Seidel. 4 5 https://bugs.webkit.org/show_bug.cgi?id=28073 6 Treat icons with no bit count and no color count as 256-color for 7 purposes of quality ranking. Also fix a couple cases of a style 8 violation. 9 10 Test: fast/images/icon-0colors.html 11 12 * platform/image-decoders/ico/ICOImageDecoder.cpp: 13 (WebCore::ICOImageDecoder::processDirectory): 14 (WebCore::ICOImageDecoder::readDirectoryEntry): 15 1 16 2009-08-11 Drew Wilson <atwilson@google.com> 2 17 -
trunk/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
r46814 r47042 250 250 CURSOR = 2, 251 251 }; 252 if (((fileType != ICON) && (fileType != CURSOR)) || ( idCount == 0)) {252 if (((fileType != ICON) && (fileType != CURSOR)) || (!idCount)) { 253 253 setFailed(); 254 254 return false; … … 304 304 // what a zero byte really means). 305 305 int width = static_cast<uint8_t>(m_data->data()[m_decodedOffset]); 306 if ( width == 0)306 if (!width) 307 307 width = 256; 308 308 int height = static_cast<uint8_t>(m_data->data()[m_decodedOffset + 1]); 309 if ( height == 0)309 if (!height) 310 310 height = 256; 311 311 IconDirectoryEntry entry; … … 319 319 // this value to determine which icon entry is best. 320 320 if (!entry.m_bitCount) { 321 uint8_t colorCount = m_data->data()[m_decodedOffset + 2]; 322 if (colorCount) { 323 for (--colorCount; colorCount; colorCount >>= 1) 324 ++entry.m_bitCount; 325 } 321 int colorCount = 322 static_cast<uint8_t>(m_data->data()[m_decodedOffset + 2]); 323 if (!colorCount) 324 colorCount = 256; // Vague in the spec, needed by real-world icons. 325 for (--colorCount; colorCount; colorCount >>= 1) 326 ++entry.m_bitCount; 326 327 } 327 328
Note: See TracChangeset
for help on using the changeset viewer.