Bug 53148 - Location of <style> block affects generation of anonymous table boxes
Summary: Location of <style> block affects generation of anonymous table boxes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL: data:text/html,<!doctype html><style>...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-25 17:19 PST by Tab Atkins
Modified: 2023-12-15 14:28 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?