mirror of
https://github.com/servo/servo.git
synced 2025-06-26 10:04:33 +01:00
script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call. This is simpler. Currently, the set of methods is not safe, but I plan to lock it down more soon.
This commit is contained in:
parent
da4cff034b
commit
be69a503fe
96 changed files with 646 additions and 522 deletions
|
@ -26,7 +26,6 @@ use layout_interface::{Reflow, ReflowDocumentDamage, ReflowForDisplay, ReflowGoa
|
|||
use layout_interface::ContentChangedDocumentDamage;
|
||||
use layout_interface;
|
||||
|
||||
use dom::node::ScriptView;
|
||||
use extra::url::Url;
|
||||
use geom::point::Point2D;
|
||||
use geom::size::Size2D;
|
||||
|
@ -133,7 +132,7 @@ pub struct Page {
|
|||
resize_event: Option<Size2D<uint>>,
|
||||
|
||||
/// Pending scroll to fragment event, if any
|
||||
fragment_node: Option<AbstractNode<ScriptView>>
|
||||
fragment_node: Option<AbstractNode>
|
||||
}
|
||||
|
||||
pub struct PageTree {
|
||||
|
@ -804,7 +803,7 @@ impl ScriptTask {
|
|||
page.fragment_node = fragment.map_default(None, |fragid| self.find_fragment_node(page, fragid));
|
||||
}
|
||||
|
||||
fn find_fragment_node(&self, page: &mut Page, fragid: ~str) -> Option<AbstractNode<ScriptView>> {
|
||||
fn find_fragment_node(&self, page: &mut Page, fragid: ~str) -> Option<AbstractNode> {
|
||||
let document = page.frame.expect("root frame is None").document;
|
||||
match document.document().GetElementById(fragid.to_owned()) {
|
||||
Some(node) => Some(node),
|
||||
|
@ -823,7 +822,7 @@ impl ScriptTask {
|
|||
}
|
||||
}
|
||||
|
||||
fn scroll_fragment_point(&self, pipeline_id: PipelineId, page: &mut Page, node: AbstractNode<ScriptView>) {
|
||||
fn scroll_fragment_point(&self, pipeline_id: PipelineId, page: &mut Page, node: AbstractNode) {
|
||||
let (port, chan) = comm::stream();
|
||||
match page.query_layout(ContentBoxQuery(node, chan), port) {
|
||||
ContentBoxResponse(rect) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue