Changeset 260590 in webkit
- Timestamp:
- Apr 23, 2020 12:49:50 PM (4 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r260589 r260590 1 2020-04-23 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION: Elements: Styles: color functions are missing swatches 4 https://bugs.webkit.org/show_bug.cgi?id=210930 5 6 Reviewed by Brian Burg. 7 8 * UserInterface/Views/SpreadsheetStyleProperty.js: 9 (WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens): 10 (WI.SpreadsheetStyleProperty.prototype._addGradientTokens): 11 (WI.SpreadsheetStyleProperty.prototype._addColorTokens): 12 (WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens): 13 (WI.SpreadsheetStyleProperty.prototype._addBoxShadowTokens): 14 (WI.SpreadsheetStyleProperty.prototype._addVariableTokens): 15 Only attempt to `WI.Color.fromString` when at a ")" that is not part of another function. 16 Drive-by: add variable tokens after variable text is resolved, as otherwise the variable is 17 replaced with a `WI.InlineSwatch`, which replaces the original text, preventing it 18 from being used for looking up the variable name. 19 1 20 2020-04-23 Devin Rousso <drousso@apple.com> 2 21 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js
r259929 r260590 556 556 return this._addBoxShadowTokens(tokens); 557 557 558 tokens = this._addVariableTokens(tokens);559 560 558 if (this._property.isVariable || WI.CSSKeywordCompletions.isColorAwareProperty(this._property.name)) { 561 559 tokens = this._addGradientTokens(tokens); … … 567 565 tokens = this._addTimingFunctionTokens(tokens, "spring"); 568 566 } 567 568 tokens = this._addVariableTokens(tokens); 569 569 570 570 return tokens; … … 593 593 594 594 let rawTokens = tokens.slice(gradientStartIndex, i + 1); 595 595 596 let text = this._resolveVariables(rawTokens.map((token) => token.value).join("")); 597 rawTokens = this._addVariableTokens(rawTokens); 598 596 599 let gradient = WI.Gradient.fromString(text); 597 600 if (gradient) … … 640 643 } 641 644 642 if (token.value === ")") { 643 --openParentheses; 644 if (openParentheses) 645 continue; 646 } 647 648 // Color Function end 645 if (token.value !== ")") 646 continue; 647 648 if (--openParentheses) 649 continue; 649 650 650 651 let rawTokens = tokens.slice(colorFunctionStartIndex, i + 1); 652 651 653 let text = this._resolveVariables(rawTokens.map((token) => token.value).join("")); 654 rawTokens = this._addVariableTokens(rawTokens); 655 652 656 pushPossibleColorToken(text, ...rawTokens); 653 657 colorFunctionStartIndex = NaN; … … 679 683 680 684 let rawTokens = tokens.slice(startIndex, i + 1); 685 681 686 let text = this._resolveVariables(rawTokens.map((token) => token.value).join("")); 687 rawTokens = this._addVariableTokens(rawTokens); 682 688 683 689 let valueObject; … … 732 738 733 739 let text = this._resolveVariables(nonWhitespaceTokens.map((rawToken) => rawToken.value).join("")); 740 nonWhitespaceTokens = this._addVariableTokens(nonWhitespaceTokens); 741 734 742 let boxShadow = WI.BoxShadow.fromString(text); 735 743 if (boxShadow) … … 804 812 if (fallbackStartIndex !== -1) { 805 813 contents.pushAll(rawTokens.slice(variableNameIndex + 1, fallbackStartIndex)); 806 contents.pushAll(this._replaceSpecialTokens(rawTokens.slice(fallbackStartIndex, i))); 814 815 let fallbackTokens = rawTokens.slice(fallbackStartIndex, i); 816 fallbackTokens = this._addBoxShadowTokens(fallbackTokens); 817 fallbackTokens = this._addGradientTokens(fallbackTokens); 818 fallbackTokens = this._addColorTokens(fallbackTokens); 819 fallbackTokens = this._addTimingFunctionTokens(fallbackTokens, "cubic-bezier"); 820 fallbackTokens = this._addTimingFunctionTokens(fallbackTokens, "spring"); 821 fallbackTokens = this._addVariableTokens(fallbackTokens); 822 contents.pushAll(fallbackTokens); 807 823 } else 808 824 contents.pushAll(rawTokens.slice(variableNameIndex + 1, i));
Note: See TracChangeset
for help on using the changeset viewer.