title: Can CSS3 access the browsing context name?
body: <p>I have an HTML file that wants to be viewed standalone, so it needs an h1.
  But I want to embed it in another page too, where it does not need an h1, using object.</p>
  
  <p>What I've come up with is</p>
  
  <pre><code>&lt;head&gt;
  &lt;style&gt;
  #foo h1 {display: none;}
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;
  document.body.id = window.name;
  &lt;/script&gt;
  &lt;h1&gt;title&lt;/h1&gt;
  Content.
  &lt;/body&gt;
  </code></pre>
  
  <p>The style has no effect when the document is loaded by itself, because the window.name is null. But, in the including file, I use:</p>
  
  <pre><code>&lt;object data="that-file-up-there.html" name="foo"&gt;
  </code></pre>
  
  <p>which gives the nested browsing context the name foo, and then the javascript copies it as the id of the nested document , thus causing the style to trigger, and suppress the h1. This works, but am I overlooking a way to not need the javascript?</p>