Living Standard â Last Updated 1 September 2026
HTMLã«ã¯ãæ¥ä»ãæ°ãªã©ãç¹å®ã®ããŒã¿åãåãå ¥ããããŸããŸãªç®æãããããã®ç¯ã§ã¯ããããã®åœ¢åŒã®å 容ã®é©ååºæºãäœãããããŠã©ã®ããã«è§£æãããã説æããã
å®è£ è ã¯ã以äžã«èª¬æãããæ§æã®è§£æãå®è£ ããããã«äœ¿çšããããšãæ€èšãããããããªããµãŒãããŒãã£ã®ã©ã€ãã©ãªãŒãæ³šææ·±ãæ€æ»ããããšã匷ãå§ãããããšãã°ãæ¥ä»ã©ã€ãã©ãªãŒã¯ãã®ä»æ§ã§èŠæ±ããããã®ãšã¯ç°ãªããšã©ãŒåŠçã®æåãå®è£ ããå¯èœæ§ãé«ããããã¯ããšã©ãŒåŠçã®æåã¯ãã®ä»æ§ã§äœ¿çšããããã®ãšé¡äŒŒããæ¥ä»æ§æãèšè¿°ãã仿§ã§å€ãã®å Žåã¯å®çŸ©ããããããããã«å®è£ ã¯ãšã©ãŒãåŠçããæ¹æ³ã倧ããå€åããåŸåãããããã§ããã
Some of the micro-parsers described below follow the pattern of having an input variable that holds the string being parsed, and having a position variable pointing at the next character to parse in input.
ããã€ãã®å±æ§ã¯çåœå±æ§ã§ãããèŠçŽ ã§ã®çåœå±æ§ã®ååšã¯çã®å€ã衚ãã屿§ã®äžåšã¯åœã®å€ã衚ãã
屿§ãååšããå Žåããã®å€ã¯å é ãŸãã¯æ«å°Ÿã®ç©ºçœãªãã§ãç©ºã®æååãŸãã¯å±æ§ã®æ£èŠåã«ASCII倧æåã»å°æåäžåºå¥ã§äžèŽããå€ã§ãªããã°ãªããªãã
å€"true"ããã³"false"ã¯çåœå±æ§ã§èš±å¯ãããªããåœã®å€ã衚ãããã屿§ã¯å®å šã«çç¥ãããå¿ èŠãããã
checkedããã³disabledãšãªããã§ãã¯ããã¯ã¹ã®äŸã瀺ããcheckedããã³disabled屿§ã¯çåœå±æ§ã§ããã
< label >< input type = checkbox checked name = cheese disabled > Cheese</ label >
ããã¯æ¬¡ã«æžããããã®ãšç䟡ã§ããã¹ãã§ããïŒ
< label >< input type = checkbox checked = checked name = cheese disabled = disabled > Cheese</ label >
ã¹ã¿ã€ã«ãæ··åšãããããšãã§ããã以äžã¯äŸç¶ãšããŠç䟡ã§ããïŒ
< label >< input type = 'checkbox' checked name = cheese disabled = "" > Cheese</ label >
åæå±æ§ãšåŒã°ããäžéšã®å±æ§ã¯ãç¶æ ã®æééåãåãããã®ãããªå±æ§ã®ç¶æ ã¯ã屿§ã®å€ãäžé£ã®ããŒã¯ãŒãããã³ç¶æ ã®ãããã³ã°ããªãã³ã«å±æ§ã®ä»æ§ã§æå®ã§ãã3ã€ã®ç¹æ®ãªç¶æ ãçµã¿åãããããšã«ãã£ãŠå°åºãããããããã®ç¹æ®ãªç¶æ ã¯ãç¡å¹å€ã®ããã©ã«ããæ¬ æå€ã®ããã©ã«ããããã³ç©ºã®å€ã®ããã©ã«ãã§ããã
è€æ°ã®ããŒã¯ãŒããåãç¶æ ã«ãããã§ããã
屿§ã®ç¶æ ãå€å¥ããã«ã¯ã次ã®ã¹ããããå©çšããïŒ
屿§ãæå®ãããŠããªãå ŽåïŒ
屿§ãæ¬ æå€ã®ããã©ã«ãç¶æ ãå®çŸ©ãããŠããå Žåããã®æ¬ èœå€ã®ããã©ã«ãç¶æ ãè¿ãã
ããã§ãªããã°ãç¶æ ãªããè¿ãã
屿§ã®å€ãã屿§ã«å®çŸ©ãããŠããããŒã¯ãŒãã®1ã€ãšASCII倧æåã»å°æåäžåºå¥ã§ãããããå Žåããã®ããŒã¯ãŒãã§è¡šãããç¶æ ãè¿ãã
屿§ã空ã®å€ã®ããã©ã«ãç¶æ ãå®çŸ©ãããŠããããã®å±æ§ã®å€ãç©ºã®æååã§ããå Žåããã®ç©ºã®å€ã®ããã©ã«ãç¶æ ãè¿ãã
屿§ãç¡å¹å€ã®ããã©ã«ãç¶æ ãå®çŸ©ãããŠããå Žåããã®ç¡å¹å€ã®ããã©ã«ãç¶æ ãè¿ãã
ç¶æ ãªããè¿ãã
ãªãŒãµãªã³ã°ã®é©åã®ãããåæå±æ§ãæå®ããå Žåã屿§ã®å€ã¯æ¬¡ã®ããããã§ãªããã°ãªããªãïŒ
ãã®å±æ§ã®é©åããŒã¯ãŒãã®1ã€ã«å¯ŸããASCII倧æåã»å°æåäžåºå¥ãããã§ãååŸã«ç©ºçœããªããã®ã
ç©ºã®æååããã³å±æ§ã¯ã空ã®å€ã®ããã©ã«ããå®çŸ©ããªããã°ãªããªãã
åå°ã®ç®çã§ããããã³ã°ãããŠããããŒã¯ãŒããããç¶æ ã¯ãæ£èŠã®ããŒã¯ãŒããæã€ãšèšããããããã¯æ¬¡ã®ããã«æ±ºå®ãããïŒ
ç¹å®ã®ç¶æ ã«ãããã³ã°ãããŠããããŒã¯ãŒãã1ã€ãããªãå Žåããã®ããŒã¯ãŒãã§ããã
ç¹å®ã®ç¶æ ã«ãããã³ã°ãããŠããé©åããŒã¯ãŒãã1ã€ãããªãå Žåãããã¯ãã®é©åããŒã¯ãŒãã§ããã
æå®ãããç¶æ ã«ãããã³ã°ãã2ã€ã®é©åããŒã¯ãŒããããã1ã€ã空æååã§ããå Žåãæ£èŠããŒã¯ãŒãã¯ç©ºã®æååã§ã¯ãªãé©åããŒã¯ãŒãã«ãªãã
ããã§ãªããã°ãç¶æ ã®æ£èŠããŒã¯ãŒãã¯ã屿§ã®ä»æ§ã§æç€ºçã«æå®ãããã
æååã1ã€ä»¥äžã®ASCII æ°åãä»»æã§æ¥é èŸU+002D HYPHEN-MINUSæåïŒ-ïŒãæã€å Žåãæååã¯åŠ¥åœãªæŽæ°ã§ããã
æ¥é èŸU+002D HYPHEN-MINUSïŒ-ïŒæ¥é èŸãªãã®åŠ¥åœãªæŽæ°ã¯ã10鲿°ã衚ããU+002D HYPHEN-MINUSæåïŒ-ïŒæ¥é èŸããã®åŠ¥åœãªæŽæ°ã¯ãU+002D HYPHEN-MINUSã«ç¶ã10鲿°ã衚ãã0ããæžç®ãããã
The rules for parsing integers are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either an integer or an error.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Let sign have the value "positive".
Skip ASCII whitespace within input given position.
If position is past the end of input, return an error.
If the character indicated by position (the first character) is a U+002D HYPHEN-MINUS character (-):
Otherwise, if the character indicated by position (the first character) is a U+002B PLUS SIGN character (+):
+" is ignored, but it is not conforming.)If the character indicated by position is not an ASCII digit, then return an error.
Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Let value be that integer.
If sign is "positive", return value, otherwise return the result of subtracting value from zero.
1ã€ä»¥äžã®ASCIIæ°åãããªãå Žåãæååã¯åŠ¥åœãªéè² æŽæ°ã§ããã
劥åœãªéè² æŽæ°ã¯ã10鲿°ã§ããæ°ã衚ãã
The rules for parsing non-negative integers are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either zero, a positive integer, or an error.
Let input be the string being parsed.
Let value be the result of parsing input using the rules for parsing integers.
If value is an error, return an error.
If value is less than zero, return an error.
Return value.
次ã®å Žåãæååã¯åŠ¥åœãªæµ®åå°æ°ç¹æ°ã§ããïŒ
ä»»æã§ã1ã€ã®A U+002D HYPHEN-MINUSæåïŒ-ïŒã
次ã®ãããããŸãã¯äž¡æ¹ã®ãäžããããé ïŒ
ã²ãšç¶ãã®1ã€ä»¥äžã®ASCIIæ°åã
次ã®äž¡æ¹ã®ãäžããããé ã§ïŒ
1ã€ã®U+002E FULL STOPæåïŒ.ïŒã
ã²ãšç¶ãã®1ã€ä»¥äžã®ASCIIæ°åã
ä»»æã§ïŒ
1ã€ã® U+0065 LATIN SMALL LETTER EæåïŒeïŒã1ã€ã®U+0045 LATIN CAPITAL LETTER EæåïŒEïŒã®ããããã
ä»»æã§ã1ã€ã®U+002D HYPHEN-MINUSæåïŒ-ïŒãŸãã¯1ã€ã®U+002B PLUS SIGNæåïŒ+ïŒã
ã²ãšç¶ãã®1ã€ä»¥äžã®ASCIIæ°åã
劥åœãªæµ®åå°æ°ç¹æ°ã¯ã10ã®çޝä¹ã«ããä»®æ°éšã®ä¹ç®ã«ãã£ãŠåŸããããããã§ä¹ç®ã¯æåã®æ°ã§ããã10鲿°ãšããŠè§£éãããïŒããããã°ãå°æ°ç¹ããã³å°æ°ç¹ã®åŸã®æ°ãå«ã¿ãæååå šäœãU+002D HYPHEN-MINUSæåïŒ-ïŒã§å§ãŸãããã³æ°å€ã0ã§ãªãå Žåãè² æ°ãšããŠä»®æ°éšãè§£éããïŒããŸãããã§ãããããã°ãææ°ã¯Eã®åŸã®æ°åã§ããïŒEãšæ°åãšæ°åã®éã«U+002D HYPHEN-MINUSæåïŒ-ïŒãããå Žåãè² æ°ãšããŠè§£éãããæ°åã0ã§ãªãããŸãã¯ãã®ä»Eãšæ°åã®éã«U+002B PLUS SIGNæåïŒ+ïŒãååšããå Žåç¡èŠã§ããïŒãEãååšããªãå Žåãææ°ã¯0ãšããŠæ±ãããã
ç¡é倧ããã³éæ°ïŒNaNïŒå€ã¯åŠ¥åœãªæµ®åå°æ°ç¹æ°ã§ã¯ãªãã
The valid floating-point number concept is typically only used to restrict what is allowed for authors, while the user agent requirements use the rules for parsing floating-point number values below (e.g., the max attribute of the progress element). However, in some cases the user agent requirements include checking if a string is a valid floating-point number (e.g., the value sanitization algorithm for the Number state of the input element, or the parse a srcset attribute algorithm).
The best representation of the number n as a floating-point number is the string obtained from running ToString(n). The abstract operation ToString is not uniquely determined. When there are multiple possible strings that could be obtained from ToString for a particular value, the user agent must always return the same string for that value (though it may differ from the value used by other user agents).
The rules for parsing floating-point number values are as given in the following algorithm. This algorithm must be aborted at the first step that returns something. This algorithm will return either a number or an error.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Let value have the value 1.
Let divisor have the value 1.
Let exponent have the value 1.
Skip ASCII whitespace within input given position.
If position is past the end of input, return an error.
If the character indicated by position is a U+002D HYPHEN-MINUS character (-):
Otherwise, if the character indicated by position (the first character) is a U+002B PLUS SIGN character (+):
+" is ignored, but it is not conforming.)If the character indicated by position is a U+002E FULL STOP (.), and that is not the last character in input, and the character after the character indicated by position is an ASCII digit, then set value to zero and jump to the step labeled fraction.
If the character indicated by position is not an ASCII digit, then return an error.
Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Multiply value by that integer.
Fraction: If the character indicated by position is a U+002E FULL STOP (.), run these substeps:
Advance position to the next character.
If position is past the end of input, or if the character indicated by position is not an ASCII digit, U+0065 LATIN SMALL LETTER E (e), or U+0045 LATIN CAPITAL LETTER E (E), then jump to the step labeled conversion.
If the character indicated by position is a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E), skip the remainder of these substeps.
Fraction loop: Multiply divisor by ten.
Advance position to the next character.
If position is past the end of input, then jump to the step labeled conversion.
If the character indicated by position is an ASCII digit, jump back to the step labeled fraction loop in these substeps.
If the character indicated by position is U+0065 (e) or a U+0045 (E):
Advance position to the next character.
If position is past the end of input, then jump to the step labeled conversion.
If the character indicated by position is a U+002D HYPHEN-MINUS character (-):
If position is past the end of input, then jump to the step labeled conversion.
Otherwise, if the character indicated by position is a U+002B PLUS SIGN character (+):
If position is past the end of input, then jump to the step labeled conversion.
If the character indicated by position is not an ASCII digit, then jump to the step labeled conversion.
Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Multiply exponent by that integer.
Multiply value by ten raised to the exponentth power.
Conversion: Let S be the set of finite IEEE 754 double-precision floating-point values except â0, but with two special values added: 21024 and â21024.
Let rounded-value be the number in S that is closest to value, selecting the number with an even significand if there are two equally close values. (The two special values 21024 and â21024 are considered to have even significands for this purpose.)
If rounded-value is 21024 or â21024, return an error.
Return rounded-value.
The rules for parsing dimension values are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either a number greater than or equal to 0.0, or failure; if a number is returned, then it is further categorized as either a percentage or a length.
Let input be the string being parsed.
Let position be a position variable for input, initially pointing at the start of input.
Skip ASCII whitespace within input given position.
If position is past the end of input or the code point at position within input is not an ASCII digit, then return failure.
Collect a sequence of code points that are ASCII digits from input given position, and interpret the resulting sequence as a base-ten integer. Let value be that number.
If position is past the end of input, then return value as a length.
If the code point at position within input is U+002E (.):
Advance position by 1.
If position is past the end of input or the code point at position within input is not an ASCII digit, then return the current dimension value with value, input, and position.
Let divisor have the value 1.
While true:
Multiply divisor by ten.
Add the value of the code point at position within input, interpreted as a base-ten digit (0..9) and divided by divisor, to value.
Advance position by 1.
If position is past the end of input, then return value as a length.
If the code point at position within input is not an ASCII digit, then break.
Return the current dimension value with value, input, and position.
The current dimension value, given value, input, and position, is determined as follows:
If position is past the end of input, then return value as a length.
If the code point at position within input is U+0025 (%), then return value as a percentage.
Return value as a length.
The rules for parsing nonzero dimension values are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will return either a number greater than 0.0, or an error; if a number is returned, then it is further categorized as either a percentage or a length.
Let input be the string being parsed.
Let value be the result of parsing input using the rules for parsing dimension values.
If value is an error, return an error.
If value is zero, return an error.
If value is a percentage, return value as a percentage.
Return value as a length.
劥åœãªæµ®åå°æ°ç¹æ°ãªã¹ãã¯ãU+002C COMMAæåã«ãã£ãŠåºåããã倿°ã®åŠ¥åœãªæµ®åå°æ°ç¹æ°ã§ãããä»ã®æåãæããªãïŒããšãã°ASCIIç©ºçœæåã®ãªãïŒãããã«ãäžããããæµ®åå°æ°ç¹æ°ã®æ°ããŸãã¯èš±å¯ãããå€ã®ç¯å²ã«ã¯å¶éããããããããªãã
The rules for parsing a list of floating-point numbers are as follows:
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Let numbers be an initially empty list of floating-point numbers. This list will be the result of this algorithm.
Collect a sequence of code points that are ASCII whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given position. This skips past any leading delimiters.
While position is not past the end of input:
Collect a sequence of code points that are not ASCII whitespace, U+002C COMMA, U+003B SEMICOLON, ASCII digits, U+002E FULL STOP, or U+002D HYPHEN-MINUS characters from input given position. This skips past leading garbage.
Collect a sequence of code points that are not ASCII whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given position, and let unparsed number be the result.
Let number be the result of parsing unparsed number using the rules for parsing floating-point number values.
If number is an error, set number to zero.
Append number to numbers.
Collect a sequence of code points that are ASCII whitespace, U+002C COMMA, or U+003B SEMICOLON characters from input given position. This skips past the delimiter.
Return numbers.
The rules for parsing a list of dimensions are as follows. These rules return a list of zero or more pairs consisting of a number and a unit, the unit being one of percentage, relative, and absolute.
Let raw input be the string being parsed.
If the last character in raw input is a U+002C COMMA character (,), then remove that character from raw input.
Split the string raw input on commas. Let raw tokens be the resulting list of tokens.
Let result be an empty list of number/unit pairs.
For each token in raw tokens, run the following substeps:
Let input be the token.
Let position be a pointer into input, initially pointing at the start of the string.
Let value be the number 0.
Let unit be absolute.
If position is past the end of input, set unit to relative and jump to the last substep.
If the character at position is an ASCII digit, collect a sequence of code points that are ASCII digits from input given position, interpret the resulting sequence as an integer in base ten, and increment value by that integer.
If the character at position is U+002E (.):
Collect a sequence of code points consisting of ASCII whitespace and ASCII digits from input given position. Let s be the resulting sequence.
Remove all ASCII whitespace in s.
If s is not the empty string:
Let length be the number of characters in s (after the spaces were removed).
Let fraction be the result of interpreting s as a base-ten integer, and then dividing that number by 10length.
Increment value by fraction.
Skip ASCII whitespace within input given position.
If the character at position is a U+0025 PERCENT SIGN character (%), then set unit to percentage.
Otherwise, if the character at position is a U+002A ASTERISK character (*), then set unit to relative.
Add an entry to result consisting of the number given by value and the unit given by unit.
Return the list result.
äžèšã®ã¢ã«ãŽãªãºã ã«ãããŠã幎yearã®æmonthã®æ¥æ°ã¯ïŒmonthã1ã3ã5ã7ã8ã10ã12ãªãã°31ã§ãããmonthã4ã6ã9ã11ãªãã°30ã§ãããmonthã2ãã€yearã400ã§å²ãåããæ°ããŸãã¯yearã4ã§å²ãåããã100ã§å²ãåããªããªãã°29ã§ãããããã§ãªããã°28ã§ãããããã¯ãã°ã¬ãŽãªãªæŠã®é幎ãèæ ®ã«å ¥ããŠããã[GREGORIAN]
ASCIIæ°åããã®ç¯ã§å®çŸ©ãããæ¥ä»ããã³æå»ã®æ§æã§äœ¿çšãããå Žåããããã¯10鲿°ã§è¡šçŸãããã
While the formats described here are intended to be subsets of the corresponding ISO8601 formats, this specification defines parsing rules in much more detail than ISO8601. Implementers are therefore encouraged to carefully examine any date parsing libraries before using them to implement the parsing rules described below; ISO8601 libraries might not parse dates and times in exactly the same manner. [ISO8601]
ãã®ä»æ§ãå çºã°ã¬ãŽãªãªæŠãåç §ããå Žåãããã¯ã1幎ã«é¡ã£ãŠæ¿å ¥ãããçŸä»£ã®ã°ã¬ãŽãªãªæŠãæå³ãããå çºã°ã¬ãŽãªãªæ¥ä»ãšããŠæç€ºçã«åç §ãããå çºã°ã¬ãŽãªãªæŠã§ã®æ¥ä»ã¯ãããšãæŠãåé¡ã®æå»ïŒãŸãã¯å ŽæïŒã§äœ¿çšãããŠããªããšããŠãããã®æŠã䜿çšããŠèª¬æãããã[GREGORIAN]
ãã®ä»æ§ã«ãããŠã¯ã€ã€åœ¢åŒãšããŠã®ã°ã¬ãŽãªãªæŠã®äœ¿çšã¯ã決å®ã«é¢ãã人ã
ã®æåçãªãã€ã¢ã¹ã«èµ·å ããæ£æçãªéžæè¢ã§ãããïŒèè
ã«å¯ŸããïŒãã©ãŒã ã®æ¥ä»ãæå»ãæ°å€ã®åœ¢åŒããã©ãŒã ã³ã³ãããŒã«ã®ããŒã«ã©ã€ãŒãŒã·ã§ã³ã«é¢ããå®è£
ããŒãããã³timeã®ç¯ãåç
§ã®ããšã
æã¯ãã¿ã€ã ãŸãŒã³æ å ±ããã³å¹Žãšæãè¶ ããæ¥ä»ãæããªããç¹å®ã®å çºã°ã¬ãŽãªãªæŠããæãã[GREGORIAN]
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯ã幎yearããã³æmonthã§è¡šããã劥åœãªææååã§ããïŒ
The rules to parse a month string are as follows. This will return either a year and month, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a month component to obtain year and month. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Return year and month.
The rules to parse a month component, given an input string and a position, are as follows. This will return either a year and a month, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not at least four characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let year be that number.
If year is not a number greater than zero, then fail.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move position forwards one character.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let month be that number.
If month is not a number in the range 1 â€Â month â€Â 12, then fail.
Return year and month.
æ¥ä»ã¯ãå¹Žææ¥ãããªãã¿ã€ã ãŸãŒã³æ å ±ãæããªããç¹å®ã®å çºã°ã¬ãŽãªãªæŠãããªãã[GREGORIAN]
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯å¹Žyearãæmonthãæ¥dayã§è¡šããã劥åœãªæ¥ä»æååã§ããïŒ
The rules to parse a date string are as follows. This will return either a date, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Let date be the date with year year, month month, and day day.
Return date.
The rules to parse a date component, given an input string and a position, are as follows. This will return either a year, a month, and a day, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Parse a month component to obtain year and month. If this returns nothing, then fail.
Let maxday be the number of days in month month of year year.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move position forwards one character.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let day be that number.
If day is not a number in the range 1 â€Â day â€Â maxday, then fail.
Return year, month, and day.
幎ãªãæ¥ä»ã¯ã°ã¬ã³ãªãªæãšãã®æã®æ¥ãããªããã幎ã䌎ããªãã[GREGORIAN]
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯æmonthããã³æ¥dayã§è¡šããã劥åœãªå¹Žãªãæ¥ä»æååã§ããïŒ
èšãæãããšã2æãæå³ããmonthã"02"ã§ããå Žåããããããã®å¹Žã¯é幎ãã®ããã«ãæ¥ã¯29ã§ãã£ãŠãããã
The rules to parse a yearless date string are as follows. This will return either a month and a day, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a yearless date component to obtain month and day. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Return month and day.
The rules to parse a yearless date component, given an input string and a position, are as follows. This will return either a month and a day, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Collect a sequence of code points that are U+002D HYPHEN-MINUS characters (-) from input given position. If the collected sequence is not exactly zero or two characters long, then fail.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let month be that number.
If month is not a number in the range 1 â€Â month â€Â 12, then fail.
Let maxday be the number of days in month month of any arbitrary leap year (e.g. 4 or 2000).
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move position forwards one character.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let day be that number.
If day is not a number in the range 1 â€Â day â€Â maxday, then fail.
Return month and day.
æå»ã¯ãæãåãç§ãç§ä»¥äžãããªãã¿ã€ã ãŸãŒã³æ å ±ãæããªããç¹å®ã®æå»ãããªãã
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯ãæhourãåminuteãç§secondã§è¡šããã劥åœãªæå»æååã§ããïŒ
secondã³ã³ããŒãã³ãã¯60ãŸãã¯61ã«ã¯ãªãåŸãªããéç§ã衚ãããšã¯ã§ããªãã
The rules to parse a time string are as follows. This will return either a time, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Let time be the time with hour hour, minute minute, and second second.
Return time.
The rules to parse a time component, given an input string and a position, are as follows. This will return either an hour, a minute, and a second, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let hour be that number.
If position is beyond the end of input or if the character at position is not a U+003A COLON character, then fail. Otherwise, move position forwards one character.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let minute be that number.
Let second be 0.
If position is not beyond the end of input and the character at position is U+003A (:):
Advance position to the next character in input.
If position is beyond the end of input, or at the last character in input, or if the next two characters in input starting at position are not both ASCII digits, then fail.
Collect a sequence of code points that are either ASCII digits or U+002E FULL STOP characters from input given position. If the collected sequence is three characters long, or if it is longer than three characters long and the third character is not a U+002E FULL STOP character, or if it has more than one U+002E FULL STOP character, then fail. Otherwise, interpret the resulting sequence as a base-ten number (possibly with a fractional part). Set second to that number.
If second is not a number in the range 0 â€Â second < 60, then fail.
Return hour, minute, and second.
ããŒã«ã«æ¥ä»ããã³æå»ã¯ã幎ãæãæ¥ãæãåãç§ãç§ä»¥äžãããªãç¹å®ã®å çºã°ã¬ã³ãªãªæŠãããªãããã¿ã€ã ãŸãŒã³æ å ±ãæããªãã[GREGORIAN]
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯åŠ¥åœãªããŒã«ã«æ¥ä»ããã³æå»æååã§ããïŒ
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯åŠ¥åœãªèŠæ ŒåããŒã«ã«æ¥ä»ããã³æå»æååã§ããïŒ
The rules to parse a local date and time string are as follows. This will return either a date and time, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
If position is beyond the end of input or if the character at position is neither a U+0054 LATIN CAPITAL LETTER T character (T) nor a U+0020 SPACE character, then fail. Otherwise, move position forwards one character.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Let date be the date with year year, month month, and day day.
Let time be the time with hour hour, minute minute, and second second.
Return date and time.
ã¿ã€ã ãŸãŒã³ãªãã»ããã¯ç¬Šå·ä»ãã®æãšåã®æ°åãããªãã
次ã®ãããããããªãå Žåãæååã¯ãã¿ã€ã ãŸãŒã³ãªãã»ããã衚ã劥åœãªã¿ã€ã ãŸãŒã³ãªãã»ããæååã§ããïŒ
ã¿ã€ã ãŸãŒã³ãUTCã®å Žåã®ã¿èš±ããããU+005A LATIN CAPITAL LETTER ZæåïŒZïŒ
ãŸãã¯ãäžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ãïŒ
ãã®åœ¢åŒã¯ã-23:59ãã+23:59ãŸã§ã®ã¿ã€ã ãŸãŒã³ãªãã»ãããèš±å¯ãããç¹ã«ãå®éã®ã¿ã€ã ãŸãŒã³ãªãã»ããã®ç¯å²ã¯-12:00ãã+14:00ãŸã§ã§ãããå®éã®ã¿ã€ã ãŸãŒã³ãªãã»ããã®åã³ã³ããŒãã³ãã¯åžžã«00ã30ãŸãã¯45ã®ããããã§ããããšã¯ãããã¿ã€ã ãŸãŒã³ã¯æ¿äºã®å ·ãšããŠäœ¿çšãããéåžžã«æ°ãŸãããªæ¿ç決å®ã®å¯Ÿè±¡ãšãããã®ã§ãæ°žé ã«ä¿æãããä¿èšŒã¯ãªãã
æ£åŒãªã¿ã€ã ãŸãŒã³ã®åœ¢æä»¥åã«é¡ãæŽå²çãªæä»£ã§ã®ã¿ã€ã ãŸãŒã³ã®ãªãã»ããã䜿çšã«ã€ããŠã®è©³çްã¯ãäžèšã®ã°ããŒãã«æ¥ä»ããã³æå»ã®ç¯ã«ãã䜿çšäžã®æ³šæãšäŸãåç §ã®ããšã
The rules to parse a time-zone offset string are as follows. This will return either a time-zone offset, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a time-zone offset component to obtain timezonehours and timezoneminutes. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Return the time-zone offset that is timezonehours hours and timezoneminutes minutes from UTC.
The rules to parse a time-zone offset component, given an input string and a position, are as follows. This will return either time-zone hours and time-zone minutes, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
If the character at position is a U+005A LATIN CAPITAL LETTER Z character (Z):
Let timezonehours be 0.
Let timezoneminutes be 0.
Advance position to the next character in input.
Otherwise, if the character at position is either a U+002B PLUS SIGN (+) or a U+002D HYPHEN-MINUS (-):
If the character at position is a U+002B PLUS SIGN (+), let sign be "positive". Otherwise, it's a U+002D HYPHEN-MINUS (-); let sign be "negative".
Advance position to the next character in input.
Collect a sequence of code points that are ASCII digits from input given position. Let s be the collected sequence.
If s is exactly two characters long:
Interpret s as a base-ten integer. Let timezonehours be that number.
If position is beyond the end of input or if the character at position is not a U+003A COLON character, then fail. Otherwise, move position forwards one character.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let timezoneminutes be that number.
If s is exactly four characters long:
Interpret the first two characters of s as a base-ten integer. Let timezonehours be that number.
Interpret the last two characters of s as a base-ten integer. Let timezoneminutes be that number.
Otherwise, fail.
Otherwise, fail.
Return timezonehours and timezoneminutes.
ã°ããŒãã«æ¥ä»ããã³æå»ã¯ã笊å·ä»ãæåãããªãã¿ã€ã ãŸãŒã³ãªãã»ãããšãšãã«å¹Žãæãæ¥ãæãåãç§ãç§ä»¥äžãããªãç¹å®å çºã°ã¬ã³ãªãªæŠã§æ§æããã[GREGORIAN]
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæ¥ä»ãæå»ãã¿ã€ã ãŸãŒã³ãªãã»ããã衚ãæååã¯åŠ¥åœãªã°ããŒãã«æ¥ä»ããã³æå»ã§ããïŒ
20äžçŽåã°ã«UTCã圢æããåã®æ¥ä»ã®æå»ã¯ãUTCïŒUT1ã®è¿äŒŒãSIç§ãå»ãïŒã§ã¯ãªããUT1ïŒ0°çµåºŠã§ã®çŸä»£ã®å°çå€ªéœæïŒã®èŠå°ãã衚çŸããã³è§£éãããªããã°ãªããªããã¿ã€ã ãŸãŒã³ã圢æããåã®æå»ã¯ãé©åãªããŒã«ã«æå»ãšãã³ãã³ã®ã°ãªãããžã§èŠ³æž¬ãããæå»ãšã®éã®ããããã®çŸä»£çãªéãã®ããæç€ºçãªã¿ã€ã ãŸãŒã³ãšãšãã«UT1ã®æå»ãšããŠè¡šçŸããã³è§£éãããªããã°ãªããªãã
以äžã¯åŠ¥åœãªã°ããŒãã«æ¥ä»ããã³æå»ãšããŠèšè¿°ãããäŸã®äžéšã§ããã
0037-12-13 00:00Z"1979-10-14T12:00:00.001-04:00"8592-01-01T02:09+02:09"æ¬¡ã®æ¥ä»ã«é¢ããŠããã€ãã®æ³šç®ã«å€ããç¹ãããïŒ
T"ã空çœã«çœ®æãããå Žåãåäžã®ç©ºçœæåã§ãªããã°ãªããªããæåå"2001-12-21  12:00Z"ïŒã³ã³ããŒãã³ãã®éã«2ã€ã®ç©ºçœïŒã¯ããŸãè§£éãããªãã ãããThe rules to parse a global date and time string are as follows. This will return either a time in UTC, with associated time-zone offset information for roundtripping or display purposes, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Parse a date component to obtain year, month, and day. If this returns nothing, then fail.
If position is beyond the end of input or if the character at position is neither a U+0054 LATIN CAPITAL LETTER T character (T) nor a U+0020 SPACE character, then fail. Otherwise, move position forwards one character.
Parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
If position is beyond the end of input, then fail.
Parse a time-zone offset component to obtain timezonehours and timezoneminutes. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
Let time be the moment in time at year year, month month, day day, hours hour, minute minute, second second, subtracting timezonehours hours and timezoneminutes minutes. That moment in time is a moment in the UTC time zone.
Let timezone be timezonehours hours and timezoneminutes minutes from UTC.
Return time and timezone.
é±ã¯ãé±çªå·å¹Žãšé±çªå·ãããªããé±çªå·ã¯ãæææ¥ããå§ãŸã7æ¥éã瀺ããæ¬¡ã®å®çŸ©ã«åŸã£ãŠããã®ã«ã¬ã³ããŒã·ã¹ãã ã«ãããé±çªå·å¹Žã¯52ãŸãã¯53ã®7æ¥éãæã€ãã°ã¬ãŽãªãªæŠã®æ¥ä»ã§1969幎12æ29æ¥ïŒ1969-12-29ïŒæææ¥ã§å§ãŸã7æ¥éã¯ã1970é±çªå·å¹Žã§é±çªå·1ãšããŠå®çŸ©ããããé£ç¶ããé±ã¯é£çªãä»ãããããé±çªå·å¹Žã§1é±ç®ã®åã®é±ã¯ãåã®é±çªå·å¹Žã®æçµé±ã§ãããéããŸãåæ§ã§ããã[GREGORIAN]
æåã®æ¥ïŒ1æ1æ¥ïŒãæšæã§ããå çºã°ã¬ã³ãªãªæŠã®å¹ŽyearããŸãã¯æåã®æ¥ïŒ1æ1æ¥ïŒãæšæã§ããå çºã°ã¬ã³ãªãªæŠã®å¹Žyearã®ããããã«å¯Ÿå¿ããå Žåãæ°åyearãšãšãã«é±çªå·å¹Žã¯53é±ãæã€ãããã§ãyearã¯400ã§å²ãåããæ°åããŸãã¯4ã§å²ãåããã100ã§å²ãåããªãæ°åã§ãããä»ã®ãã¹ãŠã®é±çªå·å¹Žã¯52é±ã§ããã
53é±ããã€é±çªå·å¹Žã®æçµæ¥ã®é±çªå·ã¯53ã§ããã52é±ããã€é±çªå·å¹Žã®æçµæ¥ã®é±çªå·ã¯52ã§ããã
ç¹å®ã®æ¥ã®é±çªå·å¹Žã®æ°ã¯ãå çºã°ã¬ãŽãªãªæŠã§ããã®æ¥ãå«ãå¹Žã®æ°ãšç°ãªãå Žåããããé±çªå·å¹Žyã§ã®æåã®é±ã¯ãã°ã¬ã³ãªãªå¹Žyã®æåã®æšæãå«ãé±ã§ããã
çŸä»£ã®çšéã«å¯ŸããŠãããã§å®çŸ©ãããé±ã¯ãISO 8601ã§å®çŸ©ããããããªISOé±ã«çžåœããã[ISO8601]
äžããããé ã§æ¬¡ã®ã³ã³ããŒãã³ããããªãå Žåãæååã¯ãé±çªå·å¹Žyearããã³é±weekã衚ã劥åœãªé±æååã§ããïŒ
The rules to parse a week string are as follows. This will return either a week-year number and week number, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not at least four characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let year be that number.
If year is not a number greater than zero, then fail.
If position is beyond the end of input or if the character at position is not a U+002D HYPHEN-MINUS character, then fail. Otherwise, move position forwards one character.
If position is beyond the end of input or if the character at position is not a U+0057 LATIN CAPITAL LETTER W character (W), then fail. Otherwise, move position forwards one character.
Collect a sequence of code points that are ASCII digits from input given position. If the collected sequence is not exactly two characters long, then fail. Otherwise, interpret the resulting sequence as a base-ten integer. Let week be that number.
Let maxweek be the week number of the last day of year year.
If week is not a number in the range 1 â€Â week â€Â maxweek, then fail.
If position is not beyond the end of input, then fail.
Return the week-year number year and the week number week.
ç¶ç¶æéã¯è€æ°ç§ãããªãã
æãšç§ã¯åçã§ã¯ãªãïŒ1ãæã¯æ£ç¢ºãªç§æ°ã§ã¯ãªãããã®æ£ç¢ºãªé·ãã¯ã枬å®ãããæ£ç¢ºãª1æ¥ã«äŸåããæéã§ããïŒã®ã§ããã®ä»æ§ã§å®çŸ©ãããç¶ç¶æéã¯æãå«ããããšã¯ã§ããªãïŒãŸã幎ã¯12ãæã«çããïŒç¹å®ã®ç§æ°ãèšè¿°ããç¶ç¶æéã®ã¿ãèšè¿°å¯èœã§ããã
次ã®ãããããããªãå Žåãæååã¯ãç¶ç¶æétã§è¡šã劥åœãªç¶ç¶æéæååã§ããïŒ
äžããããé ã§ãªãã©ã«ã«U+0050 LATIN CAPITAL LETTER Pæåã®åŸã«æ¬¡ã®ãµãã³ã³ããŒãã³ããç¶ããããã§æ¥ãæãåããã³ç§æ°ã¯tãšããŠåãç§æ°ã«å¯Ÿå¿ããïŒ
U+0044 LATIN CAPITAL LETTER Dæåã®åŸã«ç¶ããæ¥æ°ã衚ã1ã€ä»¥äžã®ASCIIæ°åã
äžããããé ã§ãU+0054 LATIN CAPITAL LETTER Tæåã®åŸã«æ¬¡ã®ãµãã³ã³ããŒãã³ããç¶ãïŒ
U+0048 LATIN CAPITAL LETTER Hæåã®åŸã«ç¶ããææ°ã衚ã1ã€ä»¥äžã®ASCIIæ°åã
U+0044 LATIN CAPITAL LETTER Mæåã®åŸã«ç¶ããåæ°ã衚ã1ã€ä»¥äžã®ASCIIæ°åã
次ã®ã³ã³ããŒãã³ãïŒ
ç§æ°ã衚ãã1ã€ä»¥äžã®ASCIIæ°åã
ä»»æã§ãç§ä»¥äžã衚ãU+002E FULL STOPæåïŒ.ïŒã®åŸã«ç¶ã1ã2ããŸãã¯3ã€ã®ASCIIæ°åã
U+0053 LATIN CAPITAL LETTER Sæåã
ããã¯ããã®ä»æ§ã§å®çŸ©ãããä»ã®æ¥ä»ããã³æå»äŸåã®ãã€ã¯ãæ§æãšåæ§ã«ãISO 8601ã§å®çŸ©ããã圢åŒã®1ã€ã«åºã¥ãã[ISO8601]
ä»»æã®é ã§ãããããç°ãªãç¶ç¶æéã³ã³ããŒãã³ãã®ã¹ã±ãŒã«ã䌎ãã1ã€ä»¥äžã®ç¶ç¶æéã³ã³ããŒãã³ããç§æ°tãšç䟡ã§ããç§æ°ã§è¡šãããåèšã
ç¶ç¶æéã³ã³ããŒãã³ãã¯æ¬¡ã®ã³ã³ããŒãã³ããããªãæååã§ããïŒ
0å以äžã®ASCIIç©ºçœæåã
ç§æ°ã衚çŸããããã«æå®ãããç¶ç¶æéã³ã³ããŒãã³ãã¹ã±ãŒã«ïŒäžèšåç §ïŒã§ã¹ã±ãŒã«ãããæå»åäœæ°ã§è¡šãã1ã€ä»¥äžã®ASCIIæ°åã
æå®ãããç¶ç¶æéã³ã³ããŒãã³ãã¹ã±ãŒã«ã1ïŒããªãã¡åäœãç§ïŒã®å Žåãä»»æã§ãU+002E FULL STOPæåïŒ.ïŒæåã®åŸã«ç¶ãç§ä»¥äžã衚ã1ã2ããŸãã¯3ã€ã®ASCIIæ°åã
0å以äžã®ASCIIç©ºçœæåã
ç¶ç¶æéã³ã³ããŒãã³ãã®æ°åéšã§çšããããæå»åäœã®ç¶ç¶æéã³ã³ããŒãã³ãã¹ã±ãŒã«ã衚ããæ¬¡ã®æåã®1ã€ïŒ
0å以äžã®ASCIIç©ºçœæåã
ããã¯ISO 8601ã§ã®åœ¢åŒã®ãããã«ãåºã¥ããªããISO 8601ç¶ç¶æé圢åŒã®ä»£ããã«ããã人éã«èªã¿ãããããããšãæå³ããã
The rules to parse a duration string are as follows. This will return either a duration or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Let months, seconds, and component count all be zero.
Let M-disambiguator be minutes.
This flag's other value is months. It is used to disambiguate the "M" unit in ISO8601 durations, which use the same unit for months and minutes. Months are not allowed, but are parsed for future compatibility and to avoid misinterpreting ISO8601 durations that would be valid in other contexts.
Skip ASCII whitespace within input given position.
If position is past the end of input, then fail.
If the character in input pointed to by position is a U+0050 LATIN CAPITAL LETTER P character, then advance position to the next character, set M-disambiguator to months, and skip ASCII whitespace within input given position.
While true:
Let units be undefined. It will be assigned one of the following values: years, months, weeks, days, hours, minutes, and seconds.
Let next character be undefined. It is used to process characters from the input.
If position is past the end of input, then break.
If the character in input pointed to by position is a U+0054 LATIN CAPITAL LETTER T character, then advance position to the next character, set M-disambiguator to minutes, skip ASCII whitespace within input given position, and continue.
Set next character to the character in input pointed to by position.
If next character is a U+002E FULL STOP character (.), then let N be 0. (Do not advance position. That is taken care of below.)
Otherwise, if next character is an ASCII digit, then collect a sequence of code points that are ASCII digits from input given position, interpret the resulting sequence as a base-ten integer, and let N be that number.
Otherwise, next character is not part of a number; fail.
If position is past the end of input, then fail.
Set next character to the character in input pointed to by position, and this time advance position to the next character. (If next character was a U+002E FULL STOP character (.) before, it will still be that character this time.)
If next character is U+002E (.):
Collect a sequence of code points that are ASCII digits from input given position. Let s be the resulting sequence.
If s is the empty string, then fail.
Let length be the number of characters in s.
Let fraction be the result of interpreting s as a base-ten integer, and then dividing that number by 10length.
Increment N by fraction.
Skip ASCII whitespace within input given position.
If position is past the end of input, then fail.
Set next character to the character in input pointed to by position, and advance position to the next character.
If next character is neither a U+0053 LATIN CAPITAL LETTER S character nor a U+0073 LATIN SMALL LETTER S character, then fail.
Set units to seconds.
Otherwise:
If next character is ASCII whitespace, then skip ASCII whitespace within input given position, set next character to the character in input pointed to by position, and advance position to the next character.
If next character is a U+0059 LATIN CAPITAL LETTER Y character, or a U+0079 LATIN SMALL LETTER Y character, set units to years and set M-disambiguator to months.
If next character is a U+004D LATIN CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M character, and M-disambiguator is months, then set units to months.
If next character is a U+0057 LATIN CAPITAL LETTER W character or a U+0077 LATIN SMALL LETTER W character, set units to weeks and set M-disambiguator to minutes.
If next character is a U+0044 LATIN CAPITAL LETTER D character or a U+0064 LATIN SMALL LETTER D character, set units to days and set M-disambiguator to minutes.
If next character is a U+0048 LATIN CAPITAL LETTER H character or a U+0068 LATIN SMALL LETTER H character, set units to hours and set M-disambiguator to minutes.
If next character is a U+004D LATIN CAPITAL LETTER M character or a U+006D LATIN SMALL LETTER M character, and M-disambiguator is minutes, then set units to minutes.
If next character is a U+0053 LATIN CAPITAL LETTER S character or a U+0073 LATIN SMALL LETTER S character, set units to seconds and set M-disambiguator to minutes.
Otherwise, if next character is none of the above characters, then fail.
Increment component count.
Let multiplier be 1.
If units is years, multiply multiplier by 12 and set units to months.
If units is months, add the product of N and multiplier to months.
Otherwise:
If units is weeks, multiply multiplier by 7 and set units to days.
If units is days, multiply multiplier by 24 and set units to hours.
If units is hours, multiply multiplier by 60 and set units to minutes.
If units is minutes, multiply multiplier by 60 and set units to seconds.
Forcibly, units is now seconds. Add the product of N and multiplier to seconds.
Skip ASCII whitespace within input given position.
If component count is zero, fail.
If months is not zero, fail.
Return the duration consisting of seconds seconds.
次ã®ããããã§ããå Žåãæååã¯ä»»æã®æå»ãæã€åŠ¥åœãªæ¥ä»æååã§ããïŒ
The rules to parse a date or time string are as follows. The algorithm will return either a date, a time, a global date and time, or nothing. If at any point the algorithm says that it "fails", this means that it is aborted at that point and returns nothing.
Let input be the string being parsed.
Let position be a pointer into input, initially pointing at the start of the string.
Set start position to the same position as position.
Set the date present and time present flags to true.
Parse a date component to obtain year, month, and day. If this fails, then set the date present flag to false.
If date present is true, and position is not beyond the end of input, and the character at position is either a U+0054 LATIN CAPITAL LETTER T character (T) or a U+0020 SPACE character, then advance position to the next character in input.
Otherwise, if date present is true, and either position is beyond the end of input or the character at position is neither a U+0054 LATIN CAPITAL LETTER T character (T) nor a U+0020 SPACE character, then set time present to false.
Otherwise, if date present is false, set position back to the same position as start position.
If the time present flag is true, then parse a time component to obtain hour, minute, and second. If this returns nothing, then fail.
If the date present and time present flags are both true, but position is beyond the end of input, then fail.
If the date present and time present flags are both true, parse a time-zone offset component to obtain timezonehours and timezoneminutes. If this returns nothing, then fail.
If position is not beyond the end of input, then fail.
If the date present flag is true and the time present flag is false, then let date be the date with year year, month month, and day day, and return date.
Otherwise, if the time present flag is true and the date present flag is false, then let time be the time with hour hour, minute minute, and second second, and return time.
Otherwise, let time be the moment in time at year year, month month, day day, hours hour, minute minute, second second, subtracting timezonehours hours and timezoneminutes minutes, that moment in time being a moment in the UTC time zone; let timezone be timezonehours hours and timezoneminutes minutes from UTC; and return time and timezone.
Some obsolete legacy attributes parse colors using the rules for parsing a legacy color value, given a string input. They will return either a CSS color or failure.
If input is the empty string, then return failure.
Strip leading and trailing ASCII whitespace from input.
If input is an ASCII case-insensitive match for "transparent", then return failure.
If input is an ASCII case-insensitive match for one of the named colors, then return the CSS color corresponding to that keyword. [CSSCOLOR]
CSS2 System Colors are not recognized.
If input's code point length is four, and the first character in input is U+0023 (#), and the last three characters of input are all ASCII hex digits:
Let result be a CSS color.
Interpret the second character of input as a hexadecimal digit; let the red component of result be the resulting number multiplied by 17.
Interpret the third character of input as a hexadecimal digit; let the green component of result be the resulting number multiplied by 17.
Interpret the fourth character of input as a hexadecimal digit; let the blue component of result be the resulting number multiplied by 17.
Return result.
Replace any code points greater than U+FFFF in input (i.e., any characters that are not in the basic multilingual plane) with "00".
If input's code point length is greater than 128, truncate input, leaving only the first 128 characters.
If the first character in input is U+0023 (#), then remove it.
Replace any character in input that is not an ASCII hex digit with U+0030 (0).
While input's code point length is zero or not a multiple of three, append U+0030 (0) to input.
Split input into three strings of equal code point length, to obtain three components. Let length be the code point length that all of those components have (one third the code point length of input).
If length is greater than 8, then remove the leading length-8 characters in each component, and let length be 8.
While length is greater than two and the first character in each component is U+0030 (0), remove that character and reduce length by one.
If length is still greater than two, truncate each component, leaving only the first two characters in each.
Let result be a CSS color.
Interpret the first component as a hexadecimal number; let the red component of result be the resulting number.
Interpret the second component as a hexadecimal number; let the green component of result be the resulting number.
Interpret the third component as a hexadecimal number; let the blue component of result be the resulting number.
Return result.
空çœåºåãããŒã¯ã³ã®éåã¯ã1ã€ä»¥äžã®ASCIIç©ºçœæåã«ãã£ãŠåºåããã0å以äžã®åèªïŒããŒã¯ã³ãšããŠç¥ãããïŒãå«ãæååã§ãããããã§ãåèªã¯1ã€ä»¥äžã®æåãå«ã¿ãASCIIç©ºçœæåãå«ãŸãªãã
空çœåºåãããŒã¯ã³ã®éåãæ§æããæååã¯ãå é ãŸãã¯æ«å°Ÿã«ASCIIç©ºçœæåãæã£ãŠãããã
é äžåã®äžæãªç©ºçœåºåãããŒã¯ã³ã®éåã¯ãç¹°ãè¿ãããŒã¯ã³ã®ãªã空çœåºåãããŒã¯ã³ã®éåã§ããã
é åºä»ãã®äžæãªç©ºçœåºåãããŒã¯ã³ã®éåã¯ãç¹°ãè¿ãããŒã¯ã³ã¯ãªãããããŒã¯ã³ã®é åºãæå³ã®ãã空çœåºåãããŒã¯ã³ã®éåã§ããã
空çœåºåãããŒã¯ã³ã®éåã¯ææå®çŸ©ãããèš±å¯ãããå€ã®éåãæã€ãèš±å¯ãããå€ã®éåãå®çŸ©ãããå ŽåãããŒã¯ã³ã¯ãã¹ãŠèš±å¯ãããå€ã®ãªã¹ãã§ãªããã°ãªããªãããã®ä»ã®å€ã¯äžé©åã§ããããã®ãããªèš±å¯ãããå€ã®éåãçšæãããªãå Žåããã¹ãŠã®å€ã¯é©åã§ããã
空çœåºåãããŒã¯ã³ã®éåã®ããŒã¯ã³ãã©ã®ããã«æ¯èŒããããïŒããšãã°ã倧æåå°æåãåºå¥ãããã©ããïŒã¯ãã»ããããšã«å®çŸ©ãããã
ã³ã³ãåºåãããŒã¯ã³ã®éåã¯ãããããåäžã®U+002C COMMAæåïŒ,ïŒã§åºåããã0å以äžã®ããŒã¯ã³ãå«ãæååã§ãããããã§ããŒã¯ã³ã¯0å以äžã®ä»»æã®æååãããªããå é ãæ«å°ŸãASCIIç©ºçœæåã§ãªããU+002C COMMAæåïŒ,ïŒãå«ãŸããä»»æã§ASCIIç©ºçœæåã«å²ãŸãããã®ã§ããã
ããšãã°ãæåå" a ,b,,d d "ã¯4ã€ã®ããŒã¯ã³ãããªãã"a"ã"b"ã空æååããã³"d d"ãåããŒã¯ã³ã®åšãã®å
é ãšæ«å°Ÿã®ç©ºçœã¯ããŒã¯ã³ã®äžéšãšããŠã«ãŠã³ããããã空æååã¯ããŒã¯ã³ã§ãããããããªãã
ã³ã³ãåºåãããŒã¯ã³ã®éåã¯æã«åŠ¥åœãªããŒã¯ã³ãæ§æãããããªãå¶çŽãæã€ããã®ãããªå¶éãå®çŸ©ãããå ŽåãããŒã¯ã³ã¯ãã¹ãŠãã®å¶éã«åãŸãããã«ããªããã°ãªããªãããã®ä»ã®å€ã¯äžé©åã§ããããã®ãããªå¶éãæå®ãããªãå Žåããã¹ãŠã®å€ã¯é©åã§ããã
ã¿ã€ãtypeèŠçŽ ã®åŠ¥åœãªããã·ã¥ååç
§ã¯ã U+0023 NUMBER SIGNæåïŒ#ïŒã®åŸã«åãããªãŒã§ã¿ã€ãtypeããã€èŠçŽ ã®name屿§ã®å€ã«æ£ç¢ºã«äžèŽããæååããæ§æãããæååã§ããã
The rules for parsing a hash-name reference to an element of type type, given a context node scope, are as follows:
If the string being parsed does not contain a U+0023 NUMBER SIGN character, or if the first such character in the string is the last character in the string, then return null.
Let s be the string from the character immediately after the first U+0023 NUMBER SIGN character in the string being parsed up to the end of that string.
Return the first element of type type in scope's tree, in tree order, that has an id or name attribute whose value is s, or null if there is no such element.
Although id attributes are accounted for when parsing, they are not used in determining whether a value is a valid hash-name reference. That is, a hash-name reference that refers to an element based on id is a conformance error (unless that element also has a name attribute with the same value).
Media Queriesã®<media-query-list>çæç©ã«äžèŽããå Žåãæååã¯åŠ¥åœãªã¡ãã£ã¢ã¯ãšãªãŒãªã¹ãã§ããã[MQ]
空æååãASCIIç©ºçœæåã®ã¿ãããªãæååããŸãã¯Media Queriesã§äžããããå®çŸ©ã«åŸã£ããŠãŒã¶ãŒç°å¢ã«ãããããã¡ãã£ã¢ã¯ãšãªãŒã®å Žåãæååã¯ãŠãŒã¶ãŒç°å¢ã«äžèŽããã[MQ]
äžæã®å éšå€ã¯ãã·ãªã¢ã«åå¯èœã§ãå€ã«ãã£ãŠæ¯èŒå¯èœã§ãããã¹ã¯ãªããã«å ¬éãããããšã®ãªãå€ã§ããã
æ°ããäžæã®å éšå€ãäœæããã«ã¯ããã®ã¢ã«ãŽãªãºã ã«ãã£ãŠä»¥åã«è¿ãããããšã®ãªãäžæã®å éšå€ãè¿ãã