#252 Consider moving getElementsByName up to document.prototype

Open
opened 3 years ago by wolfbeast · 2 comments
wolfbeast commented 3 years ago (Migrated from github.com)

https://dom.spec.whatwg.org/#domimplementation
https://dom.spec.whatwg.org/#interface-document
https://html.spec.whatwg.org/multipage/dom.html#the-document-object

Let namespace be the HTML namespace, if the context object is an HTML document or context object’s content type is “application/xhtml+xml”, and null otherwise.

An example (for Scratchpad):

alert((new DOMParser).parseFromString(
"<html><body/></html>","text/html").getElementsByName);
alert((new DOMParser).parseFromString(
"<html xmlns='http://www.w3.org/1999/xhtml'><body/</html>",
"application/xhtml+xml").getElementsByName);

Actual results:

function getElementsByName() {
    [native code]
}
undefined

Expected results:

function getElementsByName() {
    [native code]
}
function getElementsByName() {
    [native code]
}

Some test/personal branch/commit (with the expected result):
_testBranch_dom_document_1

Bug(s) - RESOLVED FIXED:
https://bugzilla.mozilla.org/show_bug.cgi?id=1415176

But see also (“META” - “Merge HTMLDocument into Document”):
https://bugzilla.mozilla.org/show_bug.cgi?id=897815

Moving body up to Document.prototype
https://bugzilla.mozilla.org/show_bug.cgi?id=1276438
(AFAIK: it does not look so easy)
Depends on (IMHO):
(EditorBase should cache pointer to mSelConWeak, mPlaceHolderTxn and mDocWeak)
https://bugzilla.mozilla.org/show_bug.cgi?id=1372829

https://dom.spec.whatwg.org/#domimplementation https://dom.spec.whatwg.org/#interface-document https://html.spec.whatwg.org/multipage/dom.html#the-document-object > Let namespace be the HTML namespace, if the context object is an HTML document or context object’s content type is "application/xhtml+xml", and null otherwise. __An example (for Scratchpad):__ ``` javascript alert((new DOMParser).parseFromString( "<html><body/></html>","text/html").getElementsByName); alert((new DOMParser).parseFromString( "<html xmlns='http://www.w3.org/1999/xhtml'><body/</html>", "application/xhtml+xml").getElementsByName); ``` __Actual results:__ ``` function getElementsByName() { [native code] } undefined ``` __Expected results:__ ``` function getElementsByName() { [native code] } function getElementsByName() { [native code] } ``` Some test/personal branch/commit (with the expected result): [_testBranch_dom_document_1](https://github.com/janekptacijarabaci/moebius/tree/_testBranch_dom_document_1) Bug(s) - RESOLVED FIXED: https://bugzilla.mozilla.org/show_bug.cgi?id=1415176 But see also ("META" - "Merge HTMLDocument into Document"): https://bugzilla.mozilla.org/show_bug.cgi?id=897815 Moving body up to Document.prototype https://bugzilla.mozilla.org/show_bug.cgi?id=1276438 (AFAIK: it does not look so easy) Depends on (IMHO): (EditorBase should cache pointer to mSelConWeak, mPlaceHolderTxn and mDocWeak) https://bugzilla.mozilla.org/show_bug.cgi?id=1372829
janekptacijarabaci commented 3 years ago (Migrated from github.com)
Owner

Could you please fix a typo here (application/xhtml+xml)?

alert((new DOMParser).parseFromString(
"<html><body/></html>","text/html").getElementsByName);
alert((new DOMParser).parseFromString(
"<html xmlns='http://www.w3.org/1999/xhtml'><body/</html>",
"application/xhtml+xml").getElementsByName);
Could you please fix a typo here (`application/xhtml+xml`)? ``` javascript alert((new DOMParser).parseFromString( "<html><body/></html>","text/html").getElementsByName); alert((new DOMParser).parseFromString( "<html xmlns='http://www.w3.org/1999/xhtml'><body/</html>", "application/xhtml+xml").getElementsByName); ```
g4jc commented 1 year ago (Migrated from github.com)
Owner

Going to attempt this, a lot of dependencies so it may be awhile, but once we get DOM up to speed it should be easier to port anything else going forward.

Going to attempt this, a lot of dependencies so it may be awhile, but once we get DOM up to speed it should be easier to port anything else going forward.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.