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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp

Issue 1785323002: Move computeIntrinsicSizingInfo to LayoutReplaced (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-computeIntrinsicSizingInfo
Patch Set: Created 4 years, 9 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: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
index 729bb9014a25e35e64ff20b6df1560cc28f5fef0..e2737bd2f7786a07ad4b94c9f079fdbdf6b20eaf 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -146,7 +146,7 @@ static inline bool layoutObjectHasAspectRatio(const LayoutObject* layoutObject)
return layoutObject->isImage() || layoutObject->isCanvas() || layoutObject->isVideo();
}
-void LayoutReplaced::computeIntrinsicSizingInfoForLayoutBox(LayoutBox* contentLayoutObject, IntrinsicSizingInfo& intrinsicSizingInfo) const
+void LayoutReplaced::computeIntrinsicSizingInfoForReplacedContent(LayoutReplaced* contentLayoutObject, IntrinsicSizingInfo& intrinsicSizingInfo) const
{
if (contentLayoutObject) {
contentLayoutObject->computeIntrinsicSizingInfo(intrinsicSizingInfo);
@@ -560,7 +560,7 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalWidth(ShouldComputePreferred sh
// 10.3.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width
IntrinsicSizingInfo intrinsicSizingInfo;
- computeIntrinsicSizingInfoForLayoutBox(contentLayoutObject, intrinsicSizingInfo);
+ computeIntrinsicSizingInfoForReplacedContent(contentLayoutObject, intrinsicSizingInfo);
FloatSize constrainedSize = constrainIntrinsicSizeToMinMax(intrinsicSizingInfo);
if (style()->logicalWidth().isAuto()) {
@@ -621,7 +621,7 @@ LayoutUnit LayoutReplaced::computeReplacedLogicalHeight() const
// 10.6.2 Inline, replaced elements: http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height
IntrinsicSizingInfo intrinsicSizingInfo;
- computeIntrinsicSizingInfoForLayoutBox(contentLayoutObject, intrinsicSizingInfo);
+ computeIntrinsicSizingInfoForReplacedContent(contentLayoutObject, intrinsicSizingInfo);
FloatSize constrainedSize = constrainIntrinsicSizeToMinMax(intrinsicSizingInfo);
bool widthIsAuto = style()->logicalWidth().isAuto();
@@ -758,4 +758,11 @@ void LayoutReplaced::setSelectionState(SelectionState state)
inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone);
}
+void LayoutReplaced::IntrinsicSizingInfo::transpose()
+{
+ size = size.transposedSize();
+ aspectRatio = aspectRatio.transposedSize();
+ std::swap(hasWidth, hasHeight);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutReplaced.h ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698