Bug 47046 - REGRESSION (r63517): Apple concierge website broken because of text node between HEAD and BODY
Summary: REGRESSION (r63517): Apple concierge website broken because of text node betw...
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Major
Assignee: Nobody
URL: http://concierge.apple.com/store/R075
Keywords: InRadar, Regression
Depends on:
Blocks: 41115
  Show dependency treegraph
Reported: 2010-10-02 02:26 PDT by mitz
Modified: 2011-01-13 16:04 PST (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2010-10-02 02:26:26 PDT
In TOT, the product tiles at http://concierge.apple.com/store/R075 do not respond to hovering over them or clicking them. The Inspector console reports
HIERARCHY_REQUEST_ERR: DOM Exception 3: A Node was inserted somewhere it doesn't belong.
An inspection of the DOM reveals that the BODY element’s previous sibling is a text node. In Safari 5.0.2, the BODY element’s previous sibling is the HEAD element.

This is a reduction:
<head></head>  <body><script>alert(document.body.previousSibling)</script></body>
Comment 1 mitz 2010-10-02 02:27:36 PDT
Comment 2 mitz 2010-10-02 02:37:38 PDT
Caused by <http://trac.webkit.org/changeset/63517>.
Comment 3 Adam Barth 2010-10-02 15:26:35 PDT
The site is also broken in Firefox 4.  Perhaps we can evangalize the site to use document.head or document.getElementsByTagName('head')[0] to local the head element?
Comment 4 Alexey Proskuryakov 2010-10-02 20:24:53 PDT
Does this HTML5 behavior match any shipping browser?
Comment 5 Adam Barth 2010-10-02 22:17:15 PDT
I complained about this change when we first implemented it.  I can dig up the W3C bug if you like.  The spec skips some whitespace nodes early in the document for compatibility.  At the time Ian's position was that skipping these nodes is aesthetically ugly because you lose information about the original document.  You can see this effect, for example, when you serialize the DOM back to a string.

My guess is this issue will come down to an estimate of how many cites are affected.  If this is the first one that we and Henri have seen, we might try to evangelize it (especially since it's from a company that, you know, makes a web browser).  If we see more examples, we might want to change the spec.
Comment 6 Henri Sivonen 2010-10-04 00:39:11 PDT
(In reply to comment #5)
> If this is the first one that we and Henri have seen

I don't recall seeing this before.
Comment 7 Andy Estes 2011-01-13 15:33:25 PST
I don't see this bug on the live site anymore. I can hover over the product categories and they gain border highlighting; I can also click them. Mitz, can you confirm this?
Comment 8 mitz 2011-01-13 16:00:03 PST
I cannot reproduce the symptom with a build of TOT.
Comment 9 Adam Barth 2011-01-13 16:01:04 PST
Please feel free to re-open this bug if we find more examples.