* [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY>
@ 2017-03-02 2:43 Kevin Carhart
2017-03-02 12:00 ` Karl Dahlke
0 siblings, 1 reply; 5+ messages in thread
From: Kevin Carhart @ 2017-03-02 2:43 UTC (permalink / raw)
To: Edbrowse-dev
One of the tests in acid3 that fails is test #0 out of 0-99.
There may be multiple causes but I think I found one. I was looking at
#0 because I wanted to take it from the top.
test #0 says this
var scripts = document.getElementsByTagName('script');
document.body.removeChild(scripts[scripts.length-1]);
The problem is that the script it is trying to find has parentNode head
and not body according to how we currently allocate them.
The acid3 page has some scripts out in limbo that are not inside of either
<HEAD></HEAD> or <BODY></BODY>. For instance, the page begins like this
<html>
<title>The Acid3 Test</title>
<script type="text/javascript">
var startTime = new Date();
</script>
This might be a tidy question. What should be the tree presence for
scripts that are found out in limbo? In other words, if you had,
<HTML>1<HEAD>2</HEAD>3<BODY>4</BODY>5</HTML>
>From what branch should 1, 3 and 5 descend?
thanks
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY>
2017-03-02 2:43 [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY> Kevin Carhart
@ 2017-03-02 12:00 ` Karl Dahlke
2017-03-02 18:11 ` Kevin Carhart
0 siblings, 1 reply; 5+ messages in thread
From: Karl Dahlke @ 2017-03-02 12:00 UTC (permalink / raw)
To: Edbrowse-dev
[-- Attachment #1: Type: text/plain, Size: 706 bytes --]
> One of the tests in acid3 that fails is test #0 out of 0-99.
Must they run in order?
I'm just wondering if we pass any of them, or what percentage,
but we don't know, if we can't get past 0.
This one is a concern, because if there is no head or body specified, I'm not sure there even is a right answer, in the spec, and if there is, then the ball is in tidy's court.
Many many web pages have scripts in the head section, so it seems reasonable to put them there if there is no head or body.
I too am not sure what to do here, although acid3 is telling us what we should do I suppose,
just not sure how to do it without mucking with tidy code or pre-arranging the html source.
Karl Dahlke
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY>
2017-03-02 12:00 ` Karl Dahlke
@ 2017-03-02 18:11 ` Kevin Carhart
2017-03-02 19:56 ` Chris Brannon
2017-03-03 3:24 ` Karl Dahlke
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Carhart @ 2017-03-02 18:11 UTC (permalink / raw)
To: Karl Dahlke; +Cc: Edbrowse-dev
On Thu, 2 Mar 2017, Karl Dahlke wrote:
>> One of the tests in acid3 that fails is test #0 out of 0-99.
>
> Must they run in order?
No... no, I don't think they have to, I think they are autonomous or there
may be some grouping around topics, like maybe 70-80 is one theme and
80-90 is another theme, but I don't think 0 is a prerequisite of the rest.
I think we are passing about one quarter or 22/100 right now, but that
number may go up in a choppy way.
On thinking about it more and trying some sample html against one of the
old pre-tidy5, "validate my html and show me my errors" web pages, I think
tidy is correct. This is a settled, venerable task that it has done for
decades, so if you want to know the correct placement, work backwards and
whatever tidy is doing, that's where the scripts need to go. Thanks tidy
and tidy5 developers!
So I think I misdiagnosed this. The reason why the test
code can't find the script in body is, check out how ugly and baroque the
script code is..
<script type="text/javascript">document.write('<map name=""><area
href="" shape="rect" coords="2,2,4,4" alt="<\'>"><iframe
src="empty.png">FAIL<\/iframe><iframe
src="empty.txt">FAIL<\/iframe><iframe src="empty.html"
id="selectors"><\/iframe><form action="" name="form"><input
type=HIDDEN><\/form><table><tr><td><p><\/tbody>
<\/table><\/map>');</script>
It's clearly something to do with the interaction between a script,
document.write, iframes and embedded html with backslashes and quoting.
Still interesting for later, but I may have barked up the wrong tree.
thanks
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY>
2017-03-02 18:11 ` Kevin Carhart
@ 2017-03-02 19:56 ` Chris Brannon
2017-03-03 3:24 ` Karl Dahlke
1 sibling, 0 replies; 5+ messages in thread
From: Chris Brannon @ 2017-03-02 19:56 UTC (permalink / raw)
To: Edbrowse-dev
Kevin Carhart <kevin@carhart.net> writes:
> So I think I misdiagnosed this. The reason why the test code can't
> find the script in body is, check out how ugly and baroque the script
> code is..
Not necessarily. In the case where script comes between head and body,
tidy5 adds it to head. So I wonder, in our DOM, is the missing script
there, rather than in body? If so, we've got another parsing problem.
-- Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY>
2017-03-02 18:11 ` Kevin Carhart
2017-03-02 19:56 ` Chris Brannon
@ 2017-03-03 3:24 ` Karl Dahlke
1 sibling, 0 replies; 5+ messages in thread
From: Karl Dahlke @ 2017-03-03 3:24 UTC (permalink / raw)
To: Edbrowse-dev
Well that funny script compiles pretty well on my system, no errors just warnings.
The three frames are there, I assume the third would expand properly if we were running this on their site.
But a question:
<iframe>stuff</iframe>
What am I suppose to do with stuff?
Right now it appears after the frame.
On a standard browser you might not see it at all,
the frame sitting on top of it.
Karl Dahlke
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-03 3:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 2:43 [Edbrowse-dev] allocating <SCRIPT> to <HEAD> or <BODY> Kevin Carhart
2017-03-02 12:00 ` Karl Dahlke
2017-03-02 18:11 ` Kevin Carhart
2017-03-02 19:56 ` Chris Brannon
2017-03-03 3:24 ` Karl Dahlke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).