edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] nasa / prepending "on" to events
Date: Sat, 27 Jan 2018 22:12:39 -0500	[thread overview]
Message-ID: <20180027221239.eklhad@comcast.net> (raw)
In-Reply-To: <CA+PgotKGaLDr_LuJM_soCgauL07iRw+zB9MTE4Ssq=GkSkC7hQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3097 bytes --]

Boy did you open a can of worms!
Most of this was percolating in my mind for some time, but this has brought it to the fore.

1. I didn't have a Footer class, or recognize the <footer> tag. Didn't know anything about it.
That was an easy fix, just a few lines of code, but without it the critical section in your test3 didn't even run.

2. A.href side effects.
First some background. If you set document.location = url, that is not suppose to replace the document location object with the string url.
It is a side effect setter; the string is suppose to pass into the document.location URL object.
And it has a further side effect of redirecting the browser to a new web page, but that is beyond the scope.
I had thought for some time that A.href is suppose to do the same thing.
If javascript wants to set, or change, the URL that a hyperlink points to,
it will just set A.href = blah.
Right now that replaces the URL object with the string, and sometimes that works, but that's not how it is suppose to work.
It is suppose to be, and remain, a URL object.

A. href Image.src Script.src Frame.src Link.href Area.href Form.action
Am I missing any?

There is a clever compact way to do this; put getters and setters on the prototypes of these classes, similar to those that are on document.location.
See startwindow.js line 1078.
This change is mostly transparent to the rest of edbrowse, you get and set A.href as usual, and go through getters and setters, but did I break something? I wouldn't be a bit surprised.
Well test it out and let me know.
Meantime, the line

    r.setAttribute("href","http://www.nasa.gov/about/contact/index.html");

from the NASA code now creates a URL object with the correct components.
But it still isn't rendered properly; see item 4 below.

3. This goes back to something Kevin said a month ago.
A web page was referencing A.protocol, which was never set.
He created a default empty string a.protocol = "", which got us past the error but made me feel uneasy.
I thought then, and still think, that this should be a getter and setter to dip into a.href.protocol.
It's basically a shortcut.
And similarly for the other components, so I made all these getters and setters.
See the two nested loops at startwindow.js line 1155.

4. Now the hyperlink was constructed properly, but was not rendered as a link in the edbrowse buffer.
I did not look dynamically, upon each render, to see if js had set, or changed, the url of that anchor.
Again, only a few lines of code, but it makes all the difference.
Now test3.html works.
As for nasa.gov, it's empty again. Did I break something?
I don't know, because it comes up empty on the earlier version, before I made any of these changes.
I backed out the last commit, with prepending "on" to the event, it still comes up empty.
And radiocaroline.co.uk hangs forever.
Are the websites changing out from under us? Am I missing something?   (disappointed)
Well I decided to push anyways, so you all can look and comment,
and we're all working with the same code.

Karl Dahlke

  parent reply	other threads:[~2018-01-28  3:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 20:08 [Edbrowse-dev] Error Object Karl Dahlke
2018-01-19 20:51 ` Dominique Martinet
2018-01-25 10:48 ` [Edbrowse-dev] defaultView / cloning onevent$$array Kevin Carhart
2018-01-25 14:07   ` Karl Dahlke
2018-01-25 23:07     ` Kevin Carhart
2018-01-26  2:58       ` Karl Dahlke
2018-01-26  3:50         ` [Edbrowse-dev] nasa / prepending "on" to events Kevin Carhart
2018-01-26  4:59           ` Karl Dahlke
2018-01-26  5:51             ` Kevin Carhart
2018-01-26  6:43               ` Karl Dahlke
2018-01-26  8:10                 ` Kevin Carhart
2018-01-26  8:21                   ` Kevin Carhart
2018-01-26  9:08                     ` Karl Dahlke
2018-01-26 10:38                       ` Kevin Carhart
2018-01-26 14:32                         ` Karl Dahlke
2018-01-26 19:13                           ` Geoff McLane
2018-01-26 19:28                             ` Karl Dahlke
2018-01-27  3:52                           ` Kevin Carhart
2018-01-27 18:52                             ` Geoff McLane
2018-01-27 21:10                               ` Karl Dahlke
2018-01-28  3:12                               ` Karl Dahlke [this message]
2018-01-28 19:19                                 ` Geoff McLane
2018-01-28 21:35                                   ` Karl Dahlke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180027221239.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).