Bug 264676

Summary: Add remaining 'legend' UA stylesheet rules from HTML Web Specification
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar, WPTImpact
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-11-11 08:02:22 PST
Hi Team,

While looking into default UA stylesheet of 'ladybird' browser, I noticed that they are following all UA stylesheet rules and noticed, we have added following:

____

legend[align=left i] {
  justify-self: left;
}

legend[align=center i] {
  justify-self: center;
}

legend[align=right i] {
  justify-self: right;
}

____

Web-Spec: https://html.spec.whatwg.org/#the-fieldset-and-legend-elements

In my local testing, adding them leads to progress following test case: http://wpt.live/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-align-justify-self.html

I think we should go for it and get all those WPT wins unless if there is genuine reason that we don't want to do them.

Thanks!
Comment 1 Ahmad Saleem 2023-11-11 15:34:20 PST
Please refer to PR attempt, which is not correct way to approach this bug as highlighted by Tim.

https://github.com/WebKit/WebKit/pull/20370

Just to note for future purposes:

"It's complicated. You'd need to implement support for justify-self for children of blocks and remove the old code that maps align to text-align, and then sync the UA styles as you did here."
Comment 2 Radar WebKit Bug Importer 2023-11-18 08:03:14 PST
<rdar://problem/118602283>