WebKit Bugzilla
Attachment 347419 Details for
Bug 188713
: Pack booleans in Event into a bitfield
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Cleanup
bug-188713-20180817174130.patch (text/plain), 5.42 KB, created by
Ryosuke Niwa
on 2018-08-17 17:41:30 PDT
(
hide
)
Description:
Cleanup
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-08-17 17:41:30 PDT
Size:
5.42 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 235003) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2018-08-17 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Pack booleans in Event into a bitfield >+ https://bugs.webkit.org/show_bug.cgi?id=188713 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use bitfields for booleans in Event class. >+ >+ * dom/Event.cpp: >+ (WebCore::Event::Event): >+ * dom/Event.h: >+ (WebCore::Event::IsComposed): Added. >+ (WebCore::Event): Packed booleans into a bitfield. >+ > 2018-08-17 Alex Christensen <achristensen@webkit.org> > > Clean up CSSSelectorList after r234825 >Index: Source/WebCore/dom/Event.cpp >=================================================================== >--- Source/WebCore/dom/Event.cpp (revision 234999) >+++ Source/WebCore/dom/Event.cpp (working copy) >@@ -34,41 +34,48 @@ > > namespace WebCore { > >+ALWAYS_INLINE Event::Event(MonotonicTime createTime, const AtomicString& type, IsTrusted isTrusted, CanBubble canBubble, IsCancelable cancelable, IsComposed composed) >+ : m_type { type } >+ , m_isInitialized { !type.isNull() } >+ , m_canBubble { canBubble == CanBubble::Yes } >+ , m_cancelable { cancelable == IsCancelable::Yes } >+ , m_composed { composed == IsComposed::Yes } >+ , m_propagationStopped { false } >+ , m_immediatePropagationStopped { false } >+ , m_wasCanceled { false } >+ , m_defaultHandled { false } >+ , m_isDefaultEventHandlerIgnored { false } >+ , m_isTrusted { isTrusted == IsTrusted::Yes } >+ , m_isExecutingPassiveEventListener { false } >+ , m_eventPhase { NONE } >+ , m_createTime { createTime } >+{ >+} >+ > Event::Event(IsTrusted isTrusted) >- : m_isTrusted(isTrusted == IsTrusted::Yes) >- , m_createTime(MonotonicTime::now()) >+ : Event { MonotonicTime::now(), { }, isTrusted, CanBubble::No, IsCancelable::No, IsComposed::No } > { > } > > Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable) >- : m_type(eventType) >- , m_isInitialized(true) >- , m_canBubble(canBubble == CanBubble::Yes) >- , m_cancelable(isCancelable == IsCancelable::Yes) >- , m_isTrusted(true) >- , m_createTime(MonotonicTime::now()) >+ : Event { MonotonicTime::now(), eventType, IsTrusted::Yes, canBubble, isCancelable, IsComposed::No } > { >+ ASSERT(!eventType.isNull()); > } > > Event::Event(const AtomicString& eventType, CanBubble canBubble, IsCancelable isCancelable, MonotonicTime timestamp) >- : m_type(eventType) >- , m_isInitialized(true) >- , m_canBubble(canBubble == CanBubble::Yes) >- , m_cancelable(isCancelable == IsCancelable::Yes) >- , m_isTrusted(true) >- , m_createTime(timestamp) >+ : Event { timestamp, eventType, IsTrusted::Yes, canBubble, isCancelable, IsComposed::No } > { >+ ASSERT(!eventType.isNull()); > } > > Event::Event(const AtomicString& eventType, const EventInit& initializer, IsTrusted isTrusted) >- : m_type(eventType) >- , m_isInitialized(true) >- , m_canBubble(initializer.bubbles) >- , m_cancelable(initializer.cancelable) >- , m_composed(initializer.composed) >- , m_isTrusted(isTrusted == IsTrusted::Yes) >- , m_createTime(MonotonicTime::now()) >+ : Event { MonotonicTime::now(), eventType, isTrusted, >+ initializer.bubbles ? CanBubble::Yes : CanBubble::No, >+ initializer.cancelable ? IsCancelable::Yes : IsCancelable::No, >+ initializer.composed ? IsComposed::Yes : IsComposed::No } > { >+ ASSERT(!eventType.isNull()); > } > > Event::~Event() = default; >Index: Source/WebCore/dom/Event.h >=================================================================== >--- Source/WebCore/dom/Event.h (revision 234999) >+++ Source/WebCore/dom/Event.h (working copy) >@@ -43,8 +43,9 @@ public: > enum class IsTrusted : uint8_t { No, Yes }; > enum class CanBubble : uint8_t { No, Yes }; > enum class IsCancelable : uint8_t { No, Yes }; >+ enum class IsComposed : uint8_t { No, Yes }; > >- enum PhaseType { >+ enum PhaseType { > NONE = 0, > CAPTURING_PHASE = 1, > AT_TARGET = 2, >@@ -148,24 +149,27 @@ protected: > virtual void receivedTarget() { } > > private: >- AtomicString m_type; >+ explicit Event(MonotonicTime createTime, const AtomicString& type, IsTrusted, CanBubble, IsCancelable, IsComposed); > > void setCanceledFlagIfPossible(); > >- bool m_isInitialized { false }; >- bool m_canBubble { false }; >- bool m_cancelable { false }; >- bool m_composed { false }; >- >- bool m_propagationStopped { false }; >- bool m_immediatePropagationStopped { false }; >- bool m_wasCanceled { false }; >- bool m_defaultHandled { false }; >- bool m_isDefaultEventHandlerIgnored { false }; >- bool m_isTrusted { false }; >- bool m_isExecutingPassiveEventListener { false }; >+ AtomicString m_type; >+ >+ unsigned m_isInitialized : 1; >+ unsigned m_canBubble : 1; >+ unsigned m_cancelable : 1; >+ unsigned m_composed : 1; >+ >+ unsigned m_propagationStopped : 1; >+ unsigned m_immediatePropagationStopped : 1; >+ unsigned m_wasCanceled : 1; >+ unsigned m_defaultHandled : 1; >+ unsigned m_isDefaultEventHandlerIgnored : 1; >+ unsigned m_isTrusted : 1; >+ unsigned m_isExecutingPassiveEventListener : 1; >+ >+ unsigned m_eventPhase : 2; // 13-bits > >- PhaseType m_eventPhase { NONE }; > RefPtr<EventTarget> m_currentTarget; > const EventPath* m_eventPath { nullptr }; > RefPtr<EventTarget> m_target;
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:
dbates
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188713
: 347419