2010/6/4 bobbykjack <[email protected]>:
> Hi Pedro,
>
> Many thanks for your detailed reply.
>
> I'm very familiar with CSS, inheritance, the cascade etc. just not
> familiar with the internals of Firebug! Good tip on development mode -
> I'll go check that out.
>
> However, since my original post, I've come to the conclusion that it's
> impossible for javascript to obtain the values declared by the user
> agent stylesheet. Indeed, Firebug lite doesn't seem to offer this
> option, unlike the full Firebug add-on (which I'm assuming has
> privileged access to the user stylesheet).
>
> Can anyone confirm that assumption?

Yes. The user-agent styles (the default color of links, etc) cannot
be accessed using only JavaScript.

Firebug relies on Firefox's internals (XPCOM) to access all page
styles (including user-agent ones).

Firebug Lite access styles via document.styleSheets and
therefore cannot read detailed info such as line numbers
and/or user-agent styles.

regards,

Pedro Simonetti.


>
> - Bobby
>
> On Jun 4, 4:43 pm, Pedro Simonetti Garcia <[email protected]>
> wrote:
>> Hi Bobby,
>>
>> 2010/6/4 bobbykjack <[email protected]>:
>>
>> > Is anyone able + willing to help out a newbie to the codebase? I'm
>> > trying to understand how Firebug (specifically, Firebug lite since
>> > that seems easier) parses stylesheets and presents the style info for
>> > a specific element in the style tab / panel. I've made some progress,
>> > but I'm wondering if someone can point me towards the code that
>> > handles parsing of the user agent stylesheet.
>>
>> > Also, whilst I'm here, if anyone can direct me to the uncompressed
>> > source, that would be a great help. I'm kinda tired of reformatting
>> > thousands of lines of javascript, now! ;-)
>>
>> I suggest running Firebug Lite in development 
>> mode:http://getfirebug.com/firebuglite#DevelopmentMode
>>
>> You can get the latest version of the code with our 
>> repository:http://fbug.googlecode.com/svn/lite/branches/firebug1.3/
>>
>> Or, you can get the full stable source 
>> here:http://getfirebug.com/releases/lite/latest/firebug-lite.tar.tgz
>>
>> The file you are looking for 
>> is:http://fbug.googlecode.com/svn/lite/branches/firebug1.3/content/fireb...
>>
>> The functions you are looking for seem to be these
>> (located at the beginning of the css.js file):
>>
>> - processAllStyleSheets()
>> - processStyleSheet()
>> - sortElementRules()
>> - getCSSRuleSpecificity()
>>
>> I suggest also reading some background about how
>> CSS Cascading Order and Inheritance works. Here
>> is a very good article:
>>
>> Cascading Order and Inheritance in 
>> CSShttp://monc.se/kitchen/38/cascading-order-and-inheritance-in-css
>>
>> Also, W3C specifications about the subject:
>>
>> Cascading Order Specificationhttp://www.w3.org/TR/REC-CSS1/#cascading-order
>>
>> Assigning property values, Cascading, and 
>> Inheritancehttp://www.w3.org/TR/CSS21/cascade.html
>>
>> Table of CSS properties with initial values - Appendix F. Full property 
>> tablehttp://www.w3.org/TR/CSS21/propidx.html
>>
>> If you have any other question, please post here
>> and I'll be glad to help you.
>>
>> regards,
>>
>> Pedro Simonetti.
>>
>>
>>
>> > Cheers,
>>
>> > - Bobby
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Firebug" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to 
>> > [email protected].
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/firebug?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Firebug" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/firebug?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en.

Reply via email to