- From: Garrett Smith <dhtmlkitchen@gmail.com>
- Date: Tue, 20 Jul 2010 00:09:13 -0700
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: www-style <www-style@w3.org>
On 7/19/10, Boris Zbarsky <bzbarsky@mit.edu> wrote: > On 7/19/10 10:07 PM, Garrett Smith wrote: >> On 7/19/10, Boris Zbarsky<bzbarsky@mit.edu> wrote: >>> On 7/19/10 8:12 PM, Garrett Smith wrote: >>>> On 7/19/10, Boris Zbarsky<bzbarsky@mit.edu> wrote: >>>>> On 7/19/10 3:39 PM, Garrett Smith wrote: >>>>>> On 7/19/10, Boris Zbarsky<bzbarsky@mit.edu> wrote: >>>>>>> On 7/19/10 2:50 PM, Garrett Smith wrote: >>>>>>>> So the problem is where the property is a getter and that getter has >>>>>>>> side effects and the side effects include modifying the DOM. >>>>>>> >>>>>> >>>>>> [...] >>>>>> >>>>>>> In Gecko, sure. For example offsetWidth. >>>>>>> >>>>>> >>>>>> What is the side effect in the DOM from getting offsetWidth? >>>>> >>>>> In Gecko, due to the existence of XBL, arbitrary script can run under >>>>> the getter (since getting offsetWidth requires flushing out pending >>>>> style and layout changes and flushing out pending style changes can >>>>> attach XBL bindings and run their constructors). >>>>> >>>> >>>> Wouldn't pending layout changes need to be flushed prior to the query? >>> >>> I'm not sure I follow the question.... What query? >> >> Any NodeSelector.query. > > No. Why would those need anything flushed? > I see. If you don't use properties, flushing is irrelevant. If you wanted to have: div:property(offsetWidth=100), then it would need to be flushed. Moreover, that wouldn't make much sense to continually flush rules as parsing a stylesheet. > Note that the NodeSelector case is NOT the common case for selector > matching, by the way. The common case is style sheets. > Well obviously. Virtually any site uses at least some CSS but don't use scripts. There are even some old "dhtml" luddites who don't even use query selector API! (can you believe it?!) Query selector matching is a little different situation. Garrett
Received on Tuesday, 20 July 2010 07:09:42 UTC