W3C home > Mailing lists > Public > public-html@w3.org > February 2009

Foster-parenting and taint

From: Henri Sivonen <hsivonen@iki.fi>
Date: Wed, 25 Feb 2009 15:28:17 +0200
Message-Id: <E0F199D0-03D8-48C2-8B1B-8465FC0E1BA1@iki.fi>
To: HTMLWG WG <public-html@w3.org>

 From black-box behavior, it seems that Gecko manages table taint and  
foster-parents space characters, comments and <style> based on taint.  
<script> and <input type=hidden> are not foster-parented, regardless  
of taint. Also, text nodes in the DOM that resulted from discontiguous  
runs of character tokens are not joined.

 From black-box behavior, it seems that WebKit accumulates a run of  
text into a buffer, flushes the buffer late, makes the decision to  
foster parent on a per flush basis and doesn't join text nodes in the  
DOM that resulted from discontiguous runs of character tokens.  
<script> is not foster-parented, and <style> is hoisted to <head>.  
<input type=hidden> is always foster-parented.

Opera and IE prior to IE8 mode don't foster parent in the DOM. The  
visual effect is similar to foster parenting, but content that was  
before the <table> tag in source and content that was after are  
rendered on different lines unlike in Gecko and WebKit.

IE8 mode doesn't even try to achieve the visual effect of foster  

Per spec, there is taint and space characters, <script>, <style> and  
<input type=hidden> are taint-sensitive but comments are not.

Why are <script> and <input type=hidden> taint-sensitive in the spec  
when they aren't taint-sensitive in Gecko and script is not foster  
parented by WebKit, either?
Could we get away with foster-parenting <style> unconditionally?
For space characters, is there a reason to prefer Gecko-style taint  
over WebKit-style late flushing and per-flush inspection of the buffer  
for non-space characters?

Concretely, would the following work:
  1) Characters are buffered and are flushed immediately ahead of the  
next non-character insertion to the DOM.
  2) If the run of characters being flushed doesn't consist entirely  
of space characters, the run is foster parented.
  3) Comments, <script> and <input type=hidden> are not foster parented.
  4) Other elements, including <style>, are foster parented.
Henri Sivonen
Received on Wednesday, 25 February 2009 13:28:59 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:42 UTC