DOM and DOMImpl

15 views
Skip to first unread message

wahaha

unread,
Dec 4, 2011, 10:23:41 PM12/4/11
to Google Web Toolkit
there are two classes DOM and DOMImpl,looks the same,what is the
difference between their functions?

wahaha

unread,
Dec 5, 2011, 2:22:43 AM12/5/11
to Google Web Toolkit
DOM.getAbsoluteLeft(Element element) calles elem.getAbsoluteLeft(),
and elem.getAbsoluteLeft() calles DOMImpl.impl.getAbsoluteLeft(Element
element).
why designed it like this?

Thomas Broyer

unread,
Dec 5, 2011, 3:16:35 AM12/5/11
to google-we...@googlegroups.com
Legacy.

Originally, JavaScriptObject were opaque handles, there was no "overlay types". So DOM directly called DOMImpl (or DOMImplIE6, DOMImplMozilla, etc. using deferred binding). Then overlay types were introduced, and the com.google.gwt.dom.*, so part of DOMImpl were moved there, and DOM was changed to call the element's methods (so it doesn't directly depends on com.google.gwt.dom.client.impl.*)
Reply all
Reply to author
Forward
0 new messages