This repository was archived by the owner on Sep 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,10 @@ function register(name, options) {
9191 }
9292 // record name
9393 definition . __name = name . toLowerCase ( ) ;
94+ // ensure extended name is also treated case-insensitively
95+ if ( definition . extends ) {
96+ definition . extends = definition . extends . toLowerCase ( ) ;
97+ }
9498 // ensure a lifecycle object so we don't have to null test it
9599 definition . lifecycle = definition . lifecycle || { } ;
96100 // build a list of ancestral custom elements (for native base detection)
Original file line number Diff line number Diff line change @@ -183,9 +183,9 @@ suite('customElements', function() {
183183 } ) ;
184184
185185 test ( 'document.registerElement with type extension treats names as case insensitive' , function ( ) {
186- var proto = { prototype : Object . create ( HTMLButtonElement . prototype ) , extends : 'button ' } ;
186+ var proto = { prototype : Object . create ( HTMLButtonElement . prototype ) , extends : 'butTON ' } ;
187187 proto . prototype . isXCase = true ;
188- var XCase = document . registerElement ( 'X-EXTEND -CASE' , proto ) ;
188+ var XCase = document . registerElement ( 'X-extend -CASE' , proto ) ;
189189 // createElement
190190 var x = document . createElement ( 'button' , 'X-EXTEND-CASE' ) ;
191191 assert . equal ( x . isXCase , true ) ;
You can’t perform that action at this time.
0 commit comments