mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Upgrade Stylo to 2024-03-01 (#32089)
* Upgrade Stylo to 2024-03-01 * Fixup for https://bugzil.la/1882754 * Update test expectations
This commit is contained in:
parent
0678136b17
commit
f5bdfdfe94
33 changed files with 290 additions and 302 deletions
|
@ -8,7 +8,7 @@ use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
|||
use js::rust::HandleObject;
|
||||
use servo_url::ServoUrl;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
|
||||
use crate::dom::attr::Attr;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLBodyElementBinding::HTMLBodyElementMethods;
|
||||
|
@ -100,20 +100,20 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
|
|||
}
|
||||
|
||||
pub trait HTMLBodyElementLayoutHelpers {
|
||||
fn get_background_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_background_color(self) -> Option<AbsoluteColor>;
|
||||
fn get_color(self) -> Option<AbsoluteColor>;
|
||||
fn get_background(self) -> Option<ServoUrl>;
|
||||
}
|
||||
|
||||
impl HTMLBodyElementLayoutHelpers for LayoutDom<'_, HTMLBodyElement> {
|
||||
fn get_background_color(self) -> Option<RgbaLegacy> {
|
||||
fn get_background_color(self) -> Option<AbsoluteColor> {
|
||||
self.upcast::<Element>()
|
||||
.get_attr_for_layout(&ns!(), &local_name!("bgcolor"))
|
||||
.and_then(AttrValue::as_color)
|
||||
.cloned()
|
||||
}
|
||||
|
||||
fn get_color(self) -> Option<RgbaLegacy> {
|
||||
fn get_color(self) -> Option<AbsoluteColor> {
|
||||
self.upcast::<Element>()
|
||||
.get_attr_for_layout(&ns!(), &local_name!("text"))
|
||||
.and_then(AttrValue::as_color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue