| Differences between
and this patch
- a/Source/WebCore/ChangeLog +60 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2019-11-05  Dirk Schulze  <krit@webkit.org>
2
3
        Support parsing, computed style and property style for offset, offset-path, offset-distance
4
        https://bugs.webkit.org/show_bug.cgi?id=203848
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This patch implements the parsing, computed style and property style
9
        for the
10
        longhand properties: offset-path, offset-distance
11
        shorthand properties: offset
12
13
        The implementation happens behind the feature flag: motion.
14
15
        The longhand offset-rotate gets implemented in a separate patch. 
16
17
        Tests: fast/css/offset/parsing-offset-distance.html
18
               fast/css/offset/parsing-offset-path.html
19
               fast/css/offset/parsing-offset.html
20
21
        * css/CSSComputedStyleDeclaration.cpp:
22
        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
23
        * css/CSSProperties.json:
24
        * css/StyleProperties.cpp:
25
                Add offset shorthand.
26
        (WebCore::StyleProperties::getPropertyValue const):
27
        * css/parser/CSSPropertyParser.cpp:
28
        (WebCore::consumePathShapeOrNone):
29
                Only parse none | path() as Blink and Gecko do.
30
        (WebCore::CSSPropertyParser::parseSingleValue):
31
                Add longhands: offset-distance and offset-path.
32
        (WebCore::CSSPropertyParser::consumeOffsetShorthand):
33
        (WebCore::CSSPropertyParser::parseShorthand):
34
                Add offset shorthand.
35
        * css/parser/CSSPropertyParser.h:
36
        * page/RuntimeEnabledFeatures.h: Add motion feature flag.
37
        (WebCore::RuntimeEnabledFeatures::setMotionEnabled):
38
        (WebCore::RuntimeEnabledFeatures::motionEnabled const):
39
        * rendering/style/RenderStyle.h: Add offsetDistance length value
40
                and offsetPath BasicShape value.
41
        (WebCore::RenderStyle::offsetPath const):
42
        (WebCore::RenderStyle::offsetDistance const):
43
        (WebCore::RenderStyle::setOffsetDistance):
44
        (WebCore::RenderStyle::initialOffsetPath):
45
        (WebCore::RenderStyle::initialOffsetDistance):
46
        (WebCore::RenderStyle::setOffsetPath):
47
        * rendering/style/StyleRareNonInheritedData.cpp:
48
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
49
        (WebCore::StyleRareNonInheritedData::operator== const):
50
        * rendering/style/StyleRareNonInheritedData.h:
51
        * style/StyleBuilderConverter.h:
52
        (WebCore::Style::BuilderConverter::convertBasicShape):
53
                Convert basic shapes w/o bounding boxes. The spec requires
54
                support for bounding boxes but neither Blink nor Gecko
55
                implement them.
56
        (WebCore::Style::BuilderConverter::convertBasicShapeGeometryBox):
57
                Simple renaming to reflect the behavior instead of the
58
                property.
59
        (WebCore::Style::BuilderConverter::convertClipPath): Deleted.
60
1
2019-11-05  youenn fablet  <youenn@apple.com>
61
2019-11-05  youenn fablet  <youenn@apple.com>
2
62
3
        mp4 video element broken with service worker
63
        mp4 video element broken with service worker
- a/Source/WebKit/ChangeLog +14 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2019-11-05  Dirk Schulze  <krit@webkit.org>
2
3
        Support parsing, computed style and property style for offset, offset-path, offset-distance
4
        https://bugs.webkit.org/show_bug.cgi?id=203848
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The implementation of the Motion Path spec happens behind a feature flag.
9
        Expose the feature flag to the test suite.
10
11
        * Shared/WebPreferences.yaml:
12
        * WebProcess/InjectedBundle/InjectedBundle.cpp:
13
        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
14
1
2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>
15
2019-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>
2
16
3
        Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds
17
        Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds
- a/Source/WebKitLegacy/mac/ChangeLog +19 lines
Lines 1-3 a/Source/WebKitLegacy/mac/ChangeLog_sec1
1
2019-11-05  Dirk Schulze  <krit@webkit.org>
2
3
        Support parsing, computed style and property style for offset, offset-path, offset-distance
4
        https://bugs.webkit.org/show_bug.cgi?id=203848
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The implementation of the Motion Path spec happens behind a feature flag.
9
        Expose the feature flag to the test suite.
10
11
        * WebView/WebPreferenceKeysPrivate.h:
12
        * WebView/WebPreferences.mm:
13
        (+[WebPreferences initialize]):
14
        (-[WebPreferences motionEnabled]):
15
        (-[WebPreferences setMotionEnabled:]):
16
        * WebView/WebPreferencesPrivate.h:
17
        * WebView/WebView.mm:
18
        (-[WebView _preferencesChanged:]):
19
1
2019-11-04  Alex Christensen  <achristensen@webkit.org>
20
2019-11-04  Alex Christensen  <achristensen@webkit.org>
2
21
3
        REGRESSION(r243947) Epson software updater fails to install new version
22
        REGRESSION(r243947) Epson software updater fails to install new version
- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp -1 / +11 lines
Lines 4-10 a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
4
 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
4
 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5
 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
5
 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6
 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
6
 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7
 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
7
 * Copyright (C) 2013, 2019 Adobe. All rights reserved.
8
 *
8
 *
9
 * This library is free software; you can redistribute it and/or
9
 * This library is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU Lesser General Public
10
 * modify it under the terms of the GNU Lesser General Public
Lines 3006-3011 RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec2
3006
            list->append(zoomAdjustedPixelValueForLength(style.objectPosition().y(), style));
3006
            list->append(zoomAdjustedPixelValueForLength(style.objectPosition().y(), style));
3007
            return list;
3007
            return list;
3008
        }
3008
        }
3009
        case CSSPropertyOffsetPath: {
3010
            auto* basicShape = style.offsetPath();
3011
            if (!basicShape)
3012
                return cssValuePool.createIdentifierValue(CSSValueNone);
3013
            return valueForBasicShape(style, *basicShape);
3014
        }
3015
        case CSSPropertyOffsetDistance:
3016
            return cssValuePool.createValue(style.offsetDistance(), style);
3017
        case CSSPropertyOffset:
3018
            return getCSSPropertyValuesForShorthandProperties(offsetShorthand());
3009
        case CSSPropertyOpacity:
3019
        case CSSPropertyOpacity:
3010
            return cssValuePool.createValue(style.opacity(), CSSPrimitiveValue::CSS_NUMBER);
3020
            return cssValuePool.createValue(style.opacity(), CSSPrimitiveValue::CSS_NUMBER);
3011
        case CSSPropertyOrphans:
3021
        case CSSPropertyOrphans:
- a/Source/WebCore/css/CSSProperties.json -1 / +40 lines
Lines 2128-2134 a/Source/WebCore/css/CSSProperties.json_sec1
2128
                "aliases": [
2128
                "aliases": [
2129
                    "-webkit-clip-path"
2129
                    "-webkit-clip-path"
2130
                ],
2130
                ],
2131
                "converter": "ClipPath"
2131
                "converter": "BasicShapeGeometryBox"
2132
            }
2132
            }
2133
        },
2133
        },
2134
        "clip-rule": {
2134
        "clip-rule": {
Lines 3134-3139 a/Source/WebCore/css/CSSProperties.json_sec2
3134
                "url": "https://www.w3.org/TR/css3-images/#object-position"
3134
                "url": "https://www.w3.org/TR/css3-images/#object-position"
3135
            }
3135
            }
3136
        },
3136
        },
