style: Implement the body text color quirk in a more straight-forward way.

This avoids grabbing the document when values that inherit from the body,
whatever that means, aren't under the body.

In that case we'll get a semi-random value, but that's also mishandled by Gecko
anyways (and probably Blink, though haven't tested), and doesn't really make
much sense.
This commit is contained in:
Emilio Cobos Álvarez 2017-09-15 10:09:19 +02:00
parent 04e1f599d8
commit 8c3c56909e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 76 additions and 22 deletions

View file

@ -92,6 +92,13 @@ impl Device {
self.root_font_size.store(size.0 as isize, Ordering::Relaxed)
}
/// Sets the body text color for the "inherit color from body" quirk.
///
/// https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk
pub fn set_body_text_color(&self, _color: RGBA) {
// Servo doesn't implement this quirk (yet)
}
/// Returns whether we ever looked up the root font size of the Device.
pub fn used_root_font_size(&self) -> bool {
self.used_root_font_size.load(Ordering::Relaxed)