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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 22900008: Make vw/vh units to work in css transforms. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index 220362ec18f89e3f2d933a01172049017ab6ec04..b316e0b5926e56b4326ba2d13d8e193a7be060d6 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -809,12 +809,12 @@ inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& tr
return false;
}
-void RenderStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
+void RenderStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin, RenderView* renderView) const
{
- applyTransform(transform, FloatRect(FloatPoint(), borderBoxSize), applyOrigin);
+ applyTransform(transform, FloatRect(FloatPoint(), borderBoxSize), applyOrigin, renderView);
}
-void RenderStyle::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, ApplyTransformOrigin applyOrigin) const
+void RenderStyle::applyTransform(TransformationMatrix& transform, const FloatRect& boundingBox, ApplyTransformOrigin applyOrigin, RenderView* renderView) const
{
const Vector<RefPtr<TransformOperation> >& transformOperations = rareNonInheritedData->m_transform->m_operations.operations();
bool applyTransformOrigin = requireTransformOrigin(transformOperations, applyOrigin);
@@ -823,18 +823,18 @@ void RenderStyle::applyTransform(TransformationMatrix& transform, const FloatRec
float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0;
if (applyTransformOrigin) {
- transform.translate3d(floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX,
- floatValueForLength(transformOriginY(), boundingBox.height()) + offsetY,
+ transform.translate3d(floatValueForLength(transformOriginX(), boundingBox.width(), renderView) + offsetX,
+ floatValueForLength(transformOriginY(), boundingBox.height(), renderView) + offsetY,
transformOriginZ());
}
unsigned size = transformOperations.size();
for (unsigned i = 0; i < size; ++i)
- transformOperations[i]->apply(transform, boundingBox.size());
+ transformOperations[i]->apply(transform, boundingBox.size(), renderView);
if (applyTransformOrigin) {
- transform.translate3d(-floatValueForLength(transformOriginX(), boundingBox.width()) - offsetX,
- -floatValueForLength(transformOriginY(), boundingBox.height()) - offsetY,
+ transform.translate3d(-floatValueForLength(transformOriginX(), boundingBox.width(), renderView) - offsetX,
+ -floatValueForLength(transformOriginY(), boundingBox.height(), renderView) - offsetY,
-transformOriginZ());
}
}

Powered by Google App Engine
This is Rietveld 408576698