| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 1.0f); | 138 1.0f); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ImageDocumentParser::appendBytes(const char* data, size_t length) { | 141 void ImageDocumentParser::appendBytes(const char* data, size_t length) { |
| 142 if (!length) | 142 if (!length) |
| 143 return; | 143 return; |
| 144 | 144 |
| 145 LocalFrame* frame = document()->frame(); | 145 LocalFrame* frame = document()->frame(); |
| 146 Settings* settings = frame->settings(); | 146 Settings* settings = frame->settings(); |
| 147 if (!frame->loader().client()->allowImage( | 147 if (!frame->loader().client()->allowImage( |
| 148 !settings || settings->imagesEnabled(), document()->url())) | 148 !settings || settings->getImagesEnabled(), document()->url())) |
| 149 return; | 149 return; |
| 150 | 150 |
| 151 if (document()->cachedImageResourceDeprecated()) { | 151 if (document()->cachedImageResourceDeprecated()) { |
| 152 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); | 152 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); |
| 153 // If decoding has already failed, there's no point in sending additional | 153 // If decoding has already failed, there's no point in sending additional |
| 154 // data to the ImageResource. | 154 // data to the ImageResource. |
| 155 if (document()->cachedImageResourceDeprecated()->getStatus() != | 155 if (document()->cachedImageResourceDeprecated()->getStatus() != |
| 156 Resource::DecodeError) | 156 Resource::DecodeError) |
| 157 document()->cachedImageResourceDeprecated()->appendData(data, length); | 157 document()->cachedImageResourceDeprecated()->appendData(data, length); |
| 158 } | 158 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 ImageDocument::ImageDocument(const DocumentInit& initializer) | 199 ImageDocument::ImageDocument(const DocumentInit& initializer) |
| 200 : HTMLDocument(initializer, ImageDocumentClass), | 200 : HTMLDocument(initializer, ImageDocumentClass), |
| 201 m_divElement(nullptr), | 201 m_divElement(nullptr), |
| 202 m_imageElement(nullptr), | 202 m_imageElement(nullptr), |
| 203 m_imageSizeIsKnown(false), | 203 m_imageSizeIsKnown(false), |
| 204 m_didShrinkImage(false), | 204 m_didShrinkImage(false), |
| 205 m_shouldShrinkImage(shouldShrinkToFit()), | 205 m_shouldShrinkImage(shouldShrinkToFit()), |
| 206 m_imageIsLoaded(false), | 206 m_imageIsLoaded(false), |
| 207 m_styleCheckerSize(0), | 207 m_styleCheckerSize(0), |
| 208 m_styleMouseCursorMode(Default), | 208 m_styleMouseCursorMode(Default), |
| 209 m_shrinkToFitMode(frame()->settings()->viewportEnabled() ? Viewport | 209 m_shrinkToFitMode(frame()->settings()->getViewportEnabled() ? Viewport |
| 210 : Desktop) { | 210 : Desktop) { |
| 211 setCompatibilityMode(QuirksMode); | 211 setCompatibilityMode(QuirksMode); |
| 212 lockCompatibilityMode(); | 212 lockCompatibilityMode(); |
| 213 UseCounter::count(*this, UseCounter::ImageDocument); | 213 UseCounter::count(*this, UseCounter::ImageDocument); |
| 214 if (!isInMainFrame()) | 214 if (!isInMainFrame()) |
| 215 UseCounter::count(*this, UseCounter::ImageDocumentInFrame); | 215 UseCounter::count(*this, UseCounter::ImageDocumentInFrame); |
| 216 } | 216 } |
| 217 | 217 |
| 218 DocumentParser* ImageDocument::createParser() { | 218 DocumentParser* ImageDocument::createParser() { |
| 219 return ImageDocumentParser::create(this); | 219 return ImageDocumentParser::create(this); |
| 220 } | 220 } |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 } | 619 } |
| 620 | 620 |
| 621 bool ImageEventListener::operator==(const EventListener& listener) const { | 621 bool ImageEventListener::operator==(const EventListener& listener) const { |
| 622 if (const ImageEventListener* imageEventListener = | 622 if (const ImageEventListener* imageEventListener = |
| 623 ImageEventListener::cast(&listener)) | 623 ImageEventListener::cast(&listener)) |
| 624 return m_doc == imageEventListener->m_doc; | 624 return m_doc == imageEventListener->m_doc; |
| 625 return false; | 625 return false; |
| 626 } | 626 } |
| 627 | 627 |
| 628 } // namespace blink | 628 } // namespace blink |
| OLD | NEW |