2010-06-22  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        Fragment parsing needs to go through the HTML5 Parser code path
        https://bugs.webkit.org/show_bug.cgi?id=40645

        * fast/canvas/canvas-getContext-invalid-expected.txt:
         - \0 is now converted to \uFFFD per HTML5.
        * fast/js/null-char-in-string-expected.txt: ditto.
        * fast/js/switch-behaviour-expected.txt: ditto.
        * fast/parser/comment-in-textarea-expected.txt:
         - <textarea> is parsed in the RCDATA state, which means
           that comments are ignored, thus the </textarea> in the
           comment correctly closes the <textarea>.  This test is invalid.
           Our new behavior matches minefield.
        * fast/tokenizer/lessthan-terminates-tags-and-attrs-expected.txt:
         - This test is invalid and probably should just be removed.
           This same behavior is tested by fast/invalid/016.html.
        * inspector/timeline-parse-html-expected.txt:
         - The "extra" ParseHTML is expected.  The HTML5 Parser tells the
           inspector about every parser pump, even ones which pump no data.
           The HTML5 parser pumps one last time in finish() to flush any
           buffered characters.  Eventually we'll teach the inspector to
           filter out (not display) 0-sized pumps.
        * storage/domstorage/complex-values-expected.txt:
         - \0 is now converted to \uFFFD per HTML5
        * svg/dom/fuzz-path-parser-expected.txt: ditto.
        * svg/dom/rgb-color-parser-expected.txt: ditto
        * websocket/tests/bad-sub-protocol-control-chars-expected.txt: ditto.
2010-06-22  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        Fragment parsing needs to go through the HTML5 Parser code path
        https://bugs.webkit.org/show_bug.cgi?id=40645

        Added a new HTML5DocumentParser::parseHTMLDocumentFragment
        codepath which optionally calls through to the old fragment
        parsing path, now renamed parseLegacyHTMLDocumentFragment.

        * dom/Element.cpp:
        (WebCore::Element::createContextualFragment):
         - Use document()->createDocumentFragment() instead
           of DocumentFragment::create() to match other callers
           (and not depend on DocumentFragment.h).
         - Update call to parseHTMLDocumentFragment to use the new
           HTML5 parser codepath.
        * dom/MappedAttributeEntry.h:
         - Add a FIXME about this horrible enum placement.
           Sadly this will cause a world-rebuild for everyone.
        * html/HTML5DocumentParser.cpp:
        (WebCore::HTML5DocumentParser::HTML5DocumentParser):
        (WebCore::HTML5DocumentParser::runScriptsForPausedTreeConstructor):
         - The main pumpLexer function has gotten to large.  Move the script
           running logic into this new function.
         - Handle the case where we have no m_scriptRunner (fragment case).
        (WebCore::HTML5DocumentParser::pumpLexer):
         - Use new runScriptsForPausedTreeConstructor().
        (WebCore::HTML5DocumentParser::executingScript):
        (WebCore::HTML5DocumentParser::inScriptExecution):
         - New function to handle the case where m_scriptRunner is null.
        (WebCore::HTML5DocumentParser::resumeParsingAfterScriptExecution):
         - Use inScriptExecution() instead of m_scriptRunner->inScriptExecution().
        (WebCore::HTML5DocumentParser::executeScript): ditto.
        (WebCore::HTML5DocumentParser::notifyFinished): ditto.
        (WebCore::HTML5DocumentParser::executeScriptsWaitingForStylesheets): ditto.
        (WebCore::shouldUseLegacyParser):
         - Helper function to check the html5ParserEnabled() setting.
        (WebCore::HTML5DocumentParser::parseHTMLDocumentFragment):
         - Run HTML5DocumentParser in fragment mode, or optionally run
           the legacy parser if !html5ParserEnabled().
        * html/HTML5DocumentParser.h:
        * html/HTML5TreeBuilder.cpp:
        (WebCore::HTML5TreeBuilder::HTML5TreeBuilder):
        (WebCore::HTML5TreeBuilder::passTokenToLegacyParser):
         - Implement the FragmentScriptingNotAllowed hack for platform/Pasteboard.
        * html/HTML5TreeBuilder.h:
        * html/HTMLDocumentParser.cpp:
        (WebCore::parseLegacyHTMLDocumentFragment):
         - Renamed from parseHTMLDocumentFragment
        * html/HTMLDocumentParser.h:
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::insertAdjacentHTML):
         - Call HTML5DocumentParser::parseHTMLDocumentFragment.
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::documentFragment): ditto.
        * xml/XSLTProcessor.cpp:
        (WebCore::createFragmentFromSource): ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index a323a07..5091c2b 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -1223,6 +1223,7 @@
     dom/EventTarget.h \
     dom/ExceptionBase.h \
     dom/ExceptionCode.h \
+    dom/FragmentScriptingPermission.h \
     dom/InputElement.h \
     dom/KeyboardEvent.h \
     dom/MessageChannel.h \