Skip to content

Commit

Permalink
[IFC] BoxGeometry::m_contentWidth/height should read m_contentBoxWidt…
Browse files Browse the repository at this point in the history
…h/height

https://bugs.webkit.org/show_bug.cgi?id=259217

Reviewed by Antti Koivisto.

* Source/WebCore/layout/layouttree/LayoutBoxGeometry.h:
(WebCore::Layout::BoxGeometry::setHasValidContentBoxHeight):
(WebCore::Layout::BoxGeometry::setHasValidContentBoxWidth):
(WebCore::Layout::BoxGeometry::setContentBoxHeight):
(WebCore::Layout::BoxGeometry::setContentBoxWidth):
(WebCore::Layout::BoxGeometry::setContentBoxSize):
(WebCore::Layout::BoxGeometry::contentBoxHeight const):
(WebCore::Layout::BoxGeometry::contentBoxWidth const):
(WebCore::Layout::BoxGeometry::geometryForWritingModeAndDirection const):
(WebCore::Layout::BoxGeometry::setHasValidContentHeight): Deleted.
(WebCore::Layout::BoxGeometry::setHasValidContentWidth): Deleted.

Canonical link: https://commits.webkit.org/266067@main
  • Loading branch information
alanbaradlay committed Jul 14, 2023
1 parent 3dff075 commit f379bd5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(BoxGeometry);

BoxGeometry::BoxGeometry(const BoxGeometry& other)
: m_topLeft(other.m_topLeft)
, m_contentWidth(other.m_contentWidth)
, m_contentHeight(other.m_contentHeight)
, m_contentBoxWidth(other.m_contentBoxWidth)
, m_contentBoxHeight(other.m_contentBoxHeight)
, m_horizontalMargin(other.m_horizontalMargin)
, m_verticalMargin(other.m_verticalMargin)
, m_border(other.m_border)
Expand All @@ -50,8 +50,8 @@ BoxGeometry::BoxGeometry(const BoxGeometry& other)
, m_hasValidVerticalMargin(other.m_hasValidVerticalMargin)
, m_hasValidBorder(other.m_hasValidBorder)
, m_hasValidPadding(other.m_hasValidPadding)
, m_hasValidContentHeight(other.m_hasValidContentHeight)
, m_hasValidContentWidth(other.m_hasValidContentWidth)
, m_hasValidContentBoxHeight(other.m_hasValidContentBoxHeight)
, m_hasValidContentBoxWidth(other.m_hasValidContentBoxWidth)
, m_hasPrecomputedMarginBefore(other.m_hasPrecomputedMarginBefore)
#endif
{
Expand Down
39 changes: 23 additions & 16 deletions Source/WebCore/layout/layouttree/LayoutBoxGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class BoxGeometry {

void setContentBoxHeight(LayoutUnit);
void setContentBoxWidth(LayoutUnit);
void setContentBoxSize(const LayoutSize&);

void setHorizontalMargin(HorizontalMargin);
void setVerticalMargin(VerticalMargin);
Expand Down Expand Up @@ -164,13 +165,13 @@ class BoxGeometry {
void setHasValidBorder() { m_hasValidBorder = true; }
void setHasValidPadding() { m_hasValidPadding = true; }

void setHasValidContentHeight() { m_hasValidContentHeight = true; }
void setHasValidContentWidth() { m_hasValidContentWidth = true; }
void setHasValidContentBoxHeight() { m_hasValidContentBoxHeight = true; }
void setHasValidContentBoxWidth() { m_hasValidContentBoxWidth = true; }
#endif // ASSERT_ENABLED

LayoutPoint m_topLeft;
LayoutUnit m_contentWidth;
LayoutUnit m_contentHeight;
LayoutUnit m_contentBoxWidth;
LayoutUnit m_contentBoxHeight;

HorizontalMargin m_horizontalMargin;
VerticalMargin m_verticalMargin;
Expand All @@ -188,8 +189,8 @@ class BoxGeometry {
bool m_hasValidVerticalMargin { false };
bool m_hasValidBorder { false };
bool m_hasValidPadding { false };
bool m_hasValidContentHeight { false };
bool m_hasValidContentWidth { false };
bool m_hasValidContentBoxHeight { false };
bool m_hasValidContentBoxWidth { false };
bool m_hasPrecomputedMarginBefore { false };
#endif // ASSERT_ENABLED
};
Expand Down Expand Up @@ -249,29 +250,35 @@ inline void BoxGeometry::setLogicalLeft(LayoutUnit left)
inline void BoxGeometry::setContentBoxHeight(LayoutUnit height)
{
#if ASSERT_ENABLED
setHasValidContentHeight();
setHasValidContentBoxHeight();
#endif
m_contentHeight = height;
m_contentBoxHeight = height;
}

inline void BoxGeometry::setContentBoxWidth(LayoutUnit width)
{
#if ASSERT_ENABLED
setHasValidContentWidth();
setHasValidContentBoxWidth();
#endif
m_contentWidth = width;
m_contentBoxWidth = width;
}

inline void BoxGeometry::setContentBoxSize(const LayoutSize& size)
{
setContentBoxWidth(size.width());
setContentBoxHeight(size.height());
}

inline LayoutUnit BoxGeometry::contentBoxHeight() const
{
ASSERT(m_hasValidContentHeight);
return m_contentHeight;
ASSERT(m_hasValidContentBoxHeight);
return m_contentBoxHeight;
}

inline LayoutUnit BoxGeometry::contentBoxWidth() const
{
ASSERT(m_hasValidContentWidth);
return m_contentWidth;
ASSERT(m_hasValidContentBoxWidth);
return m_contentBoxWidth;
}

inline void BoxGeometry::setHorizontalMargin(HorizontalMargin margin)
Expand Down Expand Up @@ -443,8 +450,8 @@ inline BoxGeometry BoxGeometry::geometryForWritingModeAndDirection(bool isHorizo
}

// Vertical flip.
visualGeometry.m_contentWidth = m_contentHeight;
visualGeometry.m_contentHeight = m_contentWidth;
visualGeometry.m_contentBoxWidth = m_contentBoxHeight;
visualGeometry.m_contentBoxHeight = m_contentBoxWidth;

visualGeometry.m_horizontalMargin = { m_verticalMargin.after, m_verticalMargin.before };
visualGeometry.m_verticalMargin = { m_horizontalMargin.start, m_horizontalMargin.end };
Expand Down

0 comments on commit f379bd5

Please sign in to comment.