Issue #1705 - Part 4: Add scrollbar-width CSS keyword to CSS parser.

This should be all parts needed to add a brand new enum keyword including
getting the computed style from it...
This commit is contained in:
Moonchild 2021-01-06 23:57:26 +00:00 committed by roytam1
commit 8e08d8bfd3
14 changed files with 72 additions and 0 deletions

View file

@ -4024,6 +4024,7 @@ nsStyleUserInterface::nsStyleUserInterface(StyleStructContext aContext)
, mPointerEvents(NS_STYLE_POINTER_EVENTS_AUTO)
, mCursor(NS_STYLE_CURSOR_AUTO)
, mCaretColor(StyleComplexColor::Auto())
, mScrollbarWidth(StyleScrollbarWidth::Auto)
{
MOZ_COUNT_CTOR(nsStyleUserInterface);
}
@ -4036,6 +4037,7 @@ nsStyleUserInterface::nsStyleUserInterface(const nsStyleUserInterface& aSource)
, mCursor(aSource.mCursor)
, mCursorImages(aSource.mCursorImages)
, mCaretColor(aSource.mCaretColor)
, mScrollbarWidth(aSource.mScrollbarWidth)
{
MOZ_COUNT_CTOR(nsStyleUserInterface);
}
@ -4087,6 +4089,13 @@ nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aNewData) const
if (mCaretColor != aNewData.mCaretColor) {
hint |= nsChangeHint_RepaintFrame;
}
if (mScrollbarWidth != aNewData.mScrollbarWidth) {
// For scrollbar-width change, we need some special handling similar
// to overflow properties. Specifically, we may need to reconstruct
// the scrollbar or force reflow of the viewport scrollbar.
hint |= nsChangeHint_ScrollbarChange;
}
return hint;
}