style: Document Gecko's traversal code.

Actually, I think most of the functions in DOMTraversalContext deserve a nice
comment, but that's probably fine as a followup, I want to land the require-docs
thing now.
This commit is contained in:
Emilio Cobos Álvarez 2017-01-02 04:56:18 +01:00
parent 58173367be
commit 632c99676b
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Gecko-specific bits for the styling DOM traversal.
use atomic_refcell::AtomicRefCell;
use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext};
use data::ElementData;
@ -9,11 +11,14 @@ use dom::{NodeInfo, TNode};
use gecko::wrapper::{GeckoElement, GeckoNode};
use traversal::{DomTraversal, PerLevelTraversalData, recalc_style_at};
/// This is the simple struct that Gecko uses to encapsulate a DOM traversal for
/// styling.
pub struct RecalcStyleOnly {
shared: SharedStyleContext,
}
impl RecalcStyleOnly {
/// Create a `RecalcStyleOnly` traversal from a `SharedStyleContext`.
pub fn new(shared: SharedStyleContext) -> Self {
RecalcStyleOnly {
shared: shared,