Changeset 213873 in webkit


Ignore:
Timestamp:
Mar 13, 2017 3:27:20 PM (7 years ago)
Author:
webkit@devinrousso.com
Message:

Web Inspector: Event Listeners section is missing 'once', 'passive' event listener flags
https://bugs.webkit.org/show_bug.cgi?id=167080

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

  • inspector/protocol/DOM.json:

Add "passive" and "once" items to the EventListener type.

Source/WebCore:

Test: inspector/dom/getEventListenersForNode.html

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::buildObjectForEventListener):
Add "passive" and "once" values to the EventListener protocol object when applicable.

Source/WebInspectorUI:

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Views/EventListenerSectionGroup.js:

(WebInspector.EventListenerSectionGroup):
(WebInspector.EventListenerSectionGroup.prototype._type): Deleted.

LayoutTests:

Tests the result of DOMAgent.getEventListenersForNode and ensures that additional options
are passed to the frontend.

  • inspector/dom/getEventListenersForNode-expected.txt: Added.
  • inspector/dom/getEventListenersForNode.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r213869 r213873  
     12017-03-13  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: Event Listeners section is missing 'once', 'passive' event listener flags
     4        https://bugs.webkit.org/show_bug.cgi?id=167080
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Tests the result of DOMAgent.getEventListenersForNode and ensures that additional options
     9        are passed to the frontend.
     10
     11        * inspector/dom/getEventListenersForNode-expected.txt: Added.
     12        * inspector/dom/getEventListenersForNode.html: Added.
     13
    1142017-03-13  Dean Jackson  <dino@apple.com>
    215
  • trunk/Source/JavaScriptCore/ChangeLog

    r213872 r213873  
     12017-03-13  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: Event Listeners section is missing 'once', 'passive' event listener flags
     4        https://bugs.webkit.org/show_bug.cgi?id=167080
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * inspector/protocol/DOM.json:
     9        Add "passive" and "once" items to the EventListener type.
     10
    1112017-03-13  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Source/JavaScriptCore/inspector/protocol/DOM.json

    r208540 r213873  
    8181                { "name": "location", "$ref": "Debugger.Location", "optional": true, "description": "Handler code location." },
    8282                { "name": "sourceName", "type": "string", "optional": true, "description": "Source script URL." },
    83                 { "name": "handler", "$ref": "Runtime.RemoteObject", "optional": true, "description": "Event handler function value." }
     83                { "name": "handler", "$ref": "Runtime.RemoteObject", "optional": true, "description": "Event handler function value." },
     84                { "name": "passive", "type": "boolean", "optional": true, "description": "<code>EventListener</code>'s passive." },
     85                { "name": "once", "type": "boolean", "optional": true, "description": "<code>EventListener</code>'s once." }
    8486            ],
    8587            "description": "A structure holding event listener properties."
  • trunk/Source/WebCore/ChangeLog

    r213871 r213873  
     12017-03-13  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: Event Listeners section is missing 'once', 'passive' event listener flags
     4        https://bugs.webkit.org/show_bug.cgi?id=167080
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Test: inspector/dom/getEventListenersForNode.html
     9
     10        * inspector/InspectorDOMAgent.cpp:
     11        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
     12        Add "passive" and "once" values to the EventListener protocol object when applicable.
     13
    1142017-03-13  John Wilander  <wilander@apple.com>
    215
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r213355 r213873  
    15471547            value->setSourceName(sourceName);
    15481548    }
     1549    if (registeredEventListener.isPassive())
     1550        value->setPassive(true);
     1551    if (registeredEventListener.isOnce())
     1552        value->setOnce(true);
    15491553    return value;
    15501554}
  • trunk/Source/WebInspectorUI/ChangeLog

    r213765 r213873  
     12017-03-13  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: Event Listeners section is missing 'once', 'passive' event listener flags
     4        https://bugs.webkit.org/show_bug.cgi?id=167080
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * Localizations/en.lproj/localizedStrings.js:
     9        * UserInterface/Views/EventListenerSectionGroup.js:
     10        (WebInspector.EventListenerSectionGroup):
     11        (WebInspector.EventListenerSectionGroup.prototype._type): Deleted.
     12
    1132017-03-11  Matt Baker  <mattbaker@apple.com>
    214
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r213691 r213873  
    561561localizedStrings["Object Store"] = "Object Store";
    562562localizedStrings["Offset"] = "Offset";
     563localizedStrings["Once"] = "Once";
    563564localizedStrings["Online"] = "Online";
    564565localizedStrings["Only show resources with issues"] = "Only show resources with issues";
     
    595596localizedStrings["Parent"] = "Parent";
    596597localizedStrings["Partial Garbage Collection"] = "Partial Garbage Collection";
     598localizedStrings["Passive"] = "Passive";
    597599localizedStrings["Path"] = "Path";
    598600localizedStrings["Pause Playback"] = "Pause Playback";
  • trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js

    r208304 r213873  
    3636        rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Node"), this._nodeTextOrLink()));
    3737        rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Function"), this._functionTextOrLink()));
    38         rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Type"), this._type()));
     38
     39        if (this._eventListener.useCapture)
     40            rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Capturing"), WebInspector.UIString("Yes")));
     41        else
     42            rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Bubbling"), WebInspector.UIString("Yes")));
     43
     44        if (this._eventListener.isAttribute)
     45            rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Attribute"), WebInspector.UIString("Yes")));
     46
     47        if (this._eventListener.passive)
     48            rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Passive"), WebInspector.UIString("Yes")));
     49
     50        if (this._eventListener.once)
     51            rows.push(new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Once"), WebInspector.UIString("Yes")));
     52
    3953        this.rows = rows;
    4054    }
     
    5367
    5468        return WebInspector.linkifyNodeReference(node);
    55     }
    56 
    57     _type()
    58     {
    59         if (this._eventListener.useCapture)
    60             return WebInspector.UIString("Capturing");
    61 
    62         if (this._eventListener.isAttribute)
    63             return WebInspector.UIString("Attribute");
    64 
    65         return WebInspector.UIString("Bubbling");
    6669    }
    6770
Note: See TracChangeset for help on using the changeset viewer.