- From: Kang-Hao (Kenny) Lu <kennyluck@w3.org>
- Date: Wed, 08 Feb 2012 23:08:43 +0800
- To: W3C HTML5 中文興趣小組 <public-html-ig-zh@w3.org>
http://dev.w3.org/csswg/css3-images/
3.2. Image Fallbacks and Annotations: the ‘image()’ notation
# So that authors can take advantage of CSS's forwards-compatible parsing
# rules to provide a fallback for image slices, implementations that
support
# the ‘image()’ notation must support the xywh=#,#,#,# form of media
# fragment identifiers for images. [MEDIA-FRAGS]
我認為要求實作備用圖片(image())的使用者代理必要實作媒體片段
(xywh=#,#,#,#)並不合理(當然如果瀏覽器商願意這樣我也管 不著),畢竟這
兩個本來是平行的功能。一個合理的作法是要求「實作備用圖片但不實作媒體片段
的使用者代理,在碰到 #xywh 的時候,需要將他視為是讀取失敗的圖片」。如果
要求改成這樣的話,Example 4 的
# background-image: url('swirl.png'); /* old UAs */
# background-image: image('sprites.png#xywh=10,30,60,20'); /* new UAs */
可以改成
| background-image: url('swirl.png'); /* old UAs */
| background-image: image('sprites.png#xywh=10,30,60,20',
'swirl.png'); /* 新 UAs:支不支援媒體片段都可 */
另外,image() 這裡可能要講一下取值用這個的時後,計算值怎麼處理。雖然比如
說描述 'background-image' 的表格[1]有這樣的東西:
# Computed value: as specified, but with URIs made absolute
但是以比較吹毛求疵的角度來說,他並沒有講說 image('swirl.png') 的計算值是
不是要變成 image('http://example.com/swirl.png'),因為在 CSS 2.1 裡
面,URI 只有是 url(xxx) 的樣式。當然這可能是 CSSOM 的問題。
(這節裡面有 image('http://example.com/swirl.png' ltr) ,如果要求橫豎排
共用 CSS[2] 的話,這裡應該要求一個 horizontal/vertical 什麼的,考慮到在
可預測的近來這個東西並不是那麼有需要,就先不管了...)
3.3. Using Elements as Images: the ‘element()’ notation
因為這幾天的草案裡面,element() 的語法從
<element-reference> = element( [<id-selector> | <identifier> ] )
變成
<element-reference> = element( <id-selector> )
也就是沒有 element(xxx) 了,都要用 element(#xxx)。這裡 Example 9、10、11
還沒更正。
例外,這節沒有提到當存在多個元素的 id 一樣的時候,element(#xxx) 是指第一
個元素。
(在 Firefox 下測試
data:text/html,<style>%23a {color:red;}</style><span
id="a">A</span><span id="a">B</span><p style="white-space:pre;
background-image: -moz-element(%23a);"> </p>
的確是用 A 作為背景,另外注意到 A、B 都是紅色的)
4. Gradients
# The two functions described in this section allow an author to specify
# such an image in a terse syntax
「two」→「four」
這裡既然 <linear-gradient> 有連結了,<radial-gradient>、<repeating-
linear-gradient> 和 <repeating-radial-gradient> 也應該有,已幫助閱讀。
# Gradients are a type of image, and can be used anywhere an image
# can, such as in the ‘background-image’ or ‘list-style-image’
properties.
這句話太重複了跟 Example 13 基本太重複了。
4.1.2. Linear Gradient Examples
Example 19
我看了好久才知道這是一個 <object> 而且可以捲動...(好像是編輯草案才有這
個問題)
4.2.3. Degenerate Radial Gradients
(這節我感覺有問題,不過不是很肯定,之後檢討)
4.3. Repeating Gradients: the ‘repeating-linear-gradient()’ and
‘repeating-radial-gradient()’ notations
Find the average color of the gradient 的其中一個連結只到 "find the
average color" 而已(我知道這很無聊...)
5.3. Default Concrete Object Size Resolution
# If the specified size has neither a definite width nor height, and
# has no additional contraints, the dimensions of the concrete
# object size are calculated as follows:
裡,直到
# 2. If the concrete object size is still missing a width or height, and
# the object has an intrinsic aspect ratio, the missing dimension is
# calculated from the present dimension and the intrinsic aspect
# ratio. Otherwise, the missing dimension is taken from the default
# object size.
裡,感覺最後一句話沒有提到內在大小的長寬都不存在的情形(漸層)。可能最後
一句話
「dimension」→「dimension(s)」就好了吧。
5.4. Sizing Objects: the ‘object-fit’ property
object-fit: none 敘述裡的 object sizing algorithm 沒有連結。
6.2. Orienting an Image on the Page: the ‘image-orientation’ property
# If the image itself is transformed in some way (for example, if the
# content of an element is provided by the ‘image()’ function with
# a directionality opposite the element's directionality), the image's
# transformation must be applied before ‘image-orientation’ is.
# As well, ‘image-orientation’ must be applied before any further
# transformation of the element, such as through CSS Transforms.
這段話邏輯不對吧,假如 'ltr' 'rtl' 鏡像轉換在 'image-orientation' 之前,
那 "as well" 應該是指 CSS Transforms 也在 'image-orientation' 之前吧?不
管怎麼樣,'ltr' 'rtl' 的鏡像轉換應該在 'image-orientation' 之後,畢竟
'image-orientation' 是錯誤校正用的屬性吧?
遲了 11 小時了,再來就是寫信。這點程度的遲交應該還算在可原諒的範圍之內吧 :p
[1] http://www.w3.org/TR/2011/CR-css3-background-20110215/#background-image
[2] http://lists.w3.org/Archives/Public/public-html-ig-zh/2011Apr/0068
此致
呂 康豪(Kenny), 中文興趣小組W3C連絡人
新浪微博: http://t.sina.com.cn/1950042164
Google+: https://plus.google.com/112088462407783855918/posts
Received on Wednesday, 8 February 2012 15:12:00 UTC