gecko-dev/dom/events
Jessica Jong 3342b6100d Bug 1375599 - Change IsDisabled() to look at NS_EVENT_STATE_DISABLED instead of the "disabled" attribute. r=bz
In order to speed up IsDisabled(), instead of querying for the @disabled
attribute, we're now using the NS_EVENT_STATE_DISABLED flag to know whether an
element is disabled.
It is safe to use the NS_EVENT_STATE_DISABLED flag for the following reasons:
- For form elements, nsGenericHTMLFormElement::IsDisabled() is only called on
  form elements that can be disabled; form elements that can't be disabled
  overrides IsDisabled() to return false directly.
  And, before this patch, NS_EVENT_STATE_DISABLED flag is set by
  nsGenericHTMLFormElement::IntrinsicState() if and only if IsDisabled() in all
  cases when CanBeDisabled() is true, and when CanBeDisabled() is false then
  IsDisabled() is always false and the flag is not set.
- For non form elements, optgroup and option have the flag matching
  IsDisabled(). Note that option's IsDisabled() should also refer to optgroup's
  (if it exists) disabled state, which was not done before this patch.

For this to work correctly, we need to set NS_EVENT_STATE_DISABLED earlier,
that is, in AfterSetAttr(), before any consumer of IsDisabled().
We also need to update the flag whenever the element's parent (e.g. fieldset or
optgroup) disabled state changes and when moving into/out of a parent
container.

Note that NS_EVENT_STATE_DISABLED/ENABLED is now part of the
EXTERNALLY_MANAGED_STATES.