3137
        "offset": {
3138
            "codegen-properties": {
3139
                "runtime-flag": "motion",
3140
                "longhands": [
3141
                    "offset-path",
3142
                    "offset-distance"
3143
                ]
3144
            },
3145
            "specification": {
3146
                "category": "css-offset-props",
3147
                "url": "https://drafts.fxtf.org/motion-1/#offset-shorthand"
3148
            }
3149
        },
3150
        "offset-path": {
3151
            "codegen-properties": {
3152
                "runtime-flag": "motion",
3153
                "converter": "BasicShape"
3154
            },
3155
            "specification": {
3156
                "category": "css-offset-props",
3157
                "url": "https://drafts.fxtf.org/motion-1/#offset-path-property"
3158
            }
3159
        },
3160
        "offset-distance": {
3161
            "codegen-properties": {
3162
                "runtime-flag": "motion",
3163
                "converter": "Length"
3164
            },
3165
            "specification": {
3166
                "category": "css-offset-props",
3167
                "url": "https://drafts.fxtf.org/motion-1/#offset-distance-property"
3168
            }
3169
        },
3137
        "opacity": {
3170
        "opacity": {
3138
            "codegen-properties": {
3171
            "codegen-properties": {
3139
                "converter": "Opacity",
3172
                "converter": "Opacity",
Lines 7101-7106 a/Source/WebCore/css/CSSProperties.json_sec3
7101
            "longname": "CSS Lists and Counters Module",
7134
            "longname": "CSS Lists and Counters Module",
7102
            "url": "https://www.w3.org/TR/css-lists-3/"
7135
            "url": "https://www.w3.org/TR/css-lists-3/"
7103
        },
7136
        },
7137
        "css-offset-props": {
7138
            "shortname": "Motion Path",
7139
            "longname": "Motion Path Module",
7140
            "url": "https://drafts.fxtf.org/motion-1/",
7141
            "status": "experimental"
7142
        },
7104
        "css-logical-props": {
7143
        "css-logical-props": {
7105
            "shortname": "CSS Logical Properties",
7144
            "shortname": "CSS Logical Properties",
7106
            "longname": "CSS Logical Properties Module",
7145
            "longname": "CSS Logical Properties Module",
- a/Source/WebCore/css/StyleProperties.cpp +2 lines
Lines 255-260 String StyleProperties::getPropertyValue(CSSPropertyID propertyID) const a/Source/WebCore/css/StyleProperties.cpp_sec1
255
        return get2Values(marginInlineShorthand());
255
        return get2Values(marginInlineShorthand());
256
    case CSSPropertyWebkitMarginCollapse:
256
    case CSSPropertyWebkitMarginCollapse:
257
        return getShorthandValue(webkitMarginCollapseShorthand());
257
        return getShorthandValue(webkitMarginCollapseShorthand());
258
    case CSSPropertyOffset:
259
        return getShorthandValue(offsetShorthand());
258
    case CSSPropertyOverflow:
260
    case CSSPropertyOverflow:
259
        return get2Values(overflowShorthand());
261
        return get2Values(overflowShorthand());
260
    case CSSPropertyPadding:
262
    case CSSPropertyPadding:
- a/Source/WebCore/css/parser/CSSPropertyParser.cpp +48 lines
Lines 1-5 a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec1
1
// Copyright 2015 The Chromium Authors. All rights reserved.
1
// Copyright 2015 The Chromium Authors. All rights reserved.
2
// Copyright (C) 2016 Apple Inc. All rights reserved.
2
// Copyright (C) 2016 Apple Inc. All rights reserved.
3
// Copyright (C) 2019 Adobe. All rights reserved.
3
//
4
//
4
// Redistribution and use in source and binary forms, with or without
5
// Redistribution and use in source and binary forms, with or without
5
// modification, are permitted provided that the following conditions are
6
// modification, are permitted provided that the following conditions are
Lines 2530-2535 static RefPtr<CSSBasicShapeInset> consumeBasicShapeInset(CSSParserTokenRange& ar a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec2
2530
    return shape;
2531
    return shape;
2531
}
2532
}
2532
2533
2534
static RefPtr<CSSValue> consumePathShapeOrNone(CSSParserTokenRange& range)
2535
{
2536
    if (range.peek().id() == CSSValueNone)
2537
        return consumeIdent(range);
2538
    if (range.peek().type() != FunctionToken)
2539
        return nullptr;
2540
    CSSValueID id = range.peek().functionId();
2541
    CSSParserTokenRange rangeCopy = range;
2542
    CSSParserTokenRange args = consumeFunction(rangeCopy);
2543
2544
    // FIXME-NEWPARSER: CSSBasicShape should be a CSSValue, and shapes should not be primitive values.
2545
    RefPtr<CSSBasicShape> shape;
2546
    if (id == CSSValuePath)
2547
        shape = consumeBasicShapePath(args);
2548
    if (!shape)
2549
        return nullptr;
2550
    range = rangeCopy;
2551
    
2552
    if (!args.atEnd())
2553
        return nullptr;
2554
2555
    return CSSValuePool::singleton().createValue(shape.releaseNonNull());
2556
}
2557
2533
static RefPtr<CSSValue> consumeBasicShape(CSSParserTokenRange& range, const CSSParserContext& context)
2558
static RefPtr<CSSValue> consumeBasicShape(CSSParserTokenRange& range, const CSSParserContext& context)
2534
{
2559
{
2535
    RefPtr<CSSValue> result;
2560
    RefPtr<CSSValue> result;
Lines 3930-3935 RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec3
3930
#endif
3955
#endif
3931
    case CSSPropertyObjectPosition:
3956
    case CSSPropertyObjectPosition:
3932
        return consumePosition(m_range, m_context.mode, UnitlessQuirk::Forbid, PositionSyntax::Position);
3957
        return consumePosition(m_range, m_context.mode, UnitlessQuirk::Forbid, PositionSyntax::Position);
3958
    case CSSPropertyOffsetPath:
3959
        // Only support none | path() initially like Blink.
3960
        return consumePathShapeOrNone(m_range);
3961
    case CSSPropertyOffsetDistance:
3962
        return consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
3933
    case CSSPropertyWebkitLineClamp:
3963
    case CSSPropertyWebkitLineClamp:
3934
        return consumeLineClamp(m_range);
3964
        return consumeLineClamp(m_range);
3935
    case CSSPropertyWebkitFontSizeDelta:
3965
    case CSSPropertyWebkitFontSizeDelta:
Lines 5444-5449 static RefPtr<CSSValue> consumeImplicitGridAutoFlow(CSSParserTokenRange& range, a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec4
5444
    return list;
5474
    return list;
5445
}
5475
}
5446
5476
5477
bool CSSPropertyParser::consumeOffsetShorthand(bool important)
5478
{
5479
    RefPtr<CSSValue> path = consumePathShapeOrNone(m_range);
5480
    if (!path)
5481
        return false;
5482
5483
    RefPtr<CSSValue> distance = consumeLengthOrPercent(m_range, m_context.mode, ValueRangeNonNegative);
5484
    if (!distance)
5485
        distance = CSSValuePool::singleton().createImplicitInitialValue();
5486
5487
    addProperty(CSSPropertyOffsetPath, CSSPropertyOffset, path.releaseNonNull(), important);
5488
    addProperty(CSSPropertyOffsetDistance, CSSPropertyOffset, distance.releaseNonNull(), important);
5489
5490
    return m_range.atEnd();
5491
}
5492
5447
bool CSSPropertyParser::consumeGridShorthand(bool important)
5493
bool CSSPropertyParser::consumeGridShorthand(bool important)
5448
{
5494
{
5449
    ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 6);
5495
    ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 6);
Lines 5833-5838 bool CSSPropertyParser::parseShorthand(CSSPropertyID property, bool important) a/Source/WebCore/css/parser/CSSPropertyParser.cpp_sec5
5833
        return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
5879
        return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
5834
    case CSSPropertyGrid:
5880
    case CSSPropertyGrid:
5835
        return consumeGridShorthand(important);
5881
        return consumeGridShorthand(important);
5882
    case CSSPropertyOffset:
5883
        return consumeOffsetShorthand(important);
5836
    case CSSPropertyPlaceContent:
5884
    case CSSPropertyPlaceContent:
5837
        return consumePlaceContentShorthand(important);
5885
        return consumePlaceContentShorthand(important);
5838
    case CSSPropertyPlaceItems:
5886
    case CSSPropertyPlaceItems:
- a/Source/WebCore/css/parser/CSSPropertyParser.h +2 lines
Lines 92-97 private: a/Source/WebCore/css/parser/CSSPropertyParser.h_sec1
92
    bool consumeGridShorthand(bool important);
92
    bool consumeGridShorthand(bool important);
93
    bool consumeGridAreaShorthand(bool important);
93
    bool consumeGridAreaShorthand(bool important);
94
94
95
    bool consumeOffsetShorthand(bool important);
96
95
    bool consumePlaceContentShorthand(bool important);
97
    bool consumePlaceContentShorthand(bool important);
96
    bool consumePlaceItemsShorthand(bool important);
98
    bool consumePlaceItemsShorthand(bool important);
97
    bool consumePlaceSelfShorthand(bool important);
99
    bool consumePlaceSelfShorthand(bool important);
- a/Source/WebCore/page/RuntimeEnabledFeatures.h +4 lines
Lines 179-184 public: a/Source/WebCore/page/RuntimeEnabledFeatures.h_sec1
179
    void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; }
179
    void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; }
180
    bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; }
180
    bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; }
