WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Proposed Fix (+win build fix)
bug-136051-20141001160417.patch (text/plain), 40.98 KB, created by
Brian Burg
on 2014-10-01 16:04:51 PDT
(
hide
)
Description:
Proposed Fix (+win build fix)
Filename:
MIME Type:
Creator:
Brian Burg
Created:
2014-10-01 16:04:51 PDT
Size:
40.98 KB
patch
obsolete
>Subversion Revision: 174177 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ac8eb2665844ce1958d356d8c24a1232dd7e5d95..013716e328fda04582105ab2c374352592b4211d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,79 @@ >+2014-10-01 Brian J. Burg <burg@cs.washington.edu> >+ >+ Web Replay: EventSender dispatches should be per-Document >+ https://bugs.webkit.org/show_bug.cgi?id=136051 >+ >+ EventSender uses a Timer to asynchronously dispatch the same event to multiple >+ elements of the same type on a future run loop. However, we previously dispatched events >+ to elements from any Document rather than the one that requested the event send. >+ >+ This patch changes EventSender to be associated with a single Document. EventSenders >+ for each Document are lazily allocated. Further per-Document or global optimizations >+ are possible. >+ >+ This change also lays the groundwork for making EventSender-related DOM events >+ deterministic during web replay, tracked at <https://webkit.org/b/137090>. >+ >+ No new tests, covered by fast/text/svg-font-trigger-load-event.html. >+ >+ * CMakeLists.txt: >+ * WebCore.vcxproj/WebCore.vcxproj: >+ * WebCore.vcxproj/WebCore.vcxproj.filters: >+ * WebCore.xcodeproj/project.pbxproj: >+ * dom/DOMAllInOne.cpp: >+ * dom/Document.cpp: >+ (WebCore::Document::Document): >+ (WebCore::Document::implicitClose): >+ Dispatch pending events for this document only. Rename local variable f to frame. >+ >+ * dom/Document.h: >+ (WebCore::Document::sharedEventSenders): >+ * dom/EventSender.h: >+ (WebCore::EventSender::EventSender): >+ (WebCore::EventSender::hasPendingEvents): >+ (WebCore::EventSender<T>::dispatchEventSoon): >+ (WebCore::EventSender<T>::cancelEvent): >+ (WebCore::EventSender<T>::dispatchPendingEvents): >+ (WebCore::EventSender<T>::EventSender): Deleted. The type argument was not necessary. >+ * dom/SharedEventSenders.cpp: Added. Lazily creates event senders as they are requested. >+ (WebCore::SharedEventSenders::linkLoadEventSender): >+ (WebCore::SharedEventSenders::styleLoadEventSender): >+ (WebCore::SharedEventSenders::imageBeforeloadEventSender): >+ (WebCore::SharedEventSenders::imageLoadEventSender): >+ (WebCore::SharedEventSenders::imageErrorEventSender): >+ * dom/SharedEventSenders.h: Added. >+ (WebCore::SharedEventSenders::SharedEventSenders): >+ * html/HTMLLinkElement.cpp: >+ (WebCore::HTMLLinkElement::~HTMLLinkElement): >+ (WebCore::HTMLLinkElement::dispatchPendingEvent): >+ (WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources): >+ (WebCore::linkLoadEventSender): Deleted. >+ (WebCore::HTMLLinkElement::dispatchPendingLoadEvents): Deleted. >+ * html/HTMLLinkElement.h: >+ * html/HTMLStyleElement.cpp: >+ (WebCore::HTMLStyleElement::~HTMLStyleElement): >+ (WebCore::HTMLStyleElement::dispatchPendingEvent): >+ (WebCore::HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources): >+ (WebCore::styleLoadEventSender): Deleted. >+ (WebCore::HTMLStyleElement::dispatchPendingLoadEvents): Deleted. >+ * html/HTMLStyleElement.h: >+ * loader/ImageLoader.cpp: >+ (WebCore::ImageLoader::beforeLoadEventSender): >+ (WebCore::ImageLoader::loadEventSender): >+ (WebCore::ImageLoader::errorEventSender): >+ (WebCore::ImageLoader::dispatchPendingEvent): >+ (WebCore::beforeLoadEventSender): Deleted. >+ (WebCore::loadEventSender): Deleted. >+ (WebCore::errorEventSender): Deleted. >+ (WebCore::ImageLoader::dispatchPendingBeforeLoadEvents): Deleted. >+ (WebCore::ImageLoader::dispatchPendingLoadEvents): Deleted. >+ (WebCore::ImageLoader::dispatchPendingErrorEvents): Deleted. >+ * loader/ImageLoader.h: >+ * xml/parser/XMLDocumentParser.cpp: >+ (WebCore::XMLDocumentParser::append): Remove an early call to the EventSender for image >+ beforeload events. This was a performance optimization, but is no longer safe since the >+ document (and thus the event sender) may not be available in a synchronous document write. >+ > 2014-10-01 Zan Dobersek <zdobersek@igalia.com> > > [TexMap] Sprinkle range-based for-loops in GraphicsLayerTextureMapper, TextureMapperLayer >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 20ecf58baf9b540c0c890f04b5db3be66f406d41..1f1d0bb5fea6eba2b8f0aa99321d82077577fbdb 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -1437,6 +1437,7 @@ set(WebCore_SOURCES > dom/SecurityContext.cpp > dom/SelectorQuery.cpp > dom/ShadowRoot.cpp >+ dom/SharedEventSenders.cpp > dom/SpaceSplitString.cpp > dom/StaticNodeList.cpp > dom/StringCallback.cpp >diff --git a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj >index 8661bb171959695310d1206ea83f8dba4340946c..ead96af45d1f1f15bde888eb295d87be68d81f4f 100644 >--- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj >+++ b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj >@@ -13776,6 +13776,20 @@ <?xml version="1.0" encoding="utf-8"?> > <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild> > <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> > </ClCompile> >+ <ClCompile Include="..\dom\SharedEventSenders.cpp"> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild> >+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild> >+ </ClCompile> > <ClCompile Include="..\dom\SpaceSplitString.cpp"> > <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> > <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> >@@ -20579,6 +20593,7 @@ <?xml version="1.0" encoding="utf-8"?> > <ClInclude Include="..\dom\SecurityContext.h" /> > <ClInclude Include="..\dom\SelectorQuery.h" /> > <ClInclude Include="..\dom\SimulatedClickOptions.h" /> >+ <ClInclude Include="..\dom\SharedEventSenders.h" /> > <ClInclude Include="..\dom\SpaceSplitString.h" /> > <ClInclude Include="..\dom\StaticHashSetNodeList.h" /> > <ClInclude Include="..\dom\StaticNodeList.h" /> >diff --git a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters >index d71ccfdacdb61d478081dd7a5cf4d927f00ca6c3..88b835baca538f0dbd5c11eed782b07a9da7c00b 100644 >--- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters >+++ b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters >@@ -3354,6 +3354,9 @@ <?xml version="1.0" encoding="utf-8"?> > <ClCompile Include="..\dom\SelectorQuery.cpp"> > <Filter>dom</Filter> > </ClCompile> >+ <ClCompile Include="..\dom\SharedEventSenders.cpp"> >+ <Filter>dom</Filter> >+ </ClCompile> > <ClCompile Include="..\dom\SpaceSplitString.cpp"> > <Filter>dom</Filter> > </ClCompile> >@@ -10446,6 +10449,9 @@ <?xml version="1.0" encoding="utf-8"?> > <ClInclude Include="..\dom\SelectorQuery.h"> > <Filter>dom</Filter> > </ClInclude> >+ <ClInclude Include="..\dom\SharedEventSenders.h"> >+ <Filter>dom</Filter> >+ </ClInclude> > <ClInclude Include="..\dom\SimulatedClickOptions.h"> > <Filter>dom</Filter> > </ClInclude> >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index d543d7923bfa84bde9dff99693d3d353fa06785a..084ef580fd2674f0d0a77ccfb9250c590d10b809 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -5512,6 +5512,9 @@ > C3CF17A615B0063F00276D39 /* IdTargetObserverRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3CF17A215B0063F00276D39 /* IdTargetObserverRegistry.cpp */; }; > C3CF17A715B0063F00276D39 /* IdTargetObserverRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CF17A315B0063F00276D39 /* IdTargetObserverRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; }; > C400D10918F1C8F60090D863 /* EventLoopInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C400D10818F1C8F60090D863 /* EventLoopInput.cpp */; }; >+ C49474A119A2847C009B3DE8 /* SharedEventSenders.h in Headers */ = {isa = PBXBuildFile; fileRef = C49474A019A2847C009B3DE8 /* SharedEventSenders.h */; }; >+ C49474A819A2D612009B3DE8 /* EventSender.h in Headers */ = {isa = PBXBuildFile; fileRef = CE5CB1B314EDAB6F00BB2795 /* EventSender.h */; }; >+ C49474AA19A2E2E5009B3DE8 /* SharedEventSenders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C49474A919A2E2E5009B3DE8 /* SharedEventSenders.cpp */; }; > C4CD629A18383766007EBAF1 /* FrameSnapshotting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */; }; > C4CD629B18383766007EBAF1 /* FrameSnapshotting.h in Headers */ = {isa = PBXBuildFile; fileRef = C4CD629918383766007EBAF1 /* FrameSnapshotting.h */; settings = {ATTRIBUTES = (Private, ); }; }; > C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50B561412119D23008B46E0 /* GroupSettings.cpp */; }; >@@ -12925,6 +12928,8 @@ > C3CF17A315B0063F00276D39 /* IdTargetObserverRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IdTargetObserverRegistry.h; sourceTree = "<group>"; }; > C3E61C653A64807A83E76FB8 /* MathMLMencloseElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLMencloseElement.cpp; sourceTree = "<group>"; }; > C400D10818F1C8F60090D863 /* EventLoopInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventLoopInput.cpp; sourceTree = "<group>"; }; >+ C49474A019A2847C009B3DE8 /* SharedEventSenders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedEventSenders.h; sourceTree = "<group>"; }; >+ C49474A919A2E2E5009B3DE8 /* SharedEventSenders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedEventSenders.cpp; sourceTree = "<group>"; }; > C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameSnapshotting.cpp; sourceTree = "<group>"; }; > C4CD629918383766007EBAF1 /* FrameSnapshotting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameSnapshotting.h; sourceTree = "<group>"; }; > C50B561412119D23008B46E0 /* GroupSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GroupSettings.cpp; sourceTree = "<group>"; }; >@@ -22769,6 +22774,8 @@ > E45322AA140CE267005A0F92 /* SelectorQuery.h */, > A6D169611346B49B000EB770 /* ShadowRoot.cpp */, > A6D169631346B4C1000EB770 /* ShadowRoot.h */, >+ C49474A919A2E2E5009B3DE8 /* SharedEventSenders.cpp */, >+ C49474A019A2847C009B3DE8 /* SharedEventSenders.h */, > 31741AAB16635E45008A5B7E /* SimulatedClickOptions.h */, > D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */, > D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */, >@@ -23362,6 +23369,7 @@ > 070363E0181A1CDC00C074A5 /* AVAudioCaptureSource.h in Headers */, > 070363E2181A1CDC00C074A5 /* AVCaptureDeviceManager.h in Headers */, > 070363E4181A1CDC00C074A5 /* AVMediaCaptureSource.h in Headers */, >+ C49474A819A2D612009B3DE8 /* EventSender.h in Headers */, > CD336F6217F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h in Headers */, > 070363E6181A1CDC00C074A5 /* AVVideoCaptureSource.h in Headers */, > 29A812380FBB9C1D00510293 /* AXObjectCache.h in Headers */, >@@ -26399,6 +26407,7 @@ > 85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */, > AA4739D21757AFEC00E76767 /* UIRequestEvent.h in Headers */, > 9B2D8A7914997CCF00ECEF3E /* UndoStep.h in Headers */, >+ C49474A119A2847C009B3DE8 /* SharedEventSenders.h in Headers */, > A863E2011343412000274926 /* UnicodeBidi.h in Headers */, > E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */, > D086FE9809D53AAB005BC74D /* UnlinkCommand.h in Headers */, >@@ -28064,6 +28073,7 @@ > 8931DE5B14C44C44000DC9D2 /* JSBlobCustom.cpp in Sources */, > 1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */, > 65DF323909D1DE65000BE325 /* JSCanvasGradient.cpp in Sources */, >+ C49474AA19A2E2E5009B3DE8 /* SharedEventSenders.cpp in Sources */, > 65DF323B09D1DE65000BE325 /* JSCanvasPattern.cpp in Sources */, > 49EED1421051969400099FAB /* JSCanvasRenderingContext.cpp in Sources */, > 49EED1441051969400099FAB /* JSCanvasRenderingContext2D.cpp in Sources */, >diff --git a/Source/WebCore/dom/DOMAllInOne.cpp b/Source/WebCore/dom/DOMAllInOne.cpp >index 66539ec7896d4b63bd5429cb1ea7a40b1401820f..60d3a999df7d75a3bf02f248ae6428fa2adddc77 100644 >--- a/Source/WebCore/dom/DOMAllInOne.cpp >+++ b/Source/WebCore/dom/DOMAllInOne.cpp >@@ -124,6 +124,7 @@ > #include "SecurityContext.cpp" > #include "SelectorQuery.cpp" > #include "ShadowRoot.cpp" >+#include "SharedEventSenders.cpp" > #include "SpaceSplitString.cpp" > #include "StaticNodeList.cpp" > #include "StyledElement.cpp" >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 3e8acbc66998becb7151891b1405ac9ede3e5fe3..2e7aabdadee371a4e9cb180eb51febf63375539c 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -138,6 +138,7 @@ > #include "SelectorQuery.h" > #include "Settings.h" > #include "ShadowRoot.h" >+#include "SharedEventSenders.h" > #include "StyleProperties.h" > #include "StyleResolver.h" > #include "StyleSheetContents.h" >@@ -471,6 +472,7 @@ Document::Document(Frame* frame, const URL& url, unsigned documentClasses, unsig > , m_sawElementsInKnownNamespaces(false) > , m_isSrcdocDocument(false) > , m_eventQueue(*this) >+ , m_sharedEventSenders(std::make_unique<SharedEventSenders>()) > , m_weakFactory(this) > #if ENABLE(FULLSCREEN_API) > , m_areKeysEnabledInFullScreen(0) >@@ -2421,21 +2423,19 @@ void Document::implicitClose() > // -When any new HTMLLinkElement is inserted into the document > // But those add a dynamic component to the favicon that has UI > // ramifications, and we need to decide what is the Right Thing To Do(tm) >- Frame* f = frame(); >- if (f) { >- f->loader().icon().startLoader(); >- f->animation().startAnimationsIfNotSuspended(this); >- >- // FIXME: We shouldn't be dispatching pending events globally on all Documents here. >- // For now, only do this when there is a Frame, otherwise this could cause JS reentrancy >- // below SVG font parsing, for example. <https://webkit.org/b/136269> >- ImageLoader::dispatchPendingBeforeLoadEvents(); >- ImageLoader::dispatchPendingLoadEvents(); >- ImageLoader::dispatchPendingErrorEvents(); >- HTMLLinkElement::dispatchPendingLoadEvents(); >- HTMLStyleElement::dispatchPendingLoadEvents(); >+ Frame* frame = this->frame(); >+ if (frame) { >+ frame->loader().icon().startLoader(); >+ frame->animation().startAnimationsIfNotSuspended(this); > } > >+ sharedEventSenders().imageBeforeloadEventSender().dispatchPendingEvents(); >+ sharedEventSenders().imageLoadEventSender().dispatchPendingEvents(); >+ sharedEventSenders().imageErrorEventSender().dispatchPendingEvents(); >+ >+ sharedEventSenders().linkLoadEventSender().dispatchPendingEvents(); >+ sharedEventSenders().styleLoadEventSender().dispatchPendingEvents(); >+ > // To align the HTML load event and the SVGLoad event for the outermost <svg> element, fire it from > // here, instead of doing it from SVGElement::finishedParsingChildren (if externalResourcesRequired="false", > // which is the default, for ='true' its fired at a later time, once all external resources finished loading). >@@ -2446,15 +2446,15 @@ void Document::implicitClose() > enqueuePageshowEvent(PageshowEventNotPersisted); > enqueuePopstateEvent(m_pendingStateObject ? m_pendingStateObject.release() : SerializedScriptValue::nullValue()); > >- if (f) >- f->loader().handledOnloadEvents(); >+ if (frame) >+ frame->loader().handledOnloadEvents(); > #ifdef INSTRUMENT_LAYOUT_SCHEDULING > if (!ownerElement()) > printf("onload fired at %lld\n", elapsedTime().count()); > #endif > > // An event handler may have removed the frame >- if (!frame()) { >+ if (!this->frame()) { > m_processingLoadEvent = false; > return; > } >@@ -2463,7 +2463,7 @@ void Document::implicitClose() > // fires. This will improve onload scores, and other browsers do it. > // If they wanna cheat, we can too. -dwh > >- if (frame()->navigationScheduler().locationChangePending() && elapsedTime() < settings()->layoutInterval()) { >+ if (this->frame()->navigationScheduler().locationChangePending() && elapsedTime() < settings()->layoutInterval()) { > // Just bail out. Before or during the onload we were shifted to another page. > // The old i-Bench suite does this. When this happens don't bother painting or laying out. > m_processingLoadEvent = false; >@@ -2471,7 +2471,7 @@ void Document::implicitClose() > return; > } > >- frame()->loader().checkCallImplicitClose(); >+ this->frame()->loader().checkCallImplicitClose(); > > // We used to force a synchronous display and flush here. This really isn't > // necessary and can in fact be actively harmful if pages are loading at a rate of > 60fps >@@ -2488,7 +2488,7 @@ void Document::implicitClose() > m_processingLoadEvent = false; > > #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(EFL) >- if (f && hasLivingRenderTree() && AXObjectCache::accessibilityEnabled()) { >+ if (frame && hasLivingRenderTree() && AXObjectCache::accessibilityEnabled()) { > // The AX cache may have been cleared at this point, but we need to make sure it contains an > // AX object to send the notification to. getOrCreate will make sure that an valid AX object > // exists in the cache (we ignore the return value because we don't need it here). This is >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 3a98426a06170c864e974e84591c261627044030..0620c28591a8e5751eaf5df253f1483aa7a1d411 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -144,6 +144,7 @@ class SelectorQueryCache; > class SerializedScriptValue; > class SegmentedString; > class Settings; >+class SharedEventSenders; > class StyleResolver; > class StyleSheet; > class StyleSheetContents; >@@ -1119,6 +1120,8 @@ public: > void enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject); > virtual DocumentEventQueue& eventQueue() const override { return m_eventQueue; } > >+ SharedEventSenders& sharedEventSenders() const { return *m_sharedEventSenders; } >+ > WEBCORE_EXPORT void addMediaCanStartListener(MediaCanStartListener*); > WEBCORE_EXPORT void removeMediaCanStartListener(MediaCanStartListener*); > MediaCanStartListener* takeAnyMediaCanStartListener(); >@@ -1568,6 +1571,8 @@ private: > RenderPtr<RenderView> m_renderView; > mutable DocumentEventQueue m_eventQueue; > >+ const std::unique_ptr<SharedEventSenders> m_sharedEventSenders; >+ > WeakPtrFactory<Document> m_weakFactory; > > HashSet<MediaCanStartListener*> m_mediaCanStartListeners; >diff --git a/Source/WebCore/dom/EventSender.h b/Source/WebCore/dom/EventSender.h >index 04fe258f722e28ad4f6ce1a3e46a813b1c4d5129..bd86c44791d114c4fec0a739b66040853f36d6ad 100644 >--- a/Source/WebCore/dom/EventSender.h >+++ b/Source/WebCore/dom/EventSender.h >@@ -1,5 +1,6 @@ > /* > * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2014 University of Washington. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,10 +32,15 @@ > > namespace WebCore { > >-template<typename T> class EventSender { >+template <typename T> >+class EventSender { > WTF_MAKE_NONCOPYABLE(EventSender); WTF_MAKE_FAST_ALLOCATED; > public: >- explicit EventSender(const AtomicString& eventType); >+ EventSender(const AtomicString& eventType) >+ : m_eventType(eventType) >+ , m_timer(this, &EventSender::timerFired) >+ { >+ } > > const AtomicString& eventType() const { return m_eventType; } > void dispatchEventSoon(T&); >@@ -42,9 +48,9 @@ public: > void dispatchPendingEvents(); > > #ifndef NDEBUG >- bool hasPendingEvents(T& sender) const >+ bool hasPendingEvents(T& client) const > { >- return m_dispatchSoonList.find(&sender) != notFound || m_dispatchingList.find(&sender) != notFound; >+ return m_dispatchSoonList.find(&client) != notFound || m_dispatchingList.find(&client) != notFound; > } > #endif > >@@ -57,34 +63,31 @@ private: > Vector<T*> m_dispatchingList; > }; > >-template<typename T> EventSender<T>::EventSender(const AtomicString& eventType) >- : m_eventType(eventType) >- , m_timer(this, &EventSender::timerFired) >-{ >-} >- >-template<typename T> void EventSender<T>::dispatchEventSoon(T& sender) >+template <typename T> >+void EventSender<T>::dispatchEventSoon(T& client) > { >- m_dispatchSoonList.append(&sender); >+ m_dispatchSoonList.append(&client); > if (!m_timer.isActive()) > m_timer.startOneShot(0); > } > >-template<typename T> void EventSender<T>::cancelEvent(T& sender) >+template<typename T> >+void EventSender<T>::cancelEvent(T& client) > { >- // Remove instances of this sender from both lists. >+ // Remove instances of this client from both lists. > // Use loops because we allow multiple instances to get into the lists. > for (auto& event : m_dispatchSoonList) { >- if (event == &sender) >+ if (event == &client) > event = nullptr; > } > for (auto& event : m_dispatchingList) { >- if (event == &sender) >+ if (event == &client) > event = nullptr; > } > } > >-template<typename T> void EventSender<T>::dispatchPendingEvents() >+template<typename T> >+void EventSender<T>::dispatchPendingEvents() > { > // Need to avoid re-entering this function; if new dispatches are > // scheduled before the parent finishes processing the list, they >@@ -94,13 +97,11 @@ template<typename T> void EventSender<T>::dispatchPendingEvents() > > m_timer.stop(); > >- m_dispatchSoonList.checkConsistency(); >- > m_dispatchingList.swap(m_dispatchSoonList); > for (auto& event : m_dispatchingList) { >- if (T* sender = event) { >+ if (T* client = event) { > event = nullptr; >- sender->dispatchPendingEvent(this); >+ client->dispatchPendingEvent(*this); > } > } > m_dispatchingList.clear(); >diff --git a/Source/WebCore/dom/SharedEventSenders.cpp b/Source/WebCore/dom/SharedEventSenders.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..2145dd41319b7be346982c55c8717f7f54adcdd1 >--- /dev/null >+++ b/Source/WebCore/dom/SharedEventSenders.cpp >@@ -0,0 +1,75 @@ >+/* >+ * Copyright (C) 2014 University of Washington. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "SharedEventSenders.h" >+ >+#include "HTMLLinkElement.h" >+#include "HTMLStyleElement.h" >+#include "ImageLoader.h" >+ >+namespace WebCore { >+ >+EventSender<HTMLLinkElement>& SharedEventSenders::linkLoadEventSender() >+{ >+ if (!m_linkLoadEventSender) >+ m_linkLoadEventSender = std::make_unique<EventSender<HTMLLinkElement>>(eventNames().loadEvent); >+ >+ return *m_linkLoadEventSender; >+} >+ >+EventSender<HTMLStyleElement>& SharedEventSenders::styleLoadEventSender() >+{ >+ if (!m_styleLoadEventSender) >+ m_styleLoadEventSender = std::make_unique<EventSender<HTMLStyleElement>>(eventNames().loadEvent); >+ >+ return *m_styleLoadEventSender; >+} >+ >+EventSender<ImageLoader>& SharedEventSenders::imageBeforeloadEventSender() >+{ >+ if (!m_imageBeforeloadEventSender) >+ m_imageBeforeloadEventSender = std::make_unique<EventSender<ImageLoader>>(eventNames().beforeloadEvent); >+ >+ return *m_imageBeforeloadEventSender; >+} >+ >+EventSender<ImageLoader>& SharedEventSenders::imageLoadEventSender() >+{ >+ if (!m_imageLoadEventSender) >+ m_imageLoadEventSender = std::make_unique<EventSender<ImageLoader>>(eventNames().loadEvent); >+ >+ return *m_imageLoadEventSender; >+} >+ >+EventSender<ImageLoader>& SharedEventSenders::imageErrorEventSender() >+{ >+ if (!m_imageErrorEventSender) >+ m_imageErrorEventSender = std::make_unique<EventSender<ImageLoader>>(eventNames().errorEvent); >+ >+ return *m_imageErrorEventSender; >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/dom/SharedEventSenders.h b/Source/WebCore/dom/SharedEventSenders.h >new file mode 100644 >index 0000000000000000000000000000000000000000..d97c878024d3522a469f08726f34c3e9efeb2ff2 >--- /dev/null >+++ b/Source/WebCore/dom/SharedEventSenders.h >@@ -0,0 +1,58 @@ >+/* >+ * Copyright (C) 2014 University of Washington. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef SharedEventSenders_h >+#define SharedEventSenders_h >+ >+#include "EventNames.h" >+#include "EventSender.h" >+ >+namespace WebCore { >+ >+class HTMLLinkElement; >+class HTMLStyleElement; >+class ImageLoader; >+ >+class SharedEventSenders { >+ WTF_MAKE_NONCOPYABLE(SharedEventSenders); WTF_MAKE_FAST_ALLOCATED; >+public: >+ explicit SharedEventSenders() { } >+ >+ EventSender<HTMLLinkElement>& linkLoadEventSender(); >+ EventSender<HTMLStyleElement>& styleLoadEventSender(); >+ EventSender<ImageLoader>& imageBeforeloadEventSender(); >+ EventSender<ImageLoader>& imageLoadEventSender(); >+ EventSender<ImageLoader>& imageErrorEventSender(); >+private: >+ std::unique_ptr<EventSender<HTMLLinkElement>> m_linkLoadEventSender; >+ std::unique_ptr<EventSender<HTMLStyleElement>> m_styleLoadEventSender; >+ std::unique_ptr<EventSender<ImageLoader>> m_imageBeforeloadEventSender; >+ std::unique_ptr<EventSender<ImageLoader>> m_imageLoadEventSender; >+ std::unique_ptr<EventSender<ImageLoader>> m_imageErrorEventSender; >+}; >+ >+} // namespace WebCore >+ >+#endif // SharedEventSenders_h >diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp >index dd6f9878452ff40cba0517b9afd21dcca7d0f961..bfa050f1de1e0b3b01da828c45ac038c1b047439 100644 >--- a/Source/WebCore/html/HTMLLinkElement.cpp >+++ b/Source/WebCore/html/HTMLLinkElement.cpp >@@ -33,7 +33,6 @@ > #include "Document.h" > #include "DocumentStyleSheetCollection.h" > #include "Event.h" >-#include "EventSender.h" > #include "Frame.h" > #include "FrameLoader.h" > #include "FrameLoaderClient.h" >@@ -47,6 +46,7 @@ > #include "RenderStyle.h" > #include "SecurityOrigin.h" > #include "Settings.h" >+#include "SharedEventSenders.h" > #include "StyleInheritedData.h" > #include "StyleResolveForDocument.h" > #include "StyleSheetContents.h" >@@ -57,12 +57,6 @@ namespace WebCore { > > using namespace HTMLNames; > >-static LinkEventSender& linkLoadEventSender() >-{ >- DEPRECATED_DEFINE_STATIC_LOCAL(LinkEventSender, sharedLoadEventSender, (eventNames().loadEvent)); >- return sharedLoadEventSender; >-} >- > inline HTMLLinkElement::HTMLLinkElement(const QualifiedName& tagName, Document& document, bool createdByParser) > : HTMLElement(tagName, document) > , m_linkLoader(this) >@@ -94,7 +88,7 @@ HTMLLinkElement::~HTMLLinkElement() > if (inDocument()) > document().styleSheetCollection().removeStyleSheetCandidateNode(*this); > >- linkLoadEventSender().cancelEvent(*this); >+ document().sharedEventSenders().linkLoadEventSender().cancelEvent(*this); > } > > void HTMLLinkElement::setDisabledState(bool disabled) >@@ -361,14 +355,10 @@ bool HTMLLinkElement::sheetLoaded() > return false; > } > >-void HTMLLinkElement::dispatchPendingLoadEvents() >+void HTMLLinkElement::dispatchPendingEvent(EventSender<HTMLLinkElement>& eventSender) > { >- linkLoadEventSender().dispatchPendingEvents(); >-} >+ ASSERT_UNUSED(eventSender, &eventSender == &document().sharedEventSenders().linkLoadEventSender()); > >-void HTMLLinkElement::dispatchPendingEvent(LinkEventSender* eventSender) >-{ >- ASSERT_UNUSED(eventSender, eventSender == &linkLoadEventSender()); > if (m_loadedSheet) > linkLoaded(); > else >@@ -380,7 +370,7 @@ void HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOccu > if (m_firedLoad) > return; > m_loadedSheet = !errorOccurred; >- linkLoadEventSender().dispatchEventSoon(*this); >+ document().sharedEventSenders().linkLoadEventSender().dispatchEventSoon(*this); > m_firedLoad = true; > } > >diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h >index 5cacb77d2aea515c0d59ba546a476b4a8b64730b..026dc2ae90e6d749e7e2f4c2a011b018527e79c7 100644 >--- a/Source/WebCore/html/HTMLLinkElement.h >+++ b/Source/WebCore/html/HTMLLinkElement.h >@@ -40,7 +40,6 @@ class HTMLLinkElement; > class URL; > > template<typename T> class EventSender; >-typedef EventSender<HTMLLinkElement> LinkEventSender; > > class HTMLLinkElement final : public HTMLElement, public CachedStyleSheetClient, public LinkLoaderClient { > public: >@@ -68,8 +67,7 @@ public: > void setSizes(const String&); > DOMSettableTokenList* sizes() const; > >- void dispatchPendingEvent(LinkEventSender*); >- static void dispatchPendingLoadEvents(); >+ void dispatchPendingEvent(EventSender<HTMLLinkElement>&); > > private: > virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; >diff --git a/Source/WebCore/html/HTMLStyleElement.cpp b/Source/WebCore/html/HTMLStyleElement.cpp >index 6806494928dc831c87d89d18e97ff8592a061b9d..0fb3d140518043cbc6f246f3a471ee6e0d32c804 100644 >--- a/Source/WebCore/html/HTMLStyleElement.cpp >+++ b/Source/WebCore/html/HTMLStyleElement.cpp >@@ -27,23 +27,18 @@ > #include "Attribute.h" > #include "Document.h" > #include "Event.h" >-#include "EventSender.h" > #include "HTMLNames.h" > #include "MediaList.h" > #include "RuntimeEnabledFeatures.h" > #include "ScriptableDocumentParser.h" > #include "ShadowRoot.h" >+#include "SharedEventSenders.h" > #include "StyleSheetContents.h" > > namespace WebCore { > > using namespace HTMLNames; > >-static StyleEventSender& styleLoadEventSender() >-{ >- DEPRECATED_DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender, (eventNames().loadEvent)); >- return sharedLoadEventSender; >-} > > inline HTMLStyleElement::HTMLStyleElement(const QualifiedName& tagName, Document& document, bool createdByParser) > : HTMLElement(tagName, document) >@@ -60,7 +55,7 @@ HTMLStyleElement::~HTMLStyleElement() > // Therefore we can't ASSERT(m_scopedStyleRegistrationState == NotRegistered). > m_styleSheetOwner.clearDocumentData(document(), *this); > >- styleLoadEventSender().cancelEvent(*this); >+ document().sharedEventSenders().styleLoadEventSender().cancelEvent(*this); > } > > PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagName, Document& document, bool createdByParser) >@@ -114,14 +109,10 @@ void HTMLStyleElement::childrenChanged(const ChildChange& change) > m_styleSheetOwner.childrenChanged(*this); > } > >-void HTMLStyleElement::dispatchPendingLoadEvents() >+void HTMLStyleElement::dispatchPendingEvent(EventSender<HTMLStyleElement>& eventSender) > { >- styleLoadEventSender().dispatchPendingEvents(); >-} >+ ASSERT_UNUSED(eventSender, &eventSender == &document().sharedEventSenders().styleLoadEventSender()); > >-void HTMLStyleElement::dispatchPendingEvent(StyleEventSender* eventSender) >-{ >- ASSERT_UNUSED(eventSender, eventSender == &styleLoadEventSender()); > if (m_loadedSheet) > dispatchEvent(Event::create(eventNames().loadEvent, false, false)); > else >@@ -133,7 +124,7 @@ void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(bool errorOcc > if (m_firedLoad) > return; > m_loadedSheet = !errorOccurred; >- styleLoadEventSender().dispatchEventSoon(*this); >+ document().sharedEventSenders().styleLoadEventSender().dispatchEventSoon(*this); > m_firedLoad = true; > } > >diff --git a/Source/WebCore/html/HTMLStyleElement.h b/Source/WebCore/html/HTMLStyleElement.h >index 91f0b7cd58d46688becf64f4700500043e23b876..025d93d642c97c81547c9bed9a0bb25e3f3877ab 100644 >--- a/Source/WebCore/html/HTMLStyleElement.h >+++ b/Source/WebCore/html/HTMLStyleElement.h >@@ -32,7 +32,6 @@ class HTMLStyleElement; > class StyleSheet; > > template<typename T> class EventSender; >-typedef EventSender<HTMLStyleElement> StyleEventSender; > > class HTMLStyleElement final : public HTMLElement { > public: >@@ -44,8 +43,7 @@ public: > bool disabled() const; > void setDisabled(bool); > >- void dispatchPendingEvent(StyleEventSender*); >- static void dispatchPendingLoadEvents(); >+ void dispatchPendingEvent(EventSender<HTMLStyleElement>&); > > private: > HTMLStyleElement(const QualifiedName&, Document&, bool createdByParser); >diff --git a/Source/WebCore/loader/ImageLoader.cpp b/Source/WebCore/loader/ImageLoader.cpp >index f8f4f43c27105ea26e62c7790dab3bf580baf340..09efe7a727e23c52e1e0d3510478e355a692cef4 100644 >--- a/Source/WebCore/loader/ImageLoader.cpp >+++ b/Source/WebCore/loader/ImageLoader.cpp >@@ -29,7 +29,6 @@ > #include "Document.h" > #include "Element.h" > #include "Event.h" >-#include "EventSender.h" > #include "Frame.h" > #include "HTMLNames.h" > #include "HTMLObjectElement.h" >@@ -38,6 +37,7 @@ > #include "RenderImage.h" > #include "RenderSVGImage.h" > #include "SecurityOrigin.h" >+#include "SharedEventSenders.h" > #include <wtf/NeverDestroyed.h> > > #if ENABLE(VIDEO) >@@ -63,22 +63,19 @@ template<> struct ValueCheck<WebCore::ImageLoader*> { > > namespace WebCore { > >-static ImageEventSender& beforeLoadEventSender() >+EventSender<ImageLoader>& ImageLoader::beforeLoadEventSender() const > { >- static NeverDestroyed<ImageEventSender> sender(eventNames().beforeloadEvent); >- return sender; >+ return m_element.document().sharedEventSenders().imageBeforeloadEventSender(); > } > >-static ImageEventSender& loadEventSender() >+EventSender<ImageLoader>& ImageLoader::loadEventSender() const > { >- static NeverDestroyed<ImageEventSender> sender(eventNames().loadEvent); >- return sender; >+ return m_element.document().sharedEventSenders().imageLoadEventSender(); > } > >-static ImageEventSender& errorEventSender() >+EventSender<ImageLoader>& ImageLoader::errorEventSender() const > { >- static NeverDestroyed<ImageEventSender> sender(eventNames().errorEvent); >- return sender; >+ return m_element.document().sharedEventSenders().imageErrorEventSender(); > } > > static inline bool pageIsBeingDismissed(Document& document) >@@ -379,10 +376,10 @@ void ImageLoader::timerFired(Timer<ImageLoader>&) > element().deref(); > } > >-void ImageLoader::dispatchPendingEvent(ImageEventSender* eventSender) >+void ImageLoader::dispatchPendingEvent(EventSender<ImageLoader>& eventSender) > { >- ASSERT(eventSender == &beforeLoadEventSender() || eventSender == &loadEventSender() || eventSender == &errorEventSender()); >- const AtomicString& eventType = eventSender->eventType(); >+ ASSERT(&eventSender == &beforeLoadEventSender() || &eventSender == &loadEventSender() || &eventSender == &errorEventSender()); >+ const AtomicString& eventType = eventSender.eventType(); > if (eventType == eventNames().beforeloadEvent) > dispatchPendingBeforeLoadEvent(); > if (eventType == eventNames().loadEvent) >@@ -448,21 +445,6 @@ void ImageLoader::dispatchPendingErrorEvent() > updatedHasPendingEvent(); > } > >-void ImageLoader::dispatchPendingBeforeLoadEvents() >-{ >- beforeLoadEventSender().dispatchPendingEvents(); >-} >- >-void ImageLoader::dispatchPendingLoadEvents() >-{ >- loadEventSender().dispatchPendingEvents(); >-} >- >-void ImageLoader::dispatchPendingErrorEvents() >-{ >- errorEventSender().dispatchPendingEvents(); >-} >- > void ImageLoader::elementDidMoveToNewDocument() > { > clearFailedLoadURL(); >diff --git a/Source/WebCore/loader/ImageLoader.h b/Source/WebCore/loader/ImageLoader.h >index 5f3724ccabb65efa78bfdf867da1f278d4ddd73d..8a0156b770d4ad95920d05a563e4cf74c25c3f6d 100644 >--- a/Source/WebCore/loader/ImageLoader.h >+++ b/Source/WebCore/loader/ImageLoader.h >@@ -35,7 +35,6 @@ class ImageLoader; > class RenderImageResource; > > template<typename T> class EventSender; >-typedef EventSender<ImageLoader> ImageEventSender; > > class ImageLoader : public CachedImageClient { > WTF_MAKE_FAST_ALLOCATED; >@@ -65,11 +64,11 @@ public: > bool hasPendingBeforeLoadEvent() const { return m_hasPendingBeforeLoadEvent; } > bool hasPendingActivity() const { return m_hasPendingLoadEvent || m_hasPendingErrorEvent; } > >- void dispatchPendingEvent(ImageEventSender*); >+ void dispatchPendingEvent(EventSender<ImageLoader>&); > >- static void dispatchPendingBeforeLoadEvents(); >- static void dispatchPendingLoadEvents(); >- static void dispatchPendingErrorEvents(); >+ EventSender<ImageLoader>& beforeLoadEventSender() const; >+ EventSender<ImageLoader>& loadEventSender() const; >+ EventSender<ImageLoader>& errorEventSender() const; > > protected: > explicit ImageLoader(Element&); >diff --git a/Source/WebCore/xml/parser/XMLDocumentParser.cpp b/Source/WebCore/xml/parser/XMLDocumentParser.cpp >index 11e347e03a5bf30e233e263600a5e9321653a533..1e99bbcda44c53304e749f374f6204d618a979dc 100644 >--- a/Source/WebCore/xml/parser/XMLDocumentParser.cpp >+++ b/Source/WebCore/xml/parser/XMLDocumentParser.cpp >@@ -120,9 +120,6 @@ void XMLDocumentParser::append(PassRefPtr<StringImpl> inputSource) > } > > doWrite(source.toString()); >- >- // After parsing, go ahead and dispatch image beforeload events. >- ImageLoader::dispatchPendingBeforeLoadEvents(); > } > > void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* m, TextPosition position)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
kling
:
review+
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 136051
:
236793
|
238735
|
238741
| 239062