StyleElement::m_sheet should clear its owner node when the StyleElement is destructed
StyleElement::m_sheet should clear its owner node when the StyleElement is destructed

As far as I see the crash report, the problem looks like that CSSStyleSheet::m_ownerNode points to an already freed Node. The minor DOM GC exposed the bug by accident.

I checked all elements that hold m_sheet, which are StyleElement, HTMLLinkElement, Document, ProcessingInstruction and DocumentStyleSheetCollection. StyleElement is the only element that doesn't clear m_sheet when destructed. I'm not sure if the CL fixes the original bug, but the CL looks reasonable.

R=inferno,abarth
BUG=246203
TEST=none (I couldn't reproduce bug 246203.)

Review URL: https://chromiumcodereview.appspot.com/15994008

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@151735 bbb929c8-8fbe-4397-9dbb-9b2b20218538

PeterWangIntel/blink-crosswalk,Pluto-tv/blink-crosswalk,PeterWangIntel/blink-crosswalk,jtg-gg/blink,smishenk/blink-crosswalk,hgl888/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,XiaosongWei/blink-crosswalk,ondra-novak/blink,crosswalk-project/blink-crosswalk-efl,smishenk/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,PeterWangIntel/blink-crosswalk,jtg-gg/blink,nwjs/blink,nwjs/blink,Bysmyyr/blink-crosswalk,Bysmyyr/blink-crosswalk,kurli/blink-crosswalk,jtg-gg/blink,nwjs/blink,smishenk/blink-crosswalk,nwjs/blink,hgl888/blink-crosswalk-efl,hgl888/blink-crosswalk-efl,kurli/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,ondra-novak/blink,Bysmyyr/blink-crosswalk,hgl888/blink-crosswalk-efl,crosswalk-project/blink-crosswalk-efl,jtg-gg/blink,hgl888/blink-crosswalk-efl,kurli/blink-crosswalk,nwjs/blink,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,Bysmyyr/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,jtg-gg/blink,kurli/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,smishenk/blink-crosswalk,kurli/blink-crosswalk,Pluto-tv/blink-crosswalk,ondra-novak/blink,XiaosongWei/blink-crosswalk,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,Bysmyyr/blink-crosswalk,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,jtg-gg/blink,nwjs/blink,ondra-novak/blink,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,smishenk/blink-crosswalk,nwjs/blink,XiaosongWei/blink-crosswalk,PeterWangIntel/blink-crosswalk,PeterWangIntel/blink-crosswalk,modulexcite/blink,modulexcite/blink,modulexcite/blink,Pluto-tv/blink-crosswalk,smishenk/blink-crosswalk,kurli/blink-crosswalk,Pluto-tv/blink-crosswalk,ondra-novak/blink,PeterWangIntel/blink-crosswalk,XiaosongWei/blink-crosswalk,ondra-novak/blink,ondra-novak/blink,kurli/blink-crosswalk,nwjs/blink,crosswalk-project/blink-crosswalk-efl,crosswalk-project/blink-crosswalk-efl,ondra-novak/blink,Bysmyyr/blink-crosswalk,modulexcite/blink,XiaosongWei/blink-crosswalk,kurli/blink-crosswalk,ondra-novak/blink,Bysmyyr/blink-crosswalk,jtg-gg/blink,nwjs/blink,hgl888/blink-crosswalk-efl,modulexcite/blink,hgl888/blink-crosswalk-efl,smishenk/blink-crosswalk,nwjs/blink,Pluto-tv/blink-crosswalk,Bysmyyr/blink-crosswalk,crosswalk-project/blink-crosswalk-efl,jtg-gg/blink,modulexcite/blink,smishenk/blink-crosswalk,modulexcite/blink,crosswalk-project/blink-crosswalk-efl,Bysmyyr/blink-crosswalk,jtg-gg/blink,PeterWangIntel/blink-crosswalk,hgl888/blink-crosswalk-efl,modulexcite/blink,Pluto-tv/blink-crosswalk,Pluto-tv/blink-crosswalk,jtg-gg/blink,smishenk/blink-crosswalk,modulexcite/blink,Pluto-tv/blink-crosswalk,XiaosongWei/blink-crosswalk,Pluto-tv/blink-crosswalk,kurli/blink-crosswalk,kurli/blink-crosswalk,modulexcite/blink