[go: nahoru, domu]

Skip to content

Commit

Permalink
[css-values] Specify that 0 parses as a <number> if …他
Browse files Browse the repository at this point in the history
Specify that 0 parses as a <number> if it's ambiguous whether it's a
<number> or <length>.
Fixes w3c/csswg-drafts#489 .
w3c/csswg-drafts@b6b1b24b6cf0440adafd78ff5b9f1
b65ecd26d7c

Remove ability for percentages to resolve against numbers. Fixes
w3c/csswg-drafts#1463 .
w3c/csswg-drafts@f2b85b3b1d655b03c137ca2ce31a4
cbcf1c1fdf2
  • Loading branch information
triple-underscore committed Jun 10, 2017
1 parent fe69d25 commit a34f0ea
Showing 1 changed file with 75 additions and 26 deletions.
101 changes: 75 additions & 26 deletions css-values-ja.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
数値式:numeric expression:~
切詰めら:clamp :切り詰めら
代数的:algebraic:~
代数:algebra:~
簡約-:reduce:~
関数:function:~
関数記法:functional notation:~
Expand Down Expand Up @@ -606,7 +607,12 @@
共通的な:common :よくある
依拠-:rely:~
要件:requirements:~
もたらす:create
有意:significant:~
問題:problem:~
提供-:provide:~
実際の:actual:~
一致:identical
もたらす:create/cause
ほぼ確実にalmost certain
同様に:Likewise
編集上の:editorial
Expand Down Expand Up @@ -635,6 +641,7 @@
中央寄せに:center:~
中央:center:~
長さ:length:~
長さの様なもの:length-like
区画:area:~
横幅:width:~
縦幅:height:~
Expand Down Expand Up @@ -846,6 +853,8 @@
括っている/括る:wrapper
前置され:precede :~
異なる:different/differs
なる:become
であり続ける:stay as

●未分類
obj:object::オブジェクト
Expand Down Expand Up @@ -904,17 +913,19 @@
外側:outside:~
角括弧で括られ:bracketed
出力:output:~
新たな:new:~
単独の:single:~
段落:paragraph
一意:unique:~
一時的:temporary:~
正確:exact:~
精確:precise:~
平均:average:~
個数 count
変形-:transform:~
:altho
並び:sequence

実際の:actual:~
新たな:new:~
単独の:single:~
~~素の:bare
:form
当の:in question
Expand All @@ -937,7 +948,6 @@
:side
代わりに:instead
同じ:same
並び:sequence
別の:another
容易に:easily
-:capacity
Expand All @@ -948,6 +958,13 @@
位置により多義的になるようなpositionally-ambiguous
突然/いきなり:suddenly:~
他の:cross-
その:that
そのような:such
決して:never
常に:always
過ぎない:just
少数:few
具体的には:specifically
</script>

<!--%links
Expand Down Expand Up @@ -1036,6 +1053,7 @@
p.font:~CSSFONT#propdef-font
p.font-size:~CSSFONT#propdef-font-size
p.line-height:~CSS2VISUDET#propdef-line-height
p.tab-size:~CSSTEXT#propdef-tab-size

p.writing-mode:~CSSWM#propdef-writing-mode
p.text-orientation:~CSSWM#propdef-text-orientation
Expand Down Expand Up @@ -1292,7 +1310,7 @@ <h1>CSS Values and Units Module Level 4 日本語訳</h1>
</p>

