Auto merge of #6043 - mukilan:get_root_element, r=Ms2ger
Auto merge of #6043 - mukilan:get_root_element, r=Ms2ger

The [current implementation](http://mxr.mozilla.org/servo/source/components/script/dom/element.rs#666) is wrong as it always tries to cast the furthest ancestor into an element.
When the method is invoked on an element that is in the document tree, this will be the `Document` node, which is not an element. The ```last().map(ElementCast::to_temporary)``` returns Some(None) hence the method will return ```None```, while the correct behaviour is to return the ```html``` node.

This PR interprets the line ```"furthest ancestor element node of whatever node is being discussed"``` in the spec to mean ```"find the furthest ancestor that is an element node"```.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6043)
<!-- Reviewable:end -->

avadacatavra/servo,larsbergstrom/servo,j3parker/servo,sadmansk/servo,A-deLuna/servo,ryancanhelpyou/servo,kindersung/servo,nnethercote/servo,anthgur/servo,ConnorGBrewster/servo,AnthonyBroadCrawford/servo,tempbottle/servo,avadacatavra/servo,huonw/servo,runarberg/servo,dvberkel/servo,DominoTree/servo,nnethercote/servo,rentongzhang/servo,dvberkel/servo,rentongzhang/servo,zhangjunlei26/servo,dvberkel/servo,CJ8664/servo,canaltinova/servo,mt2d2/servo,runarberg/servo,cbrewster/servo,g-k/servo,A-deLuna/servo,tafia/servo,nrc/servo,meh/servo,dsandeephegde/servo,jlegendary/servo,mattnenterprise/servo,jgraham/servo,bjwbell/servo,zhangjunlei26/servo,mt2d2/servo,jlegendary/servo,pyecs/servo,splav/servo,j3parker/servo,zhangjunlei26/servo,jimberlage/servo,ryancanhelpyou/servo,saratang/servo,thiagopnts/servo,rixrix/servo,jlegendary/servo,tschneidereit/servo,AnthonyBroadCrawford/servo,GyrosOfWar/servo,nerith/servo,nick-thompson/servo,peterjoel/servo,meh/servo,ryancanhelpyou/servo,pyfisch/servo,saneyuki/servo,avadacatavra/servo,notriddle/servo,karlito40/servo,j3parker/servo,jimberlage/servo,AnthonyBroadCrawford/servo,sadmansk/servo,jgraham/servo,RenaudParis/servo,anthgur/servo,dhananjay92/servo,anthgur/servo,mt2d2/servo,zentner-kyle/servo,emilio/servo,sadmansk/servo,ConnorGBrewster/servo,RenaudParis/servo,brendandahl/servo,boghison/servo,j3parker/servo,fiji-flo/servo,fiji-flo/servo,rentongzhang/servo,GreenRecycleBin/servo,tschneidereit/servo,nick-thompson/servo,AnthonyBroadCrawford/servo,WriterOfAlicrow/servo,fiji-flo/servo,DominoTree/servo,j3parker/servo,runarberg/servo,steveklabnik/servo,nnethercote/servo,mattnenterprise/servo,karlito40/servo,DominoTree/servo,meh/servo,mbrubeck/servo,karlito40/servo,karlito40/servo,paulrouget/servo,kindersung/servo,youprofit/servo,peterjoel/servo,karlito40/servo,splav/servo,dagnir/servo,KiChjang/servo,dagnir/servo,huonw/servo,deokjinkim/servo,A-deLuna/servo,RenaudParis/servo,emilio/servo,GreenRecycleBin/servo,g-k/servo,canaltinova/servo,codemac/servo,samfoo/servo,hyowon/servo,eddyb/servo,nerith/servo,avadacatavra/servo,aweinstock314/servo,ConnorGBrewster/servo,ConnorGBrewster/servo,jdramani/servo,GreenRecycleBin/servo,jdramani/servo,codemac/servo,ConnorGBrewster/servo,emilio/servo,anthgur/servo,caldwell/servo,sadmansk/servo,DominoTree/servo,walac/servo,A-deLuna/servo,saratang/servo,sadmansk/servo,mbrubeck/servo,peterjoel/servo,szeged/servo,bjwbell/servo,emilio/servo,DominoTree/servo,dhananjay92/servo,mbrubeck/servo,dsandeephegde/servo,avadacatavra/servo,wartman4404/servo,kindersung/servo,upsuper/servo,sadmansk/servo,kindersung/servo,thiagopnts/servo,s142857/servo,A-deLuna/servo,paulrouget/servo,A-deLuna/servo,SimonSapin/servo,DominoTree/servo,g-k/servo,j3parker/servo,meh/servo,pyecs/servo,canaltinova/servo,thiagopnts/servo,eddyb/servo,mt2d2/servo,nick-thompson/servo,deokjinkim/servo,boghison/servo,jimberlage/servo,paulrouget/servo,deokjinkim/servo,thiagopnts/servo,peterjoel/servo,paulrouget/servo,dsandeephegde/servo,RenaudParis/servo,dati91/servo,rixrix/servo,nnethercote/servo,larsbergstrom/servo,SimonSapin/servo,ConnorGBrewster/servo,WriterOfAlicrow/servo,peterjoel/servo,dhananjay92/servo,rixrix/servo,tafia/servo,jimberlage/servo,nick-thompson/servo,nick-thompson/servo,vks/servo,AnthonyBroadCrawford/servo,codemac/servo,jdramani/servo,SimonSapin/servo,tempbottle/servo,nnethercote/servo,notriddle/servo,nrc/servo,nrc/servo,notriddle/servo,boghison/servo,akosel/servo,RenaudParis/servo,dati91/servo,karlito40/servo,dsandeephegde/servo,jlegendary/servo,boghison/servo,ConnorGBrewster/servo,CJ8664/servo,CJ8664/servo,samfoo/servo,akosel/servo,rnestler/servo,KiChjang/servo,hyowon/servo,codemac/servo,steveklabnik/servo,pyfisch/servo,wartman4404/servo,WriterOfAlicrow/servo,eddyb/servo,thiagopnts/servo,tafia/servo,zentner-kyle/servo,pgonda/servo,rentongzhang/servo,kindersung/servo,anthgur/servo,tafia/servo,nerith/servo,emilio/servo,saratang/servo,AnthonyBroadCrawford/servo,fiji-flo/servo,brendandahl/servo,walac/servo,dati91/servo,nnethercote/servo,caldwell/servo,emilio/servo,aweinstock314/servo,huonw/servo,zhangjunlei26/servo,mattnenterprise/servo,canaltinova/servo,bjwbell/servo,nnethercote/servo,rnestler/servo,GreenRecycleBin/servo,larsbergstrom/servo,szeged/servo,notriddle/servo,rixrix/servo,vks/servo,tafia/servo,kindersung/servo,GyrosOfWar/servo,mdibaiee/servo,SimonSapin/servo,dsandeephegde/servo,cbrewster/servo,anthgur/servo,szeged/servo,aweinstock314/servo,szeged/servo,wartman4404/servo,huonw/servo,youprofit/servo,runarberg/servo,bjwbell/servo,deokjinkim/servo,emilio/servo,brendandahl/servo,huonw/servo,steveklabnik/servo,deokjinkim/servo,SimonSapin/servo,dhananjay92/servo,hyowon/servo,GreenRecycleBin/servo,avadacatavra/servo,mdibaiee/servo,saratang/servo,paulrouget/servo,upsuper/servo,wartman4404/servo,nrc/servo,KiChjang/servo,dvberkel/servo,aidanhs/servo,jgraham/servo,cbrewster/servo,sadmansk/servo,dvberkel/servo,s142857/servo,CJ8664/servo,szeged/servo,GyrosOfWar/servo,hyowon/servo,s142857/servo,upsuper/servo,dvberkel/servo,jimberlage/servo,youprofit/servo,nerith/servo,zentner-kyle/servo,akosel/servo,hyowon/servo,mt2d2/servo,saneyuki/servo,aidanhs/servo,mdibaiee/servo,zhangjunlei26/servo,mbrubeck/servo,deokjinkim/servo,saratang/servo,KiChjang/servo,caldwell/servo,upsuper/servo,brendandahl/servo,zentner-kyle/servo,splav/servo,upsuper/servo,codemac/servo,notriddle/servo,larsbergstrom/servo,nerith/servo,saratang/servo,rixrix/servo,mattnenterprise/servo,s142857/servo,jimberlage/servo,szeged/servo,rnestler/servo,aidanhs/servo,peterjoel/servo,tempbottle/servo,rnestler/servo,steveklabnik/servo,jimberlage/servo,zentner-kyle/servo,mt2d2/servo,jgraham/servo,jlegendary/servo,fiji-flo/servo,runarberg/servo,pyecs/servo,tempbottle/servo,peterjoel/servo,rnestler/servo,caldwell/servo,wartman4404/servo,codemac/servo,GyrosOfWar/servo,akosel/servo,eddyb/servo,eddyb/servo,akosel/servo,notriddle/servo,SimonSapin/servo,huonw/servo,ryancanhelpyou/servo,rentongzhang/servo,zentner-kyle/servo,zhangjunlei26/servo,dhananjay92/servo,tschneidereit/servo,CJ8664/servo,sadmansk/servo,vks/servo,dhananjay92/servo,canaltinova/servo,hyowon/servo,pgonda/servo,paulrouget/servo,rnestler/servo,mattnenterprise/servo,dati91/servo,runarberg/servo,pgonda/servo,jdramani/servo,aidanhs/servo,saneyuki/servo,mt2d2/servo,mdibaiee/servo,jgraham/servo,wartman4404/servo,meh/servo,steveklabnik/servo,youprofit/servo,CJ8664/servo,nnethercote/servo,nnethercote/servo,jgraham/servo,rixrix/servo,tempbottle/servo,paulrouget/servo,splav/servo,cbrewster/servo,WriterOfAlicrow/servo,splav/servo,huonw/servo,runarberg/servo,splav/servo,larsbergstrom/servo,avadacatavra/servo,mbrubeck/servo,notriddle/servo,g-k/servo,rnestler/servo,pyecs/servo,aidanhs/servo,peterjoel/servo,deokjinkim/servo,mdibaiee/servo,notriddle/servo,pyfisch/servo,dsandeephegde/servo,meh/servo,aidanhs/servo,KiChjang/servo,nerith/servo,mattnenterprise/servo,g-k/servo,akosel/servo,pyecs/servo,SimonSapin/servo,rixrix/servo,thiagopnts/servo,dagnir/servo,rixrix/servo,fiji-flo/servo,tempbottle/servo,walac/servo,szeged/servo,jdramani/servo,saneyuki/servo,samfoo/servo,WriterOfAlicrow/servo,larsbergstrom/servo,nick-thompson/servo,tschneidereit/servo,paulrouget/servo,saneyuki/servo,CJ8664/servo,wartman4404/servo,aweinstock314/servo,samfoo/servo,pyfisch/servo,saratang/servo,samfoo/servo,caldwell/servo,szeged/servo,dati91/servo,mattnenterprise/servo,dsandeephegde/servo,saneyuki/servo,KiChjang/servo,upsuper/servo,KiChjang/servo,bjwbell/servo,canaltinova/servo,larsbergstrom/servo,tschneidereit/servo,hyowon/servo,jdramani/servo,walac/servo,jlegendary/servo,pyfisch/servo,rnestler/servo,saneyuki/servo,brendandahl/servo,SimonSapin/servo,bjwbell/servo,tafia/servo,KiChjang/servo,splav/servo,notriddle/servo,bjwbell/servo,szeged/servo,anthgur/servo,larsbergstrom/servo,dagnir/servo,dhananjay92/servo,fiji-flo/servo,zentner-kyle/servo,WriterOfAlicrow/servo,youprofit/servo,karlito40/servo,s142857/servo,s142857/servo,nick-thompson/servo,kindersung/servo,thiagopnts/servo,steveklabnik/servo,jgraham/servo,ryancanhelpyou/servo,WriterOfAlicrow/servo,jimberlage/servo,avadacatavra/servo,pgonda/servo,caldwell/servo,mbrubeck/servo,DominoTree/servo,canaltinova/servo,splav/servo,splav/servo,zhangjunlei26/servo,aidanhs/servo,vks/servo,akosel/servo,vks/servo,meh/servo,mdibaiee/servo,larsbergstrom/servo,mattnenterprise/servo,dvberkel/servo,ryancanhelpyou/servo,youprofit/servo,GyrosOfWar/servo,eddyb/servo,ConnorGBrewster/servo,boghison/servo,rixrix/servo,tempbottle/servo,j3parker/servo,eddyb/servo,walac/servo,pyfisch/servo,pyfisch/servo,codemac/servo,dsandeephegde/servo,DominoTree/servo,pyfisch/servo,mdibaiee/servo,vks/servo,aweinstock314/servo,aweinstock314/servo,pyecs/servo,dagnir/servo,DominoTree/servo,GreenRecycleBin/servo,paulrouget/servo,tschneidereit/servo,GyrosOfWar/servo,samfoo/servo,rentongzhang/servo,KiChjang/servo,larsbergstrom/servo,GreenRecycleBin/servo,ryancanhelpyou/servo,cbrewster/servo,szeged/servo,GreenRecycleBin/servo,GreenRecycleBin/servo,aweinstock314/servo,boghison/servo,cbrewster/servo,anthgur/servo,boghison/servo,samfoo/servo,pyfisch/servo,cbrewster/servo,thiagopnts/servo,dati91/servo,nrc/servo,saneyuki/servo,upsuper/servo,nerith/servo,paulrouget/servo,dagnir/servo,cbrewster/servo,jdramani/servo,RenaudParis/servo,GyrosOfWar/servo,pyfisch/servo,vks/servo,notriddle/servo,canaltinova/servo,pgonda/servo,A-deLuna/servo,s142857/servo,mbrubeck/servo,walac/servo,youprofit/servo,emilio/servo,caldwell/servo,saneyuki/servo,splav/servo,emilio/servo,nrc/servo,pgonda/servo,g-k/servo,RenaudParis/servo,pgonda/servo,g-k/servo,KiChjang/servo,upsuper/servo,tafia/servo,mbrubeck/servo,emilio/servo,tschneidereit/servo,dagnir/servo,dati91/servo,peterjoel/servo,AnthonyBroadCrawford/servo,pyecs/servo,peterjoel/servo,CJ8664/servo,brendandahl/servo,jimberlage/servo,dati91/servo,zhangjunlei26/servo,walac/servo,zhangjunlei26/servo,brendandahl/servo,rentongzhang/servo,nrc/servo,fiji-flo/servo,jlegendary/servo,saneyuki/servo,eddyb/servo,DominoTree/servo,steveklabnik/servo,nnethercote/servo