Closed
Bug 196779
Opened 22 years ago
Closed 18 years ago
Scroll position element properties not documented
Categories
(Documentation Graveyard :: Web Developer, defect)
Documentation Graveyard
Web Developer
Tracking
(Not tracked)
RESOLVED
WORKSFORME
mozilla1.8final
People
(Reporter: ernestcline, Assigned: bugzilla)
References
(Depends on 1 open bug, )
Details
(Keywords: testcase, Whiteboard: http://www.gtalbot.org/BugzillaSection/DocumentAllDHTMLproperties.html)
Attachments
(24 files, 4 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/jpeg
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130
The following DOM Level 0 Element properties are not documented, altho they are
in Mozilla.
element.clientHeight
element.clientWidth
element.scrollHeight
element.scrollLeft
element.scrollTop
element.scrollWidth
Reproducible: Always
Steps to Reproduce:
1. Go to the documentation.
2. Look for these properties.
Actual Results:
No such properties to be found.
Expected Results:
These properties, which Mozilla does implement should be documented.
Comment 2•21 years ago
|
||
moving stuff over to an outside-the-firewall email for the time being, looking
for people to pick these Help and doc bugs up for me.
Assignee: oeschger → oeschger
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•20 years ago
|
||
Here are the references I intend to use for this bug:
http://bugzilla.mozilla.org/show_bug.cgi?id=62536#c109
http://www10.brinkster.com/doctorunclear/HTMLJavascriptCSS/DUWindowsNS6.html
http://www.quirksmode.org/viewport/compatibility.html
http://msdn.microsoft.com/workshop/author/om/measuring.asp
http://www10.brinkster.com/doctorunclear/BrowserBugsSection/MozillaBugs/Bug189308_ScrollEvent.html
/ Top
/ client / Left
elementReference. / offset / Width
\ scroll \ Height
are often and more widely referred as the DHTML object model properties in books
and references: they originally come from MSDN. window.pageXOffset and
window.pageYOffset came from NS. offsetParent will need to be defined as well.
Interactive examples and instructional image showing the measurements,
illustrating the concepts will be needed to make these pages as useful and
recommendable as they can be.
Another idea is to create a cross-browser interactive demo page like
http://msdn.microsoft.com/workshop/samples/author/css/overview/interactivemeasurement.htm
Assignee | ||
Comment 6•20 years ago
|
||
oops, I meant
https://bugzilla.mozilla.org/show_bug.cgi?id=62536#c101 not c109
and here, scrollWidth and scrollHeight definitions need to be more accurate.
Assignee | ||
Comment 7•20 years ago
|
||
scrollWidth, scrollHeight: it is the width/height of the content of an element
according/related to/given for a certain height/width of such element's
viewport. What I mean by this is that if the element height/width is reduced or
increased (while its content remains the same), its scrollWidth/scrollHeight
will be reverse-proportionally increased. I will just add this as a note to the
definition though.
clientWidth, clientHeight. This the width/height of the element's viewport. E.g.
for clientWidth, this equates to offsetWidth - border-left-width -
border-right-width - width of vertical scroll bar (if present). clientWidth,
clientHeight include the padding of the element.
Assignee | ||
Comment 8•20 years ago
|
||
I use this page to create the upcoming images
Assignee | ||
Comment 9•20 years ago
|
||
Assignee | ||
Comment 10•20 years ago
|
||
Assignee | ||
Comment 11•20 years ago
|
||
Assignee | ||
Comment 12•20 years ago
|
||
Assignee | ||
Comment 13•20 years ago
|
||
Assignee | ||
Comment 14•20 years ago
|
||
Assignee | ||
Comment 15•20 years ago
|
||
If the element has a vertical scrollbar and if the text direction is rtl, then
clientLeft property must include the width of the vertical scrollbar.
Assignee | ||
Comment 16•20 years ago
|
||
Assignee | ||
Comment 17•20 years ago
|
||
Assignee | ||
Comment 18•20 years ago
|
||
Assignee | ||
Comment 19•20 years ago
|
||
Assignee | ||
Comment 20•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #167299 -
Attachment description: DHTML offsetWidth (with vertical scrollbar) → DHTML offsetHeight (with vertical scrollbar)
Assignee | ||
Comment 21•20 years ago
|
||
Assignee | ||
Comment 22•20 years ago
|
||
Assignee | ||
Comment 23•20 years ago
|
||
Assignee | ||
Comment 24•20 years ago
|
||
Assignee | ||
Comment 25•20 years ago
|
||
Attachment #167305 -
Attachment is obsolete: true
Assignee | ||
Comment 26•20 years ago
|
||
Attachment #167301 -
Attachment is obsolete: true
Assignee | ||
Comment 27•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #167302 -
Attachment is obsolete: true
Assignee | ||
Comment 28•20 years ago
|
||
This is just one single example of how each of the
/ Top
/ client / Left
elementReference. / offset / Width
\ scroll \ Height , window.pageXOffset,
window.pageYOffset
could be explained, demonstrated, defined and measured in an HTML document for
best instructional purposes.
The image on the right shows in a static manner the visual representation of
the property.
The div on the left shows an interactive demo of the property.
Not included is the strict textual definition of that scrollTop property with
details (type, value, compatibility support, etc.).
Note that this demo works in MSIE 6 and also works (or should work) in Opera
7.60 PR3.
Assignee | ||
Comment 29•20 years ago
|
||
(Please ignore previous attachment)
This is just one single example of how each of the
/ Top
/ client / Left
elementReference. / offset / Width
\ scroll \ Height , window.pageXOffset,
window.pageYOffset
could be explained, demonstrated, defined and measured in an HTML document for
best instructional purposes.
The image on the right shows in a static manner the visual representation of
the property.
The div on the left shows an interactive demo of the property.
Not included is the strict textual definition of that scrollTop property with
details (type, value, compatibility support, etc.).
Note that this demo works in MSIE 6 and also works (or should work) in Opera
7.60 PR3.
Attachment #167345 -
Attachment is obsolete: true
Assignee | ||
Comment 30•20 years ago
|
||
I've created a meta interactive demo page of what I've done so far.
http://www.gtalbot.org/Bugzilla/DocumentAllDHTMLproperties.html
The pages for each property would be created with the individual images. There
are several other possible improvements to such meta page and then they can be
transferred, reused in the Gecko DOM Reference pages.
I think I'll need to redo all the images that involve height since the *Height
images so far do not show any horizontal scrollbar. This is important since
offsetHeight include such scrollbar while clientHeight and scrollHeight exclude
it. I may need to redo all the images anyway for several reasons (consistent
look, way of presenting info, reproducible value and functioning with live
example) and that's the long part. Best is to start with a real existing div
with content so that the info in a static image can be achieved, reproduced with
a real, live, existing <div>.
I don't know when I'll be able to do all the pages involved into this bugfile:
right now, it maybe more than 20 pages since the root element implements some of
those DHTML object model properties differently in MSIE and Mozilla. Note that
there are also window.scrollX, window.scrollY to cover and also offsetLeft,
offsetTop, offsetParent. Right now, my wish would be to fix all this before
march 30th 2005 or so.
I think these new Gecko DOM reference pages (to be created individually) should
be able to convey without javascript useful, meaningful and trustworty
definitions, information about these properties *and* should offer a small
interactive javascript-driven demo, instructional example. If an image is worth
a thousand words, on the web, a good interactive demo is worth a thousand words
and images, I'd say.
I need to document also the bugs which affect the value of such properties and
how they affect these. For instance, rendering of padding-bottom in bug 47710.
Assignee | ||
Updated•20 years ago
|
Target Milestone: --- → mozilla1.8final
Assignee | ||
Comment 31•20 years ago
|
||
I uploaded a first document on my site and have requested a review, comments,
feedback:
http://www.gtalbot.org/Bugzilla/OffsetHeight.html
Comment 32•20 years ago
|
||
I've read through this bug and the linked/attached test cases and they all look
fine to me.
Assignee | ||
Comment 33•20 years ago
|
||
I have made some corrections (tweaking, tuning, corrections) to
http://www.gtalbot.org/Bugzilla/OffsetHeight.html
and also uploaded
http://www.gtalbot.org/Bugzilla/OffsetWidth.html
http://www.gtalbot.org/Bugzilla/ClientHeight.html
http://www.gtalbot.org/Bugzilla/ClientWidth.html
Doron: are these files ok for GDR?
Assignee | ||
Comment 34•20 years ago
|
||
http://www.gtalbot.org/Bugzilla/ScrollHeight.html
http://www.gtalbot.org/Bugzilla/ScrollTop.html
have been added.
I will remove all inline-style and edit css declarations in the <head> section
later.
Comment 35•20 years ago
|
||
"...relative to the layout or relative to its offsetParent."
The size (offsetWidth, offsetHeight) is not really relative to the offsetParent.
As a matter of fact there is really no connection between the offsetWidth/Height
and the offsetParent.
I also think that the paragraph with -moz-box-sizing is a bit confusing and I'm
not sure that this paragraph helps people understand and use offset*
clientWidth/Height is often referred to as inner width/height or viewport
width/height. The first sentence in both these are a bit cryptic. A better
alternative (IMHO):
DHTML property that represents the inner height of an element. This includes
possible padding but not scrollbar, border nor margin.
Assignee | ||
Comment 36•20 years ago
|
||
> The size (offsetWidth, offsetHeight) is not really relative to the offsetParent.
Agreed! I removed reference to offsetParent. Strangely enough, MSDN mentions
that offsetWidth/Height is relative to offsetParent. <shrug>
> I also think that the paragraph with -moz-box-sizing is a bit confusing and I'm
> not sure that this paragraph helps people understand and use offset*
Agreed! Removals done.
> clientWidth/Height is often referred to as inner width/height or viewport
> width/height. The first sentence in both these are a bit cryptic.
Regarding clientWidth/Height, there is actually a bug in MSIE which Opera and
Mozilla browsers are duplicating, reproducing and it makes the definition
painful to do.
clientWidth could be narrower than the css width and I've tried to render such
possibility in the definition. Anyway, I made some changes in the definitions.
Assignee | ||
Comment 37•20 years ago
|
||
The offsetHeight file is:
http://www.mozilla.org/docs/dom/domref/dom_el_ref18.html
- Converted to HTML 4.01 strict
- removed some 40 markup errors
- everything was upgraded and updated: definition, description, example,
illustration, notes, references, links, etc.
Many thanks to Fantasai for her assistance for the file uploads
Assignee | ||
Comment 38•20 years ago
|
||
The file is:
http://www.mozilla.org/docs/dom/domref/dom_el_ref22.html
- Converted to HTML 4.01 strict
- removed some 37 markup errors in HTML 3.2
- everything was upgraded and updated: definition, description, example,
illustration, notes, references, links, etc.
Assignee | ||
Comment 39•20 years ago
|
||
http://www.mozilla.org/docs/dom/domref/clientHeight.html
Many thanks to Fantasai for uploading the file. I re-edited the path of links
and path of images in this patch.
To do: reposition the offsetContainer
Assignee | ||
Comment 40•20 years ago
|
||
Many thanks to Fantasai :) for uploading the first patch.
http://www.mozilla.org/docs/dom/domref/clientWidth.html
Re-edited path of links and path of images in the patch.
To do: reposition the offsetContainer accordingly
Assignee | ||
Comment 41•20 years ago
|
||
Many thanks to Fantasai :) for uploading the first patch.
http://www.mozilla.org/docs/dom/domref/scrollHeight.html
Re-edited path of the links and path of images in the patch.
To do: adjust the position of offsetContainer accordingly.
Assignee | ||
Comment 42•20 years ago
|
||
Many thanks to Fantasai for uploading the first patch.
http://www.mozilla.org/docs/dom/domref/scrollTop.html
Re-edited path of links and path of images in the patch.
To do: correct the position of offsetContainer, the form and to initialize the
event listeners accordingly once the page has loaded.
Assignee | ||
Comment 43•19 years ago
|
||
Today, I got formal approval from Larry Chamberlain of www.best-cat-art.com/ to
include the Birman cat image and its related text description in the example
sections of all DHTML object model properties pages. Larry asked for a link back
to his page and I agreed. So, I updated accordingly each/all of the following pages:
http://www.mozilla.org/docs/dom/domref/clientHeight.html
http://www.mozilla.org/docs/dom/domref/clientWidth.html
http://www.mozilla.org/docs/dom/domref/dom_el_ref18.html
http://www.mozilla.org/docs/dom/domref/dom_el_ref22.html
http://www.mozilla.org/docs/dom/domref/scrollHeight.html
http://www.mozilla.org/docs/dom/domref/scrollTop.html
and
http://developer.mozilla.org/en/docs/DOM:element.clientHeight
http://developer.mozilla.org/en/docs/DOM:element.clientWidth
http://developer.mozilla.org/en/docs/DOM:element.offsetHeight
http://developer.mozilla.org/en/docs/DOM:element.offsetWidth
http://developer.mozilla.org/en/docs/DOM:element.scrollHeight
http://developer.mozilla.org/en/docs/DOM:element.scrollTop
and I will eventually update the scrollHeight.png and scrollTop.png images where
they are used. Eventually, I will use the Birman cat image and related text
description in other DHTML object properties pages
(to do: clientLeft [lrt and rtl versions], clientTop, offsetLeft, offsetTop,
offsetParent, scrollLeft, scrollWidth and possibly window.pageXOffset,
window.pageYOffset, window.scrollX, window.scrollY,
document.documentElement.scrollLeft, document.documentElement.scrollTop, etc.).
Thank you, Larry :)
Whiteboard: http://www.gtalbot.org/Bugzilla/DocumentAllDHTMLproperties.html → http://www.gtalbot.org/BugzillaSection/DocumentAllDHTMLproperties.html
Assignee | ||
Comment 44•19 years ago
|
||
> I will eventually update the scrollHeight.png and scrollTop.png images where
> they are used.
Done at:
http://developer.mozilla.org/en/docs/DOM:element.scrollHeight
http://developer.mozilla.org/en/docs/DOM:element.scrollTop
Assignee | ||
Updated•18 years ago
|
Assignee | ||
Comment 45•18 years ago
|
||
Ernest,
the Gecko DOM Reference is now/has migrated at Mozilla Developer Center. So, it makes no more sense to have a bugzilla file opened for documenting DHTML properties. Anyone, including yourself, can update the files, the properties not defined so far (scrollLeft, offsetTop, offsetLeft, offsetParent, window.pageXOffset and window.pageYOffset) at MDC.
So, I'm resolving this bug as WORKSFORME
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•