<p>
更新:<time>2017-05-04</time>
更新:<time>2017-06-11</time>
(公開:<time>2012-07-17</time>
</p>

Expand All @@ -1309,7 +1327,7 @@ <h1>CSS Values and Units Module Level 4 日本語訳</h1>
<a href="https://www.w3.org/" id="_W3C">W3C</a>
<hgroup>
<h1>CSS の値と単位 — CSS Values and Units Module Level 4</h1>
<h2>2017 年 53 日付 W3C 編集者草案</h2>
<h2>2017 年 610 日付 W3C 編集者草案</h2>
</hgroup>

<dl id="_versions">
Expand Down Expand Up @@ -1597,7 +1615,7 @@ <h3 title="Component value types">2.1. 成分~値の型</h3>
したがって、一般に,同じ宣言の中で これらの~keywordが他の成分~値と組合わされた場合、その宣言は無効になる。
例えば
<samp class="css">`background$p: `url(corner.png) no-repeat, inherit^v;</samp>
は、無効である
は、無効になる
Note: This implies that, in general, combining these keywords with other component values in the same declaration results in an invalid declaration. For example, background: url(corner.png) no-repeat, inherit; is invalid.
</p>
Expand Down Expand Up @@ -2734,10 +2752,19 @@ <h2 title="Distance Units: the &lt;length&gt; type">5. 距離の単位: `lengt
`length@t
で表される。
長さは 何らかの`次元$による量である。
Lengths refer to distance measurements and are denoted by &lt;length&gt; in the property definitions. A length is a dimension.
</p>

<p>
長さが~zeroのときは単位~識別子を省略できる(すなわち,構文的には
`number$t の `0^v として表現し得る)。
ただし、~propにおいて `0^v が
`number$t, `length$t
のどちらにも構文解析できる場合( `line-height$p など)、
`number$t として構文解析され~MUST。
Lengths refer to distance measurements and are denoted by &lt;length&gt; in the property definitions. A length is a dimension. However, for zero lengths the unit identifier is optional (i.e. can be syntactically represented as the &lt;number&gt; 0).
For zero lengths the unit identifier is optional (i.e. can be syntactically represented as the &lt;number&gt; 0). However, if a 0 could be parsed as either a &lt;number&gt; or a &lt;length&gt; in a property (such as line-height), it must parse as a &lt;number&gt;.
</p>

<p>
Expand Down Expand Up @@ -4004,7 +4031,7 @@ <h4 title="Type Checking">8.1.2. 型検査</h4>
`integer$t
`解決型$は、式が置かれている場所で妥当な型で~MUST。
他の場合、その式は無効である
他の場合、その式は無効になる
式の`解決型$は、式に含まれている値の型により決定される。
`number-token$P は、
`number$t または `integer$t
Expand Down Expand Up @@ -4032,17 +4059,14 @@ <h4 title="Type Checking">8.1.2. 型検査</h4>
</p>

<p>
百分率が受容される文脈に置かれた式 の中の
`percentage-token$P
の値~型は,その百分率が相対基準にしているそれになる。
例えば、 `width$p ~propにおける百分率は `length$t 型になり,
`opacity$p においては `number$t 型になる。
百分率を受容する文脈に置かれた式の中の `percentage-token$P の値~型は、その文脈が定義する百分率の相対基準が別の `number$t 以外の型であるならば、その型になる。
例えば、 `width$p ~propにおける百分率は `length$t 型になる。
百分率は、それを用いる文脈において[
`percentage$t 値が,他のどの型とも 使用値として互換でない
]場合に限り, `percentage$t 型になる。
百分率が通常は許容されないような所では、その文脈においては,百分率を含んでいる `calc$f 式は無効になる。
百分率は通常は許容されない文脈においては、百分率を含んでいる `calc$f 式は無効になる。
If percentages are accepted in the context in which the expression is placed, a &lt;percentage-token&gt; has the type of the value that percentages are relative to. For example, in the width property, percentages have the &lt;length&gt; type, and in opacity they have the &lt;number&gt; type. A percentage only has the &lt;percentage&gt; type if in that context &lt;percentage&gt; values are not used-value compatible with any other type. If percentages are not normally allowed in place of the calc(), then a calc() expression containing percentages is invalid in that context.
If percentages are accepted in the context in which the expression is placed, and they are defined to be relative to another type besides &lt;number&gt;, a &lt;percentage-token&gt; is treated as that type. For example, in the width property, percentages have the &lt;length&gt; type. A percentage only has the &lt;percentage&gt; type if in that context &lt;percentage&gt; values are not used-value compatible with any other type. If percentages are not normally allowed in place of the calc(), then a calc() expression containing percentages is invalid in that context.
</p>

<p>
Expand All @@ -4054,6 +4078,29 @@ <h4 title="Type Checking">8.1.2. 型検査</h4>
Operators form sub-expressions, which gain types based on their arguments. To make expressions simpler, operators have restrictions on the types they accept. At each operator, the types of the left and right argument are checked for these restrictions. If compatible, the type resolves as described below (the following ignores precedence rules on the operators for simplicity):
</p>

<p class="note">注記:
`number$t に相対的な `percentage$t
— `opacity$p におけるそれなど —
は、 `calc$f 内では許容されないことに注意。
これを許容すると,( `dimension$t の乗算や除算を許容するための) “単位~代数” に有意な問題をもたらすことになるので。
どの事例においても,それが新たな機能性を提供することはない。
(例えば
<samp class="css">`opacity^p: `25%^v</samp>
は,
<samp class="css">`opacity^p: `.25^v</samp>
に一致する
— それは自明な構文~変形-に過ぎない。)
Note: Note that &lt;percentage&gt;s relative to &lt;number&gt;s, such as in opacity, are not allowed in calc(). Allowing this would cause significant problems with "unit algebra" (allowing multiplication/division of &lt;dimension&gt;s), and in every case so far, doesn’t provide any new functionality. (For example, opacity: 25% is identical to opacity: .25; it’s just a trivial syntax transform.)
</p>

