mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
f220d6d3a5
commit
c94d909a86
585 changed files with 5411 additions and 5013 deletions
|
@ -22,13 +22,13 @@ use crate::dom::document::Document;
|
|||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
pub enum MediaQueryListMatchState {
|
||||
pub(crate) enum MediaQueryListMatchState {
|
||||
Same,
|
||||
Changed,
|
||||
}
|
||||
|
||||
#[dom_struct]
|
||||
pub struct MediaQueryList {
|
||||
pub(crate) struct MediaQueryList {
|
||||
eventtarget: EventTarget,
|
||||
document: Dom<Document>,
|
||||
#[no_trace]
|
||||
|
@ -46,7 +46,7 @@ impl MediaQueryList {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(document: &Document, media_query_list: MediaList) -> DomRoot<MediaQueryList> {
|
||||
pub(crate) fn new(document: &Document, media_query_list: MediaList) -> DomRoot<MediaQueryList> {
|
||||
reflect_dom_object(
|
||||
Box::new(MediaQueryList::new_inherited(document, media_query_list)),
|
||||
document.window(),
|
||||
|
@ -56,7 +56,7 @@ impl MediaQueryList {
|
|||
}
|
||||
|
||||
impl MediaQueryList {
|
||||
pub fn evaluate_changes(&self) -> MediaQueryListMatchState {
|
||||
pub(crate) fn evaluate_changes(&self) -> MediaQueryListMatchState {
|
||||
let matches = self.evaluate();
|
||||
|
||||
let result = if let Some(old_matches) = self.last_match_state.get() {
|
||||
|
@ -73,7 +73,7 @@ impl MediaQueryList {
|
|||
result
|
||||
}
|
||||
|
||||
pub fn evaluate(&self) -> bool {
|
||||
pub(crate) fn evaluate(&self) -> bool {
|
||||
let quirks_mode = self.document.quirks_mode();
|
||||
self.media_query_list
|
||||
.evaluate(self.document.window().layout().device(), quirks_mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue