Changes

Jump to: navigation, search

Gecko:Overview

No change in size, 10:29, 29 March 2017
MXR -> DXR
The loading of CSS style sheets from the network is managed by the
[https://mxrdxr.mozilla.org/mozilla-central/source/layout/style/Loader.h CSS loader];
they are then tokenized by the
[https://mxrdxr.mozilla.org/mozilla-central/source/layout/style/nsCSSScanner.h CSS scanner]
and parsed by the
[https://mxrdxr.mozilla.org/mozilla-central/source/layout/style/nsCSSParser.h CSS parser].
Those that are attached to the document also expose APIs to
script that are known as the CSS Object Model, or CSSOM.
The style sheets that apply to a document are managed by a class called
the [https://mxrdxr.mozilla.org/mozilla-central/source/layout/style/nsStyleSet.h style set].
The style set interacts with the different types of
style sheets (representing CSS style sheets, presentational
attributes, and 'style' attributes) through two interfaces:
[http://mxrdxr.mozilla.org/mozilla-central/source/layout/style/nsIStyleSheet.h nsIStyleSheet] for basic management of style sheets and[http://mxrdxr.mozilla.org/mozilla-central/source/layout/style/nsIStyleRuleProcessor.h nsIStyleRuleProcessor] for getting the style data out of them. Usually
the same object implements both interfaces, except in the most important
case, CSS style sheets, where there is a single rule processor for all
The process of turning the style sheets into computed style data goes
through three main steps, the first two of which closely relate to the
[http://mxrdxr.mozilla.org/mozilla-central/source/layout/style/nsIStyleRule.h nsIStyleRule] interface, which represents an immutable source of style
data, conceptually representing (and for CSS style rules, directly
storing) a set of property:value pairs. (It is similar to the idea of a
with a simple mark and sweep collector (which often never needs to run).
* code: [http://mxrdxr.mozilla.org/mozilla-central/source/layout/style/ layout/style/], where most files have useful one line descriptions at the top that show up in MXRDXR
* Bugzilla: Style System (CSS)
* specifications
TODO: link to documentation of XUL frame classes
Code (note that most files in base and generic have useful one line descriptions at the top that show up in MXRDXR):* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/base/ layout/base/] contains objects that coordinate everything and a bunch of other miscellaneous things* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/generic/ layout/generic/] contains the basic frame classes as well as support code for their reflow methods (nsHTMLReflowState, nsHTMLReflowMetrics)* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/forms/ layout/forms/] contains frame classes for HTML form controls* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/tables/ layout/tables/] contains frame classes for CSS/HTML tables* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/mathml/ layout/mathml/] contains frame classes for MathML* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/svg/ layout/svg/] contains frame classes for SVG* [http://mxrdxr.mozilla.org/mozilla-central/source/layout/xul/ layout/xul/] contains frame classes for the XUL box model and for various XUL widgets
Bugzilla:
* Code to create frames from frame construction items.
Code: [http://mxrdxr.mozilla.org/mozilla-central/source/layout/base/nsCSSFrameConstructor.h layout/base/nsCSSFrameConstructor.h] and [http://mxrdxr.mozilla.org/mozilla-central/source/layout/base/nsCSSFrameConstructor.cpp layout/base/nsCSSFrameConstructor.cpp]
==== Reflow ====
It is worth reading the inline code documentation in the following files:
* [http://mxrdxr.mozilla.org/mozilla-central/source/gfx/layers/Compositor.h gfx/layers/Compositor.h]* [http://mxrdxr.mozilla.org/mozilla-central/source/gfx/layers/ShadowLayers.h gfx/layers/ShadowLayers.h]* [http://mxrdxr.mozilla.org/mozilla-central/source/gfx/layers/Layers.h gfx/layers/Layers.h]* [http://mxrdxr.mozilla.org/mozilla-central/source/gfx/layers/host/TextureHost.h gfx/layers/host/TextureHost.h]* [http://mxrdxr.mozilla.org/mozilla-central/source/gfx/layers/client/CompositableClient.h gfx/layers/client/CompositableClient.h]
To visualize how a web page is layered, turn on the pref "layers.draw-borders" in about:config. When this pref is on, the borders of layers and tiles are displayed on top of the content. This only works when using the new Compositor API, that is when off-main-thread compositing is activated. OMTC is activated by default on all mobile platforms, and will progressively get activated on desktop platforms (not yet, though). On platforms where OMTC is not used, this pref has no effect.
Confirm, emeritus
969
edits

Navigation menu