mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
style: Don't look for viewport units in stylesheets.
Use whether we've computed any viewport unit instead. This is more accurate (we avoid restyling unnecessarily if we've found anything ever on the stylesheet, but that hasn't matched). This has the benefit of also matching Gecko, and simplify some code and fishyness around, and also hopefully speeding up stylesheet parsing.
This commit is contained in:
parent
97338d0e84
commit
15e71c5670
10 changed files with 39 additions and 66 deletions
|
@ -127,9 +127,9 @@ impl<'a> Context<'a> {
|
|||
self.builder.device
|
||||
}
|
||||
|
||||
/// The current viewport size.
|
||||
pub fn viewport_size(&self) -> Size2D<Au> {
|
||||
self.builder.device.au_viewport_size()
|
||||
/// The current viewport size, used to resolve viewport units.
|
||||
pub fn viewport_size_for_viewport_unit_resolution(&self) -> Size2D<Au> {
|
||||
self.builder.device.au_viewport_size_for_viewport_unit_resolution()
|
||||
}
|
||||
|
||||
/// The default computed style we're getting our reset style from.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue