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

Changeset 287046 in webkit


Ignore:
Timestamp:
Dec 14, 2021, 2:04:50 PM (5 years ago)
Author:
Patrick Angle
Message:

Web Inspector: After r286657, anonymous layers are providing an empty string for their grouping text
https://bugs.webkit.org/show_bug.cgi?id=234012

Reviewed by Devin Rousso.

Covered by existing test: LayoutTests/inspector/css/getMatchedStylesForNodeLayerGrouping.html

For anonymous layers, we should not provide the text property to the frontend, as there is technically no
text, not an empty string, provided by the author. This is effectively a minor optimization, as the frontend
does correctly handle an empty string the same way it handles no string.

  • inspector/InspectorStyleSheet.cpp:

(WebCore::buildArrayForGroupings):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r287043 r287046  
     12021-12-14  Patrick Angle  <pangle@apple.com>
     2
     3        Web Inspector: After r286657, anonymous layers are providing an empty string for their grouping text
     4        https://bugs.webkit.org/show_bug.cgi?id=234012
     5
     6        Reviewed by Devin Rousso.
     7
     8        Covered by existing test: LayoutTests/inspector/css/getMatchedStylesForNodeLayerGrouping.html
     9
     10        For anonymous layers, we should not provide the `text` property to the frontend, as there is technically no
     11        text, not an empty string, provided by the author. This is effectively a minor optimization, as the frontend
     12        does correctly handle an empty string the same way it handles no string.
     13
     14        * inspector/InspectorStyleSheet.cpp:
     15        (WebCore::buildArrayForGroupings):
     16
    1172021-12-14  Alan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r286657 r287046  
    479479                .setType(Protocol::CSS::Grouping::Type::LayerRule)
    480480                .release();
    481             layerRulePayload->setText(downcast<CSSLayerBlockRule>(parentRule)->name());
     481            auto layerName = downcast<CSSLayerBlockRule>(parentRule)->name();
     482            if (!layerName.isEmpty())
     483                layerRulePayload->setText(layerName);
    482484            ruleGroupingPayloads.append(WTFMove(layerRulePayload));
    483485        }
Note: See TracChangeset for help on using the changeset viewer.