181
181
182
    void setMotionEnabled(bool isEnabled) { m_motionEnabled = isEnabled; }
183
    bool motionEnabled() const { return m_motionEnabled; }
184
182
    void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
185
    void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
183
    bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
186
    bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
184
    
187
    
Lines 434-439 private: a/Source/WebCore/page/RuntimeEnabledFeatures.h_sec2
434
    bool m_attrStyleEnabled { false };
437
    bool m_attrStyleEnabled { false };
435
    bool m_webAPIStatisticsEnabled { false };
438
    bool m_webAPIStatisticsEnabled { false };
436
    bool m_CSSCustomPropertiesAndValuesEnabled { false };
439
    bool m_CSSCustomPropertiesAndValuesEnabled { false };
440
    bool m_motionEnabled { false };
437
    bool m_pointerEventsEnabled { true };
441
    bool m_pointerEventsEnabled { true };
438
    bool m_syntheticEditingCommandsEnabled { true };
442
    bool m_syntheticEditingCommandsEnabled { true };
439
    bool m_dialogElementEnabled { false };
443
    bool m_dialogElementEnabled { false };
- a/Source/WebCore/rendering/style/RenderStyle.h +15 lines
Lines 4-9 a/Source/WebCore/rendering/style/RenderStyle.h_sec1
4
 *           (C) 2000 Dirk Mueller (mueller@kde.org)
4
 *           (C) 2000 Dirk Mueller (mueller@kde.org)
5
 * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
5
 * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
6
 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
6
 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7
 * Copyright (C) 2019 Adobe. All rights reserved.
7
 *
8
 *
8
 * This library is free software; you can redistribute it and/or
9
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Library General Public
10
 * modify it under the terms of the GNU Library General Public
Lines 643-648 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec2
643
    ObjectFit objectFit() const { return static_cast<ObjectFit>(m_rareNonInheritedData->objectFit); }
644
    ObjectFit objectFit() const { return static_cast<ObjectFit>(m_rareNonInheritedData->objectFit); }
644
    LengthPoint objectPosition() const { return m_rareNonInheritedData->objectPosition; }
645
    LengthPoint objectPosition() const { return m_rareNonInheritedData->objectPosition; }
645
646
647
    BasicShape* offsetPath() const { return m_rareNonInheritedData->offsetPath.get(); }
648
    const Length& offsetDistance() const { return m_rareNonInheritedData->offsetDistance; }
649
646
    // Return true if any transform related property (currently transform, transformStyle3D or perspective)
650
    // Return true if any transform related property (currently transform, transformStyle3D or perspective)
647
    // indicates that we are transforming.
651
    // indicates that we are transforming.
648
    bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
652
    bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
Lines 1167-1172 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec3
1167
    void setObjectFit(ObjectFit fit) { SET_VAR(m_rareNonInheritedData, objectFit, static_cast<unsigned>(fit)); }
1171
    void setObjectFit(ObjectFit fit) { SET_VAR(m_rareNonInheritedData, objectFit, static_cast<unsigned>(fit)); }
1168
    void setObjectPosition(LengthPoint&& position) { SET_VAR(m_rareNonInheritedData, objectPosition, WTFMove(position)); }
1172
    void setObjectPosition(LengthPoint&& position) { SET_VAR(m_rareNonInheritedData, objectPosition, WTFMove(position)); }
1169
1173
1174
    void setOffsetPath(RefPtr<BasicShape>&&);
1175
    void setOffsetDistance(Length&& offsetDistance) { SET_VAR(m_rareNonInheritedData, offsetDistance, WTFMove(offsetDistance)); }
1176
1170
    void setRubyPosition(RubyPosition position) { SET_VAR(m_rareInheritedData, rubyPosition, static_cast<unsigned>(position)); }
1177
    void setRubyPosition(RubyPosition position) { SET_VAR(m_rareInheritedData, rubyPosition, static_cast<unsigned>(position)); }
1171
1178
1172
#if ENABLE(DARK_MODE_CSS)
1179
#if ENABLE(DARK_MODE_CSS)
Lines 1468-1473 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec4
1468
    static TextOrientation initialTextOrientation() { return TextOrientation::Mixed; }
1475
    static TextOrientation initialTextOrientation() { return TextOrientation::Mixed; }
1469
    static ObjectFit initialObjectFit() { return ObjectFit::Fill; }
1476
    static ObjectFit initialObjectFit() { return ObjectFit::Fill; }
1470
    static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
1477
    static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
1478
    static BasicShape* initialOffsetPath() { return nullptr; }
1479
    static Length initialOffsetDistance() { return Length(0, Fixed); }
1471
    static EmptyCell initialEmptyCells() { return EmptyCell::Show; }
1480
    static EmptyCell initialEmptyCells() { return EmptyCell::Show; }
1472
    static ListStylePosition initialListStylePosition() { return ListStylePosition::Outside; }
1481
    static ListStylePosition initialListStylePosition() { return ListStylePosition::Outside; }
1473
    static ListStyleType initialListStyleType() { return ListStyleType::Disc; }
1482
    static ListStyleType initialListStyleType() { return ListStyleType::Disc; }
Lines 2202-2207 inline void RenderStyle::setClipPath(RefPtr<ClipPathOperation>&& operation) a/Source/WebCore/rendering/style/RenderStyle.h_sec5
2202
        m_rareNonInheritedData.access().clipPath = WTFMove(operation);
2211
        m_rareNonInheritedData.access().clipPath = WTFMove(operation);
