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
Copy file name to clipboardExpand all lines: UseCaseComparisons.md
+37-24Lines changed: 37 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -33,10 +33,10 @@ Assuming three image “breakpoints” intended to remain in sync with a media-q
33
33
```
34
34
35
35
**Extended `srcset`**
36
-
N/A
36
+
*N/A*
37
37
38
38
39
-
### Using relative units ###
39
+
### Relative units ###
40
40
Assuming three image “breakpoints” intended to remain in sync with a media-query-based layout specced in `em` units.
41
41
42
42
**`picture` Element**
@@ -50,7 +50,7 @@ Assuming three image “breakpoints” intended to remain in sync with a media-q
50
50
```
51
51
52
52
**Extended `srcset`**
53
-
N/A
53
+
*N/A*
54
54
55
55
Note: the `em` values above could be manually converted to `px` by the author to ensure that the image breakpoints are within a few pixels of the `em`-based layout media queries, resulting in:
56
56
@@ -60,10 +60,11 @@ Note: the `em` values above could be manually converted to `px` by the author to
60
60
61
61
While the `em`-based CSS layout will be reevaulated based on user zoom in all modern browsers (see http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/ for a description and functional example) and we can assume the same for the `em`-based image breakpoints, the `px`-based image breakpoints will fall out of sync with the layout when the user zooms in or out.
62
62
63
-
## Portait vs. Landscape Orientation ##
64
-
[ … ]
63
+
## Portait vs. Landscape Orientation ## ##
65
64
66
65
**`picture` Element**
66
+
Assuming the author simply wants to preform image source swapping based on a device’s orientation. This would likely see use in a standalone mobile site catering to specific devices or in a combination web/native app.
@@ -73,21 +74,12 @@ While the `em`-based CSS layout will be reevaulated based on user zoom in all mo
73
74
```
74
75
75
76
**Extended `srcset`**
76
-
N/A
77
+
*N/A*
77
78
78
79
79
80
## Display Density
80
81
The two proposals are functionally identical in terms of dealing with display density when independent of the “Viewport Sizes” use case:
81
82
82
-
**`picture` Element**
83
-
```
84
-
<picture>
85
-
<source srcset="image1.jpg, image2.jpg 2x">
86
-
<img src="image1.jpg" alt="">
87
-
</picture>
88
-
```
89
-
90
-
**Extended `srcset`**
91
83
```
92
84
<img src="image1.jpg" srcset="image2.jpg 2x">
93
85
```
@@ -126,7 +118,8 @@ Assuming two image sources indended for display on screen depending on window si
126
118
```
127
119
128
120
**Extended `srcset`**
129
-
N/A
121
+
*N/A*
122
+
130
123
131
124
## Color saturation/high-contrast mode
132
125
This is based on the high-contrast mode and ambient light media queries currently being proposed in the CSS WG.
@@ -141,26 +134,46 @@ This is based on the high-contrast mode and ambient light media queries currentl
141
134
```
142
135
143
136
**Extended `srcset`**
144
-
N/A
137
+
*N/A*
145
138
146
139
147
-
## Potential for addressing bandwidth concerns
140
+
## Potential for addressing bandwidth concerns ##
141
+
[[ TODO: `srcset` as suggestion overrideable by UA, in both cases. Seperation of concerns (“art direction” vs. density cases) may make this simpler with `picture`, see writeup in http://www.w3.org/community/respimg/2012/06/18/florians-compromise/]]
148
142
149
143
150
-
## Potential for future accessibility improvements
144
+
## Potential for future accessibility improvements ##
151
145
146
+
Both patterns are functionally identical in terms of _short_ descriptive text, though authoring differs. The `picture` pattern will allow fallback content to serve as the content exposed to assistive technologies (in this case, the fallback `img` alt tag would be used), while the extended `srcset` syntax would rely on the `img` element’s `alt` attribute.
Further discussion: <ahref="http://lists.w3.org/Archives/Public/public-html/2012Sep/0029.html">http://lists.w3.org/Archives/Public/public-html/2012Sep/0029.html</a>
0 commit comments