[14] HTML の base
要素型の要素は、
文書の基底URI や基底対象枠を指定するために使用することができます。
[17] HTML での基底 URI に関しては、 HTML//基底URI も参照してください。
href | 絶対URI | (選択必須) | 基底 URI | [HTML 2], [HTML 4] |
id | (なし) | 固有識別子 | [XHTML 1.0 SE], Microsoft Word | |
target | %FrameTarget | (選択必須) | 既定の対象枠 | [HTML 4] 非推奨 |
href
属性と target
属性のいずれかは必須です (が、 DTD でこれを表すことができないので、
両方の属性が存在する DTD では、両方省略可能になっています)。
[16] この要素は
head
要素内に高々1個存在できますが HTML 4、
外部参照を持つ要素の前になければなりません HTML 4 仕様書。
base
要素の前に来得る、
外部参照を持ち得る要素型は script
,
object
, link
です。 (スクリプト内やスタイルシート内の参照も含まれるのでしょうか?
だとしたら style
要素や、
style
属性または事象系属性を持つ任意の要素が該当します。)
ところで、 head
要素自体も
profile
という値に URI
を含む属性があります。でもそれ以前にもっていくのは不可能です。
[18]
HTML 4 loose DTD でも base
が出現可能なのは高々1回です。つまり、
href
用と target
用を別にするようなことはできない、
ということです。
[5] base
要素は、HTML要素の状態に加え、
次の状態を持ちます。
[127] Document
内で木順で最初の href
属性つき
base
要素は、凍結基底URLを持ちます >>128。
凍結基底URLは文書基底URLの決定に用いられます。
[129] 次のような状況で同期的に凍結基底URLの設定が行われなければなりません >>128。
[132] 要素要素の凍結基底URLの設定は、 次のようにします >>128。
[136] これらの規定により、 base
要素によって設定される基底URLは、
それが文書基底URLとして用いられることになった時点で解決した値に固定されることになります。
フォールバック基底URLは pushState
などによって変化することがありますが、
それによって凍結基底URLは変化しません。
[137] なお、 base
要素の href
IDL属性はその時点で
href
内容属性をフォールバック基底URLに対して解決した値を返すので、
必ずしも凍結基底URLとは一致しません。
[27]
HTML には codebase
属性があって、特定の要素の特定の処理における基底 URI
を別途指定できます。
XHTML を他のマーク語彙と組合せる時の
base
要素の影響は規定されていませんから、
どう解釈されるかわかりませんので危険です。
base
要素の適用範囲#✎[8] 不思議マーク付け的には、 base
要素は次の
base
要素が現れるまで有効なのだそうです (少なくても WinIE はこの通り動くらしい)。
basefont
要素と同じですね。
[33]
WinIE (MSHTML) において、 base
要素が head
中に存在する場合、
body
の
parentNode
は base
です。head
内の要素の内、
base
の弟の
parentNode
は base
です。base
の childNodes
には base
の弟や body
が含まれます。base
の parentNode
は head
です。base
の previousSibling
は直近の兄です。base
の nextSibling
は null
です。head
の childNodes
には base
の兄や base
が含まれます。body
の previousSibling
は head
です。body
の nextSibling
は null
です。head
の previousSibling
は null
です。head
の nextSibling
は body
です。head
の parentNode
は html
です。html
の childNodes
には head
と body
が含まれます。base
の
outerHTML
, innerHTML
,
outerText
, innerText
には弟や body
の内容も含まれます。
base
の終了タグはありません。
head
の終了タグは含まれます。head
の
outerHTML
, innerHTML
,
outerText
, innerText
には body
の内容は含まれません。(WinIE 6 on Windows XP SP2 で確認)
参考: agenda 2002-03(下旬) - Personnel http://members.jcom.home.ne.jp/jintrick/Personal/d20023l.html#d18_19
>>3 のように body
内に複数
base
を入れてみると、それ以降がすべて
base
に飲み込まれます。
base
の終了タグがあっても無視されます。
(名無しさん 2005-05-29 07:33:55 +00:00)
[35] >>34 のテスト: http://suika.fam.cx/gate/cvs/*checkout*/www/test/html/base/base-in-body.html (名無しさん [sage])
[37]
こういう変な包含関係は contentEditable
でも生じるらしい
contentEditable - Anne’s Weblog about Markup & Style http://annevankesteren.nl/2005/07/contenteditable
(名無しさん [sage])
[38] >>33-35 WinIE 7 で修正される予定だそうです。
IEBlog : All your <base> are belong to us http://blogs.msdn.com/ie/archive/2005/08/29/457667.aspx
(名無しさん 2005-09-02 03:35:49 +00:00)
[64] 「base要素でいろいろ」@水無月ばけらのえび日記 http://bakera.jp/hatomaru.aspx/ebi/topic/2697 (名無しさん 2006-11-05 23:44:46 +00:00)
[65]
crisp’s blog » Blog Archive » Broken parsers; the importance of BASE (2007-01-12 23:43:01 +09:00
版) http://therealcrisp.xs4all.nl/blog/2007/01/06/broken-parsers-the-importance-of-base/
(名無しさん 2007-01-12 14:45:56 +00:00)
2007-01-13 16:06:46 +09:00
版) http://www.websemantics.co.uk/tutorials/useful_css_snippets/#baseAn unusual effect. IE refused to copy or highlight body content text. The issue was related to the use of the base element in the head section. Without it, copy worked. With it, IE refused to highlight the text.
Example:
<base href="someURL" />Caused issues. The solution was to replace it with:<base href="someURL"></base>Other head elements may also cause this problem, though the solution should be similar.
The base address tag is not used, nor is highlighting HP1 etc.
Base Address
Anchors specify addresses of other documents, in a from relative to the address of the current document. Normally, the address of a document is known to the browser because it was used to access the document. However, is a document is mailed, or is somehow visible with more than one address (for example, via its filename and also via its library name server catalogue number), then the browser needs to know the base address in order to correctly deduce external document addresses.
The format of this tag is not yet specified.
Anchors specify addresses of other documents, in a from relative to the address of the current document. Normally, the address of a document is known to the browser because it was used to access the document. However, is a document is mailed, or is somehow visible with more than one address (for example, via its filename and also via its library name server catalogue number), then the browser needs to know the base address in order to correctly deduce external document addresses.
The format of this tag is not yet specified. NOT CURRENTLY USED
savedas
要素案 (1992/11-1993/1)#✎6. Any more thoughts on the BaseAddress tag?
Yes. It should be in. I think. I've mentioned in http://info.cern.ch/hypertext/WWW/MarkUp/Future.html
Base address
savedas
- Could be a name for the tag to give the address with which the document was saved, so that relative links could be resolved even when a document is found out of context (like mailed).
savedas
savedas
の構想がある。
現在の
base
に当たるが、
メールなどでの相対URLの解決のためと説明されていた。
>>47
要素名と合わせて Internet Explorer
の
<!-- saved from url -->
構文を思い起こさせる。
SW:SavedFrom[46] EMail Msg <9301141702.AA00591@www3.cern.ch>, , https://ksi.cpsc.ucalgary.ca/archives/WWW-TALK/www-talk-1993q1.messages/64.html
Now, what about the SAVEDAS adddress so that from justthe content of the document hte partial UDIs can be resolved? I think that is a useful thing, and could be essentail. I will put that in as Standard.
Yuk, but OK for now. (I have lots to say about URLs, but until I have time to do something about it, I'll leave them be :-)
base
要素の誕生 (1993/3)#✎[114] base
要素が初めて登場するのは、現在確認されている中では、1993年3月10日版の仕様書と見られる
>>111 です。収録されている DTD にも base
要素が含まれています。
8
BASE
This element allows the URL of the document itself to be recorded in situations in which the document may be read out of context. URLs within the document may be in a "partial" form relative to this base address.
Where the base address is not specified, the reader will use the URL it used to access the document to resolve any relative URLs.
The one attribute is:
HREF
- the URL
[115] その後の版である次の文書にも base
要素は引き継がれています。
BASE
The optional <BASE> element provides a base address for interpreting relative URLs when the document is read out of context (see 7, "Hyperlinks"). The value of the HREF attribute must be an absolute URI.
省略可能な
base
要素は、 文書が文脈外で読まれる時に相対URLを解釈するための基底番地を提供します。href
属性の値は絶対URIでなければなりません。
[110] Netscape Navigator 1.0 (1995年) は既に base
要素に対応していたようです >>118。
それ以前から実装されていたかもしれません。
[39]
libwwwのHTML構文解析器は1996年7月20日のRelease 4.1b3でbase
を実装しました。
[73] >>122 の NCSA Mosaic Unix 版 2.7b5 (1996年7月) のソースを見ると base
要素にはまだ対応していないようです。
[120] >>73-74 でも >>118-119 によると 1995年10月の NCSA Mosaic 2.0 以降は base
要素に対応しているらしい。
[123] 確かに >>121 の NCSA Mosaic 2.7 のソースには base
要素が含まれています。
[19]
base
要素に id
を振って、相対 URI
を使う文脈でどの基底 URI (たとえば画像用の基底 URI)
を使うのかを選べるようにしたらどうかという案もありました。
www-html@w3.org from May 1995: Re: <BASE> processing by browsers http://lists.w3.org/Archives/Public/www-html/1995May/0004.html
BASE
element
http://www.w3.org/TR/html4/struct/links.html#edef-BASEBASE
要素 (DjVu XML)#✎2007-05-01 06:53:18 +09:00
版) http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/104602007-08-07 09:32:28 +09:00
版) http://permalink.gmane.org/gmane.org.w3c.whatwg.discuss/11598[67] 今朝 () の #whatwg より (JST):
- 08:15 <Hixie> about 5% of sites have 1 <base> tag, apparently
- 08:16 <Hixie> 0.03% have 2
- 08:16 <Hixie> 0.0017% have 3
- 08:16 <Hixie> and a few thousand have more than 3
- 08:18 <Hixie> so we're talking about a few million pages here
- 08:18 <Hixie> with 2 or more <base> elements
- 08:19 <Hixie> oh actually this was only counting _different_ values for <base>
- 08:19 <Hixie> so a few million pages use two different values for <base>
[43] IRC logs: freenode / #whatwg / 20070501, https://krijnhoetmer.nl/irc-logs/whatwg/20070501
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <TITLE>Our Products</TITLE> <BASE href="http://www.example.com/products/intro"> </HEAD> <BODY> <P>Have you seen our <A href="../cages/birds">Bird Cages</A>? </BODY> </HTML>
(HTML 4 仕様書より、改)
この場合、この文書自体の URI にかかわらず、
a
要素のリンク先は
http://www.example.com/cages/birds になります。
[117] 私の近況(2002年11月) ( ( 版)) http://www5e.biglobe.ne.jp/~tbs-i/kinkyo/2002/0211.html#18
[125] ( ( 版)) http://lynx.isc.org/current/CHANGES2.4
[138] ncsa-mosaic/CHANGES at master · alandipert/ncsa-mosaic ( ( 版)) https://github.com/alandipert/ncsa-mosaic/blob/master/CHANGES#L145
[139] ncsa-mosaic/CHANGES at master · alandipert/ncsa-mosaic ( ( 版)) https://github.com/alandipert/ncsa-mosaic/blob/master/CHANGES#L597
[1] This morning's work. · w3c/webappsec-csp@d669817 ( 版) https://github.com/w3c/webappsec-csp/commit/d6698170c8eede388bd351773dada7b633988be8
[2] Fix base-uri algorithm and grammar. · w3c/webappsec-csp@f4d2db1 ( 版) https://github.com/w3c/webappsec-csp/commit/f4d2db1c08534cdd1e36675cc8a93ee0c95d53ba
[3] URLs are parsed and produce records · whatwg/html@30bc255 ( 版) https://github.com/whatwg/html/commit/30bc2557105ad62881ec9670f253febbc9761b44
[4] Wire up CSP's control over the base element · whatwg/html@7bfca70 ( 版) https://github.com/whatwg/html/commit/7bfca708707e36bc2a7d5570bedc6dc4383b7676
[21] Correct URL parsing of base elements · whatwg/html@2719a51 ( 版) https://github.com/whatwg/html/commit/2719a514ebd2ee66813fb5ee92f52e99a1479e78
[7] Restrict `<base>` to ~sane schemes. · Issue #2249 · whatwg/html () https://github.com/whatwg/html/issues/2249
The endpoint may be a relative URL, in which case the sender must resolve it relative to the target URL according to [URL].
[24] >>23 の規定は base
要素を無視しており、 HTML Standard
と矛盾しています。
[25] Add a warning about nonces and <base>. (@arturjanc著, ) https://github.com/w3c/webappsec-csp/commit/d48fd5f01143c48a8a3c40ebb169bc865e2d2123
[29] Allow customizing base URL of a shadow root · Issue #581 · w3c/webcomponents () https://github.com/w3c/webcomponents/issues/581
base
要素は含まれていません。またsavedas
要素が含まれている DTD もなかったようです。