mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Cache computed styles objects display: none subtrees
This reuses our existing undisplayed style generation, but in a per-document rather than per-nsComputedDOMStyle object, which means that we can avoid re-resolving styles of elements in display: none subtrees much more often. This brings the test-case in the bug to par with other browsers or better, and is much simpler than the initial approach I tried back in the day. Differential Revision: https://phabricator.services.mozilla.com/D147547
This commit is contained in:
parent
39ac4840ee
commit
d1aeb3921b
3 changed files with 46 additions and 9 deletions
|
@ -411,6 +411,11 @@ impl Device {
|
|||
self.used_font_metrics.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
/// Returns whether visited styles are enabled.
|
||||
pub fn visited_styles_enabled(&self) -> bool {
|
||||
unsafe { bindings::Gecko_VisitedStylesEnabled(self.document()) }
|
||||
}
|
||||
|
||||
/// Returns the device pixel ratio.
|
||||
pub fn device_pixel_ratio(&self) -> Scale<f32, CSSPixel, DevicePixel> {
|
||||
let pc = match self.pres_context() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue