废弃的特性
废弃但符合规范的特性
此章节中列出的特性将会在规范检测中引起警告。
代码编写的作者不应该为0",最好使用CSS方式替代。
代码编写的作者不应该为JavaScript"的ASCII-case-insensitive值,并且,它的text/javascript"的ASCII-case-insensitive值。该属性应该被完全地删除(它的值为"JavaScript"时,没有任何效果),或者使用
代码编写的作者不应该为home-subtree中的其他任何IDs值相同,该元素自身的ID除外,如果有的话,也不能与该元素的home-subtree中的任何其他ID相同。在此语言的早期版本中,该属性被故意设计成为在URLs中为片段检索指定可能的目标的一种途径。它应该被
对废弃但符合规范的特性进行警告
为了简化从HTML4过渡性文档到此规范中所定义语言的过度及停止一些仅仅在非常少的状况下才被允许的特性,标准检测需要对用户在文档中使用这些特性时进行警告。它们通常都是一些没有效果的过时的特性,并且它们仅被用来区分可能的错误(常规的标准错误)以及那些仅存的标签或不常用的令人沮丧的实践(这些警告)。
下面这些特性必须按照上面的描述进行分类:
0"。
JavaScript"的ASCII-case-insensitive,并且,它没有指定text/javascript"的ASCII-case-insensitive值。
标准检测必须能够在页面中识别出没有违规错误且没有使用这些特性和没有违规错误但存在一些被废弃的特性。
如,检测器应该对有些页面报告出“合法的HTML”("Valid HTML") 和 “合法的HTML但伴有警告”("Valid HTML with warnings")
非标准特性
以下列出的元素全部都是完全过时废弃的,它们不应该被使用:
acronym
使用
bgsound
dir
使用
noframes
可以使用
isindex
使用一个显式的text field组合进行替代
listing
使用
nextid
使用GUIDs进行替代
noembed
使用
plaintext
使用"text/plain"的MIME type替代
rb
只需要将文本直接写在
strike
如果该元素标记着一处编辑过的内容则使用
xmp
使用
basefont
big
blink
center
font
multicol
nobr
spacer
tt
用其他适当的元素和CSS进行替代
在
以下的属性皆已废弃(虽然它们仍然是此语言中的一部分),请不要继续使用:
charset属性
charset属性
在链接到的源上使用HTTP Content-Type头来替代
coords属性
shape属性
为image maps使用
methods属性
link的methods属性
使用HTTP OPTIONS特性进行替代
name属性(除非像在之前章节中提到的情形)
name属性
name属性
name属性
使用
rev属性
rev属性
使用rel="author" 替代 rev="made")
urn属性
urn属性
指定首选的持久标识,采用
nohref属性
将
profile属性
当被用来声明文档中用到的注册这些名字
当用来触发特别的user agent行为时,可以用
version属性
不需要,完全可以省略
usemap属性
使用
longdesc属性
img的longdesc属性
使用一个常规的image map提供一个链接到该图片的描述部分
lowsrc属性
使用一个压缩的JPEG图片(在
target属性
不需要,完全可以省略
scheme属性
每个范围只使用一个scheme,或者,将scheme声明作为值的一部分
archive属性
classid属性
code属性
codebase属性
codetype属性
使用plugins进行调用。可以用
declare属性
完全地重复某个
standby属性
优化链接的资源以使加载更快,或者,至少有所改善
type属性
valuetype属性
在不是被用来声明值类型时,可以使用
language属性(除非像在之前章节中提到的情形)
使用
event属性
for属性
使用DOM Events机制注册事件监听。[DOMEVENTS]
datapagesize属性
不需要,完全可以省略
summary属性
td, abbr属性
在前面以简洁明了的方式使用文本,并在其后包含一些更详细的描述。可以使用
td, axis属性
在相关的
可使用script或类似XMLHttpRequest机制去实现动态页面。[XHR]
alink属性
bgcolor属性
link属性
marginbottom属性
marginheight属性
marginleft属性
marginright属性
margintop属性
marginwidth属性
text属性
vlink属性
clear属性
align属性
align属性
char属性
charoff属性
valign属性
width属性
align属性
compact属性
align属性
hspace属性
vspace属性
align属性
color属性
noshade属性
size属性
width属性
align属性
align属性
allowtransparency属性
frameborder属性
hspace属性
marginheight属性
marginwidth属性
scrolling属性
vspace属性
align属性
hspace属性
vspace属性
align属性
border属性(除非像之前章节中提到的情形)
hspace属性
vspace属性
align属性
type属性
compact属性
align属性
border属性
hspace属性
vspace属性
compact属性
align属性
width属性
align属性
bgcolor属性
cellpadding属性
cellspacing属性
frame属性
rules属性
width属性
align属性
bgcolor属性
char属性
charoff属性
height属性
nowrap属性
valign属性
width属性
align属性
bgcolor属性
char属性
charoff属性
valign属性
compact属性
type属性
全部使用CSS替代
1",其他任何值都被视为废弃的。如果想要调整表格的宽度等样式,可以使用CSS进行调整。
实施需求
applet元素
否则,user agent应该实例化一个Java语言的运行时插件(plugin),并将此元素的所有属性名和属性值传递进去,它们将按照源码解析时属性加入的顺序添加到此元素上,然后是一个值为null的"PARAM"参数,然后是所有作为tree order中,以供插件plugin使用。如果此插件支持脚本接口,
注:
interface HTMLAppletElement : HTMLElement {
attribute DOMString align;
attribute DOMString alt;
attribute DOMString archive;
attribute DOMString code;
attribute DOMString codeBase;
attribute DOMString height;
attribute unsigned long hspace;
attribute DOMString name;
attribute DOMString _object; // 底線並非標識符的一部分
attribute unsigned long vspace;
attribute DOMString width;
};
align, alt, archive, code, height, hspace, name, object, vspace, 和 width 等IDL属性必须反映与它们各自同名属性的内容。为此,object内容属性定义为包含一个URL。
IDL属性codeBase必须反映codebase内容属性,此属性因此目的而定义为包含一个URL。
marquee元素
interface HTMLMarqueeElement : HTMLElement {
attribute DOMString behavior;
attribute DOMString bgColor;
attribute DOMString direction;
attribute DOMString height;
attribute unsigned long hspace;
attribute long loop;
attribute unsigned long scrollAmount;
attribute unsigned long scrollDelay;
attribute boolean trueSpeed;
attribute unsigned long vspace;
attribute DOMString width;
attribute Function onbounce;
attribute Function onfinish;
attribute Function onstart;
void start();
void stop();
};
开启和关闭,当它被创建时,默认为开启(turned on)状态。
当start()方法被调用时,开启(turned on)。
当stop()方法被调用时,关闭(turned off)。
behavior是个可枚举的属性(enumerated attribute),它包括如下关键词(全都不符合标准):
关键词
描述
scroll
滚动
slide
滑动
alternate
交替
direction是个可枚举的属性(enumerated attribute),它包括如下关键词(全都不符合标准):
关键词
描述
left
向左
right
向右
up
向上
down
向下
默认值为left。
marquee滚动间隔(marquee scroll interval),它的获取过程如下:
如果此元素有指定scrolldelay属性,且在使用非负整数解析规则(rules for parsing non-negative integers)去解析它的值时没有返回错误,则令delay的值为该解析后的值,否则,令delay值为85。
如果该元素没有指定delay值小于60,则令delay值为60。
marquee滚动的步进距离(marquee scroll distance),如果此元素指定了scrollamount属性,且在使用非负整数解析规则(rules for parsing non-negative integers)去解析它的值时没有返回错误,则该步进距离为该解析后的值,否则,步进距离为6,单位为CSS中的像素px。
marquee循环次数(marquee loop count),如果此元素指定了loop属性,且在使用整数解析规则(rules for parsing integers)去解析它的值时没有返回错误,或返回值小于1,则该循环次数为该解析后的值,否则,循环次数为-1。
IDL属性loop,在获取的时候,必须返回此元素的marquee loop count;在设置的时候,如果所设的值与原有的值不同,且无论是大于0或等于-1,都必须为此元素属性的内容loop设置一个来自新值的有效整数(valid integer),其他值都应该被忽略。(如果有必要,需要为此元素加上loop属性及新值)
marquee当前循环索引值(marquee curent loop index),当该元素被创建时,其值为0。
渲染层将应时地增加marquee当前循环索引值(increment the marquee current loop index),必须使它按以下步骤来运行:
onbounce
弹回(bounce)
onfinish
结束(finish)
onstart
开始(start)
IDL属性behavior, direction, height, hspace, vspace, 和 width,必须能够反映与之同名属性的内容。
IDL属性bgColor,必须能够反映出bgcolor属性的内容。
IDL属性scrollAmount,必须能够反映scrollamount属性的内容,默认值为6。
IDL属性scrollDelay,必须能够反映scrolldelay属性的内容,默认值为85。
IDL属性trueSpeed,必须能够反映
Frames
frameset元素在使用帧(框架)时作为documents中的body元素(the body element)。interface HTMLFrameSetElement : HTMLElement {
attribute DOMString cols;
attribute DOMString rows;
attribute Function onafterprint;
attribute Function onbeforeprint;
attribute Function onbeforeunload;
attribute Function onblur;
attribute Function onerror;
attribute Function onfocus;
attribute Function onhashchange;
attribute Function onload;
attribute Function onmessage;
attribute Function onoffline;
attribute Function ononline;
attribute Function onpagehide;
attribute Function onpageshow;
attribute Function onpopstate;
attribute Function onredo;
attribute Function onresize;
attribute Function onscroll;
attribute Function onstorage;
attribute Function onundo;
attribute Function onunload;
};
cols和rows必须反映与之同名属性的内容。interface HTMLFrameElement : HTMLElement {
attribute DOMString frameBorder;
attribute DOMString longDesc;
attribute DOMString marginHeight;
attribute DOMString marginWidth;
attribute DOMString name;
attribute boolean noResize;
attribute DOMString scrolling;
attribute DOMString src;
readonly attribute Document contentDocument;
readonly attribute WindowProxy contentWindow;
};
name, scrolling和src,必须反映(reflect)与之同名属性的内容。
frameBorder,必须反映(reflect)该元素frameborder属性的内容。
longDesc,必须反映(reflect)该元素longdesc属性的内容,为此,它被定义为包含一个URL。
marginHeight,必须反映(reflect)该元素marginheight属性的内容。
marginWidth,必须反映(reflect)该元素marginwidth属性的内容。
noResize,必须反映(reflect)该元素noresize属性的内容。
其他元素,属性和API
user agents在某种程度上来说,就语义化和渲染效果方面,必须采取与
[Supplemental]
interface HTMLAnchorElement {
attribute DOMString coords;
attribute DOMString charset;
attribute DOMString name;
attribute DOMString rev;
attribute DOMString shape;
};
coords, charset, name, rev 和 shape,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLAreaElement {
attribute boolean noHref;
};
noHref必须能够反映interface HTMLBaseFontElement : HTMLElement {
attribute DOMString color;
attribute DOMString face;
attribute long size;
};
color, face 和 size,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLBodyElement {
attribute DOMString text;
attribute DOMString bgColor;
attribute DOMString background;
attribute DOMString link;
attribute DOMString vLink;
attribute DOMString aLink;
};
text必须能够反映(reflect)该元素的
bgColor必须能够反映(reflect)该元素的
background必须能够反映(reflect)该元素的URL,无视之前渲染章节中关于它的规则。)
link必须能够反映(reflect)该元素的
aLink必须能够反映(reflect)该元素的
vLink必须能够反映(reflect)该元素的
[Supplemental]
interface HTMLBRElement {
attribute DOMString clear;
};
clear必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLTableCaptionElement {
attribute DOMString align;
};
align必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLTableColElement {
attribute DOMString align;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
attribute DOMString width;
};
align和width必须能够反映(reflect)与之同名属性的内容。
ch必须能够反映(reflect)该元素的
chOff必须能够反映(reflect)该元素的
vAlign必须能够反映(reflect)该元素的
user agents在某种程度上来说,就语义化和渲染效果方面,必须采取与interface HTMLDirectoryElement : HTMLElement {
attribute boolean compact;
};
compact必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLDivElement {
attribute DOMString align;
};
align必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLDListElement {
attribute boolean compact;
};
compact必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLEmbedElement {
attribute DOMString align;
attribute DOMString name;
};
name和align必须能够反映(reflect)与之同名属性的内容。interface HTMLFontElement : HTMLElement {
attribute DOMString color;
attribute DOMString face;
attribute DOMString size;
};
color, face 和 size 必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLHeadingElement {
attribute DOMString align;
};
align必须能够反映(reflect)与之同名属性的内容。
注:profile(实现于其他适用的规范(another applicable specification),否则在实现时最好因此而不要去支持该属性。(我们这儿提到的,它在一个早前的DOM规范中做过了定义。)
[Supplemental]
interface HTMLHRElement {
attribute DOMString align;
attribute DOMString color;
attribute boolean noShade;
attribute DOMString size;
attribute DOMString width;
};
align, color, size 和 width 必须能够反映(reflect)与之同名属性的内容。
noShade必须能够反映(reflect)该元素的
[Supplemental]
interface HTMLHtmlElement {
attribute DOMString version;
};
version 必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLIFrameElement {
attribute DOMString align;
attribute DOMString frameBorder;
attribute DOMString longDesc;
attribute DOMString marginHeight;
attribute DOMString marginWidth;
attribute DOMString scrolling;
};
align 和 scrolling 必须能够反映(reflect)与之同名属性的内容。
frameBorder必须能够反映(reflect)该元素的
longDesc必须能够反映(reflect)该元素的
marginHeight必须能够反映(reflect)该元素的
marginWidth必须能够反映(reflect)该元素的
[Supplemental]
interface HTMLImageElement {
attribute DOMString name;
attribute DOMString align;
attribute DOMString border;
attribute unsigned long hspace;
attribute DOMString longDesc;
attribute unsigned long vspace;
};
name, align, border, space 和 space 必须能够反映(reflect)与之同名属性的内容。
longDesc必须能够反映(reflect)该元素的URL。
[Supplemental]
interface HTMLInputElement {
attribute DOMString align;
attribute DOMString useMap;
};
align必须能够反映(reflect)与之同名属性的内容。
useMap必须能够反映(reflect)该元素的
[Supplemental]
interface HTMLLegendElement {
attribute DOMString align;
};
align必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLLIElement {
attribute DOMString type;
};
type必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLLinkElement {
attribute DOMString charset;
attribute DOMString rev;
attribute DOMString target;
};
charset, rev 和 target 必须能够反映(reflect)与之同名属性的内容。
user agents在某种程度上来说,就语义化和渲染效果方面,必须采取与
[Supplemental]
interface HTMLMenuElement {
attribute boolean compact;
};
compact必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLMetaElement {
attribute DOMString scheme;
};
user agents大可将
user agents被鼓励可以忽略
比如,如果user agent在
以上是按此标记建议的处理,然而,它应该与下面的内容相同:
scheme,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLObjectElement {
attribute DOMString align;
attribute DOMString archive;
attribute DOMString border;
attribute DOMString code;
attribute DOMString codeBase;
attribute DOMString codeType;
attribute boolean declare;
attribute unsigned long hspace;
attribute DOMString standby;
attribute unsigned long vspace;
};
align, archive, border, code, declare, hspace, standby 和 vspace,必须能够反映(reflect)与之同名属性的内容。
codeBase,必须能够反映(reflect)该元素的URL。
codeType,必须能够反映(reflect)该元素的
[Supplemental]
interface HTMLOListElement {
attribute boolean compact;
};
compact,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLParagraphElement {
attribute DOMString align;
};
align,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLParamElement {
attribute DOMString type;
attribute DOMString valueType;
};
type,必须能够反映(reflect)与之同名属性的内容。
valueType,必须能够反映(reflect)该元素的
user agents在某种程度上来说,就语义化和渲染效果方面,必须采取与
[Supplemental]
interface HTMLPreElement {
attribute unsigned long width;
};
width,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLScriptElement {
attribute DOMString event;
attribute DOMString htmlFor;
};
event和htmlFor,在取值时,必须返回空字符串,在设值的时候什么都不做。
[Supplemental]
interface HTMLTableElement {
attribute DOMString align;
attribute DOMString bgColor;
attribute DOMString cellPadding;
attribute DOMString cellSpacing;
attribute DOMString frame;
attribute DOMString rules;
attribute DOMString summary;
attribute DOMString width;
};
align, frame, summary, rules 和 width,必须能够反映(reflect)与之同名属性的内容。
bgColor,必须能够反映(reflect)该元素的
cellPadding,必须能够反映(reflect)该元素的
cellSpacing,必须能够反映(reflect)该元素的
[Supplemental]
interface HTMLTableSectionElement {
attribute DOMString align;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
};
align,必须能够反映(reflect)与之同名属性的内容。
[Supplemental]
interface HTMLTableCellElement {
attribute DOMString abbr;
attribute DOMString align;
attribute DOMString axis;
attribute DOMString bgColor;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString height;
attribute boolean noWrap;
attribute DOMString vAlign;
attribute DOMString width;
};
abbr, align, axis, height 和 width,必须能够反映(reflect)与之同名属性的内容。
bgColor,必须能够反映(reflect)元素上
ch,必须能够反映(reflect)元素上
chOff,必须能够反映(reflect)元素上
noWrap,必须能够反映(reflect)元素上
vAlign,必须能够反映(reflect)元素上
[Supplemental]
interface HTMLTableRowElement {
attribute DOMString align;
attribute DOMString bgColor;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
};
align,必须能够反映(reflect)与之同名属性的内容。
bgColor,必须能够反映(reflect)元素上
ch,必须能够反映(reflect)元素上
chOff,必须能够反映(reflect)元素上
vAlign,必须能够反映(reflect)元素上
[Supplemental]
interface HTMLUListElement {
attribute boolean compact;
attribute DOMString type;
};
compact和type,必须能够反映(reflect)与之同名属性的内容。
user agents在某种程度上来说,就语义化和渲染效果方面,必须采取与
[Supplemental]
interface HTMLDocument {
attribute DOMString fgColor;
attribute DOMString bgColor;
attribute DOMString linkColor;
attribute DOMString vlinkColor;
attribute DOMString alinkColor;
readonly attribute HTMLCollection anchors;
readonly attribute HTMLCollection applets;
void clear();
readonly attribute HTMLAllCollection all;
};
以下表格中第一列所列出的这些反映(reflect)第二列中同一行所对应的在正文元素(the body element)上给出的这些属性的内容,如果正文元素(the body element)是一个
IDL属性
内容属性
fgColor
bgColor
linkColor
vlinkColor
alinkColor
anchors属性必须返回一个植根于
applets属性必须返回一个植根于
clear()方法必须什么都不做。
all属性必须返回一个植根于
通过
如果在JavaScript中调用ToBoolean()操作,user agents必须将通过
如果为了在JavaScript中做==和!=,user agents必须将通过undefined。
如果在JavaScript中调用typeof操作应用在通过undefined。
注:这些需求都是有意违反(willful violation)当前正在编写的JavaScript规范(ECMAScript 第3版)的。JavaScript规范中对ToBoolean()操作的需求是将所有对象转换为true值,且,为了完成一些确定的操作,它将不为那些看似为undefined的对象提供准备。这些违反都是出于此目的,那就是,期望能够兼容两种类别的遗留内容:一种是通过[ECMA262]