mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
stylo: Add support for <table> color quirk
MozReview-Commit-ID: 56IKARwfbhw
This commit is contained in:
parent
0392e58a2f
commit
1c23296d8a
6 changed files with 62 additions and 25 deletions
|
@ -209,6 +209,24 @@ impl ToComputedValue for specified::Color {
|
|||
specified::Color::MozHyperlinktext => to_rgba(pres_context.mLinkColor),
|
||||
specified::Color::MozActiveHyperlinktext => to_rgba(pres_context.mActiveLinkColor),
|
||||
specified::Color::MozVisitedHyperlinktext => to_rgba(pres_context.mVisitedLinkColor),
|
||||
specified::Color::InheritFromBodyQuirk => {
|
||||
use dom::TElement;
|
||||
use gecko_bindings::bindings::Gecko_GetBody;
|
||||
use gecko::wrapper::GeckoElement;
|
||||
let body = unsafe {
|
||||
Gecko_GetBody(pres_context)
|
||||
};
|
||||
if let Some(body) = body {
|
||||
let wrap = GeckoElement(body);
|
||||
let borrow = wrap.borrow_data();
|
||||
borrow.as_ref().unwrap()
|
||||
.styles().primary.values()
|
||||
.get_color()
|
||||
.clone_color()
|
||||
} else {
|
||||
to_rgba(pres_context.mDefaultColor)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,13 +257,10 @@ impl ToComputedValue for specified::CSSColor {
|
|||
|
||||
#[inline]
|
||||
fn from_computed_value(computed: &CSSColor) -> Self {
|
||||
specified::CSSColor {
|
||||
parsed: match *computed {
|
||||
CSSColor::RGBA(rgba) => specified::Color::RGBA(rgba),
|
||||
CSSColor::CurrentColor => specified::Color::CurrentColor,
|
||||
},
|
||||
authored: None,
|
||||
}
|
||||
(match *computed {
|
||||
CSSColor::RGBA(rgba) => specified::Color::RGBA(rgba),
|
||||
CSSColor::CurrentColor => specified::Color::CurrentColor,
|
||||
}).into()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue