WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
17253
parser does not create nodes inside <iframe> (test 4 in Acid3 'ignoring whitespace during NodeIterator walk' fails)
https://bugs.webkit.org/show_bug.cgi?id=17253
Summary
parser does not create nodes inside <iframe> (test 4 in Acid3 'ignoring white...
Eric Seidel (no email)
Reported
2008-02-09 01:34:39 PST
Acid3 test ignoring whitespace during NodeIterator walk fails Test 4: expected: null, got: [object HTMLIFrameElement] - expectation 21 failed This will need further reduction. function () { // test 4: ignoring whitespace text nodes with node iterators var count = 0; var expect = function(node1, node2) { count += 1; assertEquals(node1, node2, "expectation " + count + " failed"); }; var allButWS = function (node) { if (node.nodeType == 3 && node.data.match(/^\s*$/)) return 2; return 1; }; var i = document.createNodeIterator(document.body, 0x01 | 0x04 | 0x08 | 0x10 | 0x20, allButWS, true); // now walk the document body and make sure everything is in the right place expect(i.nextNode(), document.body); // 1 expect(i.nextNode(), document.getElementsByTagName('h1')[0]); expect(i.nextNode(), document.getElementsByTagName('h1')[0].firstChild); expect(i.nextNode(), document.getElementsByTagName('div')[0]); expect(i.nextNode(), document.getElementById('bucket1')); expect(i.nextNode(), document.getElementById('bucket2')); expect(i.nextNode(), document.getElementById('bucket3')); expect(i.nextNode(), document.getElementById('bucket4')); expect(i.nextNode(), document.getElementById('bucket5')); expect(i.nextNode(), document.getElementById('bucket6')); // 10 expect(i.nextNode(), document.getElementById('result')); expect(i.nextNode(), document.getElementById('score')); expect(i.nextNode(), document.getElementById('score').firstChild); expect(i.nextNode(), document.getElementById('slash')); expect(i.nextNode(), document.getElementById('slash').firstChild); expect(i.nextNode(), document.getElementById('slash').nextSibling); expect(i.nextNode(), document.getElementById('slash').nextSibling.firstChild); expect(i.nextNode(), document.getElementsByTagName('map')[0]); expect(i.nextNode(), document.getElementsByTagName('area')[0]); expect(i.nextNode(), document.getElementsByTagName('iframe')[0]); // 20 expect(i.nextNode(), document.getElementsByTagName('iframe')[0].firstChild); expect(i.nextNode(), document.getElementsByTagName('iframe')[1]); expect(i.nextNode(), document.getElementsByTagName('iframe')[1].firstChild); expect(i.nextNode(), document.getElementsByTagName('iframe')[2]); expect(i.nextNode(), document.forms[0]); expect(i.nextNode(), document.forms.form.elements[0]); expect(i.nextNode(), document.getElementsByTagName('table')[0]); expect(i.nextNode(), document.getElementsByTagName('tbody')[0]); expect(i.nextNode(), document.getElementsByTagName('tr')[0]); expect(i.nextNode(), document.getElementsByTagName('td')[0]); expect(i.nextNode(), document.getElementsByTagName('td')[0].getElementsByTagName('p')[0]); expect(i.nextNode(), document.getElementById('instructions')); expect(i.nextNode(), document.getElementById('instructions').firstChild); expect(i.nextNode().nodeName, "SPAN"); expect(i.nextNode().nodeName, "#text"); expect(i.nextNode(), document.links[1]); expect(i.nextNode(), document.links[1].firstChild); expect(i.nextNode(), document.getElementById('instructions').lastChild); expect(i.nextNode(), null); // walk it backwards for good measure expect(i.previousNode(), document.getElementById('instructions').lastChild); expect(i.previousNode(), document.links[1].firstChild); expect(i.previousNode(), document.links[1]); expect(i.previousNode().nodeName, "#text"); expect(i.previousNode().nodeName, "SPAN"); expect(i.previousNode(), document.getElementById('instructions').firstChild); expect(i.previousNode(), document.getElementById('instructions')); expect(i.previousNode(), document.getElementsByTagName('td')[0].getElementsByTagName('p')[0]); expect(i.previousNode(), document.getElementsByTagName('td')[0]); expect(i.previousNode(), document.getElementsByTagName('tr')[0]); expect(i.previousNode(), document.getElementsByTagName('tbody')[0]); expect(i.previousNode(), document.getElementsByTagName('table')[0]); expect(i.previousNode(), document.forms.form.elements[0]); expect(i.previousNode(), document.forms[0]); expect(i.previousNode(), document.getElementsByTagName('iframe')[2]); expect(i.previousNode(), document.getElementsByTagName('iframe')[1].firstChild); expect(i.previousNode(), document.getElementsByTagName('iframe')[1]); expect(i.previousNode(), document.getElementsByTagName('iframe')[0].firstChild); expect(i.previousNode(), document.getElementsByTagName('iframe')[0]); // 20 expect(i.previousNode(), document.getElementsByTagName('area')[0]); expect(i.previousNode(), document.getElementsByTagName('map')[0]); expect(i.previousNode(), document.getElementById('slash').nextSibling.firstChild); expect(i.previousNode(), document.getElementById('slash').nextSibling); expect(i.previousNode(), document.getElementById('slash').firstChild); expect(i.previousNode(), document.getElementById('slash')); expect(i.previousNode(), document.getElementById('score').firstChild); expect(i.previousNode(), document.getElementById('score')); expect(i.previousNode(), document.getElementById('result')); expect(i.previousNode(), document.getElementById('bucket6')); expect(i.previousNode(), document.getElementById('bucket5')); expect(i.previousNode(), document.getElementById('bucket4')); expect(i.previousNode(), document.getElementById('bucket3')); expect(i.previousNode(), document.getElementById('bucket2')); expect(i.previousNode(), document.getElementById('bucket1')); expect(i.previousNode(), document.getElementsByTagName('div')[0]); expect(i.previousNode(), document.getElementsByTagName('h1')[0].firstChild); expect(i.previousNode(), document.getElementsByTagName('h1')[0]); expect(i.previousNode(), document.body); expect(i.previousNode(), null); return 1; },
Attachments
possible test case? (FF and Opera fail too)
(356 bytes, text/html)
2008-02-09 02:02 PST
,
Eric Seidel (no email)
no flags
Details
Remove the special skipMode behavior for iframes.
(1.27 KB, patch)
2008-02-10 12:49 PST
,
Dave Hyatt
hyatt
: review-
Details
Formatted Diff
Diff
Treat <iframe> like <title> and <textarea>, since that's what it is really supposed to be like.
(7.09 KB, patch)
2008-02-10 13:04 PST
,
Dave Hyatt
oliver
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2008-02-09 02:02:37 PST
Created
attachment 19015
[details]
possible test case? (FF and Opera fail too)
Darin Adler
Comment 2
2008-02-09 07:19:00 PST
I added Hixie to the CC list because I thought this was a bug in the test. But I'm not so sure now. I'll investigate this some soon.
Darin Adler
Comment 3
2008-02-10 12:27:24 PST
The failure remaining seems to have nothing to do with NodeIterator. The problem is that this is an <iframe> with a src that fails to load. At some point, when the load fails, presumably we are supported to fall back and display the fallback content instead as we do with <object>. I don't know what the test does to ensure that it doesn't try to run *before* the <iframe> has tried and failed to load its src, but I'm presuming it does something. If it doesn't then there could be an Acid3 bug. Then we have to make sure that the error from the server is treated as a failure. And make sure we do fallback. As far as I can tell we don't even try to do fallback for <iframe>. In fact, until now I had been under the impression that <iframe> was supposed to fall back only for browsers that don't support <iframe>, not for missing resources.
Dave Hyatt
Comment 4
2008-02-10 12:30:01 PST
This is news to me. I had no idea <iframe> was supposed to do this.
Dave Hyatt
Comment 5
2008-02-10 12:31:15 PST
Are you sure this isn't just a bug where the fallback content is always supposed to be present in the DOM?
Dave Hyatt
Comment 6
2008-02-10 12:49:22 PST
Created
attachment 19046
[details]
Remove the special skipMode behavior for iframes.
Dave Hyatt
Comment 7
2008-02-10 12:52:29 PST
Comment on
attachment 19046
[details]
Remove the special skipMode behavior for iframes. Never mind. It's more complicated than this. We need to enter a special "CDATA parsing mode" according to HTML5. What is inside the <iframe> should be treated as simple text.
Dave Hyatt
Comment 8
2008-02-10 13:04:35 PST
Created
attachment 19047
[details]
Treat <iframe> like <title> and <textarea>, since that's what it is really supposed to be like.
Dave Hyatt
Comment 9
2008-02-10 14:30:24 PST
Fixed in
r30127
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug