+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.
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;
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+ buildSettings = {
+ };
+ buildStyles = (
+ BCEED0480A530A0A00443D9A /* Development */,
+ BCEED0490A530A0A00443D9A /* Deployment */,
+ );
hasScannedForEncodings = 1;
knownRegions = (
English,
CachedScript* cs = 0;
// don't load external scripts for standalone documents (for now)
- 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 (!m_doc->ownerElement())
- printf("Requesting script at time %d\n", m_doc->elapsedTime());
-#endif
- if ( (cs = m_doc->docLoader()->requestScript(scriptSrc, scriptSrcCharset) ))
- pendingScripts.enqueue(cs);
- else
+ 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 (!m_doc->ownerElement())
+ printf("Requesting script at time %d\n", m_doc->elapsedTime());
+ #endif
+ if ( (cs = m_doc->docLoader()->requestScript(scriptSrc, scriptSrcCharset) ))
+ pendingScripts.enqueue(cs);
+ else
+ scriptNode = 0;
+ } else
scriptNode = 0;
- } else
+ scriptSrc=DeprecatedString::null;
+ }
+ else {
+ #ifdef TOKEN_DEBUG
+ kdDebug( 6036 ) << "---START SCRIPT---" << endl;
+ kdDebug( 6036 ) << DeprecatedString(scriptCode, scriptCodeSize) << endl;
+ kdDebug( 6036 ) << "---END SCRIPT---" << endl;
+ #endif
scriptNode = 0;
- scriptSrc=DeprecatedString::null;
- }
- else {
-#ifdef TOKEN_DEBUG
- kdDebug( 6036 ) << "---START SCRIPT---" << endl;
- kdDebug( 6036 ) << DeprecatedString(scriptCode, scriptCodeSize) << endl;
- kdDebug( 6036 ) << "---END SCRIPT---" << endl;
-#endif
- scriptNode = 0;
- // Parse scriptCode containing <script> info
- doScriptExec = true;
+ // Parse scriptCode containing <script> info
+ doScriptExec = true;
+ }
}
+
state = processListing(SegmentedString(scriptCode, scriptCodeSize), state);
DeprecatedString exScript(reinterpret_cast<QChar*>(buffer), dest - buffer);
processToken();
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) {