Commit 884a874e authored by hyatt's avatar hyatt

Make the view source document properly handle <script>. We don't syntax

        highlight the JS yet, but it shows up properly now.

        Reviewed by john

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::scriptHandler):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d420935a
2006-06-28 David Hyatt <hyatt@apple.com>
Make the view source document properly handle <script>. We don't syntax
highlight the JS yet, but it shows up properly now.
Reviewed by john
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::scriptHandler):
2006-06-28 Timothy Hatcher <timothy@apple.com>
Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
......
......@@ -1569,6 +1569,23 @@
FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
/* End PBXBuildFile section */
/* Begin PBXBuildStyle section */
BCEED0480A530A0A00443D9A /* Development */ = {
isa = PBXBuildStyle;
buildSettings = {
COPY_PHASE_STRIP = NO;
};
name = Development;
};
BCEED0490A530A0A00443D9A /* Deployment */ = {
isa = PBXBuildStyle;
buildSettings = {
COPY_PHASE_STRIP = YES;
};
name = Deployment;
};
/* End PBXBuildStyle section */
/* Begin PBXContainerItemProxy section */
DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
......@@ -6371,6 +6388,12 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
buildSettings = {
};
buildStyles = (
BCEED0480A530A0A00443D9A /* Development */,
BCEED0490A530A0A00443D9A /* Deployment */,
);
hasScannedForEncodings = 1;
knownRegions = (
English,
......
......@@ -355,13 +355,14 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
CachedScript* cs = 0;
// don't load external scripts for standalone documents (for now)
if (!inViewSourceMode()) {
if (!scriptSrc.isEmpty() && m_doc->frame()) {
// forget what we just got; load from src url instead
if (!parser->skipMode() && !followingFrameset) {
#if INSTRUMENT_LAYOUT_SCHEDULING
#if INSTRUMENT_LAYOUT_SCHEDULING
if (!m_doc->ownerElement())
printf("Requesting script at time %d\n", m_doc->elapsedTime());
#endif
#endif
if ( (cs = m_doc->docLoader()->requestScript(scriptSrc, scriptSrcCharset) ))
pendingScripts.enqueue(cs);
else
......@@ -371,15 +372,17 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
scriptSrc=DeprecatedString::null;
}
else {
#ifdef TOKEN_DEBUG
#ifdef TOKEN_DEBUG
kdDebug( 6036 ) << "---START SCRIPT---" << endl;
kdDebug( 6036 ) << DeprecatedString(scriptCode, scriptCodeSize) << endl;
kdDebug( 6036 ) << "---END SCRIPT---" << endl;
#endif
#endif
scriptNode = 0;
// Parse scriptCode containing <script> info
doScriptExec = true;
}
}
state = processListing(SegmentedString(scriptCode, scriptCodeSize), state);
DeprecatedString exScript(reinterpret_cast<QChar*>(buffer), dest - buffer);
processToken();
......@@ -387,10 +390,15 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
currToken.beginTag = false;
processToken();
state.setInScript(false);
// FIXME: The script should be syntax highlighted.
if (inViewSourceMode())
return state;
SegmentedString *savedPrependingSrc = currentPrependingSrc;
SegmentedString prependingSrc;
currentPrependingSrc = &prependingSrc;
state.setInScript(false);
scriptCodeSize = scriptCodeResync = 0;
if (!parser->skipMode() && !followingFrameset) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment