Skip to content

Commit

Permalink
Unreviewed, reverting 274683@main, 274686@main and 274787@main.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=269594

SP3 overall 0.5% regression

Reverted changesets:

"Move `position` from `NonInheritedFlags` to `StyleBoxData`"
https://bugs.webkit.org/show_bug.cgi?id=269410
https://commits.webkit.org/274683@main

"Fix build after 274683@main"
https://bugs.webkit.org/show_bug.cgi?id=269410
https://commits.webkit.org/274686@main

"Followup (274683@main): Ensure `position` is no longer in `NonInheritedFlags`"
https://bugs.webkit.org/show_bug.cgi?id=269526
https://commits.webkit.org/274787@main

Canonical link: https://commits.webkit.org/274857@main
  • Loading branch information
webkit-commit-queue authored and nt1m committed Feb 16, 2024
1 parent 57f26e7 commit 85f9f9a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
14 changes: 7 additions & 7 deletions Source/WebCore/rendering/style/RenderStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ RenderStyle::RenderStyle(CreateDefaultStyleTag)
m_nonInheritedFlags.overflowX = static_cast<unsigned>(initialOverflowX());
m_nonInheritedFlags.overflowY = static_cast<unsigned>(initialOverflowY());
m_nonInheritedFlags.clear = static_cast<unsigned>(initialClear());
m_nonInheritedFlags.position = static_cast<unsigned>(initialPosition());
m_nonInheritedFlags.unicodeBidi = static_cast<unsigned>(initialUnicodeBidi());
m_nonInheritedFlags.floating = static_cast<unsigned>(initialFloating());
m_nonInheritedFlags.tableLayout = static_cast<unsigned>(initialTableLayout());
Expand Down Expand Up @@ -393,6 +394,7 @@ inline void RenderStyle::NonInheritedFlags::copyNonInheritedFrom(const NonInheri
overflowX = other.overflowX;
overflowY = other.overflowY;
clear = other.clear;
position = other.position;
unicodeBidi = other.unicodeBidi;
floating = other.floating;
tableLayout = other.tableLayout;
Expand Down Expand Up @@ -560,7 +562,7 @@ unsigned RenderStyle::hashForTextAutosizing() const
hash ^= WTF::FloatHash<float>::hash(m_inheritedData->verticalBorderSpacing);
hash ^= m_inheritedFlags.boxDirection;
hash ^= m_inheritedFlags.rtlOrdering;
hash ^= m_nonInheritedData->boxData->m_position;
hash ^= m_nonInheritedFlags.position;
hash ^= m_nonInheritedFlags.floating;
hash ^= m_nonInheritedData->miscData->textOverflow;
hash ^= m_rareInheritedData->textSecurity;
Expand All @@ -582,7 +584,7 @@ bool RenderStyle::equalForTextAutosizing(const RenderStyle& other) const
&& m_inheritedData->verticalBorderSpacing == other.m_inheritedData->verticalBorderSpacing
&& m_inheritedFlags.boxDirection == other.m_inheritedFlags.boxDirection
&& m_inheritedFlags.rtlOrdering == other.m_inheritedFlags.rtlOrdering
&& m_nonInheritedData->boxData->position() == other.m_nonInheritedData->boxData->position()
&& m_nonInheritedFlags.position == other.m_nonInheritedFlags.position
&& m_nonInheritedFlags.floating == other.m_nonInheritedFlags.floating
&& m_nonInheritedData->miscData->textOverflow == other.m_nonInheritedData->miscData->textOverflow;
}
Expand Down Expand Up @@ -949,9 +951,6 @@ bool RenderStyle::changeRequiresLayout(const RenderStyle& other, OptionSet<Style
|| m_nonInheritedData->boxData->maxHeight() != other.m_nonInheritedData->boxData->maxHeight())
return true;

if (m_nonInheritedData->boxData->position() != other.m_nonInheritedData->boxData->position())
return true;

