mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Simplify TNode a bit.
A couple of changes here: * Remove the option to unset with the dirty bit setters. * Add an explicit API for setting text node style. * Hoist has_changed handling into the restyle damage setter and text node style setter. * Make set_style take a non-Option.
This commit is contained in:
parent
ee713bc7d9
commit
cc96b292c2
8 changed files with 70 additions and 81 deletions
|
@ -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/. */
|
||||
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
use HTMLCanvasData;
|
||||
use LayoutNodeType;
|
||||
use OpaqueStyleAndLayoutData;
|
||||
|
@ -77,6 +79,10 @@ pub trait LayoutNode: TNode {
|
|||
/// Returns the type ID of this node.
|
||||
fn type_id(&self) -> LayoutNodeType;
|
||||
|
||||
fn has_changed(&self) -> bool;
|
||||
|
||||
unsafe fn clear_dirty_bits(&self);
|
||||
|
||||
fn get_style_data(&self) -> Option<&AtomicRefCell<PersistentStyleData>>;
|
||||
|
||||
fn init_style_and_layout_data(&self, data: OpaqueStyleAndLayoutData);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue