Bug 53148

Summary: Location of <style> block affects generation of anonymous table boxes
Product: WebKit Reporter: Tab Atkins <tabatkins>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, hyatt, karlcow, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
URL: data:text/html,<!doctype html><style>#a > span { display: table-cell; }</style><div id=a><span>a</span><span>b</span></div><div id=b><span>a</span><span>b</span></div><style>#b > span { display: table-cell; }</style>

Description Tab Atkins 2011-01-25 17:19:28 PST
Testcase:
<!doctype html>
<style>
#a > span { display: table-cell; }
</style>
<div id=a>
  <span>a</span>
  <span>b</span>
</div>
<div id=b>
  <span>a</span>
  <span>b</span>
</div>
<style>
#b > span { display: table-cell; }
</style>

The contents of #a and #b should be identical, as they have identical structure and identical CSS applied to them - the two spans should be wrapped in an anonymous table box.  

Instead, #b generates *two* anonymous table boxes, one for each span.  This is an error.
Comment 1 Ahmad Saleem 2023-12-15 14:28:02 PST
(In reply to Tab Atkins from comment #0)
> Testcase:
> <!doctype html>
> <style>
> #a > span { display: table-cell; }
> </style>
> <div id=a>
>   <span>a</span>
>   <span>b</span>
> </div>
> <div id=b>
>   <span>a</span>
>   <span>b</span>
> </div>
> <style>
> #b > span { display: table-cell; }
> </style>
> 
> The contents of #a and #b should be identical, as they have identical
> structure and identical CSS applied to them - the two spans should be
> wrapped in an anonymous table box.  
> 
> Instead, #b generates *two* anonymous table boxes, one for each span.  This
> is an error.

In JSFiddle: https://jsfiddle.net/zr8thm5u/show (based of Comment 0), it seems to be same across Safari 17.2, Firefox Nightly 122 and Chrome Canary 122.

Do we need anything more?