if (m_nonInheritedData->boxData->verticalAlign() != other.m_nonInheritedData->boxData->verticalAlign()
|| m_nonInheritedData->boxData->verticalAlignLength() != other.m_nonInheritedData->boxData->verticalAlignLength())
return true;
Expand Down Expand Up @@ -1024,6 +1023,7 @@ bool RenderStyle::changeRequiresLayout(const RenderStyle& other, OptionSet<Style

if (m_inheritedFlags.boxDirection != other.m_inheritedFlags.boxDirection
|| m_inheritedFlags.rtlOrdering != other.m_inheritedFlags.rtlOrdering
|| m_nonInheritedFlags.position != other.m_nonInheritedFlags.position
|| m_nonInheritedFlags.floating != other.m_nonInheritedFlags.floating
|| m_nonInheritedFlags.originalDisplay != other.m_nonInheritedFlags.originalDisplay)
return true;
Expand Down Expand Up @@ -1543,6 +1543,8 @@ void RenderStyle::conservativelyCollectChangedAnimatableProperties(const RenderS
changingProperties.m_properties.set(CSSPropertyOverflowY);
if (first.clear != second.clear)
changingProperties.m_properties.set(CSSPropertyClear);
if (first.position != second.position)
changingProperties.m_properties.set(CSSPropertyPosition);
if (first.floating != second.floating)
changingProperties.m_properties.set(CSSPropertyFloat);
if (first.tableLayout != second.tableLayout)
Expand Down Expand Up @@ -1602,8 +1604,6 @@ void RenderStyle::conservativelyCollectChangedAnimatableProperties(const RenderS
changingProperties.m_properties.set(CSSPropertyBoxSizing);
if (first.boxDecorationBreak() != second.boxDecorationBreak())
changingProperties.m_properties.set(CSSPropertyWebkitBoxDecorationBreak);
if (first.position() != second.position())
changingProperties.m_properties.set(CSSPropertyPosition);
// Non animated styles are followings.
// usedZIndex
// hasAutoUsedZIndex
Expand Down
5 changes: 3 additions & 2 deletions Source/WebCore/rendering/style/RenderStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class RenderStyle {
inline bool hasStaticInlinePosition(bool horizontal) const;
inline bool hasStaticBlockPosition(bool horizontal) const;

PositionType position() const;
PositionType position() const { return static_cast<PositionType>(m_nonInheritedFlags.position); }
inline bool hasOutOfFlowPosition() const;
inline bool hasInFlowPosition() const;
inline bool hasViewportConstrainedPosition() const;
Expand Down Expand Up @@ -1104,7 +1104,7 @@ class RenderStyle {
m_nonInheritedFlags.effectiveDisplay = m_nonInheritedFlags.originalDisplay;
}
void setEffectiveDisplay(DisplayType v) { m_nonInheritedFlags.effectiveDisplay = static_cast<unsigned>(v); }
inline void setPosition(PositionType);
void setPosition(PositionType v) { m_nonInheritedFlags.position = static_cast<unsigned>(v); }
void setFloating(Float v) { m_nonInheritedFlags.floating = static_cast<unsigned>(v); }

inline void setLeft(Length&&);
Expand Down Expand Up @@ -2193,6 +2193,7 @@ class RenderStyle {
unsigned overflowX : 3; // Overflow
unsigned overflowY : 3; // Overflow
unsigned clear : 3; // Clear
unsigned position : 3; // PositionType
unsigned unicodeBidi : 3; // UnicodeBidi
unsigned floating : 3; // Float
unsigned tableLayout : 1; // TableLayoutType
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/rendering/style/RenderStyleInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ inline float RenderStyle::perspective() const { return m_nonInheritedData->rareD
inline LengthPoint RenderStyle::perspectiveOrigin() const { return m_nonInheritedData->rareData->perspectiveOrigin(); }
inline const Length& RenderStyle::perspectiveOriginX() const { return m_nonInheritedData->rareData->perspectiveOriginX; }
inline const Length& RenderStyle::perspectiveOriginY() const { return m_nonInheritedData->rareData->perspectiveOriginY; }
inline PositionType RenderStyle::position() const { return m_nonInheritedData->boxData->position(); }
inline bool RenderStyle::preserveNewline() const { return preserveNewline(whiteSpace()); }
inline bool RenderStyle::preserves3D() const { return usedTransformStyle3D() == TransformStyle3D::Preserve3D; }
inline QuotesData* RenderStyle::quotes() const { return m_rareInheritedData->quotes.get(); }
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/rendering/style/RenderStyleSetters.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ inline void RenderStyle::setPaintOrder(PaintOrder order) { SET(m_rareInheritedDa
inline void RenderStyle::setPerspective(float perspective) { SET_NESTED(m_nonInheritedData, rareData, perspective, perspective); }
inline void RenderStyle::setPerspectiveOriginX(Length&& length) { SET_NESTED(m_nonInheritedData, rareData, perspectiveOriginX, WTFMove(length)); }
inline void RenderStyle::setPerspectiveOriginY(Length&& length) { SET_NESTED(m_nonInheritedData, rareData, perspectiveOriginY, WTFMove(length)); }
inline void RenderStyle::setPosition(PositionType position) { SET_NESTED(m_nonInheritedData, boxData, m_position, static_cast<unsigned>(position)); }
inline void RenderStyle::setResize(Resize r) { SET_NESTED(m_nonInheritedData, miscData, resize, static_cast<unsigned>(r)); }
inline void RenderStyle::setRight(Length&& length) { SET_NESTED(m_nonInheritedData, surroundData, offset.right(), WTFMove(length)); }
inline void RenderStyle::setRowGap(GapLength&& gapLength) { SET_NESTED(m_nonInheritedData, rareData, rowGap, WTFMove(gapLength)); }
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/rendering/style/StyleBoxData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ StyleBoxData::StyleBoxData()
, m_hasAutoUsedZIndex(true)
, m_boxSizing(static_cast<unsigned>(BoxSizing::ContentBox))
, m_boxDecorationBreak(static_cast<unsigned>(BoxDecorationBreak::Slice))
, m_position(static_cast<unsigned>(RenderStyle::initialPosition()))
, m_verticalAlign(static_cast<unsigned>(RenderStyle::initialVerticalAlign()))
{
}
Expand All @@ -68,7 +67,6 @@ inline StyleBoxData::StyleBoxData(const StyleBoxData& o)
, m_hasAutoUsedZIndex(o.m_hasAutoUsedZIndex)
, m_boxSizing(o.m_boxSizing)
, m_boxDecorationBreak(o.m_boxDecorationBreak)
, m_position(o.m_position)
, m_verticalAlign(o.m_verticalAlign)
{
}
Expand All @@ -93,7 +91,6 @@ bool StyleBoxData::operator==(const StyleBoxData& o) const
&& m_hasAutoUsedZIndex == o.m_hasAutoUsedZIndex
&& m_boxSizing == o.m_boxSizing
&& m_boxDecorationBreak == o.m_boxDecorationBreak
&& m_position == o.m_position
&& m_verticalAlign == o.m_verticalAlign;
}

Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/rendering/style/StyleBoxData.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class StyleBoxData : public RefCounted<StyleBoxData> {

BoxSizing boxSizing() const { return static_cast<BoxSizing>(m_boxSizing); }
BoxDecorationBreak boxDecorationBreak() const { return static_cast<BoxDecorationBreak>(m_boxDecorationBreak); }
PositionType position() const { return static_cast<PositionType>(m_position); }
VerticalAlign verticalAlign() const { return static_cast<VerticalAlign>(m_verticalAlign); }

private:
Expand All @@ -85,7 +84,6 @@ class StyleBoxData : public RefCounted<StyleBoxData> {
unsigned m_hasAutoUsedZIndex : 1;
unsigned m_boxSizing : 1; // BoxSizing
unsigned m_boxDecorationBreak : 1; // BoxDecorationBreak
unsigned m_position : 3; // PositionType
unsigned m_verticalAlign : 4; // VerticalAlign
};

Expand Down

0 comments on commit 85f9f9a

Please sign in to comment.