Changeset 26356 in webkit


Ignore:
Timestamp:
Oct 11, 2007, 2:30:54 AM (17 years ago)
Author:
lars
Message:

Ensure that setting innerHTML on an element doesn't do
weird things with the document.
Fixes most issues with http://bugs.webkit.org/show_bug.cgi?id=15456

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r26349 r26356  
     12007-10-11  Lars Knoll  <lars@trolltech.com>
     2
     3        Reviewed by Simon, testcase written by Erik.
     4
     5        Ensure that setting innerHTML on an element doesn't do
     6        weird things with the document.
     7        Fixes most issues with http://bugs.webkit.org/show_bug.cgi?id=15456
     8
     9        * fast/innerHTML/innerHTML-changing-document-properties-expected.txt: Added.
     10        * fast/innerHTML/innerHTML-changing-document-properties.xhtml: Added.
     11
    1122007-10-10  Darin Adler  <darin@apple.com>
    213
  • trunk/WebCore/ChangeLog

    r26185 r26356  
     12007-10-11  Lars Knoll  <lars@trolltech.com>
     2
     3        Reviewed by Erik Seidel and Simon.
     4
     5        Ensure that setting innerHTML on an element doesn't do
     6        weird things with the document.
     7        Fixes most issues with http://bugs.webkit.org/show_bug.cgi?id=15456
     8
     9        Test: fast/innerHTML/innerHTML-changing-document-properties.xhtml
     10
     11        * dom/XMLTokenizer.cpp:
     12        (WebCore::XMLTokenizer::write):
     13        (WebCore::XMLTokenizer::startDocument):
     14        (WebCore::XMLTokenizer::end):
     15        (WebCore::):
     16
    1172007-10-10  George Staikos  <staikos@kde.org>
    218
  • trunk/WebCore/dom/XMLTokenizer.cpp

    r26110 r26356  
    599599                String encoding = attrs.get("encoding");
    600600                ExceptionCode ec = 0;
    601                 if (!version.isEmpty())
    602                     m_doc->setXMLVersion(version, ec);
    603                 if (!encoding.isEmpty())
    604                     m_doc->setXMLEncoding(encoding);
     601                if (!m_parsingFragment) {
     602                    if (!version.isEmpty())
     603                        m_doc->setXMLVersion(version, ec);
     604                    if (!encoding.isEmpty())
     605                        m_doc->setXMLEncoding(encoding);
     606                }
    605607            }
    606608        }
     
    928930{
    929931    ExceptionCode ec = 0;
    930    
     932
    931933    if (version)
    932934        m_doc->setXMLVersion(toString(version), ec);
     
    12421244   
    12431245    setCurrentNode(0);
    1244     m_doc->finishedParsing();   
     1246    if (!m_parsingFragment)
     1247        m_doc->finishedParsing();   
    12451248}
    12461249
     
    17161719    ExceptionCode ec = 0;
    17171720
    1718     m_doc->setXMLStandalone(m_stream.isStandaloneDocument(), ec);
     1721    if (!m_parsingFragment)
     1722        m_doc->setXMLStandalone(m_stream.isStandaloneDocument(), ec);
    17191723}
    17201724
     
    19781982        setIsXHTMLDocument(true); // controls if we replace entities or not.
    19791983    }
    1980     m_doc->setDocType(new DocumentType(m_doc, name, publicId, systemId));
    1981    
    1982 }
    1983 #endif
    1984 }
    1985 
    1986 
     1984    if (!m_parsingFragment)
     1985        m_doc->setDocType(new DocumentType(m_doc, name, publicId, systemId));
     1986   
     1987}
     1988#endif
     1989}
     1990
     1991
Note: See TracChangeset for help on using the changeset viewer.