style: Remove NODE_NEEDS_DIRTY_ON_VIEWPORT_SIZE_CHANGE.

Recascading is enough.
This commit is contained in:
Emilio Cobos Álvarez 2017-08-28 11:38:22 +02:00
parent 2291ce4767
commit dcbe196ed5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 3 additions and 29 deletions

View file

@ -38,7 +38,7 @@ use layout::data::StyleAndLayoutData;
use layout::wrapper::GetRawData; use layout::wrapper::GetRawData;
use msg::constellation_msg::{BrowsingContextId, PipelineId}; use msg::constellation_msg::{BrowsingContextId, PipelineId};
use range::Range; use range::Range;
use script::layout_exports::{CAN_BE_FRAGMENTED, DIRTY_ON_VIEWPORT_SIZE_CHANGE, HAS_DIRTY_DESCENDANTS, IS_IN_DOC}; use script::layout_exports::{CAN_BE_FRAGMENTED, HAS_DIRTY_DESCENDANTS, IS_IN_DOC};
use script::layout_exports::{CharacterDataTypeId, ElementTypeId, HTMLElementTypeId, NodeTypeId}; use script::layout_exports::{CharacterDataTypeId, ElementTypeId, HTMLElementTypeId, NodeTypeId};
use script::layout_exports::{Document, Element, Node, Text}; use script::layout_exports::{Document, Element, Node, Text};
use script::layout_exports::{HANDLED_SNAPSHOT, HAS_SNAPSHOT}; use script::layout_exports::{HANDLED_SNAPSHOT, HAS_SNAPSHOT};
@ -205,14 +205,6 @@ impl<'ln> TNode for ServoLayoutNode<'ln> {
as_element(self.node) as_element(self.node)
} }
fn needs_dirty_on_viewport_size_changed(&self) -> bool {
unsafe { self.node.get_flag(DIRTY_ON_VIEWPORT_SIZE_CHANGE) }
}
unsafe fn set_dirty_on_viewport_size_changed(&self) {
self.node.set_flag(DIRTY_ON_VIEWPORT_SIZE_CHANGE, true);
}
fn can_be_fragmented(&self) -> bool { fn can_be_fragmented(&self) -> bool {
unsafe { self.node.get_flag(CAN_BE_FRAGMENTED) } unsafe { self.node.get_flag(CAN_BE_FRAGMENTED) }
} }

View file

@ -169,8 +169,7 @@ bitflags! {
/// Whether any ancestor is a fragmentation container /// Whether any ancestor is a fragmentation container
const CAN_BE_FRAGMENTED = 1 << 4, const CAN_BE_FRAGMENTED = 1 << 4,
#[doc = "Specifies whether this node needs to be dirted when viewport size changed."] // There's a free bit here.
const DIRTY_ON_VIEWPORT_SIZE_CHANGE = 1 << 5,
#[doc = "Specifies whether the parser has set an associated form owner for \ #[doc = "Specifies whether the parser has set an associated form owner for \
this element. Only applicable for form-associatable elements."] this element. Only applicable for form-associatable elements."]

View file

@ -142,7 +142,7 @@ pub mod layout_exports {
pub use dom::characterdata::LayoutCharacterDataHelpers; pub use dom::characterdata::LayoutCharacterDataHelpers;
pub use dom::document::{Document, LayoutDocumentHelpers, PendingRestyle}; pub use dom::document::{Document, LayoutDocumentHelpers, PendingRestyle};
pub use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers}; pub use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers};
pub use dom::node::{CAN_BE_FRAGMENTED, DIRTY_ON_VIEWPORT_SIZE_CHANGE, HAS_DIRTY_DESCENDANTS, IS_IN_DOC}; pub use dom::node::{CAN_BE_FRAGMENTED, HAS_DIRTY_DESCENDANTS, IS_IN_DOC};
pub use dom::node::{HANDLED_SNAPSHOT, HAS_SNAPSHOT}; pub use dom::node::{HANDLED_SNAPSHOT, HAS_SNAPSHOT};
pub use dom::node::{LayoutNodeHelpers, Node}; pub use dom::node::{LayoutNodeHelpers, Node};
pub use dom::text::Text; pub use dom::text::Text;

View file

@ -138,12 +138,6 @@ pub trait TNode : Sized + Copy + Clone + Debug + NodeInfo {
/// Get this node as an element, if it's one. /// Get this node as an element, if it's one.
fn as_element(&self) -> Option<Self::ConcreteElement>; fn as_element(&self) -> Option<Self::ConcreteElement>;
/// Whether this node needs to be laid out on viewport size change.
fn needs_dirty_on_viewport_size_changed(&self) -> bool;
/// Mark this node as needing layout on viewport size change.
unsafe fn set_dirty_on_viewport_size_changed(&self);
/// Whether this node can be fragmented. This is used for multicol, and only /// Whether this node can be fragmented. This is used for multicol, and only
/// for Servo. /// for Servo.
fn can_be_fragmented(&self) -> bool; fn can_be_fragmented(&self) -> bool;

View file

@ -318,17 +318,6 @@ impl<'ln> TNode for GeckoNode<'ln> {
fn is_in_doc(&self) -> bool { fn is_in_doc(&self) -> bool {
unsafe { bindings::Gecko_IsInDocument(self.0) } unsafe { bindings::Gecko_IsInDocument(self.0) }
} }
fn needs_dirty_on_viewport_size_changed(&self) -> bool {
// Gecko's node doesn't have the DIRTY_ON_VIEWPORT_SIZE_CHANGE flag,
// so we force them to be dirtied on viewport size change, regardless if
// they use viewport percentage size or not.
// TODO(shinglyu): implement this in Gecko: https://github.com/servo/servo/pull/11890
true
}
// TODO(shinglyu): implement this in Gecko: https://github.com/servo/servo/pull/11890
unsafe fn set_dirty_on_viewport_size_changed(&self) {}
} }
/// A wrapper on top of two kind of iterators, depending on the parent being /// A wrapper on top of two kind of iterators, depending on the parent being