Changeset 93951 in webkit
- Timestamp:
- Aug 28, 2011 4:58:25 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93948 r93951 1 2011-08-28 Sam Weinig <sam@webkit.org> 2 3 Add support for constructor syntax for Events 4 https://bugs.webkit.org/show_bug.cgi?id=63878 5 6 Reviewed by Oliver Hunt. 7 8 Add basic test for Event constructors. 9 10 * fast/events/constructors/event-constructors-expected.txt: Added. 11 * fast/events/constructors/event-constructors.html: Added. 12 1 13 2011-08-27 Robert Hogan <robert@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r93945 r93951 1 2011-08-28 Sam Weinig <sam@webkit.org> 2 3 Add support for constructor syntax for Events 4 https://bugs.webkit.org/show_bug.cgi?id=63878 5 6 Reviewed by Oliver Hunt. 7 8 Add basic support for Event constructors, starting with just supporting 9 the constructor for the base Event class and just JSC support. This lays 10 the infrastructure for the other events as well. 11 12 Test: fast/events/event-constructors.html 13 14 * GNUmakefile.list.am: 15 * UseJSC.cmake: 16 * WebCore.gypi: 17 * WebCore.pro: 18 * WebCore.vcproj/WebCore.vcproj: 19 * WebCore.xcodeproj/project.pbxproj: 20 * bindings/js/JSBindingsAllInOne.cpp: 21 Add files. 22 23 * bindings/generic/EventConstructors.h: Added. 24 Add binding agnostic header that defines the Event initializers 25 using a macro based DSL. 26 27 * bindings/js/JSEventConstructors.cpp: Added. 28 (WebCore::convertValue): 29 (WebCore::tryGetProperty): 30 (WebCore::constructJSEventWithInitializer): 31 Add JSC implementation of Event initializer DSL. 32 33 * dom/Event.cpp: 34 (WebCore::EventInit::EventInit): 35 (WebCore::Event::Event): 36 * dom/Event.h: 37 (WebCore::Event::create): 38 Add Event initializer interface for base Event. 39 40 * dom/Event.idl: 41 Mark Event as having a custom constructor function. 42 1 43 2011-08-27 Andreas Kling <kling@webkit.org> 2 44 -
trunk/Source/WebCore/GNUmakefile.list.am
r93811 r93951 646 646 Source/WebCore/bindings/generic/BindingSecurityBase.h \ 647 647 Source/WebCore/bindings/generic/BindingSecurity.h \ 648 Source/WebCore/bindings/generic/EventConstructors.h \ 648 649 Source/WebCore/bindings/generic/GenericBinding.h \ 649 650 Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp \ … … 719 720 Source/WebCore/bindings/js/JSEntrySyncCustom.cpp \ 720 721 Source/WebCore/bindings/js/JSEventCustom.cpp \ 722 Source/WebCore/bindings/js/JSEventConstructors.cpp \ 721 723 Source/WebCore/bindings/js/JSEventListener.cpp \ 722 724 Source/WebCore/bindings/js/JSEventListener.h \ -
trunk/Source/WebCore/UseJSC.cmake
r93086 r93951 51 51 bindings/js/JSElementCustom.cpp 52 52 bindings/js/JSErrorHandler.cpp 53 bindings/js/JSEventConstructors.cpp 53 54 bindings/js/JSEventCustom.cpp 54 55 bindings/js/JSEventListener.cpp -
trunk/Source/WebCore/WebCore.gypi
r93811 r93951 1731 1731 'bindings/generic/BindingSecurityBase.cpp', 1732 1732 'bindings/generic/BindingSecurityBase.h', 1733 'bindings/generic/EventConstructors.h', 1733 1734 'bindings/generic/GenericBinding.h', 1734 1735 'bindings/generic/RuntimeEnabledFeatures.cpp', … … 1819 1820 'bindings/js/JSErrorHandler.cpp', 1820 1821 'bindings/js/JSErrorHandler.h', 1822 'bindings/js/JSEventConstructors.cpp', 1821 1823 'bindings/js/JSEventCustom.cpp', 1822 1824 'bindings/js/JSEventListener.cpp', -
trunk/Source/WebCore/WebCore.pro
r93764 r93951 275 275 bindings/js/JSElementCustom.cpp \ 276 276 bindings/js/JSErrorHandler.cpp \ 277 bindings/js/JSEventConstructors.cpp \ 277 278 bindings/js/JSEventCustom.cpp \ 278 279 bindings/js/JSEventListener.cpp \ … … 1236 1237 bindings/ScriptControllerBase.h \ 1237 1238 bindings/generic/ActiveDOMCallback.h \ 1239 bindings/generic/EventConstructors.h \ 1238 1240 bindings/generic/RuntimeEnabledFeatures.h 1239 1241 -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r93811 r93951 58398 58398 </File> 58399 58399 <File 58400 RelativePath="..\bindings\generic\EventConstructors.h" 58401 > 58402 </File> 58403 <File 58400 58404 RelativePath="..\bindings\generic\GenericBinding.h" 58401 58405 > … … 61008 61012 RelativePath="..\bindings\js\JSErrorHandler.h" 61009 61013 > 61014 </File> 61015 <File 61016 RelativePath="..\bindings\js\JSEventConstructors.cpp" 61017 > 61018 <FileConfiguration 61019 Name="Debug|Win32" 61020 ExcludedFromBuild="true" 61021 > 61022 <Tool 61023 Name="VCCLCompilerTool" 61024 /> 61025 </FileConfiguration> 61026 <FileConfiguration 61027 Name="Release|Win32" 61028 ExcludedFromBuild="true" 61029 > 61030 <Tool 61031 Name="VCCLCompilerTool" 61032 /> 61033 </FileConfiguration> 61034 <FileConfiguration 61035 Name="Debug_Cairo_CFLite|Win32" 61036 ExcludedFromBuild="true" 61037 > 61038 <Tool 61039 Name="VCCLCompilerTool" 61040 /> 61041 </FileConfiguration> 61042 <FileConfiguration 61043 Name="Release_Cairo_CFLite|Win32" 61044 ExcludedFromBuild="true" 61045 > 61046 <Tool 61047 Name="VCCLCompilerTool" 61048 /> 61049 </FileConfiguration> 61050 <FileConfiguration 61051 Name="Debug_All|Win32" 61052 ExcludedFromBuild="true" 61053 > 61054 <Tool 61055 Name="VCCLCompilerTool" 61056 /> 61057 </FileConfiguration> 61058 <FileConfiguration 61059 Name="Production|Win32" 61060 ExcludedFromBuild="true" 61061 > 61062 <Tool 61063 Name="VCCLCompilerTool" 61064 /> 61065 </FileConfiguration> 61010 61066 </File> 61011 61067 <File -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r93811 r93951 5244 5244 BCE3BEC20D222B1D007E06E4 /* TagNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */; }; 5245 5245 BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */; }; 5246 BCE43897140B0051005E437E /* EventConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE43896140B0051005E437E /* EventConstructors.h */; }; 5247 BCE4389A140B0073005E437E /* JSEventConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE43899140B0073005E437E /* JSEventConstructors.cpp */; }; 5246 5248 BCE4413312F748E2009B84B8 /* RenderCombineText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */; }; 5247 5249 BCE4413412F748E2009B84B8 /* RenderCombineText.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE4413212F748E2009B84B8 /* RenderCombineText.h */; }; … … 11961 11963 BCE3BEC00D222B1D007E06E4 /* TagNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagNodeList.cpp; sourceTree = "<group>"; }; 11962 11964 BCE3BEC10D222B1D007E06E4 /* TagNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagNodeList.h; sourceTree = "<group>"; }; 11965 BCE43896140B0051005E437E /* EventConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EventConstructors.h; path = generic/EventConstructors.h; sourceTree = "<group>"; }; 11966 BCE43899140B0073005E437E /* JSEventConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventConstructors.cpp; sourceTree = "<group>"; }; 11963 11967 BCE4413112F748E2009B84B8 /* RenderCombineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCombineText.cpp; sourceTree = "<group>"; }; 11964 11968 BCE4413212F748E2009B84B8 /* RenderCombineText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderCombineText.h; sourceTree = "<group>"; }; … … 18464 18468 A622A8F6122C44A600A785B3 /* BindingSecurityBase.cpp */, 18465 18469 A622A8F7122C44A600A785B3 /* BindingSecurityBase.h */, 18470 BCE43896140B0051005E437E /* EventConstructors.h */, 18466 18471 A622A8F9122C44A600A785B3 /* GenericBinding.h */, 18467 18472 ); … … 18530 18535 F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */, 18531 18536 F3D461471161D53200CA0D09 /* JSErrorHandler.h */, 18537 BCE43899140B0073005E437E /* JSEventConstructors.cpp */, 18532 18538 BC60901E0E91B8EC000C68B5 /* JSEventTarget.cpp */, 18533 18539 BC60901D0E91B8EC000C68B5 /* JSEventTarget.h */, … … 23410 23416 93500F3213FDE3BE0099EC24 /* NSScrollerImpDetails.h in Headers */, 23411 23417 D0A3A7311405A39800FB8ED3 /* ResourceLoaderOptions.h in Headers */, 23418 BCE43897140B0051005E437E /* EventConstructors.h in Headers */, 23412 23419 ); 23413 23420 runOnlyForDeploymentPostprocessing = 0; … … 26215 26222 1A1414B513A0F0500019996C /* WebKitFontFamilyNames.cpp in Sources */, 26216 26223 DF9AFD7313FC31D80015FEB7 /* MediaPlayerPrivateAVFoundationObjC.mm in Sources */, 26224 BCE4389A140B0073005E437E /* JSEventConstructors.cpp in Sources */, 26217 26225 ); 26218 26226 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
r92304 r93951 73 73 #include "JSElementCustom.cpp" 74 74 #include "JSErrorHandler.cpp" 75 #include "JSEventConstructors.cpp" 75 76 #include "JSEventCustom.cpp" 76 77 #include "JSEventListener.cpp" -
trunk/Source/WebCore/dom/Event.cpp
r93764 r93951 23 23 #include "config.h" 24 24 #include "Event.h" 25 25 26 #include "EventDispatcher.h" 26 27 #include "EventTarget.h" 27 28 28 #include "UserGestureIndicator.h" 29 29 #include <wtf/CurrentTime.h> … … 31 31 32 32 namespace WebCore { 33 34 EventInit::EventInit() 35 : bubbles(false) 36 , cancelable(false) 37 { 38 } 39 33 40 34 41 Event::Event() … … 61 68 } 62 69 70 Event::Event(const AtomicString& eventType, const EventInit& initializer) 71 : m_type(eventType) 72 , m_canBubble(initializer.bubbles) 73 , m_cancelable(initializer.cancelable) 74 , m_propagationStopped(false) 75 , m_immediatePropagationStopped(false) 76 , m_defaultPrevented(false) 77 , m_defaultHandled(false) 78 , m_cancelBubble(false) 79 , m_eventPhase(0) 80 , m_currentTarget(0) 81 , m_createTime(convertSecondsToDOMTimeStamp(currentTime())) 82 { 83 } 84 63 85 Event::~Event() 64 86 { -
trunk/Source/WebCore/dom/Event.h
r93764 r93951 34 34 class EventTarget; 35 35 class EventDispatcher; 36 37 struct EventInit { 38 EventInit(); 39 40 bool bubbles; 41 bool cancelable; 42 }; 36 43 37 44 class Event : public RefCounted<Event> { … … 70 77 return adoptRef(new Event(type, canBubble, cancelable)); 71 78 } 79 80 static PassRefPtr<Event> create(const AtomicString& type, const EventInit& initializer) 81 { 82 return adoptRef(new Event(type, initializer)); 83 } 84 72 85 virtual ~Event(); 73 86 … … 177 190 Event(); 178 191 Event(const AtomicString& type, bool canBubble, bool cancelable); 192 Event(const AtomicString& type, const EventInit&); 179 193 180 194 virtual void receivedTarget(); -
trunk/Source/WebCore/dom/Event.idl
r93764 r93951 1 1 /* 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 4 * … … 24 24 interface [ 25 25 CustomToJS, 26 CanBeConstructed, 27 CustomConstructFunction, 26 28 NoStaticTables, 27 29 Polymorphic
Note: See TracChangeset
for help on using the changeset viewer.