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

Side by Side Diff: Source/core/rendering/RenderImage.cpp

Issue 24077007: Add support for the object-position CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master again Created 7 years, 3 months 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
« no previous file with comments | « Source/core/platform/LengthPoint.h ('k') | Source/core/rendering/RenderReplaced.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
10 * 10 *
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return false; 510 return false;
511 if (!contentBoxRect().contains(localRect)) 511 if (!contentBoxRect().contains(localRect))
512 return false; 512 return false;
513 EFillBox backgroundClip = style()->backgroundClip(); 513 EFillBox backgroundClip = style()->backgroundClip();
514 // Background paints under borders. 514 // Background paints under borders.
515 if (backgroundClip == BorderFillBox && style()->hasBorder() && !borderObscur esBackground()) 515 if (backgroundClip == BorderFillBox && style()->hasBorder() && !borderObscur esBackground())
516 return false; 516 return false;
517 // Background shows in padding area. 517 // Background shows in padding area.
518 if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style()->hasPadding()) 518 if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style()->hasPadding())
519 return false; 519 return false;
520 // Object-position may leave parts of the content box empty, regardless of t he value of object-fit.
521 if (style()->objectPosition() != RenderStyle::initialObjectPosition())
522 return false;
520 // Object-fit may leave parts of the content box empty. 523 // Object-fit may leave parts of the content box empty.
521 ObjectFit objectFit = style()->objectFit(); 524 ObjectFit objectFit = style()->objectFit();
522 if (objectFit != ObjectFitFill && objectFit != ObjectFitCover) 525 if (objectFit != ObjectFitFill && objectFit != ObjectFitCover)
523 return false; 526 return false;
524 // Check for image with alpha. 527 // Check for image with alpha.
525 return m_imageResource->cachedImage() && m_imageResource->cachedImage()->cur rentFrameKnownToBeOpaque(this); 528 return m_imageResource->cachedImage() && m_imageResource->cachedImage()->cur rentFrameKnownToBeOpaque(this);
526 } 529 }
527 530
528 bool RenderImage::computeBackgroundIsKnownToBeObscured() 531 bool RenderImage::computeBackgroundIsKnownToBeObscured()
529 { 532 {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 return 0; 620 return 0;
618 621
619 ImageResource* cachedImage = m_imageResource->cachedImage(); 622 ImageResource* cachedImage = m_imageResource->cachedImage();
620 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( )) 623 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage( ))
621 return toSVGImage(cachedImage->image())->embeddedContentBox(); 624 return toSVGImage(cachedImage->image())->embeddedContentBox();
622 625
623 return 0; 626 return 0;
624 } 627 }
625 628
626 } // namespace WebCore 629 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/LengthPoint.h ('k') | Source/core/rendering/RenderReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698