Closed Bug 409220 Opened 17 years ago Closed 16 years ago

Warn on use of getBoxObjectFor

Categories

(Core :: DOM: Core & HTML, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: matthew, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.5) Gecko/20070718 Fedora/2.0.0.5-1.fc7 Firefox/2.0.0.5
Build Identifier: n/a

Since getBoxObjectFor was never designed for general use and (at some point) will be deprecated, it would be a good idea to start warning when sites are using it now.

Reproducible: Always

Steps to Reproduce:
1.  Call document.getBoxObjectFor(element)

Actual Results:  
Call succeeds, no warning

Expected Results:  
Call succeeds, warning placed in error log that method is deprecated, please use getBoundingClientRects.
We could perhaps do this for 1.9 in those cases when element isn't a xul element.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5pre) Gecko/2008030804 Minefield/3.0b5pre ID:2008030804

I just got a warning in the Error Console and an exception when visiting:
http://66.102.9.104/search?q=cache:5y5AbM_tNygJ:boardreader.com
We do warn nowadays when using getBoxObjectFor for non-xul elements.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Depends on: 409111
Resolution: --- → FIXED
Blocks: 340571
Hello all,

I do not understand why when visiting the webpage
http://www.gtalbot.org/BugzillaSection/Bug195867GDR_WindowOpen.html
I should get a warning stating that
{
The use of « getBoxObjectFor() » is deprecated. Try to use the fonction « element.getBoundingClientRect() » if possible.
}
when the webpage is not using getBoxObjectFor() anywhere to begin with.

The Bug195867GDR_WindowOpen.html uses an 
<object data="../GRAPHICS/GIF/FirefoxChromeToolbarsDescription7a.gif" type="image/gif" width="840" height="620" usemap="#MapForImage" ...>
as an image map ... which I suppose is why I get such warning.

I have searched for a duplicate and none corresponds appropriately except this bug.

I am using (reproducible 100% with) Firefox 3.0 RC1 rv: 1.9 build 2008051206 French localization under XP Pro SP3 here.

Should I create a separate bug for this?
A quick reduced testcase:

http://www.gtalbot.org/BugzillaSection/Bug409220WarnUseGetBoxObjectFor.html

Steps:
- Use Firefox 3.0 RC1 rv: 1.9 build 2008051206
- Open and clear Error console
- load 
http://www.gtalbot.org/BugzillaSection/Bug409220WarnUseGetBoxObjectFor.html

Expected results: no warning message in Error console

Actual results: 
{
The use of « getBoxObjectFor() » is deprecated. Try to use the fonction
« element.getBoundingClientRect() » if possible.
}
warning message appears in Error console
Please make sure you're testing in safe mode?  I would fully expect that warning if you have an extension that binds XBL to <objects> and the XBL uses getBoxObjectFor (e.g. adblock and so forth).  I don't see that warning on that page.
> an extension that binds XBL to <objects> and the XBL uses
> getBoxObjectFor (e.g. adblock and so forth).

Hello Boris,

You are correct and on the spot: it was AdblockPlus 0.7.5.4. Disactivating AdblockPlus will no longer generates such warning messages on <object>s. Thank you!

I have created/opened a bugfile at mozdev regarding AdblockPlus
Bug 19126: getBoxObjectFor() deprecated, use element.getBoundingClientRect() warning message
https://www.mozdev.org/bugs/show_bug.cgi?id=19126
so that this issue be fixed over there.
Component: DOM: Core → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.