Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#956 closed task (fixed)

make dojo.body(): document.body doesn't work for XHTML, and dojo.html.body causes circular dependencies

Reported by: bill Owned by: liucougar
Priority: high Milestone:
Component: General Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

document.body doesn't work on XHTML documents, so the code should be changed to call dojo.html.body() ...

xcept for the fact that it creates circular dependencies / unwanted dependencies.

Ex: DomWidget?.js and style.js both reference document.body

Attachments (3)

body.patch (4.0 KB) - added by liucougar 13 years ago.
body.2.patch (13.0 KB) - added by liucougar 13 years ago.
body-core.patch (4.5 KB) - added by liucougar 13 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 13 years ago by Tom Trenka

You know, I *thought* this was the case, which is why we added it in the first place...

comment:2 Changed 13 years ago by bill

Milestone: 0.4
Summary: use dojo.html.body() rather than document.bodymake dojo.body(): document.body doesn't work for XHTML, and dojo.html.body causes circular dependencies

Note that document.body is referenced from hostenv_browser.js and event/browser.js.

hostenv_browser.js shouldn't be referencing dojo.html, so it should be renamed/moved to dojo.body().

Changed 13 years ago by liucougar

Attachment: body.patch added

comment:3 Changed 13 years ago by liucougar

Owner: changed from alex to liucougar
Status: newassigned

added patch to move dojo.html.body() to dojo.body()

Changed 13 years ago by liucougar

Attachment: body.2.patch added

Changed 13 years ago by liucougar

Attachment: body-core.patch added

comment:4 Changed 13 years ago by bill

OK, checked in body-core.patch and body.2.patch in [4525]. Thanks for the patch.

Leaving the bug open because there are still some places in the code that reference document.body directly, but shouldn't.

comment:5 Changed 13 years ago by liucougar

committed r4569

remaining document.body is in src/widget/Editor2.js, src/widget/RichText.js and src/widget/Editor2Toolbar.js, which I will work on later

so I'd like to close this bug, any objections?

comment:6 Changed 13 years ago by alex

So every explication of why dojo.html.body() causes "circular dependency problems" have turned out to be bullshit in one way or another. I want a clear explanation of why we can't use it before we close this ticket.

comment:7 Changed 13 years ago by bill

Alex - hostenv_browser.js references dojo.body(). Doesn't that count as a circular dependency? Also, style.js references it.

LiuCougar? - it's fine w/me if you close the bug.

comment:8 Changed 13 years ago by alex

it's a freaking one liner! just have it in both places. This patch doesn't make sense.

Regards

comment:9 Changed 13 years ago by bill

Resolution: fixed
Status: assignedclosed

comment:10 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.