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

Unified Diff: trunk/Source/core/rendering/RenderReplaced.cpp

Issue 23465021: Revert 157745 "Add support for the object-position CSS property." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/Source/core/rendering/RenderImage.cpp ('k') | trunk/Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/rendering/RenderReplaced.cpp
===================================================================
--- trunk/Source/core/rendering/RenderReplaced.cpp (revision 157750)
+++ trunk/Source/core/rendering/RenderReplaced.cpp (working copy)
@@ -314,7 +314,7 @@
{
LayoutRect contentRect = contentBoxRect();
ObjectFit objectFit = style()->objectFit();
- if (objectFit == ObjectFitFill && style()->objectPosition() == RenderStyle::initialObjectPosition())
+ if (objectFit == ObjectFitFill)
return contentRect;
LayoutSize intrinsicSize = overriddenIntrinsicSize ? *overriddenIntrinsicSize : this->intrinsicSize();
@@ -334,13 +334,13 @@
finalRect.setSize(intrinsicSize);
break;
case ObjectFitFill:
- break;
- default:
ASSERT_NOT_REACHED();
}
- LayoutUnit xOffset = minimumValueForLength(style()->objectPosition().x(), contentRect.width() - finalRect.width(), view());
- LayoutUnit yOffset = minimumValueForLength(style()->objectPosition().y(), contentRect.height() - finalRect.height(), view());
+ // FIXME: This is where object-position should be taken into account, but since it's not
+ // implemented yet, assume the initial value of "50% 50%".
+ LayoutUnit xOffset = (contentRect.width() - finalRect.width()) / 2;
+ LayoutUnit yOffset = (contentRect.height() - finalRect.height()) / 2;
finalRect.move(xOffset, yOffset);
return finalRect;
« no previous file with comments | « trunk/Source/core/rendering/RenderImage.cpp ('k') | trunk/Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698