reset algorithm

リセット (フォーム)

form 要素 onreset 属性 (HTML, XHTML 1)

[1] HTMLform 要素の onreset 属性は、 フォーム再設定される時に発生する事象に関する内在事象属性です。

[2] 仕様書:

代替

[3] 内在事象属性は表現と構造の分離の原則に反するので、 好ましくないと考える人もいます。また、 DOM 0 に基づく古い設計です。

代わりに、 script 要素などにより関連付けたスクリプト内で DOM 2 以上の事象に関するメソッド等が利用できます。 DOM 水準 2 や DOM 水準 3 はこの属性に対応する DOM の事象 ev:reset を用意しています。

属性値

[4] この属性の値は %Script です。 SGML 的には CDATA です。 自称が発生したときに実行するスクリプトの code を記述します。スクリプト言語は、 Content-Script-Type によります。

[5] この属性は省略可能です。

関連

[7] 定義上、 fieldset が再設定されるときには reset 事象は発生しませんし、 fieldset 要素に onreset 属性を指定することはできません。 また、個々のフォーム制御子ではなく form 要素の属性であることにも注意してください。

歴史

[13] 猫式Webメモ <http://d.hatena.ne.jp/nekoshiki/20040312#p2>

[14] Web Applications 1.0 r7609 Mostly, browsers seem to make these events bubble. ( ( 版)) <http://html5.org/tools/web-apps-tracker?from=7608&to=7609>

[15] Web Forms 2.0 ( 版) <http://www.whatwg.org/specs/web-forms/current-work/#additions>

[8] Web Applications 1.0 r5580 Missed .onreset somehow.Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10892 ( ( 版)) <http://html5.org/tools/web-apps-tracker?from=5579&to=5580>

[9] Web Applications 1.0 r8718 Make sure reset() can't fire a popup ( ( 版)) <http://html5.org/r/8718>

[10] Web Applications 1.0 r8886 Make sure <textarea> is reset when you parse the end tag, since otherwise it wouldn't actually ever work... ( 版) <https://html5.org/r/8886>

[11] Resetting a textarea should reset its dirty value flag · whatwg/html@d0711b0 ( 版) <https://github.com/whatwg/html/commit/d0711b022b24294340508357c91ce5687b998b7d>

[12] Editorial: clarify reset the form owner's first step · whatwg/html@6e5ecb0 ( 版) <https://github.com/whatwg/html/commit/6e5ecb099faf2c1d2b375081cb9bf03e92e8f088>

メモ

[2] reset button うざい!

[16] Update textarea textContent/defaultValue/value interaction (domenic著, ) <https://github.com/whatwg/html/commit/5afbba1cf62ee01bc6af3fd220d01f3f7591a0fc>

[17] Textarea defaultValue handling doesn't really match UAs (who don't match each other) when there are child elements · Issue #2752 · whatwg/html () <https://github.com/whatwg/html/issues/2752>

[18] Editorial: clarify a long conditional (annevk著, ) <https://github.com/whatwg/html/commit/dfb3f61140e28a10e1a63c55d566270a4785f57b>

[19] Editorial: clarify a long conditional by annevk · Pull Request #2862 · whatwg/html () <https://github.com/whatwg/html/pull/2862>

[20] element interaction: introduce clear algorithm concept (andreastt著, ) <https://github.com/w3c/webdriver/commit/bc32d801107b445a3268653671732d83b3dfac1f>

[21] Textarea/text input text cursor position is not updated by reset algorithm · Issue #3468 · whatwg/html () <https://github.com/whatwg/html/issues/3468>