mozilla

Revision 186559 of Content states and the style system

  • Revision slug: Content_states_and_the_style_system
  • Revision title: Content states and the style system
  • Revision id: 186559
  • Created:
  • Creator: Bzbarsky
  • Is current revision? No
  • Comment

Revision Content

--Bzbarsky 13:44, 13 May 2005 (PDT)

10:32:40] <beaufour> bz: hi. do you have a bit of time for bug 271720? {{mediawiki.external('10:34:03')}} <mcsmurf> heh... {{mediawiki.external('10:34:16')}} <mcsmurf> the IE window with a PDF doc in it has a Mozilla logo as window icon {{mediawiki.external('10:34:29')}} <timeless> favico? {{mediawiki.external('10:34:32')}} <bz> beaufour: yeah {{mediawiki.external('10:34:40')}} <mcsmurf> no window icon not favico  :) {{mediawiki.external('10:35:42')}} <beaufour> bz: ok. as you might can see it's not exactly my "area of expertise".... so I'm looking for some pointers on what to do exactly {{mediawiki.external('10:36:15')}} <mcsmurf> it seems the Acrobat reader changes that icon then... {{mediawiki.external('10:36:33')}} <bz> beaufour: I think the problem is that if we had such pointers it would be done by now..... {{mediawiki.external('10:36:33')}} <beaufour> bz: there's (at least) two issues. 1) dbaron wants to see it happen without increasing the size of existing objects, which I can only agree with, but how exactly and 2) the "event state manager" business {{mediawiki.external('10:36:47')}} <beaufour> bz: heh {{mediawiki.external('10:36:48')}} <bz> beaufour: I can explain the latter, like I said in the bug. {{mediawiki.external('10:37:23')}} trs80 {{mediawiki.external('trs80@203-59-159-146.dyn.iinet.net.au')}} has quit IRC: Ping timeout {{mediawiki.external('10:37:37')}} beaufour is all ears (eyes  :) ) {{mediawiki.external('10:37:54')}} <mvl> bsmedberg: the two other callers to the console service for errors also do printf {{mediawiki.external('10:38:19')}} <mvl> bsmedberg: i think it should be added to nsXPCComponents::ReportError() as well {{mediawiki.external('10:38:27')}} <beaufour> bz: ah, well, third issue: if we want it to be scriptable, where should the getter be exposed? {{mediawiki.external('10:38:29')}} dgrimm {{mediawiki.external('chatzilla@65.64.178.99')}} has quit IRC: Quit: Chatzilla 0.9.68a {{mediawiki.external('Firefox 1.0.4/20050511')}} {{mediawiki.external('10:38:44')}} <dria> who runs the end-user help project? (I'm not really sure what that is, but apparently there is one!) {{mediawiki.external('10:38:54')}} timeless thinks we should just land a js impl'd consolelistener and get rid of the callers {{mediawiki.external('10:39:01')}} <timeless> dria: heh {{mediawiki.external('10:39:03')}} yg_home {{mediawiki.external('yusufg@cm61-18-99-230.hkcable.com.hk')}} has quit IRC: Quit: Leaving {{mediawiki.external('10:39:12')}} <bz> beaufour: scriptability is a fun one that I'm really not sure about, frankly. {{mediawiki.external('10:39:14')}} timeless wonders what dria is talking about (just as dria wonders what it is) {{mediawiki.external('10:39:22')}} <timeless> neil owns the help code for suite {{mediawiki.external('10:39:25')}} <dria> shaver seemed to think you guys would know  :) {{mediawiki.external('10:39:28')}} <bz> Let's talk about the ESM thing {{mediawiki.external('10:39:32')}} <beaufour> bz: okie {{mediawiki.external('10:39:41')}} <bz> Could someone with an IRC client that does sane logging log this, please? {{mediawiki.external('10:39:46')}} <bz> and then email me the log? {{mediawiki.external('10:40:03')}} <db48x> sure {{mediawiki.external('10:40:09')}} <bz> I'll try to turn it into real docs {{mediawiki.external('10:40:12')}} <bsmedberg> mvl: IMO client code should not be printf()ing, it should be done with a console listener and be pref-offable {{mediawiki.external('10:40:32')}} <bz> OK. So the basic idea is that the style system tries to minimize the number of style reresolves it does. {{mediawiki.external('10:40:36')}} <mvl> bsmedberg: isn't #ifdef DEBUG enough of a pref?  :) {{mediawiki.external('10:40:42')}} <bz> Because those are somewhat expensive. {{mediawiki.external('10:40:47')}} <bsmedberg> dria: Steffen Wilberg owns the firefox help content, IIRC {{mediawiki.external('10:40:52')}} <timeless> mvl: no {{mediawiki.external('10:41:01')}} <timeless> because i should be able to turn it on or off in release builds {{mediawiki.external('10:41:03')}} <dria> ok {{mediawiki.external('10:41:05')}} <bz> So when something changes, the first thing it does is to check whether the something _could_ affect any styles. {{mediawiki.external('10:41:07')}} <timeless> and it shouldn't hurt code size {{mediawiki.external('10:41:20')}} <timeless> having the same stupid code in multiple places is well ... stupid  :) {{mediawiki.external('10:41:48')}} <bsmedberg> mvl: of course, IMO dump() should go to the JS console, not to stdout... {{mediawiki.external('10:41:57')}} boci^ {{mediawiki.external('boci@boci.dravanet.hu')}} has joined #developers {{mediawiki.external('10:42:00')}} <bsmedberg> so MO is not worth much {{mediawiki.external('10:42:05')}} <timeless> heh {{mediawiki.external('10:42:06')}} <bz> If the something is a content state, it walks the list of all selectors that have a "state-dependent" pseudo in them {{mediawiki.external('10:42:09')}} dmb {{mediawiki.external('chatzilla@204.8.196.2')}} has joined #developers {{mediawiki.external('10:42:15')}} timeless actually has a component to do this /somewhere/ {{mediawiki.external('10:42:21')}} <bz> (which it creates during sheet parsing) {{mediawiki.external('10:42:31')}} <bz> And for each selector checks whether it matches the node. {{mediawiki.external('10:42:42')}} <bz> If it does, then the style could depend on the state and we have to reresolve style. {{mediawiki.external('10:42:55')}} <bz> Now the hitch is what it means for the selector to match the node {{mediawiki.external('10:43:01')}} <bz> Say the selector is a:hover {{mediawiki.external('10:43:06')}} dmb {{mediawiki.external('chatzilla@204.8.196.2')}} is now known as IRCMonkey3840056 {{mediawiki.external('10:43:10')}} <bz> And the hover state on some node changes. {{mediawiki.external('10:43:18')}} <mvl> bsmedberg: that means that i have to hack it myself? {{mediawiki.external('10:43:23')}} <bz> What we need to check is whether the node matches the "a" part of the selector {{mediawiki.external('10:43:29')}} <mvl> which means #ifdef debug in the caller. {{mediawiki.external('10:43:40')}} <bz> So in other words, we want to treat all of the states that changed as matching automatically. {{mediawiki.external('10:43:44')}} <@shaver> or use debug(), in components {{mediawiki.external('10:43:54')}} <IRCMonkey3840056> arrr {{mediawiki.external('10:43:56')}} IRCMonkey3840056 {{mediawiki.external('chatzilla@204.8.196.2')}} has quit IRC: Quit: Chatzilla 0.9.68a {{mediawiki.external('Firefox 1.0/20050106')}} {{mediawiki.external('10:44:09')}} <bz> This means you have to know what states changed, of course. {{mediawiki.external('10:44:12')}} dmb_ {{mediawiki.external('chatzilla@204.8.196.2')}} has joined #developers {{mediawiki.external('10:44:13')}} dmb_ {{mediawiki.external('chatzilla@204.8.196.2')}} is now known as dmb {{mediawiki.external('10:44:35')}} <bz> And this is why the selector-matching code short-circuits to "true" for cases when the state being matched on is in the state mask {{mediawiki.external('10:44:46')}} gavin|away {{mediawiki.external('g@rn-wcs3c04.uwaterloo.ca')}} is now known as gavin {{mediawiki.external('10:44:57')}} <CTho> timeless: ah, so gcc takes -pthread or -lpthread, but ld only takes -lptherad {{mediawiki.external('10:45:10')}} timeless wonders what kind of file is needed to make {{mediawiki.external('10:45:21')}} <timeless> ctho: there are other ld's out there than the one you're using {{mediawiki.external('10:45:28')}} <beaufour> bz: ok, I think I'm following you most of the way {{mediawiki.external('10:45:29')}} <CTho> well, my ld {{mediawiki.external('10:45:39')}} <timeless> ... edit areas reasonably sized (>2px tall) {{mediawiki.external('10:45:47')}} <bz> Now the patch in bug 271720 sends UNSPECIFIED as the state mask, so a dynamic change will be treated as "nothing changed" by the style system {{mediawiki.external('10:45:55')}} <bz> beaufour: which part is unclear? {{mediawiki.external('10:46:28')}} <beaufour> bz: nothing in particular, it's only my own dubious understanding of the entire CSS thing  ;-) {{mediawiki.external('10:46:47')}} CTho {{mediawiki.external('Chris@CTHO.RES.cmu.edu')}} is now known as CTho|away {{mediawiki.external('10:47:12')}} <beaufour> bz: I had a seperate state defined for each class in an earlier patch {{mediawiki.external('10:49:04')}} <beaufour> bz: so having f.x. a NS_EVENT_STATE_PAIR_VALID and sending that as the state mask would be the correct thing todo? {{mediawiki.external('10:49:19')}} beaufour wonders why he trashed those in the first place {{mediawiki.external('10:50:03')}} <bz> beaufour: what would that mean? {{mediawiki.external('10:50:05')}} FUBAr {{mediawiki.external('fubar@212.16.199.122')}} has quit IRC: Quit: �?Ÿ�?¾�?º�?¸�?´�?°ÑŽ {{mediawiki.external('10:50:14')}} smaug {{mediawiki.external('smaug@cs181140114.pp.htv.fi')}} has joined #developers {{mediawiki.external('10:50:21')}} <bz> beaufour: Just not sure what NS_EVENT_STATE_PAIR_VALID would indicate... {{mediawiki.external('10:51:05')}} <beaufour> bz: it would mean that the valid state for the content changed, that it could now match either :valid or :invalid {{mediawiki.external('10:51:14')}} <beaufour> hi smaug {{mediawiki.external('10:51:24')}} <smaug> hi beaufour {{mediawiki.external('10:51:50')}} <bz> beaufour: ah, hm. Let me think about that for a sec. {{mediawiki.external('10:54:05')}} <bz> So that would work with style resolution.... {{mediawiki.external('10:54:11')}} <bz> db48x: want to send me that log?

Revision Source

<p>--<a href="User:Bzbarsky">Bzbarsky</a> 13:44, 13 May 2005 (PDT)
</p><p>10:32:40] &lt;beaufour&gt; bz: hi. do you have a bit of time for bug 271720?
{{mediawiki.external('10:34:03')}} &lt;mcsmurf&gt; heh...
{{mediawiki.external('10:34:16')}} &lt;mcsmurf&gt; the IE window with a PDF doc in it has a Mozilla logo as window icon
{{mediawiki.external('10:34:29')}} &lt;timeless&gt; favico?
{{mediawiki.external('10:34:32')}} &lt;bz&gt; beaufour: yeah
{{mediawiki.external('10:34:40')}} &lt;mcsmurf&gt; no window icon not favico  :) 
{{mediawiki.external('10:35:42')}} &lt;beaufour&gt; bz: ok. as you might can see it's not exactly my "area of expertise".... so I'm looking for some pointers on what to do exactly
{{mediawiki.external('10:36:15')}} &lt;mcsmurf&gt; it seems the Acrobat reader changes that icon then...
{{mediawiki.external('10:36:33')}} &lt;bz&gt; beaufour: I think the problem is that if we had such pointers it would be done by now.....
{{mediawiki.external('10:36:33')}} &lt;beaufour&gt; bz: there's (at least) two issues. 1) dbaron wants to see it happen without increasing the size of existing objects, which I can only agree with, but how exactly and 2) the "event state manager" business
{{mediawiki.external('10:36:47')}} &lt;beaufour&gt; bz: heh
{{mediawiki.external('10:36:48')}} &lt;bz&gt; beaufour: I can explain the latter, like I said in the bug.
{{mediawiki.external('10:37:23')}} trs80 {{mediawiki.external('trs80@203-59-159-146.dyn.iinet.net.au')}} has quit IRC: Ping timeout
{{mediawiki.external('10:37:37')}} beaufour is all ears (eyes  :)  )
{{mediawiki.external('10:37:54')}} &lt;mvl&gt; bsmedberg: the two other callers to the console service for errors also do printf
{{mediawiki.external('10:38:19')}} &lt;mvl&gt; bsmedberg: i think it should be added to nsXPCComponents::ReportError() as well
{{mediawiki.external('10:38:27')}} &lt;beaufour&gt; bz: ah, well, third issue: if we want it to be scriptable, where should the getter be exposed?
{{mediawiki.external('10:38:29')}} dgrimm {{mediawiki.external('chatzilla@65.64.178.99')}} has quit IRC: Quit: Chatzilla 0.9.68a {{mediawiki.external('Firefox 1.0.4/20050511')}}
{{mediawiki.external('10:38:44')}} &lt;dria&gt; who runs the end-user help project? (I'm not really sure what that is, but apparently there is one!)
{{mediawiki.external('10:38:54')}} timeless thinks we should just land a js impl'd consolelistener and get rid of the callers
{{mediawiki.external('10:39:01')}} &lt;timeless&gt; dria: heh
{{mediawiki.external('10:39:03')}} yg_home {{mediawiki.external('yusufg@cm61-18-99-230.hkcable.com.hk')}} has quit IRC: Quit: Leaving
{{mediawiki.external('10:39:12')}} &lt;bz&gt; beaufour: scriptability is a fun one that I'm really not sure about, frankly.
{{mediawiki.external('10:39:14')}} timeless wonders what dria is talking about (just as dria wonders what it is)
{{mediawiki.external('10:39:22')}} &lt;timeless&gt; neil owns the help code for suite
{{mediawiki.external('10:39:25')}} &lt;dria&gt; shaver seemed to think you guys would know  :) 
{{mediawiki.external('10:39:28')}} &lt;bz&gt; Let's talk about the ESM thing
{{mediawiki.external('10:39:32')}} &lt;beaufour&gt; bz: okie
{{mediawiki.external('10:39:41')}} &lt;bz&gt; Could someone with an IRC client that does sane logging log this, please?
{{mediawiki.external('10:39:46')}} &lt;bz&gt; and then email me the log?
{{mediawiki.external('10:40:03')}} &lt;db48x&gt; sure
{{mediawiki.external('10:40:09')}} &lt;bz&gt; I'll try to turn it into real docs
{{mediawiki.external('10:40:12')}} &lt;bsmedberg&gt; mvl: IMO client code should not be printf()ing, it should be done with a console listener and be pref-offable
{{mediawiki.external('10:40:32')}} &lt;bz&gt; OK.  So the basic idea is that the style system tries to minimize the number of style reresolves it does.
{{mediawiki.external('10:40:36')}} &lt;mvl&gt; bsmedberg: isn't #ifdef DEBUG enough of a pref?  :) 
{{mediawiki.external('10:40:42')}} &lt;bz&gt; Because those are somewhat expensive.
{{mediawiki.external('10:40:47')}} &lt;bsmedberg&gt; dria: Steffen Wilberg owns the firefox help content, IIRC
{{mediawiki.external('10:40:52')}} &lt;timeless&gt; mvl: no
{{mediawiki.external('10:41:01')}} &lt;timeless&gt; because i should be able to turn it on or off in release builds
{{mediawiki.external('10:41:03')}} &lt;dria&gt; ok
{{mediawiki.external('10:41:05')}} &lt;bz&gt; So when something changes, the first thing it does is to check whether the something _could_ affect any styles.
{{mediawiki.external('10:41:07')}} &lt;timeless&gt; and it shouldn't hurt code size
{{mediawiki.external('10:41:20')}} &lt;timeless&gt; having the same stupid code in multiple places is well ... stupid  :) 
{{mediawiki.external('10:41:48')}} &lt;bsmedberg&gt; mvl: of course, IMO dump() should go to the JS console, not to stdout...
{{mediawiki.external('10:41:57')}} boci^ {{mediawiki.external('boci@boci.dravanet.hu')}} has joined #developers
{{mediawiki.external('10:42:00')}} &lt;bsmedberg&gt; so MO is not worth much
{{mediawiki.external('10:42:05')}} &lt;timeless&gt; heh
{{mediawiki.external('10:42:06')}} &lt;bz&gt; If the something is a content state, it walks the list of all selectors that have a "state-dependent" pseudo in them
{{mediawiki.external('10:42:09')}} dmb {{mediawiki.external('chatzilla@204.8.196.2')}} has joined #developers
{{mediawiki.external('10:42:15')}} timeless actually has a component to do this /somewhere/
{{mediawiki.external('10:42:21')}} &lt;bz&gt; (which it creates during sheet parsing)
{{mediawiki.external('10:42:31')}} &lt;bz&gt; And for each selector checks whether it matches the node.
{{mediawiki.external('10:42:42')}} &lt;bz&gt; If it does, then the style could depend on the state and we have to reresolve style.
{{mediawiki.external('10:42:55')}} &lt;bz&gt; Now the hitch is what it means for the selector to match the node
{{mediawiki.external('10:43:01')}} &lt;bz&gt; Say the selector is a:hover
{{mediawiki.external('10:43:06')}} dmb {{mediawiki.external('chatzilla@204.8.196.2')}} is now known as IRCMonkey3840056
{{mediawiki.external('10:43:10')}} &lt;bz&gt; And the hover state on some node changes.
{{mediawiki.external('10:43:18')}} &lt;mvl&gt; bsmedberg: that means that i have to hack it myself?
{{mediawiki.external('10:43:23')}} &lt;bz&gt; What we need to check is whether the node matches the "a" part of the selector
{{mediawiki.external('10:43:29')}} &lt;mvl&gt; which means #ifdef debug in the caller.
{{mediawiki.external('10:43:40')}} &lt;bz&gt; So in other words, we want to treat all of the states that changed as matching automatically.
{{mediawiki.external('10:43:44')}} &lt;@shaver&gt; or use debug(), in components
{{mediawiki.external('10:43:54')}} &lt;IRCMonkey3840056&gt; arrr
{{mediawiki.external('10:43:56')}} IRCMonkey3840056 {{mediawiki.external('chatzilla@204.8.196.2')}} has quit IRC: Quit: Chatzilla 0.9.68a {{mediawiki.external('Firefox 1.0/20050106')}}
{{mediawiki.external('10:44:09')}} &lt;bz&gt; This means you have to know what states changed, of course.
{{mediawiki.external('10:44:12')}} dmb_ {{mediawiki.external('chatzilla@204.8.196.2')}} has joined #developers
{{mediawiki.external('10:44:13')}} dmb_ {{mediawiki.external('chatzilla@204.8.196.2')}} is now known as dmb
{{mediawiki.external('10:44:35')}} &lt;bz&gt; And this is why the selector-matching code short-circuits to "true" for cases when the state being matched on is in the state mask
{{mediawiki.external('10:44:46')}} gavin|away {{mediawiki.external('g@rn-wcs3c04.uwaterloo.ca')}} is now known as gavin
{{mediawiki.external('10:44:57')}} &lt;CTho&gt; timeless: ah, so gcc takes -pthread or -lpthread, but ld only takes -lptherad
{{mediawiki.external('10:45:10')}} timeless wonders what kind of file is needed to make
{{mediawiki.external('10:45:21')}} &lt;timeless&gt; ctho: there are other ld's out there than the one you're using
{{mediawiki.external('10:45:28')}} &lt;beaufour&gt; bz: ok, I think I'm following you most of the way
{{mediawiki.external('10:45:29')}} &lt;CTho&gt; well, my ld
{{mediawiki.external('10:45:39')}} &lt;timeless&gt; ... edit areas reasonably sized (&gt;2px tall)
{{mediawiki.external('10:45:47')}} &lt;bz&gt; Now the patch in bug 271720 sends UNSPECIFIED as the state mask, so a dynamic change will be treated as "nothing changed" by the style system
{{mediawiki.external('10:45:55')}} &lt;bz&gt; beaufour: which part is unclear?
{{mediawiki.external('10:46:28')}} &lt;beaufour&gt; bz: nothing in particular, it's only my own dubious understanding of the entire CSS thing  ;-) 
{{mediawiki.external('10:46:47')}} CTho {{mediawiki.external('Chris@CTHO.RES.cmu.edu')}} is now known as CTho|away
{{mediawiki.external('10:47:12')}} &lt;beaufour&gt; bz: I had a seperate state defined for each class in an earlier patch
{{mediawiki.external('10:49:04')}} &lt;beaufour&gt; bz: so having f.x. a NS_EVENT_STATE_PAIR_VALID and sending that as the state mask would be the correct thing todo?
{{mediawiki.external('10:49:19')}} beaufour wonders why he trashed those in the first place
{{mediawiki.external('10:50:03')}} &lt;bz&gt; beaufour: what would that mean?
{{mediawiki.external('10:50:05')}} FUBAr {{mediawiki.external('fubar@212.16.199.122')}} has quit IRC: Quit: �?Ÿ�?¾�?º�?¸�?´�?°ÑŽ
{{mediawiki.external('10:50:14')}} smaug {{mediawiki.external('smaug@cs181140114.pp.htv.fi')}} has joined #developers
{{mediawiki.external('10:50:21')}} &lt;bz&gt; beaufour: Just not sure what NS_EVENT_STATE_PAIR_VALID would indicate...
{{mediawiki.external('10:51:05')}} &lt;beaufour&gt; bz: it would mean that the valid state for the content changed, that it could now match either :valid or :invalid
{{mediawiki.external('10:51:14')}} &lt;beaufour&gt; hi smaug 
{{mediawiki.external('10:51:24')}} &lt;smaug&gt; hi beaufour 
{{mediawiki.external('10:51:50')}} &lt;bz&gt; beaufour: ah, hm.  Let me think about that for a sec.
{{mediawiki.external('10:54:05')}} &lt;bz&gt; So that would work with style resolution....
{{mediawiki.external('10:54:11')}} &lt;bz&gt; db48x: want to send me that log?
</p>
Revert to this revision