MozReview-Commit-ID: KSceikeqvvU
2017-07-20 02:15:00 -04:00
..
crashtests Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws. 2017-01-30 08:10:22 +01:00
test Bug 1380680 - Fix test_bug1013412 so it passes with webrender enabled. r=dvander 2017-07-13 11:15:59 -04:00
AnimationEvent.cpp
AnimationEvent.h
AsyncEventDispatcher.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
AsyncEventDispatcher.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
BeforeUnloadEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
BeforeUnloadEvent.h
ClipboardEvent.cpp
ClipboardEvent.h
CommandEvent.cpp
CommandEvent.h
CompositionEvent.cpp Bug 1333925 Make CompositionEvent::mRanges cycle collected r=smaug 2017-01-26 15:35:09 +09:00
CompositionEvent.h Bug 1333925 Make CompositionEvent::mRanges cycle collected r=smaug 2017-01-26 15:35:09 +09:00
ContentEventHandler.cpp Bug 1351170 - 1. Correctly calculate start offset for non-text nodes; r=masayuki 2017-07-19 14:29:59 -04:00
ContentEventHandler.h Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj. 2017-06-20 19:19:05 +10:00
CustomEvent.cpp
CustomEvent.h
DataTransfer.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
DataTransfer.h Bug 1327798 - Part 1. PasteNoFormatting shouldn't set text/html to clipboard event on paste. r=enndeakin 2017-02-22 18:34:45 +09:00
DataTransferItem.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
DataTransferItem.h Bug 1342057 - Part 1: Use correct MIME type for files as DataTransferItem.type, r=baku 2017-03-07 18:18:42 -05:00
DataTransferItemList.cpp Bug 1342057 - Part 1: Use correct MIME type for files as DataTransferItem.type, r=baku 2017-03-07 18:18:42 -05:00
DataTransferItemList.h
DeviceMotionEvent.cpp Bug 1261894 - Update InitDeviceMotionEvent to handle high-res timestamps. r=smaug 2017-02-28 16:50:15 -06:00
DeviceMotionEvent.h Bug 1287006 - Don't pass Nullable by value in various places, rather by const&. r=bz 2017-02-13 09:07:40 -08:00
DOMEventTargetHelper.cpp Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan 2017-05-08 08:24:22 +02:00
DOMEventTargetHelper.h Bug 1354599 - Implement DOMEventTargetHelper::KeepAliveIfHasListenersFor, r=smaug 2017-04-18 13:51:27 +02:00
DragEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
DragEvent.h
Event.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
Event.h Bug 1217238 - Reduce time precision when privacy.resistFingerprinting is on. r=mystor 2017-06-06 11:45:14 +08:00
EventDispatcher.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
EventDispatcher.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
EventListenerManager.cpp Bug 1356921 - Enable SENSOR_ROTATION_VECTOR for DeviceOrientation events. r=esawin 2017-06-30 10:27:24 -07:00
EventListenerManager.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
EventListenerService.cpp Bug 1372327 - Use LookupForAdd instead of Get+Put to avoid unnecessary hashtable lookups. r=froydnj 2017-06-14 17:27:25 +02:00
EventListenerService.h
EventNameList.h Bug 1379728 part 1. Remove the double-definition of the 'close' event from EventNameList.h. r=smaug 2017-07-11 17:49:24 -04:00
EventStateManager.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
EventStateManager.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
EventStates.h Bug 1375599 - Change IsDisabled() to look at NS_EVENT_STATE_DISABLED instead of the "disabled" attribute. r=bz 2017-07-20 02:15:00 -04:00
EventTarget.cpp Bug 1351783 part 8 - Gather whether there are key listeners on the focused element. r=kats,smaug 2017-06-05 19:22:16 -05:00
EventTarget.h Bug 1351783 part 8 - Gather whether there are key listeners on the focused element. r=kats,smaug 2017-06-05 19:22:16 -05:00
FocusEvent.cpp
FocusEvent.h
ImageCaptureError.cpp
ImageCaptureError.h
IMEContentObserver.cpp Bug 1377989 - part1: Rename nsRange::GetStartParent() to nsRange::GetStartContainer() r=smaug 2017-07-11 20:53:04 +09:00
IMEContentObserver.h Bug 1375491, make child process to cache ime properties only at animation tick time, r=masayuki 2017-06-29 14:46:11 +03:00
IMEStateManager.cpp Bug 1377672 - part3: IMEStateManager::NotifyIME() should ignore notifications and requests which comes from unexpected process r=m_kato,smaug 2017-07-06 00:47:40 +09:00
IMEStateManager.h Bug 1377672 - part4: ContentCacheInParent::RequestIMEToCommitComposition() should ignore too late requests r=m_kato 2017-07-05 19:55:18 +09:00
InputEvent.cpp
InputEvent.h
InternalMutationEvent.h
JSEventHandler.cpp Bug 1345996. Change event handler invocation to only do the "true return cancels" for onerror handlers handed ErrorEvents, and only on globals. r=smaug 2017-03-10 23:53:09 -05:00
JSEventHandler.h
KeyboardEvent.cpp
KeyboardEvent.h
KeyNameList.h
MessageEvent.cpp Bug 1311324 P2 Replace usage of ServiceWorkerMessageEvent with MessageEvent. r=bz 2017-03-09 20:50:13 -05:00
MessageEvent.h Bug 1311324 P2 Replace usage of ServiceWorkerMessageEvent with MessageEvent. r=bz 2017-03-09 20:50:13 -05:00
MouseEvent.cpp Bug 1339758, click() and similar can return 0 from various coordinate properties, r=masayuki 2017-03-23 12:57:44 +02:00
MouseEvent.h
MouseScrollEvent.cpp
MouseScrollEvent.h
moz.build Bug 1251198 - Remove various obsolete events from document.createEvent r=smaug 2017-04-20 15:45:37 +03:00
MutationEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
MutationEvent.h
NotifyPaintEvent.cpp Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
NotifyPaintEvent.h Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
nsIEventListenerService.idl
PaintRequest.cpp Bug 1302071 - Part 3: Remove flags parameter to NotifyInvalidation since it's unused. r=tnikkel 2017-02-17 11:50:58 +13:00
PaintRequest.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
PhysicalKeyCodeNameList.h
PointerEvent.cpp Bug 1292064 - [Pointer Event] Add digitizer/pen tangential (barrel) pressure and twist. r=smaug 2017-02-09 10:49:00 +08:00
PointerEvent.h Bug 1292064 - [Pointer Event] Add digitizer/pen tangential (barrel) pressure and twist. r=smaug 2017-02-09 10:49:00 +08:00
ScrollAreaEvent.cpp Bug 1333927 Make ScrollAreaEvent::mClientArea cycle collected r=smaug 2017-01-27 15:57:38 +09:00
ScrollAreaEvent.h Bug 1333927 Make ScrollAreaEvent::mClientArea cycle collected r=smaug 2017-01-27 15:57:38 +09:00
SimpleGestureEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
SimpleGestureEvent.h
SpeechRecognitionError.cpp
SpeechRecognitionError.h
StorageEvent.cpp Bug 1322550 - Rename DOMStorage to Storage, r=smaug 2017-01-04 14:53:01 +01:00
StorageEvent.h Bug 1285898 - [e10s-multi] Localstorage "storage" event is not fired with multiple content processes. r=asuth 2017-02-19 22:16:48 -05:00
TextClause.cpp
TextClause.h
TextComposition.cpp Bug 1377672 - part3: IMEStateManager::NotifyIME() should ignore notifications and requests which comes from unexpected process r=m_kato,smaug 2017-07-06 00:47:40 +09:00
TextComposition.h Bug 1377672 - part3: IMEStateManager::NotifyIME() should ignore notifications and requests which comes from unexpected process r=m_kato,smaug 2017-07-06 00:47:40 +09:00
Touch.cpp
Touch.h
TouchEvent.cpp Bug 1357872, nsPresContext is refcounted, so use it so, r=kats 2017-04-25 00:38:33 +03:00
TouchEvent.h
TransitionEvent.cpp
TransitionEvent.h
UIEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
UIEvent.h Bug 1347073 Get rid of UIEvent.isChar since it's not initialized properly on most platforms and the other browsers don't support this r=smaug 2017-03-14 18:29:39 +09:00
VirtualKeyCodeList.h
WheelEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
WheelEvent.h
WheelHandlingHelper.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
WheelHandlingHelper.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
XULCommandEvent.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
XULCommandEvent.h