mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -709,15 +709,9 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
};
|
||||
|
||||
if let Some(color) = bgcolor {
|
||||
use style::color::parsing::FromParsedColor;
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::BackgroundColor(specified::Color::from_rgba(
|
||||
color.red,
|
||||
color.green,
|
||||
color.blue,
|
||||
color.alpha,
|
||||
)),
|
||||
PropertyDeclaration::BackgroundColor(specified::Color::from_absolute_color(color)),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -749,11 +743,10 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
};
|
||||
|
||||
if let Some(color) = color {
|
||||
use style::color::parsing::FromParsedColor;
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::Color(longhands::color::SpecifiedValue(
|
||||
specified::Color::from_rgba(color.red, color.green, color.blue, color.alpha),
|
||||
specified::Color::from_absolute_color(color),
|
||||
)),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -7,7 +7,7 @@ use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
|||
use js::rust::HandleObject;
|
||||
use servo_atoms::Atom;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
use style::str::{read_numbers, HTML_SPACE_CHARACTERS};
|
||||
|
||||
use crate::dom::attr::Attr;
|
||||
|
@ -107,13 +107,13 @@ impl VirtualMethods for HTMLFontElement {
|
|||
}
|
||||
|
||||
pub trait HTMLFontElementLayoutHelpers {
|
||||
fn get_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_color(self) -> Option<AbsoluteColor>;
|
||||
fn get_face(self) -> Option<Atom>;
|
||||
fn get_size(self) -> Option<u32>;
|
||||
}
|
||||
|
||||
impl HTMLFontElementLayoutHelpers for LayoutDom<'_, HTMLFontElement> {
|
||||
fn get_color(self) -> Option<RgbaLegacy> {
|
||||
fn get_color(self) -> Option<AbsoluteColor> {
|
||||
self.upcast::<Element>()
|
||||
.get_attr_for_layout(&ns!(), &local_name!("color"))
|
||||
.and_then(AttrValue::as_color)
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom_struct::dom_struct;
|
|||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLHRElementBinding::HTMLHRElementMethods;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
|
@ -70,12 +70,12 @@ impl HTMLHRElementMethods for HTMLHRElement {
|
|||
}
|
||||
|
||||
pub trait HTMLHRLayoutHelpers {
|
||||
fn get_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_color(self) -> Option<AbsoluteColor>;
|
||||
fn get_width(self) -> LengthOrPercentageOrAuto;
|
||||
}
|
||||
|
||||
impl HTMLHRLayoutHelpers for LayoutDom<'_, HTMLHRElement> {
|
||||
fn get_color(self) -> Option<RgbaLegacy> {
|
||||
fn get_color(self) -> Option<AbsoluteColor> {
|
||||
self.upcast::<Element>()
|
||||
.get_attr_for_layout(&ns!(), &local_name!("color"))
|
||||
.and_then(AttrValue::as_color)
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom_struct::dom_struct;
|
|||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
use style::context::QuirksMode;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableCellElementBinding::HTMLTableCellElementMethods;
|
||||
|
@ -106,7 +106,7 @@ impl HTMLTableCellElementMethods for HTMLTableCellElement {
|
|||
}
|
||||
|
||||
pub trait HTMLTableCellElementLayoutHelpers<'dom> {
|
||||
fn get_background_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_background_color(self) -> Option<AbsoluteColor>;
|
||||
fn get_colspan(self) -> Option<u32>;
|
||||
fn get_rowspan(self) -> Option<u32>;
|
||||
fn get_table(self) -> Option<LayoutDom<'dom, HTMLTableElement>>;
|
||||
|
@ -114,7 +114,7 @@ pub trait HTMLTableCellElementLayoutHelpers<'dom> {
|
|||
}
|
||||
|
||||
impl<'dom> HTMLTableCellElementLayoutHelpers<'dom> for LayoutDom<'dom, HTMLTableCellElement> {
|
||||
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)
|
||||
|
|
|
@ -8,7 +8,7 @@ use dom_struct::dom_struct;
|
|||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::{parse_unsigned_integer, AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
|
||||
use crate::dom::attr::Attr;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollectionMethods;
|
||||
|
@ -438,7 +438,7 @@ impl HTMLTableElementMethods for HTMLTableElement {
|
|||
}
|
||||
|
||||
pub trait HTMLTableElementLayoutHelpers {
|
||||
fn get_background_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_background_color(self) -> Option<AbsoluteColor>;
|
||||
fn get_border(self) -> Option<u32>;
|
||||
fn get_cellpadding(self) -> Option<u32>;
|
||||
fn get_cellspacing(self) -> Option<u32>;
|
||||
|
@ -446,7 +446,7 @@ pub trait HTMLTableElementLayoutHelpers {
|
|||
}
|
||||
|
||||
impl HTMLTableElementLayoutHelpers for LayoutDom<'_, HTMLTableElement> {
|
||||
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)
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom_struct::dom_struct;
|
|||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableRowElementBinding::HTMLTableRowElementMethods;
|
||||
|
@ -153,11 +153,11 @@ impl HTMLTableRowElementMethods for HTMLTableRowElement {
|
|||
}
|
||||
|
||||
pub trait HTMLTableRowElementLayoutHelpers {
|
||||
fn get_background_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_background_color(self) -> Option<AbsoluteColor>;
|
||||
}
|
||||
|
||||
impl HTMLTableRowElementLayoutHelpers for LayoutDom<'_, HTMLTableRowElement> {
|
||||
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)
|
||||
|
|
|
@ -6,7 +6,7 @@ use dom_struct::dom_struct;
|
|||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::AbsoluteColor;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding::HTMLTableSectionElementMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||
|
@ -91,11 +91,11 @@ impl HTMLTableSectionElementMethods for HTMLTableSectionElement {
|
|||
}
|
||||
|
||||
pub trait HTMLTableSectionElementLayoutHelpers {
|
||||
fn get_background_color(self) -> Option<RgbaLegacy>;
|
||||
fn get_background_color(self) -> Option<AbsoluteColor>;
|
||||
}
|
||||
|
||||
impl HTMLTableSectionElementLayoutHelpers for LayoutDom<'_, HTMLTableSectionElement> {
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue