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:
Bobby Holley 2016-10-19 14:28:50 -07:00
parent ee713bc7d9
commit cc96b292c2
8 changed files with 70 additions and 81 deletions

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/. */
#![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);