Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3600cce060cb8295efbe80ba546ecfcbaaaed623
      
https://github.com/WebKit/WebKit/commit/3600cce060cb8295efbe80ba546ecfcbaaaed623
  Author: Aditya Keerthi <[email protected]>
  Date:   2023-01-12 (Thu, 12 Jan 2023)

  Changed paths:
    A LayoutTests/fast/forms/meter-appearance-on-pseudo-element-expected.txt
    A LayoutTests/fast/forms/meter-appearance-on-pseudo-element.html
    M Source/WebCore/rendering/RenderTheme.cpp

  Log Message:
  -----------
  Crash when using `appearance: meter` with a pseudo-element not backed by 
`PseudoElement`
https://bugs.webkit.org/show_bug.cgi?id=250488
rdar://104118606

Reviewed by Tim Nguyen.

257981@main introduced a crash due to an unconditional downcast to 
`RenderMeter`.
The idea behind the unconditional downcast is that `appearance: meter` should
behave like `appearance: auto`, and only apply to `<meter>`.

However, this behavior is currently broken for pseudo-elements not backed by
`PseudoElement`. In this case, the `element` passed into `StyleAdjuster` is
`null`, resulting in an early return from 
`RenderTheme::adjustAppearanceForElement`,
where the effective appearance is not adjusted.

In this scenario, `appearance: auto` should behave like `appearance: none`. Fix
by ensuring the effective appearance of these pseudo-elements is `none`.

* LayoutTests/fast/forms/meter-appearance-on-pseudo-element-expected.txt: Added.
* LayoutTests/fast/forms/meter-appearance-on-pseudo-element.html: Added.
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustAppearanceForElement const):

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to