Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aec66ac86be417c10adc57e7959a6fe558b11eae
      
https://github.com/WebKit/WebKit/commit/aec66ac86be417c10adc57e7959a6fe558b11eae
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    A 
LayoutTests/fast/css/revert-layer-link-match-native-appearance-expected.html
    A LayoutTests/fast/css/revert-layer-link-match-native-appearance.html
    M Source/WebCore/style/StyleBuilder.cpp

  Log Message:
  -----------
  [CSS] revert/revert-layer rollback uses the property's scalar origin instead 
of the per-link-match origin, wrongly disabling native appearance
https://bugs.webkit.org/show_bug.cgi?id=325386
rdar://188494505

Reviewed by Antti Koivisto.

Builder::applyRollbackCascadeProperty() applies the reverted value for a
specific link-match state (cssValue[linkMatchMask]) but passed the property's
scalar `origin` as the cascade origin, rather than the matching
`origins[linkMatchMask]`.

A single PropertyCascade::Property accumulates values across matched
declarations, so its scalar `origin` reflects whichever declaration was set
last regardless of link-match state, while `origins[]` tracks the origin per
state. When a property gets values from different origins across different
link-match states (e.g. a User-origin declaration for MatchDefault and an
Author-origin :visited declaration that later overwrites the scalar origin),
the two diverge.

The cascade origin passed here is consumed by
BuilderState::disableNativeAppearanceIfNeeded(), which only acts for
Origin::Author. As a result, a reverted value that actually came from the
User (or UA) origin could be treated as Author and incorrectly disable a
form control's native appearance (or vice versa). This matches the normal
apply path in applyCascadeProperty(), which already uses
property.origins[linkMatch].

Test: fast/css/revert-layer-link-match-native-appearance.html

* LayoutTests/fast/css/revert-layer-link-match-native-appearance-expected.html: 
Added.
* LayoutTests/fast/css/revert-layer-link-match-native-appearance.html: Added.
* Source/WebCore/style/StyleBuilder.cpp:
(WebCore::Style::Builder::applyRollbackCascadeProperty):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to