WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
15099
self.innerWidth is not reported correctly.
https://bugs.webkit.org/show_bug.cgi?id=15099
Summary
self.innerWidth is not reported correctly.
Vincent Lee
Reported
2007-08-27 19:12:07 PDT
PROBLEM: In Webkit nightly build 25261, self.innerWidth is reporting the whole width, including vertical scrollbar's width. METHOD: Call "self.innerWidth" at body onload handler. RESULT: "self.innerWidth" currently reports the whole application window width. EXPECTED: "self.innerWidth" should report a width value that is the difference of application window width and the vertical scrollbar. WORKAROUND: None.
Attachments
HTML file for testing self.innerWidth
(5.72 KB, text/html)
2007-08-27 19:13 PDT
,
Vincent Lee
no flags
Details
reduced test case
(4.32 KB, text/html)
2007-08-28 06:08 PDT
,
Alexey Proskuryakov
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Vincent Lee
Comment 1
2007-08-27 19:13:58 PDT
Created
attachment 16140
[details]
HTML file for testing self.innerWidth Please use this HTML file to reproduce this issue.
Alexey Proskuryakov
Comment 2
2007-08-28 06:08:34 PDT
Created
attachment 16142
[details]
reduced test case This new test case only checks innerWidth, omitting browser-specific workarounds that used scrollWidth and clientWidth. In WebKit nightlies, innerWidth appears to behave the same way it does in Firefox (IE doesn't support this property). So, this seems to have been a legitimate bug fix, and the new behavior is correct.
Vincent Lee
Comment 3
2007-08-28 10:06:53 PDT
I like to point out that in the Rhino book (p.913 the "innerHeight, innerWidth" section) it suggests that "these dimensions do not include the size of the menubar, toolbars, scrollbars, and so on.". In the reduced test case, self.innerWidth returns 800 which is actually the whole window width including the vertical scrollbar width. On the other hand, self.innerHeight when tested w/ Webkit's nightly build
r25261
reports the correct value that excludes the menubar, toolbars & the horizontal scrollbar. Since these values are reported inconsistently, resulting effect is positioning issues for different ajax framework elements that use these values.
Alexey Proskuryakov
Comment 4
2007-08-28 10:50:52 PDT
See
bug 15061
for innerHeight. For us, interoperability with other browsers is usually more important than logical consistency, as it's the former that directly affects user experience. See <
http://webkit.org/projects/goals.html
>. I'm not closing this issue yet, as someone more familiar with these historic problems may provide better insight.
Alexey Proskuryakov
Comment 5
2007-08-28 10:52:50 PDT
(In reply to
comment #4
)
> See
bug 15061
for innerHeight.
Oops, sorry, that's not related.
Chris Brichford
Comment 6
2007-09-24 14:54:24 PDT
FireFox on windows seems to not include the width of the scroll bars in the innerWidth value. However it does on mac. Latest mac webkit nightly (
r25708
) as of this writing does what mac firefox does. Did not test windows webkit.
Vincent Lee
Comment 7
2007-10-16 15:46:53 PDT
It seems the workaround is to use "document.body.clientWidth" and "document.body.clientHeight". The width of vertical/horizontal scrollbars are correctly excluded in their values; and this is the case for the latest Webkit nightly and Firefox (below). Are they replacements for "self.innerWidth" and "self.innerHeight"? If they're, then this bug is no longer valid and can be closed. - Mac Webkit nightly (
r26653
) - Windows Webkit nightly (
r26595
) - Mac Gecko/20070914 Firefox/2.0.0.7 - Windows Gecko/20070914 Firefox/2.0.0.7
Brent Fulgham
Comment 8
2022-07-12 11:26:34 PDT
This appears to work properly in Safari 15. Could you please provide further details if you believe there is an ongoing problem?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug