mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Edit Selector Implementation to be concise
Edit Selector Implementation in order to be concise. Changes involve: - Sentence rewrites - Removal of dead links - Correction of grammar and spelling Edit Style.md Edit the content under "The properties module" to make it concise . (Squashed commit)Edit Style.md #1 sytle -> style Update Style.md #1 consitency -> consistency
This commit is contained in:
parent
3a33f99cad
commit
eafd9d17ad
1 changed files with 16 additions and 21 deletions
|
@ -1,22 +1,21 @@
|
||||||
# Servo's style system overview
|
# Servo's style system overview
|
||||||
|
|
||||||
This needs to be filled more extensively. Meanwhile, you can also take a look to
|
This needs to be filled more extensively. Meanwhile, you can also take a look at
|
||||||
the [style doc comments][style-doc], or the [Styling
|
the [style doc comments][style-doc], or the [Styling
|
||||||
Overview][wiki-styling-overview] in the wiki, which is a conversation between
|
Overview][wiki-styling-overview] in the wiki, a conversation between
|
||||||
Boris Zbarsky and Patrick Walton about how style sharing works.
|
Boris Zbarsky and Patrick Walton about how style sharing works.
|
||||||
|
|
||||||
<a name="selector-impl"></a>
|
<a name="selector-impl"></a>
|
||||||
## Selector Implementation
|
## Selector Implementation
|
||||||
|
|
||||||
The style system is generic over quite a few things, in order to be shareable
|
In order to be sharable and compatible with [Stylo][stylo](a project that aims
|
||||||
with Servo's layout system, and with [Stylo][stylo], an ambitious project that
|
to integrate Servo's style system into Gecko), the style must be consistent.
|
||||||
aims to integrate Servo's style system into Gecko.
|
|
||||||
|
|
||||||
The main generic trait is [selectors' SelectorImpl][selector-impl], that has all
|
The consistency is implemented in [selectors' SelectorImpl][selector-impl],
|
||||||
the logic related to parsing pseudo-elements and other pseudo-classes appart
|
containing the logic related to parsing pseudo-elements and other pseudo-classes
|
||||||
from [tree-structural ones][tree-structural-pseudo-classes].
|
apart from [tree-structural ones][tree-structural-pseudo-classes].
|
||||||
|
|
||||||
Servo [extends][selector-impl-ext] that trait in order to allow a few more
|
Servo extends the selector implementation trait in order to allow a few more
|
||||||
things to be shared between Stylo and Servo.
|
things to be shared between Stylo and Servo.
|
||||||
|
|
||||||
The main Servo implementation (the one that is used in regular builds) is
|
The main Servo implementation (the one that is used in regular builds) is
|
||||||
|
@ -31,34 +30,30 @@ traits involved.
|
||||||
Style's [`dom` traits][style-dom-traits] (`TDocument`, `TElement`, `TNode`,
|
Style's [`dom` traits][style-dom-traits] (`TDocument`, `TElement`, `TNode`,
|
||||||
`TRestyleDamage`) are the main "wall" between layout and style.
|
`TRestyleDamage`) are the main "wall" between layout and style.
|
||||||
|
|
||||||
Layout's [`wrapper`][layout-wrapper] module is the one that makes sure that
|
Layout's [`wrapper`][layout-wrapper] module makes sure that
|
||||||
layout traits have the required traits implemented.
|
layout traits have the required traits implemented.
|
||||||
|
|
||||||
<a name="stylist"></a>
|
<a name="stylist"></a>
|
||||||
## The Stylist
|
## The Stylist
|
||||||
|
|
||||||
The [`stylist`][stylist] structure is the one that holds all the selectors and
|
The [`stylist`][stylist] structure holds all the selectors and
|
||||||
device characteristics for a given document.
|
device characteristics for a given document.
|
||||||
|
|
||||||
The stylesheets' CSS rules are converted into [`Rule`][selectors-rule]s, and
|
The stylesheets' CSS rules are converted into [`Rule`][selectors-rule]s.
|
||||||
introduced in a [`SelectorMap`][selectors-selectormap] depending on the
|
They are then introduced in a [`SelectorMap`][selectors-selectormap] depending
|
||||||
pseudo-element (see [`PerPseudoElementSelectorMap`][per-pseudo-selectormap]),
|
on the pseudo-element (see [`PerPseudoElementSelectorMap`][per-pseudo-selectormap]),
|
||||||
stylesheet origin (see [`PerOriginSelectorMap`][per-origin-selectormap]), and
|
stylesheet origin (see [`PerOriginSelectorMap`][per-origin-selectormap]), and
|
||||||
priority (see the `normal` and `important` fields in
|
priority (see the `normal` and `important` fields in
|
||||||
[`PerOriginSelectorMap`][per-origin-selectormap]).
|
[`PerOriginSelectorMap`][per-origin-selectormap]).
|
||||||
|
|
||||||
This structure is effectively created once per [pipeline][docs-pipeline], in the
|
This structure is effectively created once per [pipeline][docs-pipeline], in the
|
||||||
LayoutThread corresponding to that pipeline.
|
corresponding LayoutThread.
|
||||||
|
|
||||||
<a name="properties"></a>
|
<a name="properties"></a>
|
||||||
## The `properties` module
|
## The `properties` module
|
||||||
|
|
||||||
The [properties module][properties-module] is a mako template where all the
|
The [properties module][properties-module] is a mako template. Its complexity is derived
|
||||||
properties, computed value computation and cascading logic resides.
|
from the code that stores properties, [`cascade` function][properties-cascade-fn] and computation logic of the returned value which is exposed in the main function.
|
||||||
|
|
||||||
It's a complex template with a **lot** of code, but the main function it exposes
|
|
||||||
is the [`cascade` function][properties-cascade-fn], which performs all the
|
|
||||||
computation.
|
|
||||||
|
|
||||||
<a name="pseudo-elements"></a>
|
<a name="pseudo-elements"></a>
|
||||||
## Pseudo-Element resolution
|
## Pseudo-Element resolution
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue