Struct style::servo::url::SpecifiedUrl [] [src]

pub struct SpecifiedUrl { /* fields omitted */ }

A specified url() value for servo.

Servo eagerly resolves SpecifiedUrls, which it can then take advantage of when computing values. In contrast, Gecko uses a different URL backend, so eagerly resolving with rust-url would be duplicated work.

However, this approach is still not necessarily optimal: See https://bugzilla.mozilla.org/show_bug.cgi?id=1347435#c6

Methods

impl SpecifiedUrl
[src]

[src]

Try to parse a URL from a string value that is a valid CSS token for a URL. Never fails - the API is only fallible to be compatible with the gecko version.

[src]

Returns true if the URL is definitely invalid. For Servo URLs, we can use its |resolved| status.

[src]

Returns true if this URL looks like a fragment. See https://drafts.csswg.org/css-values/#local-urls

Since Servo currently stores resolved URLs, this is hard to implement. We either need to change servo to lazily resolve (like Gecko), or note this information in the tokenizer.

[src]

Returns the resolved url if it was valid.

[src]

Return the resolved url as string, or the empty string if it's invalid.

TODO(emilio): Should we return the original one if needed?

[src]

Creates an already specified url value from an already resolved URL for insertion in the cascade.

[src]

Gets a new url from a string for unit tests.

Trait Implementations

impl Clone for SpecifiedUrl
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for SpecifiedUrl
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for SpecifiedUrl
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

impl PartialEq for SpecifiedUrl
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl ToCss for SpecifiedUrl
[src]

[src]

Serialize self in CSS syntax, writing to dest.

[src]

Serialize self in CSS syntax and return a string. Read more

impl ToComputedValue for SpecifiedUrl
[src]

The computed value type we're going to be converted to.

[src]

Convert a specified value to a computed value, using itself and the data inside the Context. Read more

[src]

Convert a computed value to specified value form. Read more

impl AnimatedValueAsComputed for SpecifiedUrl
[src]

impl Parse for SpecifiedUrl
[src]

[src]

Parse a value of this type. Read more

impl Eq for SpecifiedUrl
[src]