mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Remove dependency on servo_url (#31358)
In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
This commit is contained in:
parent
29e1dfe1e4
commit
9a6973d629
42 changed files with 236 additions and 144 deletions
|
@ -87,8 +87,10 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-body-background
|
||||
fn SetBackground(&self, input: DOMString) {
|
||||
let value =
|
||||
AttrValue::from_resolved_url(&document_from_node(self).base_url(), input.into());
|
||||
let value = AttrValue::from_resolved_url(
|
||||
&document_from_node(self).base_url().get_arc(),
|
||||
input.into(),
|
||||
);
|
||||
self.upcast::<Element>()
|
||||
.set_attribute(&local_name!("background"), value);
|
||||
}
|
||||
|
@ -123,6 +125,7 @@ impl HTMLBodyElementLayoutHelpers for LayoutDom<'_, HTMLBodyElement> {
|
|||
.get_attr_for_layout(&ns!(), &local_name!("background"))
|
||||
.and_then(AttrValue::as_resolved_url)
|
||||
.cloned()
|
||||
.map(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,9 +167,10 @@ impl VirtualMethods for HTMLBodyElement {
|
|||
local_name!("bgcolor") | local_name!("text") => {
|
||||
AttrValue::from_legacy_color(value.into())
|
||||
},
|
||||
local_name!("background") => {
|
||||
AttrValue::from_resolved_url(&document_from_node(self).base_url(), value.into())
|
||||
},
|
||||
local_name!("background") => AttrValue::from_resolved_url(
|
||||
&document_from_node(self).base_url().get_arc(),
|
||||
value.into(),
|
||||
),
|
||||
_ => self
|
||||
.super_type()
|
||||
.unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue