You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[typed-om] Kill CSSResourceValue and CSSURLImageValue, remove all details from CSSImageValue, so it's just an opaque handle to an image, suitable for Custom Paint. Fixes#716.
{{CSSImageValue}} objects represent values for properties that take <<image>> productions,
2766
2708
for example 'background-image', 'list-style-image', and 'border-image-source'.
2767
2709
2768
-
If the {{CSSImageValue}}'s {{CSSResourceValue/state}}is "loaded",
2769
-
and the resource has an intrinsic width, height, or aspect ratio,
2770
-
then {{CSSImageValue/intrinsicWidth}}, {{CSSImageValue/intrinsicHeight}}, and {{CSSImageValue/intrinsicRatio}} must reflect the resource's corresponding value.
2771
-
In this case, {{CSSImageValue/intrinsicWidth}} and {{CSSImageValue/intrinsicHeight}} has units `px`.
2772
-
In all other cases, the attributes must be <code>null</code>.
2773
-
2774
-
Issue(186): Does the loading lifecycle need to be described here?
2710
+
Note: This object is intentionally opaque,
2711
+
and exposes no details of what kind of image it contains,
2712
+
or any aspect of the image.
2713
+
This is because having *something* to represent images is necessary for Custom Paint,
2714
+
but there are sufficient complexities in getting URL-handling and loading specified firmly
2715
+
that it's not realistically possible to specify in the timeline of this specification.
2716
+
This will be expanded on in future levels.
2775
2717
2776
-
{{CSSURLImageValue}} objects represent {{CSSImageValue}}s that match the <<url>> production. For these
2777
-
objects, the {{CSSURLImageValue/url}} attribute contains the URL that references the image.
2718
+
If a {{CSSImageValue}} object represents an <<image>> that involves a URL
2719
+
(such as ''url()'' or ''image()''),
2720
+
the handling of such values is identical to how CSS currently handles them.
2721
+
In particular, resolving relative URLs or fragment URLs
2722
+
has the same behavior as in normal CSS.
2778
2723
2779
-
<div algorithm>
2780
-
The <dfn constructor for=CSSURLImageValue>CSSURLImageValue(|url|)</dfn> constructor must,
2781
-
when called,
2782
-
perform the following steps:
2783
-
2784
-
1. Return a new {{CSSURLImageValue}}
2785
-
with its {{CSSURLImageValue/url}} internal slot
2786
-
set to |url|.
2787
-
</div>
2788
-
2789
-
<div algorithm="CSSURLImageValue.url">
2790
-
The getter for the <dfn attribute for=CSSURLImageValue>url</dfn> attribute
2791
-
of a {{CSSURLImageValue}} must return its {{CSSURLImageValue/url}} internal slot.
2724
+
<div class=example>
2725
+
For example, relative URLs are resolved against the URL of the stylesheet they're within
2726
+
(or the document's URL, if they're specified in a <{style}> element or <{html-global/style}> attribute).
2727
+
This resolution doesn't happen eagerly at parse-time,
2728
+
but at some currently-unspecified point during value computation.
2729
+
2730
+
Thus, if an element's style is set to ''background-image: url(foo);'',
2731
+
and that specified value is extracted via the Typed OM
2732
+
and then set on an element in a different document,
2733
+
both the source and destination elements
2734
+
will resolve the URL differently,
2735
+
as they provide different base URLs.
2736
+
2737
+
On the other hand,
2738
+
if the extracted value was a [=computed value=]
2739
+
(from {{computedStyleMap()}}),
2740
+
then it would already be resolved to an absolute URL,
2741
+
and thus would act identically no matter where you later set it to.
2742
+
(Unless it was a fragment URL,
2743
+
which CSS treats differently and never fully resolves,
2744
+
so it always resolves against the current document.)
0 commit comments