Changeset 275293 in webkit


Ignore:
Timestamp:
Mar 31, 2021 10:49:07 AM (16 months ago)
Author:
Patrick Angle
Message:

Web Inspector: CSS Grid overlay track sizes are incorrect when inline styles are applied to the element
https://bugs.webkit.org/show_bug.cgi?id=223908

Reviewed by BJ Burg.

Add checking the inline style attributes on an element when collecting authored track sizes for grid overlays.

  • inspector/InspectorOverlay.cpp:

(WebCore::authoredGridTrackSizes):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275288 r275293  
     12021-03-31  Patrick Angle  <pangle@apple.com>
     2
     3        Web Inspector: CSS Grid overlay track sizes are incorrect when inline styles are applied to the element
     4        https://bugs.webkit.org/show_bug.cgi?id=223908
     5
     6        Reviewed by BJ Burg.
     7
     8        Add checking the inline style attributes on an element when collecting authored track sizes for grid overlays.
     9
     10        * inspector/InspectorOverlay.cpp:
     11        (WebCore::authoredGridTrackSizes):
     12
    1132021-03-31  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebCore/inspector/InspectorOverlay.cpp

    r275128 r275293  
    3636#include "CSSGridIntegerRepeatValue.h"
    3737#include "CSSGridLineNamesValue.h"
     38#include "CSSStyleDeclaration.h"
    3839#include "DOMCSSNamespace.h"
    3940#include "DOMTokenList.h"
     
    14951496static Vector<String> authoredGridTrackSizes(Node* node, GridTrackSizingDirection direction, unsigned expectedTrackCount)
    14961497{
    1497     if (!is<Element>(node))
     1498    if (!is<StyledElement>(node))
    14981499        return { };
    1499    
    1500     auto element = downcast<Element>(node);
    1501     auto styleRules = element->styleResolver().styleRulesForElement(element);
    1502     styleRules.reverse();
    1503     RefPtr<CSSValue> cssValue;
    1504     for (auto styleRule : styleRules) {
    1505         ASSERT(styleRule);
    1506         if (!styleRule)
    1507             continue;
    1508         cssValue = styleRule->properties().getPropertyCSSValue(direction == GridTrackSizingDirection::ForColumns ? CSSPropertyID::CSSPropertyGridTemplateColumns : CSSPropertyID::CSSPropertyGridTemplateRows);
    1509         if (cssValue)
    1510             break;
     1500
     1501    auto element = downcast<StyledElement>(node);
     1502    auto directionCSSPropertyID = direction == GridTrackSizingDirection::ForColumns ? CSSPropertyID::CSSPropertyGridTemplateColumns : CSSPropertyID::CSSPropertyGridTemplateRows;
     1503    RefPtr<CSSValue> cssValue = element->cssomStyle().getPropertyCSSValueInternal(directionCSSPropertyID);
     1504
     1505    if (!cssValue) {
     1506        auto styleRules = element->styleResolver().styleRulesForElement(element);
     1507        styleRules.reverse();
     1508        for (auto styleRule : styleRules) {
     1509            ASSERT(styleRule);
     1510            if (!styleRule)
     1511                continue;
     1512            cssValue = styleRule->properties().getPropertyCSSValue(directionCSSPropertyID);
     1513            if (cssValue)
     1514                break;
     1515        }
    15111516    }
    15121517   
Note: See TracChangeset for help on using the changeset viewer.