Changeset 61964 in webkit
- Timestamp:
- Jun 26, 2010 3:59:31 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r61963 r61964 1 2010-06-26 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin Adler. 4 5 beforeProcess event needs to fire before inline scripts/stylesheets take effect 6 <rdar://problem/8084335> and https://bugs.webkit.org/show_bug.cgi?id=40484 7 8 This patch adds the Event, the onBeforeProcess attribute, and hooks the attribute up in a few places. 9 Besides that, no change in behavior. 10 11 Layout tests will come with the actual implementations as a followup to this patch. 12 13 Project file nonsense: 14 * DerivedSources.make: 15 * GNUmakefile.am: 16 * WebCore.gypi: 17 * WebCore.pri: 18 * WebCore.pro: 19 * WebCore.vcproj/WebCore.vcproj: 20 * WebCore.xcodeproj/project.pbxproj: 21 22 Scaffolding for the event itself: 23 * dom/BeforeProcessEvent.cpp: Added. 24 (WebCore::BeforeProcessEvent::text): 25 (WebCore::BeforeProcessEvent::setText): 26 * dom/BeforeProcessEvent.h: Added. 27 (WebCore::BeforeProcessEvent::create): 28 (WebCore::BeforeProcessEvent::initBeforeProcessEvent): 29 (WebCore::BeforeProcessEvent::BeforeProcessEvent): 30 * dom/BeforeProcessEvent.idl: Added. 31 32 * dom/EventNames.h: 33 34 Respect the onBeforeProcess attribute: 35 * dom/Document.cpp: 36 (WebCore::Document::addListenerTypeIfNeeded): 37 * dom/Document.h: 38 (WebCore::Document::): 39 40 * html/HTMLAttributeNames.in: 41 * html/HTMLScriptElement.cpp: 42 (WebCore::HTMLScriptElement::parseMappedAttribute): 43 * html/HTMLStyleElement.cpp: 44 (WebCore::HTMLStyleElement::parseMappedAttribute): 45 1 46 2010-06-26 Darin Adler <darin@apple.com> 2 47 -
trunk/WebCore/DerivedSources.make
r61950 r61964 54 54 BarInfo \ 55 55 BeforeLoadEvent \ 56 BeforeProcessEvent \ 56 57 Blob \ 57 58 BlobBuilder \ -
trunk/WebCore/GNUmakefile.am
r61950 r61964 130 130 WebCore/dom/Attr.idl \ 131 131 WebCore/dom/BeforeLoadEvent.idl \ 132 WebCore/dom/BeforeProcessEvent.idl \ 132 133 WebCore/dom/CDATASection.idl \ 133 134 WebCore/dom/CharacterData.idl \ … … 734 735 WebCore/dom/Attribute.h \ 735 736 WebCore/dom/BeforeLoadEvent.h \ 737 WebCore/dom/BeforeProcessEvent.cpp \ 738 WebCore/dom/BeforeProcessEvent.h \ 736 739 WebCore/dom/BeforeTextInsertedEvent.cpp \ 737 740 WebCore/dom/BeforeTextInsertedEvent.h \ -
trunk/WebCore/WebCore.gypi
r61955 r61964 31 31 'dom/Attr.idl', 32 32 'dom/BeforeLoadEvent.idl', 33 'dom/BeforeProcessEvent.idl', 33 34 'dom/CDATASection.idl', 34 35 'dom/CharacterData.idl', … … 1063 1064 'dom/BeforeTextInsertedEvent.h', 1064 1065 'dom/BeforeLoadEvent.h', 1066 'dom/BeforeProcessEvent.cpp', 1067 'dom/BeforeProcessEvent.h', 1065 1068 'dom/BeforeUnloadEvent.cpp', 1066 1069 'dom/BeforeUnloadEvent.h', -
trunk/WebCore/WebCore.pri
r61950 r61964 272 272 dom/Attr.idl \ 273 273 dom/BeforeLoadEvent.idl \ 274 dom/BeforeProcessEvent.idl \ 274 275 dom/CharacterData.idl \ 275 276 dom/ClientRect.idl \ -
trunk/WebCore/WebCore.pro
r61950 r61964 455 455 dom/Attr.cpp \ 456 456 dom/Attribute.cpp \ 457 dom/BeforeProcessEvent.cpp \ 457 458 dom/BeforeTextInsertedEvent.cpp \ 458 459 dom/BeforeUnloadEvent.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r61950 r61964 722 722 </File> 723 723 <File 724 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBeforeProcessEvent.cpp" 725 > 726 <FileConfiguration 727 Name="Debug|Win32" 728 ExcludedFromBuild="true" 729 > 730 <Tool 731 Name="VCCLCompilerTool" 732 /> 733 </FileConfiguration> 734 <FileConfiguration 735 Name="Release|Win32" 736 ExcludedFromBuild="true" 737 > 738 <Tool 739 Name="VCCLCompilerTool" 740 /> 741 </FileConfiguration> 742 <FileConfiguration 743 Name="Debug_Internal|Win32" 744 ExcludedFromBuild="true" 745 > 746 <Tool 747 Name="VCCLCompilerTool" 748 /> 749 </FileConfiguration> 750 <FileConfiguration 751 Name="Debug_Cairo|Win32" 752 ExcludedFromBuild="true" 753 > 754 <Tool 755 Name="VCCLCompilerTool" 756 /> 757 </FileConfiguration> 758 <FileConfiguration 759 Name="Release_Cairo|Win32" 760 ExcludedFromBuild="true" 761 > 762 <Tool 763 Name="VCCLCompilerTool" 764 /> 765 </FileConfiguration> 766 <FileConfiguration 767 Name="Debug_All|Win32" 768 ExcludedFromBuild="true" 769 > 770 <Tool 771 Name="VCCLCompilerTool" 772 /> 773 </FileConfiguration> 774 </File> 775 <File 776 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBeforeProcessEvent.h" 777 > 778 </File> 779 <File 724 780 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBlob.cpp" 725 781 > … … 29718 29774 </File> 29719 29775 <File 29776 RelativePath="..\dom\BeforeProcessEvent.cpp" 29777 > 29778 </File> 29779 <File 29780 RelativePath="..\dom\BeforeProcessEvent.h" 29781 > 29782 </File> 29783 <File 29720 29784 RelativePath="..\dom\BeforeTextInsertedEvent.cpp" 29721 29785 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r61950 r61964 1086 1086 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; }; 1087 1087 516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */; }; 1088 51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51721FB911D2790700638B42 /* BeforeProcessEvent.h */; }; 1089 51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */; }; 1090 51721FD311D27EF200638B42 /* JSBeforeProcessEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51721FD111D27EF200638B42 /* JSBeforeProcessEvent.h */; }; 1091 5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */; }; 1088 1092 51741D0F0B07259A00ED442C /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0B0B07259A00ED442C /* BackForwardList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1089 1093 51741D100B07259A00ED442C /* BackForwardList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0C0B07259A00ED442C /* BackForwardList.cpp */; }; … … 6745 6749 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HistoryItemMac.mm; path = mac/HistoryItemMac.mm; sourceTree = "<group>"; }; 6746 6750 516BB7920CE91E6800512F79 /* JSTreeWalkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTreeWalkerCustom.cpp; sourceTree = "<group>"; }; 6751 51721FB911D2790700638B42 /* BeforeProcessEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeforeProcessEvent.h; sourceTree = "<group>"; }; 6752 51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BeforeProcessEvent.idl; sourceTree = "<group>"; }; 6753 51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBeforeProcessEvent.cpp; sourceTree = "<group>"; }; 6754 51721FD111D27EF200638B42 /* JSBeforeProcessEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBeforeProcessEvent.h; sourceTree = "<group>"; }; 6755 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeProcessEvent.cpp; sourceTree = "<group>"; }; 6747 6756 51741D0B0B07259A00ED442C /* BackForwardList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardList.h; sourceTree = "<group>"; }; 6748 6757 51741D0C0B07259A00ED442C /* BackForwardList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackForwardList.cpp; sourceTree = "<group>"; }; … … 14491 14500 BC946345107A934B00857193 /* JSBeforeLoadEvent.cpp */, 14492 14501 BC946347107A936600857193 /* JSBeforeLoadEvent.h */, 14502 51721FD011D27EF200638B42 /* JSBeforeProcessEvent.cpp */, 14503 51721FD111D27EF200638B42 /* JSBeforeProcessEvent.h */, 14493 14504 79AC9216109945C80021266E /* JSCompositionEvent.cpp */, 14494 14505 79AC9217109945C80021266E /* JSCompositionEvent.h */, … … 16651 16662 BC9462D7107A7B4C00857193 /* BeforeLoadEvent.h */, 16652 16663 BC9462CB107A7A3900857193 /* BeforeLoadEvent.idl */, 16664 5172204A11D2960500638B42 /* BeforeProcessEvent.cpp */, 16665 51721FB911D2790700638B42 /* BeforeProcessEvent.h */, 16666 51721FBA11D2790700638B42 /* BeforeProcessEvent.idl */, 16653 16667 AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */, 16654 16668 AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */, … … 19555 19569 A853123D11D0471B00D4D077 /* FragmentScriptingPermission.h in Headers */, 19556 19570 A8E6A78111D1661B00311F4A /* HTMLParserScheduler.h in Headers */, 19571 51721FBB11D2790700638B42 /* BeforeProcessEvent.h in Headers */, 19572 51721FD311D27EF200638B42 /* JSBeforeProcessEvent.h in Headers */, 19557 19573 A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */, 19558 19574 CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */, … … 21878 21894 B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */, 21879 21895 A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */, 21896 51721FD211D27EF200638B42 /* JSBeforeProcessEvent.cpp in Sources */, 21897 5172204B11D2960500638B42 /* BeforeProcessEvent.cpp in Sources */, 21880 21898 CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */, 21881 21899 A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */, -
trunk/WebCore/dom/Document.cpp
r61904 r61964 3276 3276 else if (eventType == eventNames().beforeloadEvent) 3277 3277 addListenerType(BEFORELOAD_LISTENER); 3278 else if (eventType == eventNames().beforeprocessEvent) 3279 addListenerType(BEFOREPROCESS_LISTENER); 3278 3280 #if ENABLE(TOUCH_EVENTS) 3279 3281 else if (eventType == eventNames().touchstartEvent -
trunk/WebCore/dom/Document.h
r61868 r61964 664 664 TRANSITIONEND_LISTENER = 0x800, 665 665 BEFORELOAD_LISTENER = 0x1000, 666 TOUCH_LISTENER = 0x2000 666 TOUCH_LISTENER = 0x2000, 667 BEFOREPROCESS_LISTENER = 0x4000 667 668 }; 668 669 -
trunk/WebCore/dom/EventNames.h
r60624 r61964 35 35 macro(beforeload) \ 36 36 macro(beforepaste) \ 37 macro(beforeprocess) \ 37 38 macro(beforeunload) \ 38 39 macro(blur) \ -
trunk/WebCore/html/HTMLAttributeNames.in
r61752 r61964 146 146 onbeforeload 147 147 onbeforepaste 148 onbeforeprocess 148 149 onbeforeunload 149 150 onblur -
trunk/WebCore/html/HTMLScriptElement.cpp
r61959 r61964 75 75 else if (attrName == onbeforeloadAttr) 76 76 setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr)); 77 else if (attrName == onbeforeprocessAttr) 78 setAttributeEventListener(eventNames().beforeprocessEvent, createAttributeEventListener(this, attr)); 77 79 else 78 80 HTMLElement::parseMappedAttribute(attr); -
trunk/WebCore/html/HTMLStyleElement.cpp
r61959 r61964 28 28 #include "Document.h" 29 29 #include "HTMLNames.h" 30 #include "ScriptEventListener.h" 30 31 31 32 namespace WebCore { … … 50 51 if (attr->name() == titleAttr && m_sheet) 51 52 m_sheet->setTitle(attr->value()); 53 else if (attr->name() == onbeforeprocessAttr) 54 setAttributeEventListener(eventNames().beforeprocessEvent, createAttributeEventListener(this, attr)); 52 55 else 53 56 HTMLElement::parseMappedAttribute(attr);
Note: See TracChangeset
for help on using the changeset viewer.