mirror of
https://github.com/servo/servo.git
synced 2025-08-14 09:55:35 +01:00
Auto merge of #17092 - heycam:document-colors, r=xidorn
style: Add support for disabled document colors. Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1355716. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17092) <!-- Reviewable:end -->
This commit is contained in:
commit
43862ba045
15 changed files with 103 additions and 13 deletions
|
@ -6,9 +6,10 @@
|
|||
|
||||
use app_units::Au;
|
||||
use context::QuirksMode;
|
||||
use cssparser::{CssStringWriter, Parser, Token};
|
||||
use cssparser::{CssStringWriter, Parser, RGBA, Token};
|
||||
use euclid::Size2D;
|
||||
use font_metrics::get_metrics_provider_for_product;
|
||||
use gecko::values::convert_nscolor_to_rgba;
|
||||
use gecko_bindings::bindings;
|
||||
use gecko_bindings::structs::{nsCSSKeyword, nsCSSProps_KTableEntry, nsCSSValue, nsCSSUnit, nsStringBuffer};
|
||||
use gecko_bindings::structs::{nsMediaExpression_Range, nsMediaFeature};
|
||||
|
@ -134,6 +135,16 @@ impl Device {
|
|||
Au((*self.pres_context).mVisibleArea.height))
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns whether document colors are enabled.
|
||||
pub fn use_document_colors(&self) -> bool {
|
||||
unsafe { (*self.pres_context).mUseDocumentColors() != 0 }
|
||||
}
|
||||
|
||||
/// Returns the default background color.
|
||||
pub fn default_background_color(&self) -> RGBA {
|
||||
convert_nscolor_to_rgba(unsafe { (*self.pres_context).mBackgroundColor })
|
||||
}
|
||||
}
|
||||
|
||||
/// A expression for gecko contains a reference to the media feature, the value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue