Bug 259620

Summary: 'hr' with width as 0 or 0px get 1px leading to WPT failure
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, karlcow, ntim, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar, WPTImpact
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-07-28 18:24:07 PDT
Hi Team,

While trying to investigate our WPT failures in HTML/Rendering for 'dimension-attributes.html', I came across following:

Test Case: http://wpt.live/html/rendering/dimension-attributes.html

For following two cases:

1) <hr width="0"> mapping to <hr> width property	
2) <hr width="0px"> mapping to <hr> width property	

We get 1px due to following:

https://github.com/WebKit/WebKit/blob/088b5a6b92a887bbf29d18135987d5c2c6392d20/Source/WebCore/html/HTMLHRElement.cpp#L89

Where we are forcing 1px:

addPropertyToPresentationalHintStyle(style, CSSPropertyWidth, 1, CSSUnitType::CSS_PX);

Changing it to '0' leads to two progressions.

Only Firefox passes these tests and Chrome Canary 117 also fail them.

______

I just wanted to raise and get input whether it is good to go so I can do PR or there are other consequences of this change.

Thanks!
Comment 1 Tim Nguyen (:ntim) 2023-07-28 23:08:05 PDT
> Changing it to '0' leads to two progressions.

Seems fine, visually it doesn't seem to make a huge difference.
Comment 2 EWS 2023-07-29 16:04:29 PDT
Committed 266418@main (57717fd0d5ab): <https://commits.webkit.org/266418@main>

Reviewed commits have been landed. Closing PR #16216 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-07-29 16:05:17 PDT
<rdar://problem/113087533>