style: Add ability to clear and rebuild individual origins.

This commit is contained in:
Cameron McCormack 2017-08-12 17:15:44 +08:00
parent 72107eb838
commit f3a7adfcc7
2 changed files with 72 additions and 12 deletions

View file

@ -17,7 +17,7 @@ use properties::ComputedValues;
use servo_arc::Arc;
use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard};
use stylesheet_set::StylesheetSet;
use stylesheets::{PerOrigin, StylesheetContents, StylesheetInDocument};
use stylesheets::{Origin, PerOrigin, StylesheetContents, StylesheetInDocument};
use stylist::{ExtraStyleData, Stylist};
/// Little wrapper to a Gecko style sheet.
@ -193,6 +193,11 @@ impl PerDocumentStyleDataImpl {
self.stylist.clear();
}
/// Clear the stylist's data for the specified origin.
pub fn clear_stylist_origin(&mut self, origin: &Origin) {
self.stylist.clear_origin(origin);
}
/// Returns whether visited links are enabled.
fn visited_links_enabled(&self) -> bool {
unsafe { bindings::Gecko_AreVisitedLinksEnabled() }