mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Rename nsIDocument to mozilla::dom::Document.
Summary: Really sorry for the size of the patch. It's mostly automatic s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to add the right namespacing and such. Overall it's not a very interesting patch I think. nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and nsIDocumentInlines.h into DocumentInlines.h. I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it. While fixing up some of the bits I also removed some unneeded OwnerDoc() null checks and such, but I didn't do anything riskier than that. Bug: 1517241 Reviewed-by: smaug
This commit is contained in:
parent
274845fc14
commit
a454f6233d
4 changed files with 12 additions and 13 deletions
|
@ -144,7 +144,7 @@ bitflags! {
|
|||
/// Event-based document states.
|
||||
///
|
||||
/// NB: Is important for this to remain in sync with Gecko's
|
||||
/// dom/base/nsIDocument.h.
|
||||
/// dom/base/Document.h.
|
||||
#[derive(MallocSizeOf)]
|
||||
pub struct DocumentState: u64 {
|
||||
/// RTL locale: specific to the XUL localedir attribute
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
use crate::context::QuirksMode;
|
||||
use crate::dom::TElement;
|
||||
use crate::gecko_bindings::bindings::{self, RawServoStyleSet};
|
||||
use crate::gecko_bindings::structs::StyleSheet as DomStyleSheet;
|
||||
use crate::gecko_bindings::structs::{nsIDocument, StyleSheetInfo};
|
||||
use crate::gecko_bindings::structs::{StyleSheet as DomStyleSheet, StyleSheetInfo};
|
||||
use crate::gecko_bindings::structs::{RawGeckoPresContextBorrowed, ServoStyleSetSizes};
|
||||
use crate::gecko_bindings::sugar::ownership::{HasArcFFI, HasBoxFFI, HasFFI, HasSimpleFFI};
|
||||
use crate::invalidation::media_queries::{MediaListKey, ToMediaListKey};
|
||||
|
@ -152,7 +151,7 @@ impl PerDocumentStyleData {
|
|||
//
|
||||
// Should we just force XBL Stylists to be NoQuirks?
|
||||
let quirks_mode =
|
||||
unsafe { (*device.pres_context().mDocument.raw::<nsIDocument>()).mCompatMode };
|
||||
unsafe { (*device.pres_context().mDocument.mRawPtr).mCompatMode };
|
||||
|
||||
PerDocumentStyleData(AtomicRefCell::new(PerDocumentStyleDataImpl {
|
||||
stylist: Stylist::new(device, quirks_mode.into()),
|
||||
|
@ -198,7 +197,7 @@ impl PerDocumentStyleDataImpl {
|
|||
.device()
|
||||
.pres_context()
|
||||
.mDocument
|
||||
.raw::<nsIDocument>();
|
||||
.mRawPtr;
|
||||
unsafe { bindings::Gecko_VisitedStylesEnabled(doc) }
|
||||
}
|
||||
|
||||
|
|
|
@ -162,8 +162,8 @@ impl Device {
|
|||
|
||||
/// Gets the document pointer.
|
||||
#[inline]
|
||||
pub fn document(&self) -> *mut structs::nsIDocument {
|
||||
self.pres_context().mDocument.raw::<structs::nsIDocument>()
|
||||
pub fn document(&self) -> *mut structs::Document {
|
||||
self.pres_context().mDocument.mRawPtr
|
||||
}
|
||||
|
||||
/// Recreates the default computed values.
|
||||
|
|
|
@ -45,7 +45,7 @@ use crate::gecko_bindings::bindings::{Gecko_ElementState, Gecko_GetDocumentLWThe
|
|||
use crate::gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
|
||||
use crate::gecko_bindings::structs;
|
||||
use crate::gecko_bindings::structs::nsChangeHint;
|
||||
use crate::gecko_bindings::structs::nsIDocument_DocumentTheme as DocumentTheme;
|
||||
use crate::gecko_bindings::structs::Document_DocumentTheme as DocumentTheme;
|
||||
use crate::gecko_bindings::structs::nsRestyleHint;
|
||||
use crate::gecko_bindings::structs::EffectCompositor_CascadeLevel as CascadeLevel;
|
||||
use crate::gecko_bindings::structs::ELEMENT_HANDLED_SNAPSHOT;
|
||||
|
@ -107,9 +107,9 @@ fn elements_with_id<'a, 'le>(
|
|||
}
|
||||
}
|
||||
|
||||
/// A simple wrapper over `nsIDocument`.
|
||||
/// A simple wrapper over `Document`.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct GeckoDocument<'ld>(pub &'ld structs::nsIDocument);
|
||||
pub struct GeckoDocument<'ld>(pub &'ld structs::Document);
|
||||
|
||||
impl<'ld> TDocument for GeckoDocument<'ld> {
|
||||
type ConcreteNode = GeckoNode<'ld>;
|
||||
|
@ -121,7 +121,7 @@ impl<'ld> TDocument for GeckoDocument<'ld> {
|
|||
|
||||
#[inline]
|
||||
fn is_html_document(&self) -> bool {
|
||||
self.0.mType == structs::root::nsIDocument_Type::eHTML
|
||||
self.0.mType == structs::Document_Type::eHTML
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
@ -1242,11 +1242,11 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
}
|
||||
|
||||
fn owner_doc_matches_for_testing(&self, device: &Device) -> bool {
|
||||
self.as_node().owner_doc().0 as *const structs::nsIDocument ==
|
||||
self.as_node().owner_doc().0 as *const structs::Document ==
|
||||
device
|
||||
.pres_context()
|
||||
.mDocument
|
||||
.raw::<structs::nsIDocument>()
|
||||
.mRawPtr
|
||||
}
|
||||
|
||||
fn style_attribute(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue