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

Side by Side Diff: third_party/WebKit/Source/core/layout/HitTestResult.cpp

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer Created 5 years, 1 month 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) 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 Image* HitTestResult::image() const 310 Image* HitTestResult::image() const
311 { 311 {
312 Node* innerNodeOrImageMapImage = this->innerNodeOrImageMapImage(); 312 Node* innerNodeOrImageMapImage = this->innerNodeOrImageMapImage();
313 if (!innerNodeOrImageMapImage) 313 if (!innerNodeOrImageMapImage)
314 return nullptr; 314 return nullptr;
315 315
316 LayoutObject* layoutObject = innerNodeOrImageMapImage->layoutObject(); 316 LayoutObject* layoutObject = innerNodeOrImageMapImage->layoutObject();
317 if (layoutObject && layoutObject->isImage()) { 317 if (layoutObject && layoutObject->isImage()) {
318 LayoutImage* image = toLayoutImage(layoutObject); 318 LayoutImage* image = toLayoutImage(layoutObject);
319 if (image->cachedImage() && !image->cachedImage()->errorOccurred()) 319 if (image->cachedImage() && !image->cachedImage()->errorOccurred())
320 return image->cachedImage()->imageForLayoutObject(image); 320 return image->cachedImage()->image();
321 } 321 }
322 322
323 return nullptr; 323 return nullptr;
324 } 324 }
325 325
326 IntRect HitTestResult::imageRect() const 326 IntRect HitTestResult::imageRect() const
327 { 327 {
328 if (!image()) 328 if (!image())
329 return IntRect(); 329 return IntRect();
330 return innerNodeOrImageMapImage()->layoutBox()->absoluteContentQuad().enclos ingBoundingBox(); 330 return innerNodeOrImageMapImage()->layoutBox()->absoluteContentQuad().enclos ingBoundingBox();
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 else if (isHTMLMapElement(m_innerNode)) 526 else if (isHTMLMapElement(m_innerNode))
527 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement(); 527 imageMapImageElement = toHTMLMapElement(m_innerNode)->imageElement();
528 528
529 if (!imageMapImageElement) 529 if (!imageMapImageElement)
530 return m_innerNode.get(); 530 return m_innerNode.get();
531 531
532 return imageMapImageElement; 532 return imageMapImageElement;
533 } 533 }
534 534
535 } // namespace blink 535 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698