Skip to content
  • mitz@apple.com's avatar
    <rdar://problem/7018611> innerHTML applies meta/link/title tags from a detached html element · a1ccbd93
    mitz@apple.com authored
    Reviewed by Anders Carlsson.
    
    WebCore: 
    
    Test: fast/parser/fragment-parser.html
    
    Ensure that fragment parsing has no side effects on the fragment’s owner
    document.
    
    * html/HTMLParser.cpp:
    (WebCore::HTMLParser::insertNode): Don’t call
    dispatchDocumentElementAvailable() for fragments.
    (WebCore::HTMLParser::handleError): Don’t copy attributes to the owner
    document’s <html> and <body> elements when a redundant <html> or <body>
    is encountered while parsing a fragment.
    (WebCore::HTMLParser::framesetCreateErrorCheck): Don’t change the owner
    document’s <body> element’s style when parsing a fragment.
    (WebCore::HTMLParser::createHead): Don’t attach the new <head> to the
    ownder document of a fragment.
    
    LayoutTests: 
    
    * fast/parser/fragment-parser-expected.txt: Added.
    * fast/parser/fragment-parser.html: Added.
    * fast/parser/script-tests/fragment-parser.js: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    a1ccbd93