Auto merge of #23049 - dollinad:master, r=jdm

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

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _changes were made to docs file only__

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23049)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-21 08:20:48 -04:00 committed by GitHub
commit e2406d31dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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