Changeset 287787 in webkit
- Timestamp:
- Jan 7, 2022, 2:51:45 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/deleting/insert-in-orphaned-selection-crash.html (modified) (1 diff)
-
LayoutTests/fast/events/focusinout-expected.txt (modified) (1 diff)
-
LayoutTests/fast/events/focusinout.html (modified) (3 diffs)
-
LayoutTests/fast/events/scoped/editing-commands.html (modified) (1 diff)
-
LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html (modified) (1 diff)
-
LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (2 diffs)
-
Source/WebCore/dom/Element.cpp (modified) (1 diff)
-
Source/WebCore/dom/Element.h (modified) (1 diff)
-
Source/WebCore/dom/EventNames.h (modified) (1 diff)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287783 r287787 1 2022-01-07 Alexey Shvayka <ashvayka@apple.com> 2 3 Remove obsolete DOM Level 2 "DOMFocusIn" / "DOMFocusOut" events 4 https://bugs.webkit.org/show_bug.cgi?id=234978 5 6 Reviewed by Geoff Garen. 7 8 * editing/deleting/insert-in-orphaned-selection-crash.html: 9 * fast/events/focusinout-expected.txt: 10 * fast/events/focusinout.html: 11 * fast/events/scoped/editing-commands.html: 12 * fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html: 13 * fast/forms/textarea/textarea-autofocus-removal-while-focusing.html: 14 1 15 2022-01-07 Kate Cheney <katherine_cheney@apple.com> 2 16 -
trunk/LayoutTests/editing/deleting/insert-in-orphaned-selection-crash.html
r272779 r287787 9 9 document.execCommand("SelectAll"); 10 10 }); 11 document.addEventListener(" DOMFocusIn", function () {11 document.addEventListener("focusin", function () { 12 12 document.execCommand('InsertText'); 13 13 console.log("The test PASS if it does not CRASH."); -
trunk/LayoutTests/fast/events/focusinout-expected.txt
r56402 r287787 4 4 PASS 5 5 PASS 6 PASS7 PASS -
trunk/LayoutTests/fast/events/focusinout.html
r120792 r287787 30 30 writeFailed('result2', "Wrong event type"); 31 31 } 32 33 function focusHandlerTwo(event)34 {35 if (event.type == "DOMFocusIn")36 writePass('result3');37 else38 writeFailed('result3', "Wrong event type");39 }40 41 function blurHandlerTwo(event)42 {43 if (event.type == "DOMFocusOut")44 writePass('result4');45 else46 writeFailed('result4', "Wrong event type");47 }48 32 </script> 49 33 </head> … … 56 40 <div id="result1">FAIL</div> 57 41 <div id="result2">FAIL</div> 58 <div id="result3">FAIL</div>59 <div id="result4">FAIL</div>60 42 <div id="result5">FAIL</div> 61 43 <div id="result6">FAIL</div> … … 64 46 document.documentElement.addEventListener("focusin", focusHandler, false); 65 47 document.documentElement.addEventListener("focusout", blurHandler, false); 66 document.documentElement.addEventListener("DOMFocusIn", focusHandlerTwo, false);67 document.documentElement.addEventListener("DOMFocusOut", blurHandlerTwo, false);68 48 </script> 69 49 -
trunk/LayoutTests/fast/events/scoped/editing-commands.html
r120792 r287787 54 54 'DOMNodeRemovedFromDocument': false, 55 55 'DOMNodeInsertedIntoDocument': true, // this event can never be observed. 56 'DOMFocusIn': false,57 'DOMFocusOut': false,58 56 'focusin': false, 59 57 'focusout': false, -
trunk/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing-with-style.html
r131709 r287787 10 10 textArea.setAttribute("autofocus", ""); 11 11 textArea.appendChild(document.head); 12 textArea.addEventListener(" DOMFocusIn", function () { docElement.innerHTML = ""; }, false);12 textArea.addEventListener("focusin", function () { docElement.innerHTML = ""; }, false); 13 13 docElement.appendChild(textArea); 14 14 document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null).adoptNode(textArea); -
trunk/LayoutTests/fast/forms/textarea/textarea-autofocus-removal-while-focusing.html
r283659 r287787 9 9 const textarea = document.createElement("textarea"); 10 10 textarea.setAttribute("autofocus", ""); 11 textarea.addEventListener(" DOMFocusIn", function () { document.documentElement.innerHTML = ""; }, false);11 textarea.addEventListener("focusin", function () { document.documentElement.innerHTML = ""; }, false); 12 12 document.documentElement.appendChild(textarea); 13 13 requestAnimationFrame(() => { -
trunk/Source/WebCore/ChangeLog
r287783 r287787 1 2022-01-07 Alexey Shvayka <ashvayka@apple.com> 2 3 Remove obsolete DOM Level 2 "DOMFocusIn" / "DOMFocusOut" events 4 https://bugs.webkit.org/show_bug.cgi?id=234978 5 6 Reviewed by Geoff Garen. 7 8 This patch removes these events because according to Chrome stats, only 0.04% 9 of page loads use them [1], which is below the Blink's removal threshold of 0.10%. 10 11 All the "top sites" listed as "DOMFocusIn" / "DOMFocusOut" adopters, are now dead. 12 Also, these events were never implemented in Firefox. 13 14 [1] https://chromestatus.com/metrics/feature/timeline/popularity/211 15 16 No new tests because it's a feature removal. 17 18 * dom/Document.cpp: 19 (WebCore::Document::setFocusedElement): 20 * dom/Document.h: 21 * dom/Element.cpp: 22 (WebCore::Element::dispatchFocusInEvent): 23 (WebCore::Element::dispatchFocusOutEvent): 24 * dom/Element.h: 25 * dom/EventNames.h: 26 1 27 2022-01-07 Kate Cheney <katherine_cheney@apple.com> 2 28 -
trunk/Source/WebCore/dom/Document.cpp
r287761 r287787 4659 4659 } 4660 4660 4661 oldFocusedElement->dispatchFocusOutEvent(eventNames().focusoutEvent, newFocusedElement.copyRef()); // DOM level 3 name for the bubbling blur event. 4662 // FIXME: We should remove firing DOMFocusOutEvent event when we are sure no content depends 4663 // on it, probably when <rdar://problem/8503958> is resolved. 4664 oldFocusedElement->dispatchFocusOutEvent(eventNames().DOMFocusOutEvent, newFocusedElement.copyRef()); // DOM level 2 name for compatibility. 4661 oldFocusedElement->dispatchFocusOutEvent(newFocusedElement.copyRef()); // DOM level 3 bubbling blur event. 4665 4662 4666 4663 if (m_focusedElement) { … … 4727 4724 } 4728 4725 4729 m_focusedElement->dispatchFocusInEvent(eventNames().focusinEvent, oldFocusedElement.copyRef()); // DOM level 3 bubbling focus event. 4730 4731 if (m_focusedElement != newFocusedElement) { 4732 // handler shifted focus 4733 return false; 4734 } 4735 4736 // FIXME: We should remove firing DOMFocusInEvent event when we are sure no content depends 4737 // on it, probably when <rdar://problem/8503958> is m. 4738 m_focusedElement->dispatchFocusInEvent(eventNames().DOMFocusInEvent, oldFocusedElement.copyRef()); // DOM level 2 for compatibility. 4726 m_focusedElement->dispatchFocusInEvent(oldFocusedElement.copyRef()); // DOM level 3 bubbling focus event. 4739 4727 4740 4728 if (m_focusedElement != newFocusedElement) { -
trunk/Source/WebCore/dom/Element.cpp
r287744 r287787 3183 3183 } 3184 3184 3185 void Element::dispatchFocusInEvent( const AtomString& eventType,RefPtr<Element>&& oldFocusedElement)3185 void Element::dispatchFocusInEvent(RefPtr<Element>&& oldFocusedElement) 3186 3186 { 3187 3187 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed() || !isInWebProcess()); 3188 ASSERT(eventType == eventNames().focusinEvent || eventType == eventNames().DOMFocusInEvent); 3189 dispatchScopedEvent(FocusEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(oldFocusedElement))); 3190 } 3191 3192 void Element::dispatchFocusOutEvent(const AtomString& eventType, RefPtr<Element>&& newFocusedElement) 3188 dispatchScopedEvent(FocusEvent::create(eventNames().focusinEvent, Event::CanBubble::Yes, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(oldFocusedElement))); 3189 } 3190 3191 void Element::dispatchFocusOutEvent(RefPtr<Element>&& newFocusedElement) 3193 3192 { 3194 3193 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(ScriptDisallowedScope::InMainThread::isScriptAllowed() || !isInWebProcess()); 3195 ASSERT(eventType == eventNames().focusoutEvent || eventType == eventNames().DOMFocusOutEvent); 3196 dispatchScopedEvent(FocusEvent::create(eventType, Event::CanBubble::Yes, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(newFocusedElement))); 3194 dispatchScopedEvent(FocusEvent::create(eventNames().focusoutEvent, Event::CanBubble::Yes, Event::IsCancelable::No, document().windowProxy(), 0, WTFMove(newFocusedElement))); 3197 3195 } 3198 3196 -
trunk/Source/WebCore/dom/Element.h
r287707 r287787 570 570 bool dispatchKeyEvent(const PlatformKeyboardEvent&); 571 571 bool dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEventOptions = SendNoEvents, SimulatedClickVisualOptions = ShowPressedLook); 572 void dispatchFocusInEvent(const AtomString& eventType, RefPtr<Element>&& oldFocusedElement); 573 void dispatchFocusOutEvent(const AtomString& eventType, RefPtr<Element>&& newFocusedElement); 572 573 // FIXME: Consider changing signature to accept Element* because all callers perform copyRef(). 574 void dispatchFocusInEvent(RefPtr<Element>&& oldFocusedElement); 575 void dispatchFocusOutEvent(RefPtr<Element>&& newFocusedElement); 574 576 virtual void dispatchFocusEvent(RefPtr<Element>&& oldFocusedElement, FocusDirection); 575 577 virtual void dispatchBlurEvent(RefPtr<Element>&& newFocusedElement); -
trunk/Source/WebCore/dom/EventNames.h
r287253 r287787 45 45 macro(DOMCharacterDataModified) \ 46 46 macro(DOMContentLoaded) \ 47 macro(DOMFocusIn) \48 macro(DOMFocusOut) \49 47 macro(DOMNodeInserted) \ 50 48 macro(DOMNodeInsertedIntoDocument) \ -
trunk/Source/WebInspectorUI/ChangeLog
r287776 r287787 1 2022-01-07 Alexey Shvayka <ashvayka@apple.com> 2 3 Remove obsolete DOM Level 2 "DOMFocusIn" / "DOMFocusOut" events 4 https://bugs.webkit.org/show_bug.cgi?id=234978 5 6 Reviewed by Geoff Garen. 7 8 * UserInterface/Models/ScriptTimelineRecord.js: 9 (WI.ScriptTimelineRecord.EventType.displayName): 10 1 11 2022-01-07 Patrick Angle <pangle@apple.com> 2 12 -
trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
r286223 r287787 213 213 nameMap.set("DOMCharacterDataModified", "DOM Character Data Modified"); 214 214 nameMap.set("DOMContentLoaded", "DOM Content Loaded"); 215 nameMap.set("DOMFocusIn", "DOM Focus In");216 nameMap.set("DOMFocusOut", "DOM Focus Out");217 215 nameMap.set("DOMNodeInserted", "DOM Node Inserted"); 218 216 nameMap.set("DOMNodeInsertedIntoDocument", "DOM Node Inserted Into Document");
Note:
See TracChangeset
for help on using the changeset viewer.