[webkit-changes] [WebKit/WebKit] 5a9541: [Hardening] Introduce checkedDowncast<>() and use ...

Chris Dumez noreply at github.com
Wed Dec 20 19:01:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5a95413f257fbfa5472e2fd2702ba16e65964c56
      https://github.com/WebKit/WebKit/commit/5a95413f257fbfa5472e2fd2702ba16e65964c56
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M Source/WebCore/html/shadow/DateTimeEditElement.cpp
    M Source/WebCore/html/shadow/DateTimeFieldElement.cpp
    M Source/WebCore/html/shadow/DetailsMarkerControl.cpp
    M Source/WebCore/html/shadow/ProgressShadowElement.cpp
    M Source/WebCore/html/shadow/SliderThumbElement.cpp
    M Source/WebCore/html/shadow/TextControlInnerElements.cpp

  Log Message:
  -----------
  [Hardening] Introduce checkedDowncast<>() and use it in a few places where the type is not obvious
https://bugs.webkit.org/show_bug.cgi?id=263463
rdar://117247122

Reviewed by Darin Adler and Ryosuke Niwa.

Introduce checkedDowncast<>() and use it in a few places where the type is not
obvious (no earlier is<>() check).

checkedDowncast<>() is just like downcast<>() but its internal type check is a
RELEASE_ASSERT() instead of a debug ASSERT().

In the future, we may want to promote using either dynamicDowncast<>() or
checkedDowncast<>() and maybe phasing out downcast<>() (in which case we could
rename checkedDowncast<>() to downcast()).

* Source/WTF/wtf/Ref.h:
(WTF::checkedDowncast):
* Source/WTF/wtf/RefPtr.h:
(WTF::checkedDowncast):
* Source/WTF/wtf/TypeCasts.h:
(WTF::checkedDowncast):
* Source/WebCore/html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::fieldsWrapperElement const):
* Source/WebCore/html/shadow/DateTimeFieldElement.cpp:
(WebCore::DateTimeFieldElement::updateVisibleValue):
* Source/WebCore/html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::rendererIsNeeded):
* Source/WebCore/html/shadow/ProgressShadowElement.cpp:
(WebCore::ProgressShadowElement::progressElement const):
* Source/WebCore/html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight const):
(WebCore::RenderSliderContainer::layout):
(WebCore::SliderThumbElement::hostInput const):
* Source/WebCore/html/shadow/TextControlInnerElements.cpp:
(WebCore::isStrongPasswordTextField):
(WebCore::TextControlInnerTextElement::renderer const):
(WebCore::TextControlInnerTextElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::resolveCustomStyle):
(WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEventsWithEditability const):

Originally-landed-as: 267815.359 at safari-7617-branch (1f4ca4f6b608). rdar://119596829
Canonical link: https://commits.webkit.org/272397@main




More information about the webkit-changes mailing list