Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5a74e184fd2204750d9870b60555fb2f7fb987c8
      
https://github.com/WebKit/WebKit/commit/5a74e184fd2204750d9870b60555fb2f7fb987c8
  Author: David Kilzer <[email protected]>
  Date:   2025-08-14 (Thu, 14 Aug 2025)

  Changed paths:
    M Source/WebCore/css/SelectorChecker.cpp
    M Source/WebCore/rendering/style/FillLayer.h
    M Source/WebCore/rendering/style/RenderStyleConstants.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/rendering/style/RenderStyleSetters.h

  Log Message:
  -----------
  Fix -Wpreferred-type-bitfield-enum-conversion warnings in WebCore
<https://bugs.webkit.org/show_bug.cgi?id=297439>
<rdar://158245532>

Reviewed by Brent Fulgham.

Warnings found by -Wpreferred-type-bitfield-enum-conversion indicate
that a bitfield used to store an enum type are too small to hold one or
more values defined in the enum.

* Source/WebCore/css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match const):
- Switch to use new definition of PublicPseudoIdMask.
* Source/WebCore/rendering/style/FillLayer.h:
(WebCore::FillLayer::FillBoxBitWidth): Add.
(WebCore::FillLayer::m_clip):
(WebCore::FillLayer::m_origin):
(WebCore::FillLayer::m_clipMax):
- Define FillBoxBitWidth constant for bitwidth of FillBox enum, then
  use it when definining bitfileds of type FillBox.  This fixes the
  warning and a real bug where m_origin and m_clipMax could not hold all
  values of FillBox.
* Source/WebCore/rendering/style/RenderStyleConstants.h:
(WebCore::PseudoId::PublicPseudoIdMask): Remove.
(WebCore::PublicPseudoIdMask): Add.
- Define PublicPseudoIdMask outside enum class PseudoId since it's too
  large to be held by the RenderStyle::pseudoElementType bitfield.  This
  was not a bug in practice, but fixes the warning by moving the mask
  value outside of the enum itself.
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
- Switch to use new definition of PublicPseudoIdMask.
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles):
- Switch to use new definition of PublicPseudoIdMask.

Canonical link: https://commits.webkit.org/298737@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to