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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.h

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 static const int defaultWidth; 65 static const int defaultWidth;
66 static const int defaultHeight; 66 static const int defaultHeight;
67 bool canHaveChildren() const override { return false; } 67 bool canHaveChildren() const override { return false; }
68 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) const { } 68 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) const { }
69 LayoutRect localSelectionRect() const; // This is in local coordinates, but it's a physical rect (so the top left corner is physical top left). 69 LayoutRect localSelectionRect() const; // This is in local coordinates, but it's a physical rect (so the top left corner is physical top left).
70 70
71 bool hasObjectFit() const { return style()->getObjectFit() != ComputedStyle: :initialObjectFit(); } 71 bool hasObjectFit() const { return style()->getObjectFit() != ComputedStyle: :initialObjectFit(); }
72 72
73 void paint(const PaintInfo&, const LayoutPoint&) const override; 73 void paint(const PaintInfo&, const LayoutPoint&) const override;
74 74
75 struct IntrinsicSizingInfo {
76 STACK_ALLOCATED();
77 IntrinsicSizingInfo() : hasWidth(true), hasHeight(true) {}
78
79 FloatSize size;
80 FloatSize aspectRatio;
81 bool hasWidth;
82 bool hasHeight;
83
84 void transpose();
85 };
86
75 protected: 87 protected:
76 void willBeDestroyed() override; 88 void willBeDestroyed() override;
77 89
78 void layout() override; 90 void layout() override;
79 91
80 LayoutSize intrinsicSize() const final { return m_intrinsicSize; } 92 LayoutSize intrinsicSize() const final { return m_intrinsicSize; }
81 void computeIntrinsicSizingInfo(IntrinsicSizingInfo&) const override; 93 virtual void computeIntrinsicSizingInfo(IntrinsicSizingInfo&) const;
82 94
83 void computePositionedLogicalWidth(LogicalExtentComputedValues&) const overr ide; 95 void computePositionedLogicalWidth(LogicalExtentComputedValues&) const overr ide;
84 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const over ride; 96 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const over ride;
85 97
86 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const final; 98 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const final;
87 99
88 virtual LayoutUnit intrinsicContentLogicalHeight() const { return intrinsicL ogicalHeight(); } 100 virtual LayoutUnit intrinsicContentLogicalHeight() const { return intrinsicL ogicalHeight(); }
89 101
90 virtual LayoutUnit minimumReplacedHeight() const { return LayoutUnit(); } 102 virtual LayoutUnit minimumReplacedHeight() const { return LayoutUnit(); }
91 103
(...skipping 13 matching lines...) Expand all
105 virtual LayoutReplaced* embeddedReplacedContent() const { return nullptr; } 117 virtual LayoutReplaced* embeddedReplacedContent() const { return nullptr; }
106 118
107 PositionWithAffinity positionForPoint(const LayoutPoint&) override; 119 PositionWithAffinity positionForPoint(const LayoutPoint&) override;
108 120
109 private: 121 private:
110 void computePreferredLogicalWidths() final; 122 void computePreferredLogicalWidths() final;
111 123
112 bool canBeSelectionLeaf() const override { return true; } 124 bool canBeSelectionLeaf() const override { return true; }
113 125
114 LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObject* pai ntInvalidationContainer) const final; 126 LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObject* pai ntInvalidationContainer) const final;
115 void computeIntrinsicSizingInfoForLayoutBox(LayoutBox*, IntrinsicSizingInfo& ) const; 127 void computeIntrinsicSizingInfoForReplacedContent(LayoutReplaced*, Intrinsic SizingInfo&) const;
116 FloatSize constrainIntrinsicSizeToMinMax(const IntrinsicSizingInfo&) const; 128 FloatSize constrainIntrinsicSizeToMinMax(const IntrinsicSizingInfo&) const;
117 129
118 mutable LayoutSize m_intrinsicSize; 130 mutable LayoutSize m_intrinsicSize;
119 }; 131 };
120 132
121 } // namespace blink 133 } // namespace blink
122 134
123 #endif 135 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698