Auto merge of #13848 - mrobinson:remove-layers, r=glennw

Remove concept of Layers from Servo

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this PR should not change behavior.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13848)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-21 01:43:25 -05:00 committed by GitHub
commit bb271ef4af
21 changed files with 57 additions and 745 deletions

View file

@ -6,7 +6,7 @@ use {OpaqueStyleAndLayoutData, TrustedNodeAddress};
use app_units::Au;
use euclid::point::Point2D;
use euclid::rect::Rect;
use gfx_traits::{Epoch, LayerId};
use gfx_traits::Epoch;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use msg::constellation_msg::PipelineId;
use net_traits::image_cache_thread::ImageCacheThread;
@ -48,10 +48,6 @@ pub enum Msg {
/// Requests that the layout thread reflow with a newly-loaded Web font.
ReflowWithNewlyLoadedWebFont,
/// Updates the layout visible rects, affecting the area that display lists will be constructed
/// for.
SetVisibleRects(Vec<(LayerId, Rect<Au>)>),
/// Destroys layout data associated with a DOM node.
///
/// TODO(pcwalton): Maybe think about batching to avoid message traffic.
@ -99,7 +95,6 @@ pub enum ReflowQueryType {
NodeOverflowQuery(TrustedNodeAddress),
HitTestQuery(Point2D<f32>, Point2D<f32>, bool),
NodeGeometryQuery(TrustedNodeAddress),
NodeLayerIdQuery(TrustedNodeAddress),
NodeScrollGeometryQuery(TrustedNodeAddress),
ResolvedStyleQuery(TrustedNodeAddress, Option<PseudoElement>, Atom),
OffsetParentQuery(TrustedNodeAddress),

View file

@ -5,7 +5,6 @@
use app_units::Au;
use euclid::point::Point2D;
use euclid::rect::Rect;
use gfx_traits::LayerId;
use script_traits::UntrustedNodeAddress;
use style::properties::longhands::{margin_top, margin_right, margin_bottom, margin_left, overflow_x};
@ -28,8 +27,6 @@ pub trait LayoutRPC {
fn node_overflow(&self) -> NodeOverflowResponse;
/// Requests the scroll geometry of this node. Used by APIs such as `scrollTop`.
fn node_scroll_area(&self) -> NodeGeometryResponse;
/// Requests the layer id of this node. Used by APIs such as `scrollTop`
fn node_layer_id(&self) -> NodeLayerIdResponse;
/// Requests the node containing the point of interest
fn hit_test(&self) -> HitTestResponse;
/// Query layout for the resolved value of a given CSS property
@ -51,10 +48,6 @@ pub struct NodeGeometryResponse {
pub struct NodeOverflowResponse(pub Option<Point2D<overflow_x::computed_value::T>>);
pub struct NodeLayerIdResponse {
pub layer_id: LayerId,
}
pub struct HitTestResponse {
pub node_address: Option<UntrustedNodeAddress>,
}

View file

@ -8,7 +8,7 @@ use HTMLCanvasData;
use LayoutNodeType;
use OpaqueStyleAndLayoutData;
use SVGSVGData;
use gfx_traits::{ByteIndex, LayerId, LayerType};
use gfx_traits::ByteIndex;
use msg::constellation_msg::PipelineId;
use range::Range;
use restyle_damage::RestyleDamage;
@ -377,21 +377,6 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + NodeInfo + PartialEq + Sized {
fn get_colspan(&self) -> u32;
fn layer_id(&self) -> LayerId {
let layer_type = match self.get_pseudo_element_type() {
PseudoElementType::Normal => LayerType::FragmentBody,
PseudoElementType::Before(_) => LayerType::BeforePseudoContent,
PseudoElementType::After(_) => LayerType::AfterPseudoContent,
PseudoElementType::DetailsSummary(_) => LayerType::FragmentBody,
PseudoElementType::DetailsContent(_) => LayerType::FragmentBody,
};
LayerId::new_of_type(layer_type, self.opaque().id() as usize)
}
fn layer_id_for_overflow_scroll(&self) -> LayerId {
LayerId::new_of_type(LayerType::OverflowScroll, self.opaque().id() as usize)
}
fn get_style_data(&self) -> Option<&AtomicRefCell<PersistentStyleData>>;
}