style: Add a style flag for the root element style.

This is needed to make the root element not a containing block in presence of
filters or what not.

Differential Revision: https://phabricator.services.mozilla.com/D61167
This commit is contained in:
Emilio Cobos Álvarez 2020-01-31 14:51:06 +00:00
parent f426b644ca
commit 16fd7cad0c
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
13 changed files with 37 additions and 46 deletions

View file

@ -126,9 +126,6 @@ pub mod url;
/// A `Context` is all the data a specified value could ever need to compute
/// itself and be transformed to a computed value.
pub struct Context<'a> {
/// Whether the current element is the root element.
pub is_root_element: bool,
/// Values accessed through this need to be in the properties "computed
/// early": color, text-decoration, font-size, display, position, float,
/// border-*-style, outline-style, font-family, writing-mode...
@ -187,7 +184,6 @@ impl<'a> Context<'a> {
let provider = get_metrics_provider_for_product();
let context = Context {
is_root_element: false,
builder: StyleBuilder::for_inheritance(device, None, None),
font_metrics_provider: &provider,
cached_system_font: None,
@ -201,11 +197,6 @@ impl<'a> Context<'a> {
f(&context)
}
/// Whether the current element is the root element.
pub fn is_root_element(&self) -> bool {
self.is_root_element
}
/// The current device.
pub fn device(&self) -> &Device {
self.builder.device