Changeset 261669 in webkit


Ignore:
Timestamp:
May 13, 2020 7:34:39 PM (4 years ago)
Author:
Devin Rousso
Message:

Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
https://bugs.webkit.org/show_bug.cgi?id=211827

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

  • inspector/protocol/CSS.json:

Source/WebCore:

Tests: inspector/css/add-rule.html

inspector/css/getMatchedStylesForNode.html

  • inspector/agents/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::asInspectorStyleSheet):
(WebCore::InspectorCSSAgent::detectOrigin):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::InspectorStyleSheet::buildObjectForRule):

Source/WebInspectorUI:

  • UserInterface/Controllers/CSSManager.js:

(WI.CSSManager.protocolStyleSheetOriginToEnum):

LayoutTests:

  • inspector/css/add-rule.html:
  • inspector/css/add-rule-expected.txt:
  • inspector/css/getMatchedStylesForNode-expected.txt:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261666 r261669  
     12020-05-13  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
     4        https://bugs.webkit.org/show_bug.cgi?id=211827
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/css/add-rule.html:
     9        * inspector/css/add-rule-expected.txt:
     10        * inspector/css/getMatchedStylesForNode-expected.txt:
     11
    1122020-05-13  Jack Lee  <shihchieh_lee@apple.com>
    213
  • trunk/LayoutTests/inspector/css/add-rule-expected.txt

    r249128 r261669  
    1717PASS: Rule selector should be "div"
    1818PASS: Rule range should be [2:0,2:3]
    19 PASS: Rule origin should be "regular"
     19PASS: Rule origin should be "author"
    2020
    2121-- Running test case: CSS.addRule.BadStyleSheetId
  • trunk/LayoutTests/inspector/css/add-rule.html

    r248774 r261669  
    9696                InspectorTest.expectEqual(rulePayload.selectorList.text, "div", `Rule selector should be "div"`);
    9797                InspectorTest.expectEqual(stringify(rulePayload.selectorList.range), "2:0,2:3", `Rule range should be [2:0,2:3]`);
    98                 InspectorTest.expectEqual(rulePayload.origin, "regular", `Rule origin should be "regular"`);
     98                InspectorTest.expectEqual(rulePayload.origin, "author", `Rule origin should be "author"`);
    9999
    100100                resolve();
  • trunk/LayoutTests/inspector/css/getMatchedStylesForNode-expected.txt

    r248943 r261669  
    2525      },
    2626      "sourceLine": "<filtered>",
    27       "origin": "regular",
     27      "origin": "author",
    2828      "style": {
    2929        "cssProperties": [
     
    6868      },
    6969      "sourceLine": "<filtered>",
    70       "origin": "regular",
     70      "origin": "author",
    7171      "style": {
    7272        "cssProperties": [
     
    111111      },
    112112      "sourceLine": "<filtered>",
    113       "origin": "regular",
     113      "origin": "author",
    114114      "style": {
    115115        "cssProperties": [
     
    161161          },
    162162          "sourceLine": "<filtered>",
    163           "origin": "regular",
     163          "origin": "author",
    164164          "style": {
    165165            "cssProperties": [
     
    209209          },
    210210          "sourceLine": "<filtered>",
    211           "origin": "regular",
     211          "origin": "author",
    212212          "style": {
    213213            "cssProperties": [
     
    257257          },
    258258          "sourceLine": "<filtered>",
    259           "origin": "regular",
     259          "origin": "author",
    260260          "style": {
    261261            "cssProperties": [
     
    305305          },
    306306          "sourceLine": "<filtered>",
    307           "origin": "regular",
     307          "origin": "author",
    308308          "style": {
    309309            "cssProperties": [
     
    353353          },
    354354          "sourceLine": "<filtered>",
    355           "origin": "regular",
     355          "origin": "author",
    356356          "style": {
    357357            "cssProperties": [
     
    401401          },
    402402          "sourceLine": "<filtered>",
    403           "origin": "regular",
     403          "origin": "author",
    404404          "style": {
    405405            "cssProperties": [
     
    449449          },
    450450          "sourceLine": "<filtered>",
    451           "origin": "regular",
     451          "origin": "author",
    452452          "style": {
    453453            "cssProperties": [
     
    497497          },
    498498          "sourceLine": "<filtered>",
    499           "origin": "regular",
     499          "origin": "author",
    500500          "style": {
    501501            "cssProperties": [
     
    545545          },
    546546          "sourceLine": "<filtered>",
    547           "origin": "regular",
     547          "origin": "author",
    548548          "style": {
    549549            "cssProperties": [
     
    593593          },
    594594          "sourceLine": "<filtered>",
    595           "origin": "regular",
     595          "origin": "author",
    596596          "style": {
    597597            "cssProperties": [
     
    641641          },
    642642          "sourceLine": "<filtered>",
    643           "origin": "regular",
     643          "origin": "author",
    644644          "style": {
    645645            "cssProperties": [
     
    689689          },
    690690          "sourceLine": "<filtered>",
    691           "origin": "regular",
     691          "origin": "author",
    692692          "style": {
    693693            "cssProperties": [
     
    737737          },
    738738          "sourceLine": "<filtered>",
    739           "origin": "regular",
     739          "origin": "author",
    740740          "style": {
    741741            "cssProperties": [
     
    788788          },
    789789          "sourceLine": "<filtered>",
    790           "origin": "regular",
     790          "origin": "author",
    791791          "style": {
    792792            "cssProperties": [
     
    838838          },
    839839          "sourceLine": "<filtered>",
    840           "origin": "regular",
     840          "origin": "author",
    841841          "style": {
    842842            "cssProperties": [
     
    881881          },
    882882          "sourceLine": "<filtered>",
    883           "origin": "regular",
     883          "origin": "author",
    884884          "style": {
    885885            "cssProperties": [
     
    931931          },
    932932          "sourceLine": "<filtered>",
    933           "origin": "regular",
     933          "origin": "author",
    934934          "style": {
    935935            "cssProperties": [
     
    986986          },
    987987          "sourceLine": "<filtered>",
    988           "origin": "regular",
     988          "origin": "author",
    989989          "style": {
    990990            "cssProperties": [
     
    10361036          },
    10371037          "sourceLine": "<filtered>",
    1038           "origin": "regular",
     1038          "origin": "author",
    10391039          "style": {
    10401040            "cssProperties": [
  • trunk/Source/JavaScriptCore/ChangeLog

    r261668 r261669  
     12020-05-13  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
     4        https://bugs.webkit.org/show_bug.cgi?id=211827
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/protocol/CSS.json:
     9
    1102020-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
    211
  • trunk/Source/JavaScriptCore/inspector/protocol/CSS.json

    r253176 r261669  
    2121            "id": "StyleSheetOrigin",
    2222            "type": "string",
    23             "enum": ["user", "user-agent", "inspector", "regular"],
     23            "enum": ["user", "user-agent", "author", "inspector"],
    2424            "description": "Stylesheet type: \"user\" for user stylesheets, \"user-agent\" for user-agent stylesheets, \"inspector\" for stylesheets created by the inspector (i.e. those holding the \"via inspector\" rules), \"regular\" for regular stylesheets."
    2525        },
  • trunk/Source/WebCore/ChangeLog

    r261668 r261669  
     12020-05-13  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
     4        https://bugs.webkit.org/show_bug.cgi?id=211827
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Tests: inspector/css/add-rule.html
     9               inspector/css/getMatchedStylesForNode.html
     10
     11        * inspector/agents/InspectorCSSAgent.cpp:
     12        (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
     13        (WebCore::InspectorCSSAgent::detectOrigin):
     14        * inspector/InspectorStyleSheet.cpp:
     15        (WebCore::InspectorStyleSheet::buildObjectForRule):
     16
    1172020-05-13  Yusuke Suzuki  <ysuzuki@apple.com>
    218
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r260709 r261669  
    11361136        .release();
    11371137
    1138     if (m_origin == Inspector::Protocol::CSS::StyleSheetOrigin::Regular || m_origin == Inspector::Protocol::CSS::StyleSheetOrigin::User)
     1138    if (m_origin == Inspector::Protocol::CSS::StyleSheetOrigin::Author || m_origin == Inspector::Protocol::CSS::StyleSheetOrigin::User)
    11391139        result->setSourceURL(finalURL());
    11401140
  • trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp

    r260491 r261669  
    871871    return m_nodeToInspectorStyleSheet.ensure(&element, [this, &element] {
    872872        String newStyleSheetId = String::number(m_lastStyleSheetId++);
    873         auto inspectorStyleSheet = InspectorStyleSheetForInlineStyle::create(m_instrumentingAgents.inspectorPageAgent(), newStyleSheetId, element, Inspector::Protocol::CSS::StyleSheetOrigin::Regular, this);
     873        auto inspectorStyleSheet = InspectorStyleSheetForInlineStyle::create(m_instrumentingAgents.inspectorPageAgent(), newStyleSheetId, element, Inspector::Protocol::CSS::StyleSheetOrigin::Author, this);
    874874        m_idToInspectorStyleSheet.set(newStyleSheetId, inspectorStyleSheet.copyRef());
    875875        return inspectorStyleSheet;
     
    943943    }
    944944
    945     return Inspector::Protocol::CSS::StyleSheetOrigin::Regular;
     945    return Inspector::Protocol::CSS::StyleSheetOrigin::Author;
    946946}
    947947
  • trunk/Source/WebInspectorUI/ChangeLog

    r261498 r261669  
     12020-05-13  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec
     4        https://bugs.webkit.org/show_bug.cgi?id=211827
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Controllers/CSSManager.js:
     9        (WI.CSSManager.protocolStyleSheetOriginToEnum):
     10
    1112020-05-11  Devin Rousso  <drousso@apple.com>
    212
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js

    r261109 r261669  
    6464    {
    6565        switch (origin) {
    66         case InspectorBackend.Enum.CSS.StyleSheetOrigin.Regular:
    67             return WI.CSSStyleSheet.Type.Author;
    6866        case InspectorBackend.Enum.CSS.StyleSheetOrigin.User:
    6967            return WI.CSSStyleSheet.Type.User;
     68
    7069        case InspectorBackend.Enum.CSS.StyleSheetOrigin.UserAgent:
    7170            return WI.CSSStyleSheet.Type.UserAgent;
     71
    7272        case InspectorBackend.Enum.CSS.StyleSheetOrigin.Inspector:
    7373            return WI.CSSStyleSheet.Type.Inspector;
    74         default:
    75             console.assert(false, "Unknown CSS.StyleSheetOrigin", origin);
    76             return InspectorBackend.Enum.CSS.StyleSheetOrigin.Regular;
    77         }
     74        }
     75
     76        // COMPATIBILITY (iOS 14): CSS.StyleSheetOrigin.Regular was replaced with CSS.StyleSheetOrigin.Author.
     77        console.assert(!InspectorBackend.Enum.CSS.StyleSheetOrigin.Author || origin === InspectorBackend.Enum.CSS.StyleSheetOrigin.Author);
     78        console.assert(!InspectorBackend.Enum.CSS.StyleSheetOrigin.Regular || origin === InspectorBackend.Enum.CSS.StyleSheetOrigin.Regular);
     79        return WI.CSSStyleSheet.Type.Author;
    7880    }
    7981
Note: See TracChangeset for help on using the changeset viewer.