2203
}
2212
}
2204
2213
2214
inline void RenderStyle::setOffsetPath(RefPtr<BasicShape>&& basicShape)
2215
{
2216
    if (m_rareNonInheritedData->offsetPath != basicShape)
2217
        m_rareNonInheritedData.access().offsetPath = WTFMove(basicShape);
2218
}
2219
2205
inline bool RenderStyle::willChangeCreatesStackingContext() const
2220
inline bool RenderStyle::willChangeCreatesStackingContext() const
2206
{
2221
{
2207
    return willChange() && willChange()->canCreateStackingContext();
2222
    return willChange() && willChange()->canCreateStackingContext();
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp +6 lines
Lines 66-71 StyleRareNonInheritedData::StyleRareNonInheritedData() a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec1
66
    , mask(FillLayerType::Mask)
66
    , mask(FillLayerType::Mask)
67
    , maskBoxImage(NinePieceImage::Type::Mask)
67
    , maskBoxImage(NinePieceImage::Type::Mask)
68
    , objectPosition(RenderStyle::initialObjectPosition())
68
    , objectPosition(RenderStyle::initialObjectPosition())
69
    , offsetPath(RenderStyle::initialOffsetPath())
70
    , offsetDistance(RenderStyle::initialOffsetDistance())
69
    , shapeOutside(RenderStyle::initialShapeOutside())
71
    , shapeOutside(RenderStyle::initialShapeOutside())
70
    , shapeMargin(RenderStyle::initialShapeMargin())
72
    , shapeMargin(RenderStyle::initialShapeMargin())
71
    , shapeImageThreshold(RenderStyle::initialShapeImageThreshold())
73
    , shapeImageThreshold(RenderStyle::initialShapeImageThreshold())
Lines 151-156 inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec2
151
    , maskBoxImage(o.maskBoxImage)
153
    , maskBoxImage(o.maskBoxImage)
152
    , pageSize(o.pageSize)
154
    , pageSize(o.pageSize)
153
    , objectPosition(o.objectPosition)
155
    , objectPosition(o.objectPosition)
156
    , offsetPath(o.offsetPath)
157
    , offsetDistance(o.offsetDistance)
154
    , shapeOutside(o.shapeOutside)
158
    , shapeOutside(o.shapeOutside)
155
    , shapeMargin(o.shapeMargin)
159
    , shapeMargin(o.shapeMargin)
156
    , shapeImageThreshold(o.shapeImageThreshold)
160
    , shapeImageThreshold(o.shapeImageThreshold)
Lines 251-256 bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c a/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp_sec3
251
        && maskBoxImage == o.maskBoxImage
255
        && maskBoxImage == o.maskBoxImage
252
        && pageSize == o.pageSize
256
        && pageSize == o.pageSize
253
        && objectPosition == o.objectPosition
257
        && objectPosition == o.objectPosition
258
        && arePointingToEqualData(offsetPath, o.offsetPath)
259
        && offsetDistance == o.offsetDistance
254
        && arePointingToEqualData(shapeOutside, o.shapeOutside)
260
        && arePointingToEqualData(shapeOutside, o.shapeOutside)
255
        && shapeMargin == o.shapeMargin
261
        && shapeMargin == o.shapeMargin
256
        && shapeImageThreshold == o.shapeImageThreshold
262
        && shapeImageThreshold == o.shapeImageThreshold
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h +3 lines
Lines 144-149 public: a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h_sec1
144
    LengthSize pageSize;
144
    LengthSize pageSize;
145
    LengthPoint objectPosition;
145
    LengthPoint objectPosition;
146
146
147
    RefPtr<BasicShape> offsetPath;
148
    Length offsetDistance;
149
147
    RefPtr<ShapeValue> shapeOutside;
150
    RefPtr<ShapeValue> shapeOutside;
148
    Length shapeMargin;
151
    Length shapeMargin;
149
    float shapeImageThreshold;
152
    float shapeImageThreshold;
- a/Source/WebCore/style/StyleBuilderConverter.h -2 / +14 lines
Lines 1-6 a/Source/WebCore/style/StyleBuilderConverter.h_sec1
1
/*
1
/*
2
 * Copyright (C) 2013 Google Inc. All rights reserved.
2
 * Copyright (C) 2013 Google Inc. All rights reserved.
3
 * Copyright (C) 2014 Apple Inc. All rights reserved.
3
 * Copyright (C) 2014 Apple Inc. All rights reserved.
4
 * Copyright (C) 2019 Adobe. All rights reserved.
4
 *
5
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * modification, are permitted provided that the following conditions
Lines 90-96 public: a/Source/WebCore/style/StyleBuilderConverter.h_sec2
90
    static String convertStringOrNone(BuilderState&, const CSSValue&);
91
    static String convertStringOrNone(BuilderState&, const CSSValue&);
91
    static OptionSet<TextEmphasisPosition> convertTextEmphasisPosition(BuilderState&, const CSSValue&);
92
    static OptionSet<TextEmphasisPosition> convertTextEmphasisPosition(BuilderState&, const CSSValue&);
92
    static TextAlignMode convertTextAlign(BuilderState&, const CSSValue&);
93
    static TextAlignMode convertTextAlign(BuilderState&, const CSSValue&);
93
    static RefPtr<ClipPathOperation> convertClipPath(BuilderState&, const CSSValue&);
94
    static RefPtr<BasicShape> convertBasicShape(BuilderState&, const CSSValue&);
95
    static RefPtr<ClipPathOperation> convertBasicShapeGeometryBox(BuilderState&, const CSSValue&);
94
    static Resize convertResize(BuilderState&, const CSSValue&);
96
    static Resize convertResize(BuilderState&, const CSSValue&);
95
    static int convertMarqueeRepetition(BuilderState&, const CSSValue&);
97
    static int convertMarqueeRepetition(BuilderState&, const CSSValue&);
96
    static int convertMarqueeSpeed(BuilderState&, const CSSValue&);
98
    static int convertMarqueeSpeed(BuilderState&, const CSSValue&);
Lines 584-590 inline TextAlignMode BuilderConverter::convertTextAlign(BuilderState& builderSta a/Source/WebCore/style/StyleBuilderConverter.h_sec3
584
    return parentStyle.textAlign();
586
    return parentStyle.textAlign();
585
}
587
}
586
588
587
inline RefPtr<ClipPathOperation> BuilderConverter::convertClipPath(BuilderState& builderState, const CSSValue& value)
589
inline RefPtr<BasicShape> BuilderConverter::convertBasicShape(BuilderState& builderState, const CSSValue& value)
590
{
591
    if (is<CSSPrimitiveValue>(value)) {
592
        auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
593
        if (primitiveValue.isShape())
594
            return basicShapeForValue(builderState.cssToLengthConversionData(), *primitiveValue.shapeValue());
595
    }
596
    return nullptr;
597
}
598
599
inline RefPtr<ClipPathOperation> BuilderConverter::convertBasicShapeGeometryBox(BuilderState& builderState, const CSSValue& value)
588
{
600
{
589
    if (is<CSSPrimitiveValue>(value)) {
601
    if (is<CSSPrimitiveValue>(value)) {
590
        auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
602
        auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
- a/Source/WebKit/Shared/WebPreferences.yaml +8 lines
Lines 1377-1382 CSSCustomPropertiesAndValuesEnabled: a/Source/WebKit/Shared/WebPreferences.yaml_sec1
1377
  webcoreBinding: RuntimeEnabledFeatures
1377
  webcoreBinding: RuntimeEnabledFeatures
1378
  category: experimental
1378
  category: experimental
1379
1379
1380
MotionEnabled:
1381
  type: bool
1382
  defaultValue: false
1383
  humanReadableName: "CSS Offset properties"
1384
  humanReadableDescription: "Enable CSS Offset properties"
1385
  webcoreBinding: RuntimeEnabledFeatures
1386
  category: internal
1387
1380
CSSPaintingAPIEnabled:
1388
CSSPaintingAPIEnabled:
1381
  type: bool
1389
  type: bool
1382
  defaultValue: false
1390
  defaultValue: false
- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp +3 lines
Lines 258-263 void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp_sec1
258
    if (preference == "CSSCustomPropertiesAndValuesEnabled")
258
    if (preference == "CSSCustomPropertiesAndValuesEnabled")
259
        RuntimeEnabledFeatures::sharedFeatures().setCSSCustomPropertiesAndValuesEnabled(enabled);
259
        RuntimeEnabledFeatures::sharedFeatures().setCSSCustomPropertiesAndValuesEnabled(enabled);
260
260
261
    if (preference == "MotionEnabled")
262
        RuntimeEnabledFeatures::sharedFeatures().setMotionEnabled(enabled);
263
261
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
264
#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
262
    if (preference == "LayoutFormattingContextEnabled")
265
    if (preference == "LayoutFormattingContextEnabled")
263
        RuntimeEnabledFeatures::sharedFeatures().setLayoutFormattingContextEnabled(enabled);
266
        RuntimeEnabledFeatures::sharedFeatures().setLayoutFormattingContextEnabled(enabled);
- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h +1 lines
Lines 271-276 a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h_sec1
271
#define WebKitServerTimingEnabledPreferenceKey @"WebKitServerTimingEnabled"
271
#define WebKitServerTimingEnabledPreferenceKey @"WebKitServerTimingEnabled"
272
#define WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey @"WebKitSelectionAcrossShadowBoundariesEnabled"
272
#define WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey @"WebKitSelectionAcrossShadowBoundariesEnabled"
273
#define WebKitCSSLogicalEnabledPreferenceKey @"WebKitCSSLogicalEnabled"
273
#define WebKitCSSLogicalEnabledPreferenceKey @"WebKitCSSLogicalEnabled"
274
#define WebKitMotionEnabledPreferenceKey @"WebKitMotionEnabled"
274
#define WebKitAdClickAttributionEnabledPreferenceKey @"WebKitAdClickAttributionEnabled"
275
#define WebKitAdClickAttributionEnabledPreferenceKey @"WebKitAdClickAttributionEnabled"
275
#define WebKitReferrerPolicyAttributeEnabledPreferenceKey @"WebKitReferrerPolicyAttributeEnabled"
276
#define WebKitReferrerPolicyAttributeEnabledPreferenceKey @"WebKitReferrerPolicyAttributeEnabled"
276
#define WebKitResizeObserverEnabledPreferenceKey @"WebKitResizeObserverEnabled"
277
#define WebKitResizeObserverEnabledPreferenceKey @"WebKitResizeObserverEnabled"
- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm +11 lines
Lines 670-675 + (void)initialize a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec1
670
#endif
670
#endif
671
        @YES, WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
671
        @YES, WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
672
        @NO, WebKitCSSLogicalEnabledPreferenceKey,
672
        @NO, WebKitCSSLogicalEnabledPreferenceKey,
673
        @NO, WebKitMotionEnabledPreferenceKey,
673
        @NO, WebKitAdClickAttributionEnabledPreferenceKey,
674
        @NO, WebKitAdClickAttributionEnabledPreferenceKey,
674
#if ENABLE(INTERSECTION_OBSERVER)
675
#if ENABLE(INTERSECTION_OBSERVER)
675
        @NO, WebKitIntersectionObserverEnabledPreferenceKey,
676
        @NO, WebKitIntersectionObserverEnabledPreferenceKey,
Lines 3488-3493 - (void)setCSSLogicalEnabled:(BOOL)flag a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec2
3488
    [self _setBoolValue:flag forKey:WebKitCSSLogicalEnabledPreferenceKey];
3489
    [self _setBoolValue:flag forKey:WebKitCSSLogicalEnabledPreferenceKey];
3489
}
3490
}
3490
3491
3492
- (BOOL)motionEnabled
3493
{
3494
    return [self _boolValueForKey:WebKitMotionEnabledPreferenceKey];
3495
}
3496
3497
- (void)setMotionEnabled:(BOOL)flag
3498
{
3499
    [self _setBoolValue:flag forKey:WebKitMotionEnabledPreferenceKey];
3500
}
3501
3491
- (BOOL)adClickAttributionEnabled
3502
- (BOOL)adClickAttributionEnabled
3492
{
3503
{
3493
    return [self _boolValueForKey:WebKitAdClickAttributionEnabledPreferenceKey];
3504
    return [self _boolValueForKey:WebKitAdClickAttributionEnabledPreferenceKey];
- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h +3 lines
Lines 603-608 extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h_sec1
603
- (void)setCSSLogicalEnabled:(BOOL)flag;
603
- (void)setCSSLogicalEnabled:(BOOL)flag;
604
- (BOOL)cssLogicalEnabled;
604
- (BOOL)cssLogicalEnabled;
605
605
606
- (void)setMotionEnabled:(BOOL)flag;
607
- (BOOL)motionEnabled;
608
606
- (BOOL)adClickAttributionEnabled;
609
- (BOOL)adClickAttributionEnabled;
607
- (void)setAdClickAttributionEnabled:(BOOL)flag;
610
- (void)setAdClickAttributionEnabled:(BOOL)flag;
608
611
- a/Source/WebKitLegacy/mac/WebView/WebView.mm +2 lines
Lines 3117-3122 - (void)_preferencesChanged:(WebPreferences *)preferences a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec1
3117
3117
3118
    RuntimeEnabledFeatures::sharedFeatures().setCSSLogicalEnabled([preferences cssLogicalEnabled]);
3118
    RuntimeEnabledFeatures::sharedFeatures().setCSSLogicalEnabled([preferences cssLogicalEnabled]);
3119
3119
3120
    RuntimeEnabledFeatures::sharedFeatures().setMotionEnabled([preferences motionEnabled]);
3121
3120
    RuntimeEnabledFeatures::sharedFeatures().setAdClickAttributionEnabled([preferences adClickAttributionEnabled]);
3122
    RuntimeEnabledFeatures::sharedFeatures().setAdClickAttributionEnabled([preferences adClickAttributionEnabled]);
3121
3123
3122
    settings.setHiddenPageDOMTimerThrottlingEnabled([preferences hiddenPageDOMTimerThrottlingEnabled]);
3124
    settings.setHiddenPageDOMTimerThrottlingEnabled([preferences hiddenPageDOMTimerThrottlingEnabled]);
- a/Tools/ChangeLog +16 lines
Lines 1-3 a/Tools/ChangeLog_sec1
1
2019-11-05  Dirk Schulze  <krit@webkit.org>
2
3
        Support parsing, computed style and property style for offset, offset-path, offset-distance
4
        https://bugs.webkit.org/show_bug.cgi?id=203848
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        The implementation of the Motion Path spec happens behind a feature flag.
9
        Expose the feature flag to the test suite.
10
11
        * DumpRenderTree/TestOptions.cpp:
12
        (TestOptions::TestOptions):
13
        * DumpRenderTree/TestOptions.h:
14
        * DumpRenderTree/mac/DumpRenderTree.mm:
15
        (setWebPreferencesForTestOptions):
16
1
2019-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
17
2019-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2
18
3
        REGRESSION(r252031): layout tests fail to run in non apple ports after r252031
19
        REGRESSION(r252031): layout tests fail to run in non apple ports after r252031
- a/Tools/DumpRenderTree/TestOptions.cpp +2 lines
Lines 117-122 TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu a/Tools/DumpRenderTree/TestOptions.cpp_sec1
117
            enableWebGPU = parseBooleanTestHeaderValue(value);
117
            enableWebGPU = parseBooleanTestHeaderValue(value);
118
        else if (key == "internal:CSSLogicalEnabled")
118
        else if (key == "internal:CSSLogicalEnabled")
119
            enableCSSLogical = parseBooleanTestHeaderValue(value);
119
            enableCSSLogical = parseBooleanTestHeaderValue(value);
120
        else if (key == "internal:MotionEnabled")
121
            enableMotion = parseBooleanTestHeaderValue(value);
120
        else if (key == "experimental:AdClickAttributionEnabled")
122
        else if (key == "experimental:AdClickAttributionEnabled")
121
            adClickAttributionEnabled = parseBooleanTestHeaderValue(value);
123
            adClickAttributionEnabled = parseBooleanTestHeaderValue(value);
122
        else if (key == "experimental:ResizeObserverEnabled")
124
        else if (key == "experimental:ResizeObserverEnabled")
- a/Tools/DumpRenderTree/TestOptions.h +1 lines
Lines 48-53 struct TestOptions { a/Tools/DumpRenderTree/TestOptions.h_sec1
48
    bool enableSelectionAcrossShadowBoundaries { true };
48
    bool enableSelectionAcrossShadowBoundaries { true };
49
    bool enableWebGPU { false };
49
    bool enableWebGPU { false };
50
    bool enableCSSLogical { false };
50
    bool enableCSSLogical { false };
51
    bool enableMotion { false };
51
    bool adClickAttributionEnabled { false };
52
    bool adClickAttributionEnabled { false };
52
    bool enableResizeObserver { false };
53
    bool enableResizeObserver { false };
53
    bool enableCoreMathML { false };
54
    bool enableCoreMathML { false };
- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +1 lines
Lines 1025-1030 static void setWebPreferencesForTestOptions(const TestOptions& options) a/Tools/DumpRenderTree/mac/DumpRenderTree.mm_sec1
1025
    preferences.selectionAcrossShadowBoundariesEnabled = options.enableSelectionAcrossShadowBoundaries;
1025
    preferences.selectionAcrossShadowBoundariesEnabled = options.enableSelectionAcrossShadowBoundaries;
1026
    preferences.webGPUEnabled = options.enableWebGPU;
1026
    preferences.webGPUEnabled = options.enableWebGPU;
1027
    preferences.CSSLogicalEnabled = options.enableCSSLogical;
1027
    preferences.CSSLogicalEnabled = options.enableCSSLogical;
1028
    preferences.MotionEnabled = options.enableMotion;
1028
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1029
    preferences.adClickAttributionEnabled = options.adClickAttributionEnabled;
1029
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1030
    preferences.resizeObserverEnabled = options.enableResizeObserver;
1030
    preferences.coreMathMLEnabled = options.enableCoreMathML;
1031
    preferences.coreMathMLEnabled = options.enableCoreMathML;
- a/LayoutTests/ChangeLog +19 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2019-11-05  Dirk Schulze  <krit@webkit.org>
2
3
        Support parsing, computed style and property style for offset, offset-path, offset-distance
4
        https://bugs.webkit.org/show_bug.cgi?id=203848
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add tests for parsing, computed style and property style for the
9
        properties: offset, offset-path, offset-distance.
10
11
        * fast/css/offset/parsing-offset-distance-expected.txt: Added.
12
        * fast/css/offset/parsing-offset-distance.html: Added.
13
        * fast/css/offset/parsing-offset-expected.txt: Added.
14
        * fast/css/offset/parsing-offset-path-expected.txt: Added.
15
        * fast/css/offset/parsing-offset-path.html: Added.
16
        * fast/css/offset/parsing-offset.html: Added.
17
        * webexposed/css-properties-behind-flags-expected.txt:
18
        * webexposed/css-properties-behind-flags.html:
19
1
2019-11-05  youenn fablet  <youenn@apple.com>
20
2019-11-05  youenn fablet  <youenn@apple.com>
2
21
3
        mp4 video element broken with service worker
22
        mp4 video element broken with service worker
- a/LayoutTests/fast/css/offset/parsing-offset-distance-expected.txt +37 lines
Line 0 a/LayoutTests/fast/css/offset/parsing-offset-distance-expected.txt_sec1
1
Test parsing and computed style of offset-distance
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS innerStyle("offset-distance", "0") is "0px"
7
PASS innerStyle("offset-distance", "20px") is "20px"
8
PASS innerStyle("offset-distance", "20%") is "20%"
9
PASS innerStyle("offset-distance", "2e1%") is "20%"
10
PASS innerStyle("offset-distance", "200e-1px") is "20px"
11
PASS computedStyle("offset-distance", "0") is "0px"
12
PASS computedStyle("offset-distance", "20px") is "20px"
13
PASS computedStyle("offset-distance", "20%") is "20%"
14
PASS computedStyle("offset-distance", "2e1%") is "20%"
15
PASS computedStyle("offset-distance", "200e-1px") is "20px"
16
PASS innerStyle("offset-distance", "path('M0 0') 20px") is ""
17
PASS computedStyle("offset-distance", "path('M0 0') 20px") is "0px"
18
PASS innerStyle("offset-distance", "20px path('M0 0')") is ""
19
PASS computedStyle("offset-distance", "20px path('M0 0')") is "0px"
20
PASS innerStyle("offset-distance", "auto") is ""
21
PASS computedStyle("offset-distance", "auto") is "0px"
22
PASS innerStyle("offset-distance", "auto") is ""
23
PASS computedStyle("offset-distance", "auto") is "0px"
24
PASS innerStyle("offset-distance", "-20px") is ""
25
PASS computedStyle("offset-distance", "-20px") is "0px"
26
PASS innerStyle("offset-distance", "-20%") is ""
27
PASS computedStyle("offset-distance", "-20%") is "0px"
28
PASS innerStyle("offset-distance", "'str'") is ""
29
PASS computedStyle("offset-distance", "'str'") is "0px"
30
PASS innerStyle("offset-distance", "top left") is ""
31
PASS computedStyle("offset-distance", "top left") is "0px"
32
PASS innerStyle("offset-distance", "path('M100 100 200 200 0 200 z')") is ""
33
PASS computedStyle("offset-distance", "path('M100 100 200 200 0 200 z')") is "0px"
34
PASS successfullyParsed is true
35
36
TEST COMPLETE
37
- a/LayoutTests/fast/css/offset/parsing-offset-distance.html +70 lines
Line 0 a/LayoutTests/fast/css/offset/parsing-offset-distance.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ internal:MotionEnabled=true ] -->
2
<html>
3
<style>
4
* { font-size: 16px; }
5
div { font-size: 8px; }
6
</style>
7
<body>
8
<script src="../../../resources/js-test-pre.js"></script>
9
<script>
10
description('Test parsing and computed style of offset-distance');
11
12
function computedStyle(property, value) {
13
    var div = document.createElement("div");
14
    document.body.appendChild(div);
15
    div.style.setProperty(property, value);
16
    var computedValue = getComputedStyle(div).getPropertyValue(property);
17
    document.body.removeChild(div);
18
    return computedValue;
19
}
20
21
function innerStyle(property, value) {
22
    var div = document.createElement("div");
23
    div.style.setProperty(property, value);
24
    return div.style.getPropertyValue(property);
25
}
26
27
function testComputed(property, value, expected) {
28
    shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
29
}
30
31
function testInner(property, value, expected) {
32
    if (expected === null)
33
        expected = "";
34
    shouldBeEqualToString('innerStyle("' + property + '", "' + value + '")', expected);
35
}
36
37
function negativeTest(property, value) {
38
    testInner(property, value, null);
39
    testComputed(property, value, '0px');
40
}
41
42
// Property style
43
testInner("offset-distance", "0", "0px");
44
testInner("offset-distance", "20px", "20px");
45
testInner("offset-distance", "20%", "20%");
46
testInner("offset-distance", "2e1%", "20%");
47
testInner("offset-distance", "200e-1px", "20px");
48
49
// Computed style
50
testComputed("offset-distance", "0", "0px");
51
testComputed("offset-distance", "20px", "20px");
52
testComputed("offset-distance", "20%", "20%");
53
testComputed("offset-distance", "2e1%", "20%");
54
testComputed("offset-distance", "200e-1px", "20px");
55
56
// invalid
57
negativeTest("offset-distance", "path('M0 0') 20px");
58
negativeTest("offset-distance", "20px path('M0 0')");
59
negativeTest("offset-distance", "auto");
60
negativeTest("offset-distance", "auto");
61
negativeTest("offset-distance", "-20px");
62
negativeTest("offset-distance", "-20%");
63
negativeTest("offset-distance", "'str'");
64
negativeTest("offset-distance", "top left");
65
negativeTest("offset-distance", "path('M100 100 200 200 0 200 z')");
66
67
</script>
68
<script src="../../../resources/js-test-post.js"></script>
69
</body>
70
</html>
- a/LayoutTests/fast/css/offset/parsing-offset-expected.txt +39 lines
Line 0 a/LayoutTests/fast/css/offset/parsing-offset-expected.txt_sec1
1
Test parsing and computed style of offset
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS innerStyle("offset", "none") is "none"
7
PASS innerStyle("offset", "path('M0 0 L 100 0 L 100 100z')") is "path(\"M 0 0 L 100 0 L 100 100 Z\")"
8
PASS innerStyle("offset", "path('M0 0 L 100 0 L 100 100')") is "path(\"M 0 0 L 100 0 L 100 100\")"
9
PASS innerStyle("offset", "path('M0 0')") is "path(\"M 0 0\")"
10
PASS innerStyle("offset", "path('M0 0 L 100 0 L 100 100z') 20px") is "path(\"M 0 0 L 100 0 L 100 100 Z\") 20px"
11
PASS computedStyle("offset", "none") is "none 0px"
12
PASS computedStyle("offset", "path('M0 0 L 100 0 L 100 100z') 20px") is "path(\"M 0 0 L 100 0 L 100 100 Z\") 20px"
13
PASS computedStyle("offset", "path('M0 0 L 100 0 L 100 100z')") is "path(\"M 0 0 L 100 0 L 100 100 Z\") 0px"
14
PASS computedStyle("offset", "path('M0 0 L 100 0 L 100 100')") is "path(\"M 0 0 L 100 0 L 100 100\") 0px"
15
PASS computedStyle("offset", "path('M0 0')") is "path(\"M 0 0\") 0px"
16
PASS innerStyle("offset", "0") is ""
17
PASS computedStyle("offset", "0") is "none 0px"
18
PASS innerStyle("offset", "20px") is ""
19
PASS computedStyle("offset", "20px") is "none 0px"
20
PASS innerStyle("offset", "20%") is ""
21
PASS computedStyle("offset", "20%") is "none 0px"
22
PASS innerStyle("offset", "-20px") is ""
23
PASS computedStyle("offset", "-20px") is "none 0px"
24
PASS innerStyle("offset", "-20%") is ""
25
PASS computedStyle("offset", "-20%") is "none 0px"
26
PASS innerStyle("offset", "2e1%") is ""
27
PASS computedStyle("offset", "2e1%") is "none 0px"
28
PASS innerStyle("offset", "2e1%") is ""
29
PASS computedStyle("offset", "2e1%") is "none 0px"
30
PASS innerStyle("offset", "200e-1px") is ""
31
PASS computedStyle("offset", "200e-1px") is "none 0px"
32
PASS innerStyle("offset", "path('M0 0') nonsense") is ""
33
PASS computedStyle("offset", "path('M0 0') nonsense") is "none 0px"
34
PASS innerStyle("offset", "20px path('M0 0 L 100 0 L 100 100z')") is ""
35
PASS computedStyle("offset", "20px path('M0 0 L 100 0 L 100 100z')") is "none 0px"
36
PASS successfullyParsed is true
37
38
TEST COMPLETE
39
- a/LayoutTests/fast/css/offset/parsing-offset-path-expected.txt +43 lines
Line 0 a/LayoutTests/fast/css/offset/parsing-offset-path-expected.txt_sec1
1
Test parsing and computed style of offset-path
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS innerStyle("offset-path", "none") is "none"
7
PASS innerStyle("offset-path", "path('M0 0 L 100 0 L 100 100z')") is "path(\"M 0 0 L 100 0 L 100 100 Z\")"
8
PASS innerStyle("offset-path", "path('M0 0 L 100 0 L 100 100')") is "path(\"M 0 0 L 100 0 L 100 100\")"
9
PASS innerStyle("offset-path", "path('M0 0')") is "path(\"M 0 0\")"
10
PASS computedStyle("offset-path", "none") is "none"
11
PASS computedStyle("offset-path", "path('M0 0 L 100 0 L 100 100z')") is "path(\"M 0 0 L 100 0 L 100 100 Z\")"
12
PASS computedStyle("offset-path", "path('M0 0 L 100 0 L 100 100')") is "path(\"M 0 0 L 100 0 L 100 100\")"
13
PASS computedStyle("offset-path", "path('M0 0')") is "path(\"M 0 0\")"
14
PASS innerStyle("offset-path", "auto") is ""
15
PASS computedStyle("offset-path", "auto") is "none"
16
PASS innerStyle("offset-path", "path()") is ""
17
PASS computedStyle("offset-path", "path()") is "none"
18
PASS innerStyle("offset-path", "path('M0 0') none") is ""
19
PASS computedStyle("offset-path", "path('M0 0') none") is "none"
20
PASS innerStyle("offset-path", "none path('M0 0')") is ""
21
PASS computedStyle("offset-path", "none path('M0 0')") is "none"
22
PASS innerStyle("offset-path", "path('M0 0') path('M0 0')") is ""
23
PASS computedStyle("offset-path", "path('M0 0') path('M0 0')") is "none"
24
PASS innerStyle("offset-path", "none none") is ""
25
PASS computedStyle("offset-path", "none none") is "none"
26
PASS innerStyle("offset-path", "path('M0 0') 20px") is ""
27
PASS computedStyle("offset-path", "path('M0 0') 20px") is "none"
28
PASS innerStyle("offset-path", "path('M0 0') 20%") is ""
29
PASS computedStyle("offset-path", "path('M0 0') 20%") is "none"
30
PASS innerStyle("offset-path", "url(#shape)") is ""
31
PASS computedStyle("offset-path", "url(#shape)") is "none"
32
PASS innerStyle("offset-path", "circle()") is ""
33
PASS computedStyle("offset-path", "circle()") is "none"
34
PASS innerStyle("offset-path", "ellipse()") is ""
35
PASS computedStyle("offset-path", "ellipse()") is "none"
36
PASS innerStyle("offset-path", "inset()") is ""
37
PASS computedStyle("offset-path", "inset()") is "none"
38
PASS innerStyle("offset-path", "rectangle()") is ""
39
PASS computedStyle("offset-path", "rectangle()") is "none"
40
PASS successfullyParsed is true
41
42
TEST COMPLETE
43
- a/LayoutTests/fast/css/offset/parsing-offset-path.html +74 lines
Line 0 a/LayoutTests/fast/css/offset/parsing-offset-path.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ internal:MotionEnabled=true ] -->
2
<html>
3
<style>
4
* { font-size: 16px; }
5
div { font-size: 8px; }
6
</style>
7
<body>
8
<script src="../../../resources/js-test-pre.js"></script>
9
<script>
10
description('Test parsing and computed style of offset-path');
11
12
function computedStyle(property, value) {
13
    var div = document.createElement("div");
14
    document.body.appendChild(div);
15
    div.style.setProperty(property, value);
16
    var computedValue = getComputedStyle(div).getPropertyValue(property);
17
    document.body.removeChild(div);
18
    return computedValue;
19
}
20
21
function innerStyle(property, value) {
22
    var div = document.createElement("div");
23
    div.style.setProperty(property, value);
24
    return div.style.getPropertyValue(property);
25
}
26
27
function testComputed(property, value, expected) {
28
    shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
29
}
30
31
function testInner(property, value, expected) {
32
    if (expected === null)
33
        expected = "";
34
    shouldBeEqualToString('innerStyle("' + property + '", "' + value + '")', expected);
35
}
36
37
function negativeTest(property, value) {
38
    testInner(property, value, null);
39
    testComputed(property, value, 'none');
40
}
41
42
// Property style
43
testInner("offset-path", "none", "none");
44
testInner("offset-path", "path('M0 0 L 100 0 L 100 100z')", "path(\"M 0 0 L 100 0 L 100 100 Z\")");
45
testInner("offset-path", "path('M0 0 L 100 0 L 100 100')", "path(\"M 0 0 L 100 0 L 100 100\")");
46
testInner("offset-path", "path('M0 0')", "path(\"M 0 0\")");
47
48
// Computed style
49
testComputed("offset-path", "none", "none");
50
testComputed("offset-path", "path('M0 0 L 100 0 L 100 100z')", "path(\"M 0 0 L 100 0 L 100 100 Z\")");
51
testComputed("offset-path", "path('M0 0 L 100 0 L 100 100')", "path(\"M 0 0 L 100 0 L 100 100\")");
52
testComputed("offset-path", "path('M0 0')", "path(\"M 0 0\")");
53
54
55
// invalid
56
negativeTest("offset-path", "auto");
57
negativeTest("offset-path", "path()");
58
negativeTest("offset-path", "path('M0 0') none");
59
negativeTest("offset-path", "none path('M0 0')");
60
negativeTest("offset-path", "path('M0 0') path('M0 0')");
61
negativeTest("offset-path", "none none");
62
negativeTest("offset-path", "path('M0 0') 20px");
63
negativeTest("offset-path", "path('M0 0') 20%");
64
// May get valid in the future.
65
negativeTest("offset-path", "url(#shape)");
66
negativeTest("offset-path", "circle()");
67
negativeTest("offset-path", "ellipse()");
68
negativeTest("offset-path", "inset()");
69
negativeTest("offset-path", "rectangle()");
70
71
</script>
72
<script src="../../../resources/js-test-post.js"></script>
73
</body>
74
</html>
- a/LayoutTests/fast/css/offset/parsing-offset.html +71 lines
Line 0 a/LayoutTests/fast/css/offset/parsing-offset.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ internal:MotionEnabled=true ] -->
2
<html>
3
<style>
4
* { font-size: 16px; }
5
div { font-size: 8px; }
6
</style>
7
<body>
8
<script src="../../../resources/js-test-pre.js"></script>
9
<script>
10
description('Test parsing and computed style of offset');
11
12
function computedStyle(property, value) {
13
    var div = document.createElement("div");
14
    document.body.appendChild(div);
15
    div.style.setProperty(property, value);
16
    var computedValue = getComputedStyle(div).getPropertyValue(property);
17
    document.body.removeChild(div);
18
    return computedValue;
19
}
20
21
function innerStyle(property, value) {
22
    var div = document.createElement("div");
23
    div.style.setProperty(property, value);
24
    return div.style.getPropertyValue(property);
25
}
26
27
function testComputed(property, value, expected) {
28
    shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
29
}
30
31
function testInner(property, value, expected) {
32
    if (expected === null)
33
        expected = "";
34
    shouldBeEqualToString('innerStyle("' + property + '", "' + value + '")', expected);
35
}
36
37
function negativeTest(property, value) {
38
    testInner(property, value, null);
39
    testComputed(property, value, 'none 0px');
40
}
41
42
43
testInner("offset", "none", "none");
44
testInner("offset", "path('M0 0 L 100 0 L 100 100z')", "path(\"M 0 0 L 100 0 L 100 100 Z\")");
45
testInner("offset", "path('M0 0 L 100 0 L 100 100')", "path(\"M 0 0 L 100 0 L 100 100\")");
46
testInner("offset", "path('M0 0')", "path(\"M 0 0\")");
47
testInner("offset", "path('M0 0 L 100 0 L 100 100z') 20px", "path(\"M 0 0 L 100 0 L 100 100 Z\") 20px");
48
49
// Computed style
50
testComputed("offset", "none", "none 0px");
51
testComputed("offset", "path('M0 0 L 100 0 L 100 100z') 20px", "path(\"M 0 0 L 100 0 L 100 100 Z\") 20px");
52
testComputed("offset", "path('M0 0 L 100 0 L 100 100z')", "path(\"M 0 0 L 100 0 L 100 100 Z\") 0px");
53
testComputed("offset", "path('M0 0 L 100 0 L 100 100')", "path(\"M 0 0 L 100 0 L 100 100\") 0px");
54
testComputed("offset", "path('M0 0')", "path(\"M 0 0\") 0px");
55
56
// invalid style
57
negativeTest("offset", "0");
58
negativeTest("offset", "20px");
59
negativeTest("offset", "20%");
60
negativeTest("offset", "-20px");
61
negativeTest("offset", "-20%");
62
negativeTest("offset", "2e1%");
63
negativeTest("offset", "2e1%");
64
negativeTest("offset", "200e-1px");
65
negativeTest("offset", "path('M0 0') nonsense");
66
negativeTest("offset", "20px path('M0 0 L 100 0 L 100 100z')");
67
68
</script>
69
<script src="../../../resources/js-test-post.js"></script>
70
</body>
71
</html>
- a/LayoutTests/webexposed/css-properties-behind-flags-expected.txt +3 lines
Lines 18-21 PASS margin-block is not exposed a/LayoutTests/webexposed/css-properties-behind-flags-expected.txt_sec1
18
PASS margin-inline is not exposed 
18
PASS margin-inline is not exposed 
19
PASS padding-block is not exposed 
19
PASS padding-block is not exposed 
20
PASS padding-inline is not exposed 
20
PASS padding-inline is not exposed 
21
PASS offset is not exposed 
22
PASS offset-path is not exposed 
23
PASS offset-distance is not exposed 
21
24
- a/LayoutTests/webexposed/css-properties-behind-flags.html +3 lines
Lines 23-28 let hiddenProperties = [ a/LayoutTests/webexposed/css-properties-behind-flags.html_sec1
23
    "margin-inline",
23
    "margin-inline",
24
    "padding-block",
24
    "padding-block",
25
    "padding-inline",
25
    "padding-inline",
26
    "offset",
27
    "offset-path",
28
    "offset-distance",
26
];
29
];
27
let element = document.getElementById("test");
30
let element = document.getElementById("test");
28
let {style} = element;
31
let {style} = element;

Return to Bug 203848