Changeset 83201 in webkit
- Timestamp:
- Apr 7, 2011 1:23:48 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83196 r83201 1 2011-04-07 Andy Estes <aestes@apple.com> 2 3 Reviewed by Darin Adler. 4 5 REGRESSION (r64712): Microsoft Outlook 2011: original message contents 6 not included when replying to an email. 7 https://bugs.webkit.org/show_bug.cgi?id=57794 8 9 * WebCore.exp.in: 10 * loader/FrameLoader.cpp: 11 (WebCore::FrameLoader::finishedParsing): Call Frame::injectUserScripts() 12 before checking if the FrameLoader is parsing the initial empty document. 13 This allows user scripts to be injected at the end of document parsing 14 (if the setting is enabled). 15 * page/Frame.cpp: 16 (WebCore::Frame::injectUserScripts): Do not inject scripts if this 17 feature is disabled on the initial empty document. 18 * page/Settings.cpp: 19 (WebCore::Settings::Settings): 20 * page/Settings.h: Add a setting for injecting user scripts into the 21 initial empty document (defaults to false). 22 (WebCore::Settings::setInjectUserScriptsInInitialEmptyDocument): 23 (WebCore::Settings::injectUserScriptsInInitialEmptyDocument): 24 * platform/mac/RuntimeApplicationChecks.h: 25 * platform/mac/RuntimeApplicationChecks.mm: 26 (WebCore::applicationIsMicrosoftOutlook): Check if the embedding 27 application is Microsoft Outlook. 28 1 29 2011-04-06 Jer Noble <jer.noble@apple.com> 2 30 -
trunk/Source/WebCore/WebCore.exp.in
r83081 r83201 618 618 __ZN7WebCore28encodeWithURLEscapeSequencesERKN3WTF6StringE 619 619 __ZN7WebCore28removeLanguageChangeObserverEPv 620 __ZN7WebCore29applicationIsMicrosoftOutlookEv 620 621 __ZN7WebCore29contextMenuItemTagLeftToRightEv 621 622 __ZN7WebCore29contextMenuItemTagRightToLeftEv -
trunk/Source/WebCore/loader/FrameLoader.cpp
r82843 r83201 791 791 void FrameLoader::finishedParsing() 792 792 { 793 m_frame->injectUserScripts(InjectAtDocumentEnd); 794 793 795 if (m_stateMachine.creatingInitialEmptyDocument()) 794 796 return; 795 796 m_frame->injectUserScripts(InjectAtDocumentEnd);797 797 798 798 // This can be called from the Frame's destructor, in which case we shouldn't protect ourselves -
trunk/Source/WebCore/page/Frame.cpp
r83081 r83201 6 6 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 7 * 2001 George Staikos <staikos@kde.org> 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 9 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) … … 519 519 return; 520 520 521 if (loader()->stateMachine()->creatingInitialEmptyDocument() )522 return; 523 521 if (loader()->stateMachine()->creatingInitialEmptyDocument() && !settings()->shouldInjectUserScriptsInInitialEmptyDocument()) 522 return; 523 524 524 // Walk the hashtable. Inject by world. 525 525 const UserScriptMap* userScripts = m_page->group().userScripts(); -
trunk/Source/WebCore/page/Settings.cpp
r82386 r83201 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 173 173 , m_useQuickLookResourceCachingQuirks(false) 174 174 , m_forceCompositingMode(false) 175 , m_shouldInjectUserScriptsInInitialEmptyDocument(false) 175 176 { 176 177 // A Frame may not have been created yet, so we initialize the AtomicString -
trunk/Source/WebCore/page/Settings.h
r82386 r83201 1 1 /* 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 3 3 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 4 4 * … … 386 386 void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; } 387 387 bool forceCompositingMode() { return m_forceCompositingMode; } 388 389 void setShouldInjectUserScriptsInInitialEmptyDocument(bool flag) { m_shouldInjectUserScriptsInInitialEmptyDocument = flag; } 390 bool shouldInjectUserScriptsInInitialEmptyDocument() { return m_shouldInjectUserScriptsInInitialEmptyDocument; } 388 391 389 392 private: … … 488 491 bool m_useQuickLookResourceCachingQuirks : 1; 489 492 bool m_forceCompositingMode : 1; 493 bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1; 490 494 491 495 #if USE(SAFARI_THEME) -
trunk/Source/WebCore/platform/mac/RuntimeApplicationChecks.h
r68175 r83201 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 35 35 bool applicationIsAOLInstantMessenger(); 36 36 bool applicationIsMicrosoftMyDay(); 37 bool applicationIsMicrosoftOutlook(); 37 38 38 39 } // namespace WebCore -
trunk/Source/WebCore/platform/mac/RuntimeApplicationChecks.mm
r68175 r83201 1 1 /* 2 * Copyright (C) 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2009, 2011 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 65 65 return isMicrosoftMyDay; 66 66 } 67 68 bool applicationIsMicrosoftOutlook() 69 { 70 static bool isMicrosoftOutlook = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.microsoft.Outlook"]; 71 return isMicrosoftOutlook; 72 } 67 73 68 74 } // namespace WebCore -
trunk/Source/WebKit/ChangeLog
r83000 r83201 1 2011-04-07 Andy Estes <aestes@apple.com> 2 3 Reviewed by Darin Adler. 4 5 REGRESSION (r64712): Microsoft Outlook 2011: original message contents 6 not included when replying to an email. 7 https://bugs.webkit.org/show_bug.cgi?id=57794 8 9 * WebKit.xcodeproj/project.pbxproj: 10 1 11 2011-04-05 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r83000 r83201 82 82 226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */ = {isa = PBXBuildFile; fileRef = 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 83 83 22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 84 29AEF95E134C755400FE5096 /* OutlookQuirksUserScript.js in Sources */ = {isa = PBXBuildFile; fileRef = 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */; }; 85 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */ = {isa = PBXBuildFile; fileRef = 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */; }; 84 86 37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B6FB4C1063530C000FDB3B /* WebPDFDocumentExtras.h */; }; 85 87 37B6FB4F1063530C000FDB3B /* WebPDFDocumentExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37B6FB4D1063530C000FDB3B /* WebPDFDocumentExtras.mm */; }; … … 465 467 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 466 468 2568C72C0174912D0ECA149E /* WebKit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKit.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 469 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = OutlookQuirksUserScript.js; sourceTree = "<group>"; }; 467 470 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 468 471 2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 940 943 isa = PBXGroup; 941 944 children = ( 945 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */, 942 946 A864B3E5123ED83D00C2A612 /* MailQuirksUserScript.js */, 943 947 1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */, … … 1713 1717 buildActionMask = 2147483647; 1714 1718 files = ( 1719 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */, 1715 1720 A864B3F6123ED9FA00C2A612 /* MailQuirksUserScript.js in Resources */, 1716 1721 939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */, … … 2016 2021 BC42D34D131ED3880075FA4B /* WebLocalizableStringsInternal.mm in Sources */, 2017 2022 B82958D4132707D0000D0E79 /* CorrectionPanel.mm in Sources */, 2023 29AEF95E134C755400FE5096 /* OutlookQuirksUserScript.js in Sources */, 2018 2024 ); 2019 2025 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit/mac/ChangeLog
r83133 r83201 1 2011-04-07 Andy Estes <aestes@apple.com> 2 3 Reviewed by Darin Adler. 4 5 REGRESSION (r64712): Microsoft Outlook 2011: original message contents 6 not included when replying to an email. 7 https://bugs.webkit.org/show_bug.cgi?id=57794 8 9 Outlook populates a reply message by creating an empty WebView and 10 using DOM API to populate the WebView's empty document with content 11 from the original message. It expects the initial empty document to 12 simply be "<html></html>", and it proceeds to dynamically create and 13 append a BODY node and add the original message content as a child of 14 that node. Outlook then takes the innerHTML of the frame's first body 15 element and copies it into a *new* document that is displayed and 16 edited in the reply message window. 17 18 Due to implementing the HTML5 tree building algorithm in r64712, 19 initial empty documents went from being "<html></html>" to being 20 "<html><head></head><body></body></html>". Outlook still dynamically 21 creates a BODY node to parent the original message content, but this 22 BODY node duplicates the one created by the tree builder. When Outlook 23 then takes the innerHTML of the first body element to populate the 24 reply message window it gets the empty body element created by the 25 parser, not the one it created with the original message content. 26 27 Fix this by injecting a user script into the initial empty document 28 that removes the HEAD and BODY nodes created by the parser. This 29 ensures that the BODY created by Outlook is the only BODY in the 30 document. 31 32 * Misc/OutlookQuirksUserScript.js: Added. 33 * WebView/WebView.mm: 34 (leakMailQuirksUserScriptContents): 35 (-[WebView _injectMailQuirksScript]): 36 (needsOutlookQuirksScript): 37 (leakOutlookQuirksUserScriptContents): 38 (-[WebView _injectOutlookQuirksScript]): 39 (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): 40 1 41 2011-04-06 Dai Mikurube <dmikurube@chromium.org> 2 42 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r82386 r83201 1 1 /* 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 David Smith (catfish.man@gmail.com) 4 4 * Copyright (C) 2010 Igalia S.L … … 640 640 } 641 641 642 static NSString *leakMailQuirksUserScript Path()642 static NSString *leakMailQuirksUserScriptContents() 643 643 { 644 644 NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"MailQuirksUserScript" ofType:@"js"]; … … 648 648 - (void)_injectMailQuirksScript 649 649 { 650 static NSString *mailQuirksScript Path = leakMailQuirksUserScriptPath();650 static NSString *mailQuirksScriptContents = leakMailQuirksUserScriptContents(); 651 651 core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), 652 mailQuirksScriptPath, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); 652 mailQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); 653 } 654 655 static bool needsOutlookQuirksScript() 656 { 657 static bool isOutlookNeedingQuirksScript = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER) 658 && applicationIsMicrosoftOutlook(); 659 return isOutlookNeedingQuirksScript; 660 } 661 662 static NSString *leakOutlookQuirksUserScriptContents() 663 { 664 NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"OutlookQuirksUserScript" ofType:@"js"]; 665 return [[NSString alloc] initWithContentsOfFile:scriptPath]; 666 } 667 668 -(void)_injectOutlookQuirksScript 669 { 670 static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents(); 671 core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), 672 outlookQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); 653 673 } 654 674 … … 720 740 _private->page->setCanStartMedia([self window]); 721 741 _private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); 742 743 if (needsOutlookQuirksScript()) { 744 _private->page->settings()->setShouldInjectUserScriptsInInitialEmptyDocument(true); 745 [self _injectOutlookQuirksScript]; 746 } 722 747 723 748 [WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView];
Note: See TracChangeset
for help on using the changeset viewer.