<p class="note">注記:
~~素の `number$t が使用値の時点で `length$t になるような~propも少数あるが(具体的には `line-height$p / `tab-size$p )、
`number$t は, `calc$f 内では決して “長さの様なもの” にはならず、常に `number$t であり続ける。
Note: Altho there are a few properties in which a bare &lt;number&gt; becomes a &lt;length&gt; at used-value time (specifically, line-height and tab-size), &lt;number&gt;s never become "length-like" in calc(). They always stay as &lt;number&gt;s.
</p>

<ul>
<li>
`+^css,
Expand Down Expand Up @@ -4092,9 +4139,9 @@ <h4 title="Type Checking">8.1.2. 型検査</h4>
</ul>

<p>
上の検査に合格しない演算子を含む式は,無効である
上の検査に合格しない演算子を含む式は,無効になる
~zeroによる除算も無効になる。
これには、~literalの~zeroによる除算も, ~zeroに評価される任意の数値式による除算も含まれる(純粋な数値式は、構文解析-時に追加の情報なしで評価し得るので)。
これには、~literalの~zeroによる除算も, ~zeroに評価される任意の数値式による除算も含まれる(純粋な数値式は、構文解析-時に追加の情報なしで評価できるので)。
If an operator does not pass the above checks, the expression is invalid. Also, division by zero is invalid. This includes both dividing by the literal number zero, as well as any numeric expression that evaluates to zero (as purely-numeric expressions can be evaluated without any additional information at parse time).
</p>
Expand Down Expand Up @@ -4451,7 +4498,7 @@ <h3 title="Toggling Between Values: toggle()">8.2. 一連の値の~toggle : `t

<div class="example">
<p>
次の `toggle$f 式の例は、どれも無効である
次の `toggle$f 式の例は、どれも無効になる
The following toggle() examples are all invalid:
</p>
Expand Down Expand Up @@ -4754,7 +4801,7 @@ <h3 title="Attribute References: attr()">8.3. 属性~参照: `attr^f</h3>
<samp class="css">`box-shadow$p: `attr(size px, inset) 5px 10px blue^v;</samp>
は、 `attr$f 式が[
`px$u による長さ, または `inset^v ~keyword
]の<em>いずれに</em> 置換されても,妥当な宣言になるが、それでも無効である
]の<em>いずれに</em> 置換されても,妥当な宣言になるが、それでも無効になる
If the attr() is used alongside other values to form the full property value, however, then the default value must match the attr()'s type. For example, box-shadow: attr(size px, inset) 5px 10px blue; is invalid, even though it would create a valid declaration if you substituted the attr() expression with either a px length or the inset keyword.
</p>
Expand Down Expand Up @@ -4925,7 +4972,7 @@ <h3 title="Attribute References: attr()">8.3. 属性~参照: `attr^f</h3>

<div class="illegal example">
<p>
次の例はすべて無効であり,構文解析-時に~errorを生じさせることになる。
次の例はすべて無効になり,構文解析-時に~errorを生じさせることになる。
その結果,関連する宣言は — この場合はすべてが — 無視される:
All of the following examples are invalid and would cause a parse-time error, and thus cause the relevant declaration—in this case all of them—to be ignored:
Expand Down Expand Up @@ -5113,8 +5160,8 @@ <h3 title="Normative References">文献(規範)</h3>
CSS Image Values and Replaced Content Module Level 3 URL: https://www.w3.org/TR/css3-images/
[CSS-IMAGES-4]
Tab Atkins Jr.; Elika Etemad; Lea Verou. CSS Image Values and Replaced Content Module Level 4. URL: https://www.w3.org/TR/css-images-4/
[CSS-OVERFLOW-4]
CSS Overflow Module Level 4 URL: https://drafts.csswg.org/css-overflow-4/
[CSS-OVERFLOW-3]
David Baron; Florian Rivoal. CSS Overflow Module Level 3. URL: https://www.w3.org/TR/css-overflow-3/
[CSS-UI-3]
Tantek Çelik; Florian Rivoal. CSS Basic User Interface Module Level 3 (CSS3 UI). URL: https://www.w3.org/TR/css-ui-3/
[CSS-WRITING-MODES-4]
Expand Down Expand Up @@ -5147,6 +5194,8 @@ <h3 title="Normative References">文献(規範)</h3>
Florian Rivoal; Tab Atkins Jr.. Media Queries Level 4. URL: https://www.w3.org/TR/mediaqueries-4/
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119
[SELECTORS-3]
Selectors Level 3 URL: https://www.w3.org/TR/css3-selectors/
[SELECTORS-4]
Selectors Level 4 URL: https://www.w3.org/TR/selectors4/
[URL]
Expand All @@ -5158,11 +5207,12 @@ <h3 title="Normative References">文献(規範)</h3>
<h3 title="Informative References">文献(参考)</h3>

<script type="text/plain" class="ref_data">

[CSS-ANIMATIONS-1]
CSS Animations Module Level 1 URL: https://www.w3.org/TR/css3-animations/
[CSS-BREAK-3]
Rossen Atanassov; Elika Etemad. CSS Fragmentation Module Level 3. URL: https://www.w3.org/TR/css-break-3/
[CSS-OVERFLOW-4]
CSS Overflow Module Level 4 URL: https://drafts.csswg.org/css-overflow-4/
[CSS-TEXT-3]
Elika Etemad; Koji Ishii. CSS Text Module Level 3. URL: https://www.w3.org/TR/css-text-3/
[CSS-TEXT-DECOR-3]
Expand All @@ -5177,7 +5227,6 @@ <h3 title="Informative References">文献(参考)</h3>
Florian Rivoal; et al. Media Queries. 19 June 2012. REC. URL: https://www.w3.org/TR/css3-mediaqueries/
[RFC6694]
S. Moonesamy, Ed.. The "about" URI Scheme. August 2012. Informational. URL: https://tools.ietf.org/html/rfc6694

</script>


Expand Down

0 comments on commit a34f0ea

Please sign in to comment.