mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
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:
parent
58173367be
commit
632c99676b
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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 atomic_refcell::AtomicRefCell;
|
||||||
use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext};
|
use context::{SharedStyleContext, StyleContext, ThreadLocalStyleContext};
|
||||||
use data::ElementData;
|
use data::ElementData;
|
||||||
|
@ -9,11 +11,14 @@ use dom::{NodeInfo, TNode};
|
||||||
use gecko::wrapper::{GeckoElement, GeckoNode};
|
use gecko::wrapper::{GeckoElement, GeckoNode};
|
||||||
use traversal::{DomTraversal, PerLevelTraversalData, recalc_style_at};
|
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 {
|
pub struct RecalcStyleOnly {
|
||||||
shared: SharedStyleContext,
|
shared: SharedStyleContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RecalcStyleOnly {
|
impl RecalcStyleOnly {
|
||||||
|
/// Create a `RecalcStyleOnly` traversal from a `SharedStyleContext`.
|
||||||
pub fn new(shared: SharedStyleContext) -> Self {
|
pub fn new(shared: SharedStyleContext) -> Self {
|
||||||
RecalcStyleOnly {
|
RecalcStyleOnly {
|
||||||
shared: shared,
|
shared: shared,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue