edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* some js debugging...
@ 2022-10-07 12:20 Dominique Martinet
  0 siblings, 0 replies; only message in thread
From: Dominique Martinet @ 2022-10-07 12:20 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: edbrowse-dev


Hi Karl,

I've done some real world debugging and would like help thinking on how
to fix these...
Unfortunately it's on an internal (work), so I can't share any example
unless I try to make one :/

It's using jquery under the hood so something we must try to understand.

I'm looking at this (readable) version :
https://code.jquery.com/jquery-2.2.4.js


In the order I stumbled uppon problems:
1/ the first is outside that file, but they do getElementsByTagName()
to get a form <select> field, then var $select = jQuery(select); and
$select.prop('disabled') should apparently be false.
It's undefined for us, we can probably just add it to Option in
startwindow.js with this.disabled = false? I have not checked yet where
that should be true.

2/ next in jquery-2.2.4.js, line 7648, this option.disabled should also
be false. It'll probably be fixed with the same fix...
But then on the next line we have option.parentNode.disabled.
option is elem.options[3], and for edbrowse option.parentNode is elem.options,
but for firefox option.parentNode is elem.
We probably want to do the same, I'm not sure where we chose the parent.

3/ then Sizzle.attr line 1446
First something probably minor, but elem.ownerDocument is not defined
and on firefox it is 'document', we probably want to set that in Option
creation as well (they setDocument on the item if not, not sure what
that does in practice)
Then some weird expression I don't understand, but it's undefined and we
want that here so it's good, until elem.getAttribute("value") does not
return elem.value
That can probably be fixed in shared.js doing like we do with length and
returning this.value directly if name === "value".

4/ another unrelated problem I have is when the site apparently decided
to add an onclick event on the td of a table (via jquery data-event /
data-handler; not sure how that works but I could reproduce with
onclick)
You can try it here:
https://gaia.codewreck.org/local/tmp/link-td.html
Both "Test 1" and "Test 2" pop up an alert when clicked (they are
stylized differently but that doesn't matter, the text is clickable and
runs js)
Apparently that can be set for tr as well in which case the whole row
would be clickable anywhere in the row, and I tried for giggles but that
applies anywhere up: the table, or even body! Not sure what we'd want to
do out of that, but tr and td seem common enough that we want to come up
with a way to interact with them (and I need td with href=# for my
internal site)



I've pushed some fixes in https://github.com/martinetd/edbrowse master
branch, that fix 1/ and 3/ and it seems to work leaving a workaround for
parentNode in the site's code, but I'm not quite sure what to do with
parentNode and actions at table level.


I've also added two unrelated patches:
 - one fixes some memory leaks, there might be some left but I got a
few
 - other one fixes more (probably not very useful) gcc warnings, but at
least that makes my compilation less verbose
If you prefer to look at these separately I can remove them for now.


Cheers!
--
Dominique


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-07 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07 12:20 some js debugging Dominique Martinet

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).