Summary: | offsetHeight returns 0, where IE does not. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alice Liu <alice.barraclough> | ||||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED CONFIGURATION CHANGED | ||||||||
Severity: | Major | CC: | ahmad.saleem792, ap, bfulgham, darin, emacemac7, ian, joost, krishnamurty.podipireddy, mitz, rniwa, webkitbugzilla | ||||||
Priority: | P2 | Keywords: | HasReduction, InRadar | ||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
URL: | http://cnx.rice.edu/content/m11268/latest/ | ||||||||
Bug Depends on: | 7080 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Alice Liu
2006-01-20 18:35:48 PST
Created attachment 5819 [details] OffsetHeight test The given page enters an infinite for loop at http://cnx.rice.edu/pmathmlcss.js:35 for ( i = 3; i <= mrowH / (2*opH) ; i += 1) since opH is zero. opH comes from taking the offsetHeight of an empty <span>. FireFox also gives zero for the height of an empty <span>, but doesn't reach that code at all since it doesn't support accessing DOM nodes as JS variables by id. WinIE gives a positive height even for the empty span. I know this is a hang, but we don't need separate P1 bugs for each page where there's an infinite JavaScript loop. There are two ways to look at this: 1) we need to "finesse" this difference from WinIE so we don't hang on this page 2) we need to make sure that infinite JavaScript loops don't hang the entire browser Item (2) is something we're planning to do as part of the "tree code" project. It's not clear how to do (1) at all. I think I'd like to bump this down to P2 soon. Bug 7080 has been filed for the infinite loop part, renaming this one to track how we handle offsetHeight. Lowering to p2 in the process. Created attachment 115394 [details]
Prepares an alert message showing the offset discrepency between the same anchor tag vertical offset when inline and when set with display:block
I'd like to see this one fixed. It also impacts empty anchor elements. Positioning elements programmatically in relation to empty anchor elements is basic and necessary functionality. I'm including a related thread here which may shed additional light on the issue: http://stackoverflow.com/questions/8126648/how-to-get-the-correct-offset-top-value-from-webkit-chrome-safari-with-jquery/8126822#8126822 Thanks for your help! The bug is about offsetHeight, but that last comment seems to be about offsetTop. Are you sure this is the same issue? (In reply to comment #6) > The bug is about offsetHeight, but that last comment seems to be about offsetTop. Are you sure this is the same issue? Thanks for the head up! Sorry, I should have seen that. I'll search for the correct place for this update or log a new bug. (In reply to comment #6) > The bug is about offsetHeight, but that last comment seems to be about offsetTop. Are you sure this is the same issue? Okay, I did another search and didn't find this exact issue. I logged the following bug: https://bugs.webkit.org/show_bug.cgi?id=72524 On "OffsetHeight test" - all browsers: *** Safari 15.6 on macOS 12.5 *** Empty span offsetHeight: 18 Non-empty span offsetHeight: 18 *** Chrome Canary 106 *** Empty span offsetHeight: 19 Non-empty span offsetHeight: 19 *** Firefox Nightly 105 *** Empty span offsetHeight: 0 Non-empty span offsetHeight: 16 _____ On "Prepares..." - all browsers: *** Safari 15.6 on macOS 12.5 *** displayCss=[inline] alteredOffset.top=[427.8125] offsetAlert(calledBy=[jQuery.ready]) anchor.offset().top=[427.8125] subheading.offset().top=[427.8125] displayCss=[inline] alteredOffset.top=[427.8125] offsetAlert(calledBy=[body.onload]) anchor.offset().top=[427.8125] subheading.offset().top=[427.8125] *** Chrome Canary 106 *** displayCss=[inline] alteredOffset.top=[437.328125] offsetAlert(calledBy=[jQuery.ready]) anchor.offset().top=[437.328125] subheading.offset().top=[437.328125] displayCss=[inline] alteredOffset.top=[437.328125] offsetAlert(calledBy=[body.onload]) anchor.offset().top=[437.328125] subheading.offset().top=[437.328125] *** Firefox Nightly 105 *** displayCss=[inline] alteredOffset.top=[452.6333312988281] offsetAlert(calledBy=[jQuery.ready]) anchor.offset().top=[454.23333740234375] subheading.offset().top=[454.23333740234375] displayCss=[inline] alteredOffset.top=[452.6333312988281] offsetAlert(calledBy=[body.onload]) anchor.offset().top=[454.23333740234375] subheading.offset().top=[454.23333740234375] _________ Just wanted to share updated test results. Thanks! Looks like it's working now. |