Bug 247742

Summary: Fix broken preferred widths optimization involving subtree layout roots
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2022-11-10 09:42:40 PST
Hi Team,

While going through Blink commits, I came across following commit:

Link - https://chromium.googlesource.com/chromium/blink/+/ed902d339fbff3a62e2f6124d8d40bbad45e97c0

Which removed a hacky optimization added in 2006.

We still have this optimization here:

https://github.com/WebKit/WebKit/blob/fa2a14f12031baf24d5bc6d6727c3e25c5052589/Source/WebCore/rendering/RenderBox.cpp#LL2610

The testcase attached render same as Chrome Canary 109 as in Safari Technology Preview 157 and Safari 16.1:

Test Case - https://jsfiddle.net/m4hja1pv/show

But I think it would be better tested in EWS. I will tag @Alexey (ap), who landed this in 2006. Just to get his input.

Thanks!
Comment 1 EWS 2022-11-13 16:58:00 PST
Committed 256623@main (06fa3e82eb2e): <https://commits.webkit.org/256623@main>

Reviewed commits have been landed. Closing PR #6433 and removing active labels.
Comment 2 Radar WebKit Bug Importer 2022-11-13 16:59:18 PST
<rdar://problem/102298308>