Changeset 167598 in webkit
- Timestamp:
- Apr 21, 2014 11:08:49 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167597 r167598 1 2014-04-21 Darin Adler <darin@apple.com> 2 3 REGRESSION (r160908): Safari doesn't draw rotated images properly first time 4 https://bugs.webkit.org/show_bug.cgi?id=131930 5 6 Reviewed by Anders Carlsson. 7 8 With render tree creation sufficiently lazy, we had to put some explicit 9 calls to updateStyleIfNeeded into the ImageDocument class. 10 11 * dom/DOMImplementation.cpp: 12 (WebCore::DOMImplementation::createDocument): Pass a Frame&. 13 14 * html/ImageDocument.cpp: 15 (WebCore::ImageDocument::imageSize): Added this helper function. This updates 16 style so we can use the renderer to compute an image size taking things like 17 orientation into account, and also passes in the zoom factor. 18 (WebCore::ImageDocument::updateDuringParsing): Moved the body of the 19 ImageDocumentParser::appendBytes function into this function. Since it's a 20 member of ImageDocument, it has better access to appropriate private members, 21 and we don't have to expose as many functions to the public. Also changed to 22 not use the frame so much. Also merged in the code that creates the document 23 instead of having it be a side effect in the cachedImage helper function; all 24 the other call sites were checking for null before calling cachedImage. 25 (WebCore::ImageDocument::finishedParsing): Moved the body of the 26 ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded 27 before using the renderer to get the image size. 28 (WebCore::ImageDocumentParser::document): Made this return a reference. It's 29 just a convenience function used in the two functions below. 30 (WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing. 31 (WebCore::ImageDocumentParser::finish): Just call finishedParsing. 32 (WebCore::ImageDocument::ImageDocument): Take a reference for the argument, 33 use nullptr, and also initialize m_shouldShrinkImage directly instead of using 34 a shouldShrinkToFit() helper function to do it. 35 (WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of 36 null for the frame, since the caller does it. Removed some unneeded 37 IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of 38 calling shouldShrinkToFit since at this early point they will be identical. 39 (WebCore::ImageDocument::scale): Make non-const so we can call the new 40 imageSize helper. Use Document::view instead of Frame::view. Improved the 41 conversion to floating point so it doesn't involve a static_cast and an extra 42 conversion from int to LayoutUnit. 43 (WebCore::ImageDocument::resizeImageToFit): Ditto. 44 (WebCore::ImageDocument::imageClicked): Ditto. 45 (WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage 46 ibnstead of shouldShrinkToFit. 47 (WebCore::ImageDocument::restoreImageSize): Ditto. 48 (WebCore::ImageDocument::imageFitsInWindow): Ditto. 49 (WebCore::ImageDocument::windowSizeChanged): Ditto. 50 (WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing. 51 (WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor. 52 (WebCore::ImageEventListener::handleEvent): Updated for changes above. 53 (WebCore::ImageEventListener::operator==): Simplified. No reason this has to check 54 whether both listeners are in the same document. 55 (WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr. 56 57 * html/ImageDocument.h: Deleted some unused things, updated for changes above, 58 and made some memer functions private. 59 60 * loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins, 61 allowImage, and allowDisplayingInsecureContent functions. These were only used in 62 Chromium and are now unneeded complexity. We could bring them back if anyone wants them. 63 64 * loader/MixedContentChecker.cpp: 65 (WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to 66 allowDisplayingInsecureContent, just use the setting directly. 67 (WebCore::MixedContentChecker::canRunInsecureContent): Removed call to 68 allowRunningInsecureContent, just use the setting directly. 69 70 * loader/SubframeLoader.cpp: 71 (WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just 72 use the arePluginsEnabled setting directly. 73 74 * loader/cache/CachedResourceLoader.cpp: 75 (WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just 76 use the isScriptEnabled setting directly. 77 (WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage. 78 1 79 2014-04-21 David Hyatt <hyatt@apple.com> 2 80 -
trunk/Source/WebCore/dom/DOMImplementation.cpp
r165971 r167598 329 329 return PluginDocument::create(frame, url); 330 330 if (Image::supportsType(type)) 331 return ImageDocument::create( frame, url);331 return ImageDocument::create(*frame, url); 332 332 333 333 #if ENABLE(VIDEO) -
trunk/Source/WebCore/html/ImageDocument.cpp
r165676 r167598 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2010, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 51 51 using namespace HTMLNames; 52 52 53 class ImageEventListener : public EventListener {53 class ImageEventListener final : public EventListener { 54 54 public: 55 static PassRefPtr<ImageEventListener> create(ImageDocument* document) { return adoptRef(new ImageEventListener(document)); } 56 static const ImageEventListener* cast(const EventListener* listener) 55 static PassRefPtr<ImageEventListener> create(ImageDocument& document) { return adoptRef(new ImageEventListener(document)); } 56 57 private: 58 ImageEventListener(ImageDocument& document) 59 : EventListener(ImageEventListenerType) 60 , m_document(document) 57 61 { 58 return listener->type() == ImageEventListenerType 59 ? static_cast<const ImageEventListener*>(listener) 60 : 0; 61 } 62 63 virtual bool operator==(const EventListener& other) override; 64 65 private: 66 ImageEventListener(ImageDocument* document) 67 : EventListener(ImageEventListenerType) 68 , m_doc(document) 69 { 70 } 71 62 } 63 64 virtual bool operator==(const EventListener&) override; 72 65 virtual void handleEvent(ScriptExecutionContext*, Event*) override; 73 66 74 ImageDocument * m_doc;67 ImageDocument& m_document; 75 68 }; 76 69 … … 82 75 } 83 76 84 ImageDocument* document() const85 {86 return toImageDocument(RawDataDocumentParser::document());87 }88 89 77 private: 90 78 ImageDocumentParser(ImageDocument& document) … … 92 80 { 93 81 } 82 83 ImageDocument& document() const; 94 84 95 85 virtual void appendBytes(DocumentWriter&, const char*, size_t) override; … … 121 111 // -------- 122 112 123 static float pageZoomFactor(const Document* document) 124 { 125 Frame* frame = document->frame(); 126 return frame ? frame->pageZoomFactor() : 1; 127 } 128 129 void ImageDocumentParser::appendBytes(DocumentWriter&, const char*, size_t) 130 { 131 Frame* frame = document()->frame(); 132 if (!frame->loader().client().allowImage(frame->settings().areImagesEnabled(), document()->url())) 133 return; 134 135 CachedImage* cachedImage = document()->cachedImage(); 136 RefPtr<ResourceBuffer> resourceData = frame->loader().documentLoader()->mainResourceData(); 137 cachedImage->addDataBuffer(resourceData.get()); 138 139 document()->imageUpdated(); 140 } 141 142 void ImageDocumentParser::finish() 143 { 144 if (!isStopped() && document()->imageElement()) { 145 CachedImage* cachedImage = document()->cachedImage(); 146 RefPtr<ResourceBuffer> data = document()->frame()->loader().documentLoader()->mainResourceData(); 113 LayoutSize ImageDocument::imageSize() 114 { 115 ASSERT(m_imageElement); 116 updateStyleIfNeeded(); 117 return m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), frame() ? frame()->pageZoomFactor() : 1); 118 } 119 120 void ImageDocument::updateDuringParsing() 121 { 122 if (!frame()->settings().areImagesEnabled()) 123 return; 124 125 if (!m_imageElement) 126 createDocumentStructure(); 127 128 m_imageElement->cachedImage()->addDataBuffer(loader()->mainResourceData().get()); 129 130 imageUpdated(); 131 } 132 133 void ImageDocument::finishedParsing() 134 { 135 if (!parser()->isStopped() && m_imageElement) { 136 CachedImage& cachedImage = *m_imageElement->cachedImage(); 137 RefPtr<ResourceBuffer> data = loader()->mainResourceData(); 147 138 148 139 // If this is a multipart image, make a copy of the current part, since the resource data 149 140 // will be overwritten by the next part. 150 if ( document()->frame()->loader().documentLoader()->isLoadingMultipartContent())141 if (loader()->isLoadingMultipartContent()) 151 142 data = data->copy(); 152 143 153 cachedImage ->finishLoading(data.get());154 cachedImage ->finish();155 156 cachedImage ->setResponse(document()->frame()->loader().documentLoader()->response());144 cachedImage.finishLoading(data.get()); 145 cachedImage.finish(); 146 147 cachedImage.setResponse(loader()->response()); 157 148 158 149 // Report the natural image size in the page title, regardless of zoom level. 159 150 // At a zoom level of 1 the image is guaranteed to have an integer size. 160 IntSize size = flooredIntSize(cachedImage->imageSizeForRenderer(document()->imageElement()->renderer(), 1.0f)); 151 updateStyleIfNeeded(); 152 IntSize size = flooredIntSize(cachedImage.imageSizeForRenderer(m_imageElement->renderer(), 1)); 161 153 if (size.width()) { 162 // Compute the title , we use the decoded filename of the resource, falling163 // back on the (decoded)hostname if there is no path.164 String fileName = decodeURLEscapeSequences(document()->url().lastPathComponent());165 if ( fileName.isEmpty())166 fileName = document()->url().host();167 document()->setTitle(imageTitle(fileName, size));154 // Compute the title. We use the decoded filename of the resource, falling 155 // back on the hostname if there is no path. 156 String name = decodeURLEscapeSequences(url().lastPathComponent()); 157 if (name.isEmpty()) 158 name = url().host(); 159 setTitle(imageTitle(name, size)); 168 160 } 169 161 170 document()->imageUpdated(); 171 } 172 173 document()->finishedParsing(); 174 } 175 176 // -------- 177 178 ImageDocument::ImageDocument(Frame* frame, const URL& url) 179 : HTMLDocument(frame, url, ImageDocumentClass) 180 , m_imageElement(0) 162 imageUpdated(); 163 } 164 165 HTMLDocument::finishedParsing(); 166 } 167 168 inline ImageDocument& ImageDocumentParser::document() const 169 { 170 // Only used during parsing, so document is guaranteed to be non-null. 171 ASSERT(RawDataDocumentParser::document()); 172 return toImageDocument(*RawDataDocumentParser::document()); 173 } 174 175 void ImageDocumentParser::appendBytes(DocumentWriter&, const char*, size_t) 176 { 177 document().updateDuringParsing(); 178 } 179 180 void ImageDocumentParser::finish() 181 { 182 document().finishedParsing(); 183 } 184 185 ImageDocument::ImageDocument(Frame& frame, const URL& url) 186 : HTMLDocument(&frame, url, ImageDocumentClass) 187 , m_imageElement(nullptr) 181 188 , m_imageSizeIsKnown(false) 182 189 , m_didShrinkImage(false) 183 , m_shouldShrinkImage( shouldShrinkToFit())190 , m_shouldShrinkImage(frame.settings().shrinksStandaloneImagesToFit() && frame.isMainFrame()) 184 191 { 185 192 setCompatibilityMode(QuirksMode); … … 195 202 { 196 203 RefPtr<Element> rootElement = Document::createElement(htmlTag, false); 197 appendChild(rootElement , IGNORE_EXCEPTION);204 appendChild(rootElement); 198 205 toHTMLHtmlElement(rootElement.get())->insertedByParser(); 199 206 200 if (frame()) 201 frame()->injectUserScripts(InjectAtDocumentStart); 207 frame()->injectUserScripts(InjectAtDocumentStart); 202 208 203 209 RefPtr<Element> body = Document::createElement(bodyTag, false); 204 body->setAttribute(styleAttr, "margin: 0px;"); 205 206 rootElement->appendChild(body, IGNORE_EXCEPTION); 210 body->setAttribute(styleAttr, "margin: 0px"); 211 rootElement->appendChild(body); 207 212 208 213 RefPtr<ImageDocumentElement> imageElement = ImageDocumentElement::create(*this); 209 210 214 imageElement->setAttribute(styleAttr, "-webkit-user-select: none"); 211 215 imageElement->setLoadManually(true); 212 216 imageElement->setSrc(url().string()); 213 214 body->appendChild(imageElement, IGNORE_EXCEPTION); 215 216 if (shouldShrinkToFit()) { 217 // Add event listeners 218 RefPtr<EventListener> listener = ImageEventListener::create(this); 219 if (DOMWindow* domWindow = this->domWindow()) 220 domWindow->addEventListener("resize", listener, false); 217 body->appendChild(imageElement); 218 219 if (m_shouldShrinkImage) { 220 RefPtr<EventListener> listener = ImageEventListener::create(*this); 221 if (DOMWindow* window = this->domWindow()) 222 window->addEventListener("resize", listener, false); 221 223 imageElement->addEventListener("click", listener.release(), false); 224 222 225 #if PLATFORM(IOS) 223 226 // Set the viewport to be in device pixels (rather than the default of 980). … … 229 232 } 230 233 231 float ImageDocument::scale() const234 float ImageDocument::scale() 232 235 { 233 236 #if PLATFORM(IOS) … … 238 241 return 1; 239 242 240 FrameView* view = frame()->view();243 FrameView* view = this->view(); 241 244 if (!view) 242 245 return 1; 243 246 244 LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this)); 245 LayoutSize windowSize = LayoutSize(view->width(), view->height()); 246 247 float widthScale = static_cast<float>(windowSize.width()) / imageSize.width(); 248 float heightScale = static_cast<float>(windowSize.height()) / imageSize.height(); 247 LayoutSize imageSize = this->imageSize(); 248 249 float widthScale = view->width() / imageSize.width().toFloat(); 250 float heightScale = view->height() / imageSize.height().toFloat(); 249 251 250 252 return std::min(widthScale, heightScale); … … 260 262 return; 261 263 262 LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this));264 LayoutSize imageSize = this->imageSize(); 263 265 264 266 float scale = this->scale(); … … 282 284 m_shouldShrinkImage = !m_shouldShrinkImage; 283 285 284 if (m_shouldShrinkImage) 286 if (m_shouldShrinkImage) { 287 // Call windowSizeChanged for its side effect of sizing the image. 285 288 windowSizeChanged(); 286 else {289 } else { 287 290 restoreImageSize(); 288 291 … … 291 294 float scale = this->scale(); 292 295 293 int scrollX = static_cast<int>(x / scale - (float)frame()->view()->width() / 2);294 int scrollY = static_cast<int>(y / scale - (float)frame()->view()->height() / 2);295 296 frame()->view()->setScrollPosition(IntPoint(scrollX, scrollY));296 int scrollX = static_cast<int>(x / scale - view()->width() / 2.0f); 297 int scrollY = static_cast<int>(y / scale - view()->height() / 2.0f); 298 299 view()->setScrollPosition(IntPoint(scrollX, scrollY)); 297 300 } 298 301 #endif … … 306 309 return; 307 310 308 if ( m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this)).isEmpty())311 if (imageSize().isEmpty()) 309 312 return; 310 313 311 314 m_imageSizeIsKnown = true; 312 313 if ( shouldShrinkToFit()) {314 // Force resizing of the image315 316 if (m_shouldShrinkImage) { 317 // Call windowSizeChanged for its side effect of sizing the image. 315 318 windowSizeChanged(); 316 319 } … … 321 324 if (!m_imageElement || !m_imageSizeIsKnown) 322 325 return; 323 324 LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this));326 327 LayoutSize imageSize = this->imageSize(); 325 328 m_imageElement->setWidth(imageSize.width()); 326 329 m_imageElement->setHeight(imageSize.height()); 327 330 328 331 if (imageFitsInWindow()) 329 332 m_imageElement->removeInlineStyleProperty(CSSPropertyCursor); 330 333 else 331 334 m_imageElement->setInlineStyleProperty(CSSPropertyCursor, CSSValueWebkitZoomOut); 332 335 333 336 m_didShrinkImage = false; 334 337 } 335 338 336 bool ImageDocument::imageFitsInWindow() const339 bool ImageDocument::imageFitsInWindow() 337 340 { 338 341 if (!m_imageElement) 339 342 return true; 340 343 341 FrameView* view = frame()->view();344 FrameView* view = this->view(); 342 345 if (!view) 343 346 return true; 344 347 345 LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this));348 LayoutSize imageSize = this->imageSize(); 346 349 #if PLATFORM(IOS) 347 350 LayoutSize windowSize = view->contentsToScreen(view->visibleContentRect()).size(); … … 363 366 return; 364 367 365 LayoutSize imageSize = m_imageElement->cachedImage()->imageSizeForRenderer(m_imageElement->renderer(), pageZoomFactor(this));366 LayoutRect visibleScreenSize = frame()->view()->contentsToScreen(frame()->view()->visibleContentRect());368 LayoutSize imageSize = this->imageSize(); 369 LayoutRect visibleScreenSize = view()->contentsToScreen(view()->visibleContentRect()); 367 370 368 371 float widthScale = static_cast<float>(visibleScreenSize.width()) / imageSize.width(); … … 384 387 385 388 if (m_didShrinkImage) { 386 // If the window has been resized so that the image fits, restore the image size 389 // If the window has been resized so that the image fits, restore the image size, 387 390 // otherwise update the restored image size. 388 391 if (fitsInWindow) … … 400 403 } 401 404 402 CachedImage* ImageDocument::cachedImage()403 {404 if (!m_imageElement)405 createDocumentStructure();406 407 return m_imageElement->cachedImage();408 }409 410 bool ImageDocument::shouldShrinkToFit() const411 {412 return frame()->settings().shrinksStandaloneImagesToFit() && frame()->isMainFrame();413 }414 415 405 void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event) 416 406 { 417 407 if (event->type() == eventNames().resizeEvent) 418 m_doc ->windowSizeChanged();408 m_document.windowSizeChanged(); 419 409 else if (event->type() == eventNames().clickEvent && event->isMouseEvent()) { 420 MouseEvent* mouseEvent = toMouseEvent(event); 421 m_doc->imageClicked(mouseEvent->x(), mouseEvent->y()); 422 } 423 } 424 425 bool ImageEventListener::operator==(const EventListener& listener) 426 { 427 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(&listener)) 428 return m_doc == imageEventListener->m_doc; 429 return false; 410 MouseEvent& mouseEvent = toMouseEvent(*event); 411 m_document.imageClicked(mouseEvent.x(), mouseEvent.y()); 412 } 413 } 414 415 bool ImageEventListener::operator==(const EventListener& other) 416 { 417 // All ImageEventListener objects compare as equal; OK since there is only one per document. 418 return other.type() == ImageEventListenerType; 430 419 } 431 420 … … 442 431 if (m_imageDocument) { 443 432 m_imageDocument->disconnectImageElement(); 444 m_imageDocument = 0;433 m_imageDocument = nullptr; 445 434 } 446 435 HTMLImageElement::didMoveToNewDocument(oldDocument); -
trunk/Source/WebCore/html/ImageDocument.h
r165676 r167598 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 namespace WebCore { 31 31 32 class CachedImage;33 32 class ImageDocumentElement; 34 33 35 34 class ImageDocument final : public HTMLDocument { 36 35 public: 37 static PassRefPtr<ImageDocument> create(Frame *frame, const URL& url)36 static PassRefPtr<ImageDocument> create(Frame& frame, const URL& url) 38 37 { 39 38 return adoptRef(new ImageDocument(frame, url)); 40 39 } 41 40 42 CachedImage* cachedImage(); 43 ImageDocumentElement* imageElement() const { return m_imageElement; } 44 void disconnectImageElement() { m_imageElement = 0; } 45 41 void updateDuringParsing(); 42 void finishedParsing(); 43 44 void disconnectImageElement() { m_imageElement = nullptr; } 45 46 46 void windowSizeChanged(); 47 void imageUpdated();48 47 void imageClicked(int x, int y); 49 48 50 49 private: 51 ImageDocument(Frame *, const URL&);50 ImageDocument(Frame&, const URL&); 52 51 53 52 virtual PassRefPtr<DocumentParser> createParser() override; 54 53 54 LayoutSize imageSize(); 55 55 56 void createDocumentStructure(); 56 57 void resizeImageToFit(); 57 58 void restoreImageSize(); 58 bool imageFitsInWindow() const; 59 bool shouldShrinkToFit() const; 60 float scale() const; 61 59 bool imageFitsInWindow(); 60 float scale(); 61 62 void imageUpdated(); 63 62 64 ImageDocumentElement* m_imageElement; 63 64 // Whether enough of the image has been loaded to determine its size 65 66 // Whether enough of the image has been loaded to determine its size. 65 67 bool m_imageSizeIsKnown; 66 67 // Whether the image is shrunk to fit or not 68 69 // Whether the image is shrunk to fit or not. 68 70 bool m_didShrinkImage; 69 70 // Whether the image should be shrunk or not 71 72 // Whether the image should be shrunk or not. 71 73 bool m_shouldShrinkImage; 72 74 }; -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r167207 r167598 304 304 305 305 virtual bool allowScript(bool enabledPerSettings) { return enabledPerSettings; } 306 virtual bool allowScriptFromSource(bool enabledPerSettings, const URL&) { return enabledPerSettings; }307 virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; }308 virtual bool allowImage(bool enabledPerSettings, const URL&) { return enabledPerSettings; }309 virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, SecurityOrigin*, const URL&) { return enabledPerSettings; }310 virtual bool allowRunningInsecureContent(bool enabledPerSettings, SecurityOrigin*, const URL&) { return enabledPerSettings; }311 306 312 307 // Clients that generally disallow universal access can make exceptions for particular URLs. -
trunk/Source/WebCore/loader/MixedContentChecker.cpp
r165676 r167598 66 66 return true; 67 67 68 bool allowed = client().allowDisplayingInsecureContent(m_frame.settings().allowDisplayOfInsecureContent(), securityOrigin, url);68 bool allowed = m_frame.settings().allowDisplayOfInsecureContent(); 69 69 logWarning(allowed, "displayed", url); 70 70 … … 80 80 return true; 81 81 82 bool allowed = client().allowRunningInsecureContent(m_frame.settings().allowRunningOfInsecureContent(), securityOrigin, url);82 bool allowed = m_frame.settings().allowRunningOfInsecureContent(); 83 83 logWarning(allowed, "ran", url); 84 84 -
trunk/Source/WebCore/loader/SubframeLoader.cpp
r166684 r167598 398 398 bool SubframeLoader::allowPlugins(ReasonForCallingAllowPlugins) 399 399 { 400 return m_frame. loader().client().allowPlugins(m_frame.settings().arePluginsEnabled());400 return m_frame.settings().arePluginsEnabled(); 401 401 } 402 402 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r166992 r167598 348 348 if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentSecurityPolicy()->allowScriptFromSource(url)) 349 349 return false; 350 351 if (frame()) { 352 if (!frame()->loader().client().allowScriptFromSource(frame()->settings().isScriptEnabled(), url)) 353 return false; 354 } 350 if (frame() && !frame()->settings().isScriptEnabled()) 351 return false; 355 352 break; 356 353 case CachedResource::CSSStyleSheet: … … 679 676 } 680 677 681 bool CachedResourceLoader::clientDefersImage(const URL& url) const682 { 683 return frame() && !frame()->loader().client().allowImage(m_imagesEnabled, url);678 bool CachedResourceLoader::clientDefersImage(const URL&) const 679 { 680 return !m_imagesEnabled; 684 681 } 685 682
Note: See TracChangeset
for help on using the changeset viewer.