mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Rename browser_context identifiers to browsing_context.
This commit is contained in:
parent
7491728a9c
commit
6d7bc2cffe
4 changed files with 25 additions and 25 deletions
|
@ -702,7 +702,7 @@ pub unsafe extern fn outerize_global(_cx: *mut JSContext, obj: HandleObject) ->
|
||||||
let win: Root<window::Window> = native_from_handleobject(obj).unwrap();
|
let win: Root<window::Window> = native_from_handleobject(obj).unwrap();
|
||||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||||
let win = win.r();
|
let win = win.r();
|
||||||
let context = win.browser_context();
|
let context = win.browsing_context();
|
||||||
context.as_ref().unwrap().window_proxy()
|
context.as_ref().unwrap().window_proxy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -319,9 +319,9 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
|
||||||
fn is_fully_active(self) -> bool {
|
fn is_fully_active(self) -> bool {
|
||||||
let window = self.window.root();
|
let window = self.window.root();
|
||||||
let window = window.r();
|
let window = window.r();
|
||||||
let browser_context = window.browser_context();
|
let browsing_context = window.browsing_context();
|
||||||
let browser_context = browser_context.as_ref().unwrap();
|
let browsing_context = browsing_context.as_ref().unwrap();
|
||||||
let active_document = browser_context.active_document();
|
let active_document = browsing_context.active_document();
|
||||||
|
|
||||||
if self != active_document.r() {
|
if self != active_document.r() {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1879,10 +1879,10 @@ impl DocumentProgressHandler {
|
||||||
let _ = wintarget.dispatch_event_with_target(doctarget, event.r());
|
let _ = wintarget.dispatch_event_with_target(doctarget, event.r());
|
||||||
|
|
||||||
let window_ref = window.r();
|
let window_ref = window.r();
|
||||||
let browser_context = window_ref.browser_context();
|
let browsing_context = window_ref.browsing_context();
|
||||||
let browser_context = browser_context.as_ref().unwrap();
|
let browsing_context = browsing_context.as_ref().unwrap();
|
||||||
|
|
||||||
browser_context.frame_element().map(|frame_element| {
|
browsing_context.frame_element().map(|frame_element| {
|
||||||
let frame_window = window_from_node(frame_element.r());
|
let frame_window = window_from_node(frame_element.r());
|
||||||
let event = Event::new(GlobalRef::Window(frame_window.r()), "load".to_owned(),
|
let event = Event::new(GlobalRef::Window(frame_window.r()), "load".to_owned(),
|
||||||
EventBubbles::DoesNotBubble,
|
EventBubbles::DoesNotBubble,
|
||||||
|
|
|
@ -108,7 +108,7 @@ pub struct Window {
|
||||||
image_cache_task: ImageCacheTask,
|
image_cache_task: ImageCacheTask,
|
||||||
image_cache_chan: ImageCacheChan,
|
image_cache_chan: ImageCacheChan,
|
||||||
compositor: DOMRefCell<ScriptListener>,
|
compositor: DOMRefCell<ScriptListener>,
|
||||||
browser_context: DOMRefCell<Option<BrowsingContext>>,
|
browsing_context: DOMRefCell<Option<BrowsingContext>>,
|
||||||
page: Rc<Page>,
|
page: Rc<Page>,
|
||||||
performance: MutNullableHeap<JS<Performance>>,
|
performance: MutNullableHeap<JS<Performance>>,
|
||||||
navigation_start: u64,
|
navigation_start: u64,
|
||||||
|
@ -197,7 +197,7 @@ impl Window {
|
||||||
pub fn clear_js_runtime_for_script_deallocation(&self) {
|
pub fn clear_js_runtime_for_script_deallocation(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
*self.js_runtime.borrow_for_script_deallocation() = None;
|
*self.js_runtime.borrow_for_script_deallocation() = None;
|
||||||
*self.browser_context.borrow_for_script_deallocation() = None;
|
*self.browsing_context.borrow_for_script_deallocation() = None;
|
||||||
self.current_state.set(WindowState::Zombie);
|
self.current_state.set(WindowState::Zombie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,8 +250,8 @@ impl Window {
|
||||||
self.compositor.borrow_mut()
|
self.compositor.borrow_mut()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn browser_context<'a>(&'a self) -> Ref<'a, Option<BrowsingContext>> {
|
pub fn browsing_context<'a>(&'a self) -> Ref<'a, Option<BrowsingContext>> {
|
||||||
self.browser_context.borrow()
|
self.browsing_context.borrow()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn page<'a>(&'a self) -> &'a Page {
|
pub fn page<'a>(&'a self) -> &'a Page {
|
||||||
|
@ -343,7 +343,7 @@ impl<'a> WindowMethods for &'a Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn Document(self) -> Root<Document> {
|
fn Document(self) -> Root<Document> {
|
||||||
self.browser_context().as_ref().unwrap().active_document()
|
self.browsing_context().as_ref().unwrap().active_document()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-location
|
// https://html.spec.whatwg.org/#dom-location
|
||||||
|
@ -371,7 +371,7 @@ impl<'a> WindowMethods for &'a Window {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-frameelement
|
// https://html.spec.whatwg.org/#dom-frameelement
|
||||||
fn GetFrameElement(self) -> Option<Root<Element>> {
|
fn GetFrameElement(self) -> Option<Root<Element>> {
|
||||||
self.browser_context().as_ref().unwrap().frame_element()
|
self.browsing_context().as_ref().unwrap().frame_element()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/#dom-navigator
|
// https://html.spec.whatwg.org/#dom-navigator
|
||||||
|
@ -526,7 +526,7 @@ impl<'a> WindowMethods for &'a Window {
|
||||||
|
|
||||||
pub trait WindowHelpers {
|
pub trait WindowHelpers {
|
||||||
fn clear_js_runtime(self);
|
fn clear_js_runtime(self);
|
||||||
fn init_browser_context(self, doc: &Document, frame_element: Option<&Element>);
|
fn init_browsing_context(self, doc: &Document, frame_element: Option<&Element>);
|
||||||
fn load_url(self, href: DOMString);
|
fn load_url(self, href: DOMString);
|
||||||
fn handle_fire_timer(self, timer_id: TimerId);
|
fn handle_fire_timer(self, timer_id: TimerId);
|
||||||
fn force_reflow(self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason);
|
fn force_reflow(self, goal: ReflowGoal, query_type: ReflowQueryType, reason: ReflowReason);
|
||||||
|
@ -623,7 +623,7 @@ impl<'a> WindowHelpers for &'a Window {
|
||||||
|
|
||||||
self.current_state.set(WindowState::Zombie);
|
self.current_state.set(WindowState::Zombie);
|
||||||
*self.js_runtime.borrow_mut() = None;
|
*self.js_runtime.borrow_mut() = None;
|
||||||
*self.browser_context.borrow_mut() = None;
|
*self.browsing_context.borrow_mut() = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reflows the page unconditionally. This method will wait for the layout thread to complete
|
/// Reflows the page unconditionally. This method will wait for the layout thread to complete
|
||||||
|
@ -776,10 +776,10 @@ impl<'a> WindowHelpers for &'a Window {
|
||||||
self.window_size.set(Some(new_size));
|
self.window_size.set(Some(new_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init_browser_context(self, doc: &Document, frame_element: Option<&Element>) {
|
fn init_browsing_context(self, doc: &Document, frame_element: Option<&Element>) {
|
||||||
let mut browser_context = self.browser_context.borrow_mut();
|
let mut browsing_context = self.browsing_context.borrow_mut();
|
||||||
*browser_context = Some(BrowsingContext::new(doc, frame_element));
|
*browsing_context = Some(BrowsingContext::new(doc, frame_element));
|
||||||
(*browser_context).as_mut().unwrap().create_window_proxy();
|
(*browsing_context).as_mut().unwrap().create_window_proxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Commence a new URL load which will either replace this window or scroll to a fragment.
|
/// Commence a new URL load which will either replace this window or scroll to a fragment.
|
||||||
|
@ -955,14 +955,14 @@ impl<'a> WindowHelpers for &'a Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parent(self) -> Option<Root<Window>> {
|
fn parent(self) -> Option<Root<Window>> {
|
||||||
let browser_context = self.browser_context();
|
let browsing_context = self.browsing_context();
|
||||||
let browser_context = browser_context.as_ref().unwrap();
|
let browsing_context = browsing_context.as_ref().unwrap();
|
||||||
|
|
||||||
browser_context.frame_element().map(|frame_element| {
|
browsing_context.frame_element().map(|frame_element| {
|
||||||
let window = window_from_node(frame_element.r());
|
let window = window_from_node(frame_element.r());
|
||||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||||
let r = window.r();
|
let r = window.r();
|
||||||
let context = r.browser_context();
|
let context = r.browsing_context();
|
||||||
context.as_ref().unwrap().active_window()
|
context.as_ref().unwrap().active_window()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1006,7 +1006,7 @@ impl Window {
|
||||||
image_cache_task: image_cache_task,
|
image_cache_task: image_cache_task,
|
||||||
mem_profiler_chan: mem_profiler_chan,
|
mem_profiler_chan: mem_profiler_chan,
|
||||||
devtools_chan: devtools_chan,
|
devtools_chan: devtools_chan,
|
||||||
browser_context: DOMRefCell::new(None),
|
browsing_context: DOMRefCell::new(None),
|
||||||
performance: Default::default(),
|
performance: Default::default(),
|
||||||
navigation_start: time::get_time().sec as u64,
|
navigation_start: time::get_time().sec as u64,
|
||||||
navigation_start_precise: time::precise_time_ns() as f64,
|
navigation_start_precise: time::precise_time_ns() as f64,
|
||||||
|
|
|
@ -1394,7 +1394,7 @@ impl ScriptTask {
|
||||||
loader);
|
loader);
|
||||||
|
|
||||||
let frame_element = frame_element.r().map(|elem| ElementCast::from_ref(elem));
|
let frame_element = frame_element.r().map(|elem| ElementCast::from_ref(elem));
|
||||||
window.r().init_browser_context(document.r(), frame_element);
|
window.r().init_browsing_context(document.r(), frame_element);
|
||||||
|
|
||||||
// Create the root frame
|
// Create the root frame
|
||||||
page.set_frame(Some(Frame {
|
page.set_frame(Some(Frame {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue