⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 197059 in webkit


Ignore:
Timestamp:
Feb 24, 2016, 5:28:51 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Visual Styles sidebar should support multiple animations
​https://bugs.webkit.org/show_bug.cgi?id=154546
<rdar://problem/24773861>

Patch by Devin Rousso <Devin Rousso> on 2016-02-24
Reviewed by Timothy Hatcher.

  • UserInterface/Views/VisualStyleDetailsPanel.js:

(WebInspector.VisualStyleDetailsPanel.prototype._populateTransitionSection):
Set additional flags on the optional properties of transition to ensure
that the initial value of a new row is not considered invalid.

(WebInspector.VisualStyleDetailsPanel.prototype._populateAnimationSection):
Added a comma-separated keyword list to provide support for multiple
animations per rule.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r197046 r197059  
     12016-02-24  Devin Rousso  <dcrousso+webkit@gmail.com>
     2
     3        Web Inspector: Visual Styles sidebar should support multiple animations
     4        https://bugs.webkit.org/show_bug.cgi?id=154546
     5        <rdar://problem/24773861>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/VisualStyleDetailsPanel.js:
     10        (WebInspector.VisualStyleDetailsPanel.prototype._populateTransitionSection):
     11        Set additional flags on the optional properties of transition to ensure
     12        that the initial value of a new row is not considered invalid.
     13
     14        (WebInspector.VisualStyleDetailsPanel.prototype._populateAnimationSection):
     15        Added a comma-separated keyword list to provide support for multiple
     16        animations per rule.
     17
    1182016-02-24  Timothy Hatcher  <timothy@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js

    r196869 r197059  
    12651265
    12661266        let transitionProperty = new WebInspector.VisualStylePropertyNameInput("transition-property", WebInspector.UIString("Property"));
     1267        transitionProperty.masterProperty = true;
    12671268        let transitionTiming = new WebInspector.VisualStyleTimingEditor("transition-timing-function", WebInspector.UIString("Timing"), ["Linear", "Ease", "Ease In", "Ease Out", "Ease In Out"]);
     1269        transitionTiming.optionalProperty = true;
    12681270
    12691271        transitionPropertyRow.element.appendChild(transitionProperty.element);
    … …  
    12741276        let transitionTimeKeywords = ["s", "ms"];
    12751277        let transitionDuration = new WebInspector.VisualStyleNumberInputBox("transition-duration", WebInspector.UIString("Duration"), null, transitionTimeKeywords);
     1278        transitionDuration.optionalProperty = true;
    12761279        let transitionDelay = new WebInspector.VisualStyleNumberInputBox("transition-delay", WebInspector.UIString("Delay"), null, transitionTimeKeywords);
    12771280        transitionDelay.optionalProperty = true;
    … …  
    12801283        transitionDurationRow.element.appendChild(transitionDelay.element);
    12811284
    1282         let transitionProperties = [transitionProperty, transitionTiming, transitionDuration, transitionDelay];
     1285        let transitionProperties = [transitionProperty, transitionDuration, transitionTiming, transitionDelay];
    12831286        let transitionPropertyCombiner = new WebInspector.VisualStylePropertyCombiner("transition", transitionProperties);
    12841287
    … …  
    13041307        let properties = group.properties;
    13051308
     1309        let animationRow = new WebInspector.DetailsSectionRow;
     1310
     1311        properties.animation = new WebInspector.VisualStyleCommaSeparatedKeywordEditor("animation", null, {
     1312            "animation-name": "none",
     1313            "animation-timing-function": "ease",
     1314            "animation-iteration-count": "1",
     1315            "animation-duration": "0",
     1316            "animation-delay": "0",
     1317            "animation-direction": "normal",
     1318            "animation-fill-mode": "none",
     1319            "animation-play-state": "running"
     1320        });
     1321
     1322        animationRow.element.appendChild(properties.animation.element);
     1323
    13061324        let animationNameRow = new WebInspector.DetailsSectionRow;
    13071325
    1308         properties.animationName = new WebInspector.VisualStyleBasicInput("animation-name", WebInspector.UIString("Name"), WebInspector.UIString("Enter the name of a Keyframe"));
    1309 
    1310         animationNameRow.element.appendChild(properties.animationName.element);
     1326        let animationName = new WebInspector.VisualStyleBasicInput("animation-name", WebInspector.UIString("Name"), WebInspector.UIString("Enter the name of a Keyframe"));
     1327        animationName.masterProperty = true;
     1328
     1329        animationNameRow.element.appendChild(animationName.element);
    13111330
    13121331        let animationTimingRow = new WebInspector.DetailsSectionRow;
    13131332
    1314         properties.animationTiming = new WebInspector.VisualStyleTimingEditor("animation-timing-function", WebInspector.UIString("Timing"), ["Linear", "Ease", "Ease In", "Ease Out", "Ease In Out"]);
    1315         properties.animationIterationCount = new WebInspector.VisualStyleNumberInputBox("animation-iteration-count", WebInspector.UIString("Iterations"), this._keywords.defaults.concat(["Infinite"]), null);
    1316 
    1317         animationTimingRow.element.appendChild(properties.animationTiming.element);
    1318         animationTimingRow.element.appendChild(properties.animationIterationCount.element);
     1333        let animationTiming = new WebInspector.VisualStyleTimingEditor("animation-timing-function", WebInspector.UIString("Timing"), ["Linear", "Ease", "Ease In", "Ease Out", "Ease In Out"]);
     1334        animationTiming.optionalProperty = true;
     1335        let animationIterationCount = new WebInspector.VisualStyleNumberInputBox("animation-iteration-count", WebInspector.UIString("Iterations"), this._keywords.defaults.concat(["Infinite"]), null);
     1336        animationIterationCount.optionalProperty = true;
     1337
     1338        animationTimingRow.element.appendChild(animationTiming.element);
     1339        animationTimingRow.element.appendChild(animationIterationCount.element);
    13191340
    13201341        let animationDurationRow = new WebInspector.DetailsSectionRow;
    13211342
    13221343        let animationTimeKeywords = ["s", "ms"];
    1323         properties.animationDuration = new WebInspector.VisualStyleNumberInputBox("animation-duration", WebInspector.UIString("Duration"), null, animationTimeKeywords);
    1324         properties.animationDelay = new WebInspector.VisualStyleNumberInputBox("animation-delay", WebInspector.UIString("Delay"), null, animationTimeKeywords);
    1325 
    1326         animationDurationRow.element.appendChild(properties.animationDuration.element);
    1327         animationDurationRow.element.appendChild(properties.animationDelay.element);
     1344        let animationDuration = new WebInspector.VisualStyleNumberInputBox("animation-duration", WebInspector.UIString("Duration"), null, animationTimeKeywords);
     1345        animationDuration.optionalProperty = true;
     1346        let animationDelay = new WebInspector.VisualStyleNumberInputBox("animation-delay", WebInspector.UIString("Delay"), null, animationTimeKeywords);
     1347        animationDelay.optionalProperty = true;
     1348
     1349        animationDurationRow.element.appendChild(animationDuration.element);
     1350        animationDurationRow.element.appendChild(animationDelay.element);
    13281351
    13291352        let animationDirectionRow = new WebInspector.DetailsSectionRow;
    13301353
    1331         properties.animationDirection = new WebInspector.VisualStyleKeywordPicker("animation-direction", WebInspector.UIString("Direction"), {
     1354        let animationDirection = new WebInspector.VisualStyleKeywordPicker("animation-direction", WebInspector.UIString("Direction"), {
    13321355            basic: this._keywords.normal.concat(["Reverse"]),
    13331356            advanced: ["Alternate", "Alternate Reverse"]
    13341357        });
    1335         properties.animationFillMode = new WebInspector.VisualStyleKeywordPicker("animation-fill-mode", WebInspector.UIString("Fill Mode"), this._keywords.defaults.concat(["None", "Forwards", "Backwards", "Both"]));
    1336 
    1337         animationDirectionRow.element.appendChild(properties.animationDirection.element);
    1338         animationDirectionRow.element.appendChild(properties.animationFillMode.element);
     1358        animationDirection.optionalProperty = true;
     1359        let animationFillMode = new WebInspector.VisualStyleKeywordPicker("animation-fill-mode", WebInspector.UIString("Fill Mode"), this._keywords.defaults.concat(["None", "Forwards", "Backwards", "Both"]));
     1360        animationFillMode.optionalProperty = true;
     1361
     1362        animationDirectionRow.element.appendChild(animationDirection.element);
     1363        animationDirectionRow.element.appendChild(animationFillMode.element);
    13391364
    13401365        let animationStateRow = new WebInspector.DetailsSectionRow;
    13411366
    1342         properties.animationPlayState = new WebInspector.VisualStyleKeywordIconList("animation-play-state", WebInspector.UIString("State"), ["Running", "Paused", "Initial"]);
    1343 
    1344         animationStateRow.element.appendChild(properties.animationPlayState.element);
    1345 
    1346         let animationGroup = new WebInspector.DetailsSectionGroup([animationNameRow, animationTimingRow, animationDurationRow, animationDirectionRow, animationStateRow]);
     1367        let animationPlayState = new WebInspector.VisualStyleKeywordIconList("animation-play-state", WebInspector.UIString("State"), ["Running", "Paused", "Initial"]);
     1368        animationPlayState.optionalProperty = true;
     1369
     1370        animationStateRow.element.appendChild(animationPlayState.element);
     1371
     1372        let animationProperties = [animationName, animationDuration, animationTiming, animationDelay, animationIterationCount, animationDirection, animationFillMode, animationPlayState];
     1373        let animationPropertyCombiner = new WebInspector.VisualStylePropertyCombiner("animation", animationProperties);
     1374
     1375        let noRemainingCommaSeparatedEditorItems = this._noRemainingCommaSeparatedEditorItems.bind(this, animationPropertyCombiner, animationProperties);
     1376        properties.animation.addEventListener(WebInspector.VisualStyleCommaSeparatedKeywordEditor.Event.NoRemainingTreeItems, noRemainingCommaSeparatedEditorItems, this);
     1377
     1378        let selectedCommaSeparatedEditorItemValueChanged = this._selectedCommaSeparatedEditorItemValueChanged.bind(this, properties.animation, animationPropertyCombiner);
     1379        animationPropertyCombiner.addEventListener(WebInspector.VisualStylePropertyEditor.Event.ValueDidChange, selectedCommaSeparatedEditorItemValueChanged, this);
     1380
     1381        let commaSeparatedEditorTreeItemSelected = this._commaSeparatedEditorTreeItemSelected.bind(animationPropertyCombiner);
     1382        properties.animation.addEventListener(WebInspector.VisualStyleCommaSeparatedKeywordEditor.Event.TreeItemSelected, commaSeparatedEditorTreeItemSelected, this);
     1383
     1384        group.specifiedWidthProperties = [properties.animation];
     1385
     1386        let animationGroup = new WebInspector.DetailsSectionGroup([animationRow, animationNameRow, animationTimingRow, animationDurationRow, animationDirectionRow, animationStateRow]);
    13471387        this._populateSection(group, [animationGroup]);
    13481388    }
Note: See TracChangeset for help on using the changeset viewer.