RESOLVED FIXED 6402
Implement frameElement.width and frameElement.height
https://bugs.webkit.org/show_bug.cgi?id=6402
Summary Implement frameElement.width and frameElement.height
Alexey Proskuryakov
Reported 2006-01-06 16:41:46 PST
A partial fix for bug 4888. Implements two MSIE extensions for frameElement, width and height (which actually fixes the site). See http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/frame.asp
Attachments
proposed patch (7.34 KB, patch)
2006-01-06 16:47 PST, Alexey Proskuryakov
ggaren: review-
revised patch (7.72 KB, patch)
2006-01-07 01:02 PST, Alexey Proskuryakov
darin: review-
revised patch (8.38 KB, patch)
2006-01-07 17:16 PST, Alexey Proskuryakov
mjs: review+
Alexey Proskuryakov
Comment 1 2006-01-06 16:47:08 PST
Created attachment 5518 [details] proposed patch The code here is rather different from other accessors around; perhaps I'm doing something horribly wrong... Also, not sure if alert() is safe to use in the test here.
Eric Seidel (no email)
Comment 2 2006-01-06 17:31:24 PST
Comment on attachment 5518 [details] proposed patch /me wonders frameWidth() and frameHeight() are virtual...
Geoffrey Garen
Comment 3 2006-01-06 22:06:17 PST
Comment on attachment 5518 [details] proposed patch I second Eric's question: why virtual? The alert will work in the layout test, but it can be kinda annoying when you open that page manually. An explanation of what you're testing and a reference to the related bug are also important and missing. Check out LayoutTests/fast/js/string-split-ignore-case.html for an example. It also demonstrates how to produce output without an alert.
Alexey Proskuryakov
Comment 4 2006-01-07 01:02:15 PST
Created attachment 5521 [details] revised patch > /me wonders frameWidth() and frameHeight() are virtual... My bad, copy/paste problem. The usual way of printing the results to a "console" element doesn't work well here - DRT doesn't dump frame contents in text mode, and changing the test to pixel mode just because of this would only make checkouts longer. I've changed the test to alert() in DRT, but document.write() in manual mode. Maciej says: "in the past we've had problems with layout tests that made heavy use of alert(). probably a single use would be ok. other option would be to not dump as text. probably better to use the alert in this case."
Darin Adler
Comment 5 2006-01-07 08:51:49 PST
Comment on attachment 5521 [details] revised patch In the frameWidth and frameHeight functions, there's an assumption that both getDocument() and m_render are non-0. I'm certain that's not correct for m_render. You can easily get a pointer to a frame element that no longer has a renderer (perhaps it was removed from the DOM tree) and then calling the function will do a nil-deref. Similarly, I believe there are circumstances where you could have a reference to a frame element that does not have a document (although I'm not certain about that one). Please add the checks for 0. Also seems better to not have a space in the header between frameWidth and frameHeight declarations. Looks fine otherwise.
Alexey Proskuryakov
Comment 6 2006-01-07 17:16:08 PST
Created attachment 5534 [details] revised patch Addressed Darin's comments (WinIE also returns 0 in this case).
Maciej Stachowiak
Comment 7 2006-01-07 22:05:32 PST
Elements now always have to have a document, so I think it's ok to just assert that document is non-0 instead of checking for it. But fine as-is, r=me.
Note You need to log in before you can comment on or make changes to this bug.