yuntaozhu / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

goog.ui.TabPane adds style to header. Breaks IE < 10 #557

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. Create more than 31 TabPanes.
2. After the 31st an error will be generated when document.createStyleSheet() 
is invoked internally by the constructor.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Every time a new goog.ui.TabPane is instantiated a new style element is added 
to the head. This creates duplicate elements which serve the same exact 
purpose. Normally this would be a small problem, but in Internet Explorer this 
causes the script to crash. You cannot add more than 31 style elements to the 
head.

This is a problem in all versions of Internet Explorer previous to 10 since 
they have very low hard limits on the number of style elements that can exist 
in the head.

Please provide any additional information below.

I suggest that the constructor first verify if the style has been included 
before adding it. There is no point in adding it twice. Alternatively just put 
in the style in CSS, and don't do it dynamically at run time.

Original issue reported on code.google.com by enmanu...@gmail.com on 30 Apr 2013 at 5:10

GoogleCodeExporter commented 8 years ago
TabPane is deprecated in favor of TabBar.

Original comment by pall...@google.com on 30 Apr 2013 at 6:04

GoogleCodeExporter commented 8 years ago
Then, could you at least mark TabPane depracated in the documentation and give 
instructions to refer to TabBar? There is no way for me to know to use one over 
the other.

http://closure-library.googlecode.com/svn/docs/class_goog_ui_TabPane.html

Original comment by enmanu...@gmail.com on 30 Apr 2013 at 6:35

GoogleCodeExporter commented 8 years ago
The constructor is annotated with @deprecated.
http://closure-library.googlecode.com/svn/docs/closure_goog_ui_tabpane.js.source
.html 

The compiler should also warn when you try using it.

The deprecation is indeed not mentioned at 
http://closure-library.googlecode.com/svn/docs/class_goog_ui_TabPane.html , but 
that's a separate issue. I have to find out who maintains the doc generator.

Original comment by pall...@gmail.com on 30 Apr 2013 at 8:07