David said:
David said:
[...]
The realAttr? I don't think it does that. That function parses outerHTML
for IE. It seems like overkill.
Method realAttr address attribute issue; not properties.
Of course. There is a companion (unfortunately) called "attr" that
addresses properties.
link.href (as in HTMLLinkElement) is a property.
Yes.
The value is a relative
URI in IE.
That's a bug
Why do you say so?
Not really. But we've been over it here. In a nutshell, IE < 8 (plus
IE8 compatibility mode)
| The X-UA-COMPATIBLE header has greater precedence than Compatibility
| View. If a Web site is on the Compatibility View List and a page on
| that site includes an X-UA-COMPATIBLE header telling Internet Explorer
| 8 to display a page in IE8 mode, the page is displayed in Internet
| Explorer 8 Standards mode. This allows Web developers to support
| Internet Explorer 8 Standards mode on an incremental basis. For more
| information, see Defining Document Compatibility.
[snip]> So it shows that the white space is irrelevant in MSHTML? Regardless,
I agree that the RegExp should allow for such white space in
outerHTML. You never know when they might change it.
Whitespace is allowed there in HTML. I would not rely on nonstandard
quirks. I remember differences in Opera outerHTML.
I agree and will definitely update that RegExp when I get a chance.
[snip]
HTML 4 says an absolute URI is resolved. When? During parse time? When
the attribute is requested (as when the browser makes an HTTP request to
load a stylesheet from the src of a LINK tag)? HTML4 does not say when.
From the perspective of HTML, it doesn't matter when.
I know that. A property get will normally resolve it,
No, a property get does not normally resolve it. DOM 2 guarantees a full
URI for document.URL, a.href, and the domain of a cookie.
That's what I said.
No, you wrote: "A property get will normally resolve it".
If "it" means a property with a URL value, then that would be a false
statement. A property get of URL attribute's corresponding DOM property
does *not* normally resolve a relative URL to an absolute URL. DOM 2
HTML says absolute URI for three properties (cookie, a.href,
document.url) What browsers return for other properties that correspond
to URI attributes varies.
URIs in stylesheets is yet another matter.
The get will resolve a relative URI (to a full
URI). Getting the attribute should _not_ do that (and doesn't in most
browsers).
(that does not express my intent well; I meant that form.action reflects
the corresponding content attribute).
Why do you say so?
Using the wrappers, it is down to two as IE is
taken care of. But certainly I wouldn't count on being able to get a
URI attribute value as it appears in the markup (or conversely rely on
property gets to resolve them to full paths).
Programs can't rely on properties or attributes.
Yes. I have a companion piece that does just that. Compares Dojo,
jQuery and GoogClosure versions of "attr" to a wrapper based on my
code and the raw results from the browser. It's quite illuminating
(and very scary if you built on those libraries) but needs a little
more work before I publish it.
I am interested in seeing a test page for reading properties from objects.
DOM URI Properties are Resolved to Absolute URI?
| property | IE7 | FF3 | | Standard |
+-------------+-----+-----+ [...] -+----------+
| link.href | N | Y | | N |
| a.href | Y | Y | | Y |
| form.action | N | Y
Just adding in all the browsers. Its work to be done, but would be
worthwhile to have published, for reference.
Yes and the latter is the correct choice.
AFAIK, there isn't any standard that confirms that to be true.
In fact, the DOM explicitly states *absolute URI* for a.href, but does
not state so for link.href. This leads me to believe that the value of
the DOM property is not guaranteed to be an absolute URI.
[snip]
That hasn't been shown to be the case.
[...]
All of the other URI attributes could be tested and specified.>> In contrast to what browsers do, HTML 5 specifies that that a
LINK's href reflects.
[1]
http://www.w3.org/TR/DOM-Level-2-HTML/html.html
As in, it matches the attribute value?
Yes, HTML 5 says link.href returns the content attribute value.
That's not what four browsers do.
Actually, that's what you said the four (bad) browsers did (returned
the attribute value verbatim).
I did not write that. I wrote the opposite:
| HTML 5 says link.href returns the content attribute value. That's
| *not* what four browsers do.
Four browsers return an absolute URI for link.href.
We need a test page. I outlined earlier the object properties that have
URI-valued attributes. Each attribute needs to be tested and the resulst
published in a table.
That's wrong and if HTML5 copies that,
they have eliminated the possibility of ever getting the fully
resolved URI from the href property. (!)
Definitely. What the hell are they doing? Watching browsers and
taking notes?
Probably not in this case.
When standardizing legacy features, Ian and Anne seem look at what
browsers do. Unfortunately this often includes things that are useless,
inconsistent, and buggy, such as form.elementName, HTMLCollection.tags,
and quirks mode.
The standardizing of legacy garbage is a forest for the trees issue.
Also a chicken and egg issue. What scripts do is largely the result of
the bad DOMs and so looking at the bad DOMs and looking at the scripts
and standardizing what happens encourages browser consistency but misses
the big picture: The API should exist to solve problems. Rather than
standardizing garbage because it works in three browsers, it might make
sense to look at how it is being used and present a superior alternative.
The new HTML 5 and WebIDL features are even more bizarre, including
Element.prototype, [[Class]], special delete operator behavior. What a
disaster that is. AIUI, Brendan will be going in an cleaning up their
mess. Poor guy. Allen, great guy but they don't hang.