| Differences between
and this patch
- a/Source/WebCore/ChangeLog +44 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2021-12-22  Megan Gardner  <megan_gardner@apple.com>
2
3
        Remove unneeded webkit specific CSS attribute for Image Control Menu.
4
        https://bugs.webkit.org/show_bug.cgi?id=234405
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Test: fast/images/mac/image-controls-basic.html
9
10
        * css/CSSPrimitiveValueMappings.h:
11
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
12
        * css/CSSProperties.json:
13
        * css/CSSValueKeywords.in:
14
        * css/parser/CSSParserIdioms.cpp:
15
        (WebCore::isValueAllowedInMode):
16
        * dom/mac/ImageControlsMac.cpp:
17
        (WebCore::ImageControlsMac::isInsideImageControls):
18
        * dom/mac/ImageControlsMac.h:
19
        * html/HTMLImageElement.cpp:
20
        (WebCore::HTMLImageElement::parseAttribute):
21
        (WebCore::HTMLImageElement::setAttachmentElement):
22
        (WebCore::HTMLImageElement::updateImageControls):
23
        * html/HTMLImageElement.h:
24
        * html/shadow/mac/imageControlsMac.css:
25
        (div#image-controls button#image-controls-button):
26
        * platform/ThemeTypes.h:
27
        * rendering/HitTestResult.cpp:
28
        (WebCore::HitTestResult::nodeForImageData const):
29
        * rendering/RenderTheme.cpp:
30
        (WebCore::RenderTheme::autoAppearanceForElement const):
31
        * rendering/RenderTheme.h:
32
        (WebCore::RenderTheme::isImageControl const):
33
        * rendering/RenderThemeMac.h:
34
        * rendering/RenderThemeMac.mm:
35
        (WebCore::RenderThemeMac::isImageControl const):
36
        * rendering/style/RenderStyle.h:
37
        (WebCore::RenderStyle::setAppearance):
38
        (WebCore::RenderStyle::setEffectiveAppearance):
39
        * rendering/style/StyleRareNonInheritedData.h:
40
        * testing/Internals.cpp:
41
        (WebCore::Internals::hasImageControls const):
42
        * testing/Internals.h:
43
        * testing/Internals.idl:
44
1
2021-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
45
2021-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2
46
3
        Adopt ChromeClient::classifyModalContainerControls() in ModalContainerObserver
47
        Adopt ChromeClient::classifyModalContainerControls() in ModalContainerObserver
- a/Source/WebCore/css/CSSPrimitiveValueMappings.h -1 / +2 lines
Lines 634-640 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e) a/Source/WebCore/css/CSSPrimitiveValueMappings.h_sec1
634
#endif
634
#endif
635
#if ENABLE(SERVICE_CONTROLS)
635
#if ENABLE(SERVICE_CONTROLS)
636
    case ImageControlsButtonPart:
636
    case ImageControlsButtonPart:
637
        m_value.valueID = CSSValueInternalImageControlsButton;
637
        ASSERT_NOT_REACHED();
638
        m_value.valueID = CSSValueNone;
638
        break;
639
        break;
639
#endif
640
#endif
640
#if ENABLE(APPLE_PAY)
641
#if ENABLE(APPLE_PAY)
- a/Source/WebCore/css/CSSProperties.json -1 lines
Lines 5177-5183 a/Source/WebCore/css/CSSProperties.json_sec1
5177
                "continuous-capacity-level-indicator",
5177
                "continuous-capacity-level-indicator",
5178
                "discrete-capacity-level-indicator",
5178
                "discrete-capacity-level-indicator",
5179
                "rating-level-indicator",
5179
                "rating-level-indicator",
5180
                "-internal-image-controls-button",
5181
                "-apple-pay-button",
5180
                "-apple-pay-button",
5182
                "textarea",
5181
                "textarea",
5183
                "attachment",
5182
                "attachment",
- a/Source/WebCore/css/CSSValueKeywords.in -3 lines
Lines 890-898 relevancy-level-indicator a/Source/WebCore/css/CSSValueKeywords.in_sec1
890
continuous-capacity-level-indicator
890
continuous-capacity-level-indicator
891
discrete-capacity-level-indicator
891
discrete-capacity-level-indicator
892
rating-level-indicator
892
rating-level-indicator
893
#if defined(ENABLE_SERVICE_CONTROLS) && ENABLE_SERVICE_CONTROLS
894
-internal-image-controls-button
895
#endif
896
#if defined(ENABLE_APPLE_PAY) && ENABLE_APPLE_PAY
893
#if defined(ENABLE_APPLE_PAY) && ENABLE_APPLE_PAY
897
-apple-pay-button
894
-apple-pay-button
898
#endif
895
#endif
- a/Source/WebCore/css/parser/CSSParserIdioms.cpp -4 lines
Lines 40-49 bool isValueAllowedInMode(unsigned short id, CSSParserMode mode) a/Source/WebCore/css/parser/CSSParserIdioms.cpp_sec1
40
        return isUASheetBehavior(mode);
40
        return isUASheetBehavior(mode);
41
    case CSSValueWebkitFocusRingColor:
41
    case CSSValueWebkitFocusRingColor:
42
        return isUASheetBehavior(mode) || isQuirksModeBehavior(mode);
42
        return isUASheetBehavior(mode) || isQuirksModeBehavior(mode);
43
#if ENABLE(SERVICE_CONTROLS)
44
    case CSSValueInternalImageControlsButton:
45
        return isUASheetBehavior(mode);
46
#endif
47
    default:
43
    default:
48
        return true;
44
        return true;
49
    }
45
    }
- a/Source/WebCore/dom/mac/ImageControlsMac.cpp +8 lines
Lines 73-78 bool isImageControlsButtonElement(const Node& node) a/Source/WebCore/dom/mac/ImageControlsMac.cpp_sec1
73
    return is<Element>(node) && downcast<Element>(node).getIdAttribute() == imageControlsButtonIdentifier();
73
    return is<Element>(node) && downcast<Element>(node).getIdAttribute() == imageControlsButtonIdentifier();
74
}
74
}
75
75
76
bool isInsideImageControls(const Node& node)
77
{
78
    RefPtr host = node.shadowHost();
79
    if (!is<HTMLElement>(host.get()) || !hasControls(downcast<HTMLElement>(*host)))
80
        return false;
81
    return is<Element>(node) && downcast<Element>(node).getIdAttribute() == imageControlsElementIdentifier();
82
}
83
76
void createImageControls(HTMLElement& element)
84
void createImageControls(HTMLElement& element)
77
{
85
{
78
    Ref document = element.document();
86
    Ref document = element.document();
- a/Source/WebCore/dom/mac/ImageControlsMac.h +1 lines
Lines 38-43 namespace ImageControlsMac { a/Source/WebCore/dom/mac/ImageControlsMac.h_sec1
38
38
39
bool hasControls(const HTMLElement&);
39
bool hasControls(const HTMLElement&);
40
bool isImageControlsButtonElement(const Node&);
40
bool isImageControlsButtonElement(const Node&);
41
bool isInsideImageControls(const Node&);
41
void createImageControls(HTMLElement&);
42
void createImageControls(HTMLElement&);
42
bool handleEvent(HTMLElement&, Event&);
43
bool handleEvent(HTMLElement&, Event&);
43
44
- a/Source/WebCore/html/HTMLImageElement.cpp -8 / +12 lines
Lines 30-35 a/Source/WebCore/html/HTMLImageElement.cpp_sec1
30
#include "ChromeClient.h"
30
#include "ChromeClient.h"
31
#include "Editor.h"
31
#include "Editor.h"
32
#include "ElementIterator.h"
32
#include "ElementIterator.h"
33
#include "EventLoop.h"
33
#include "EventNames.h"
34
#include "EventNames.h"
34
#include "FrameView.h"
35
#include "FrameView.h"
35
#include "HTMLAnchorElement.h"
36
#include "HTMLAnchorElement.h"
Lines 313-320 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomStrin a/Source/WebCore/html/HTMLImageElement.cpp_sec2
313
        if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp))
314
        if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp))
314
            m_compositeOperator = CompositeOperator::SourceOver;
315
            m_compositeOperator = CompositeOperator::SourceOver;
315
#if ENABLE(SERVICE_CONTROLS)
316
#if ENABLE(SERVICE_CONTROLS)
316
    } else if (name == webkitimagemenuAttr) {
317
    } else if (m_imageMenuEnabled) {
317
        m_imageMenuEnabled = !value.isNull();
318
        updateImageControls();
318
        updateImageControls();
319
#endif
319
#endif
320
    } else if (name == loadingAttr) {
320
    } else if (name == loadingAttr) {
Lines 743-749 void HTMLImageElement::setAttachmentElement(Ref<HTMLAttachmentElement>&& attachm a/Source/WebCore/html/HTMLImageElement.cpp_sec3
743
743
744
    attachment->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone, true);
744
    attachment->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone, true);
745
    ensureUserAgentShadowRoot().appendChild(WTFMove(attachment));
745
    ensureUserAgentShadowRoot().appendChild(WTFMove(attachment));
746
    setAttributeWithoutSynchronization(webkitimagemenuAttr, emptyString());
746
#if ENABLE(SERVICE_CONTROLS)
747
    m_imageMenuEnabled = true;
748
#endif // ENABLE(SERVICE_CONTROLS)
747
}
749
}
748
750
749
RefPtr<HTMLAttachmentElement> HTMLImageElement::attachmentElement() const
751
RefPtr<HTMLAttachmentElement> HTMLImageElement::attachmentElement() const
Lines 775-785 void HTMLImageElement::updateImageControls() a/Source/WebCore/html/HTMLImageElement.cpp_sec4
775
        return;
777
        return;
776
    if (!document().settings().imageControlsEnabled())
778
    if (!document().settings().imageControlsEnabled())
777
        return;
779
        return;
778
    bool hasControls = hasImageControls();
780
    document().eventLoop().queueTask(TaskSource::InternalAsyncTask, [this, protectedThis = Ref { *this }] {
779
    if (!m_imageMenuEnabled && hasControls)
781
        bool hasControls = hasImageControls();
780
        destroyImageControls();
782
        if (!m_imageMenuEnabled && hasControls)
781
    else if (m_imageMenuEnabled && !hasControls)
783
            destroyImageControls();
782
        tryCreateImageControls();
784
        else if (m_imageMenuEnabled && !hasControls)
785
            tryCreateImageControls();
786
    });
783
}
787
}
784
788
785
void HTMLImageElement::tryCreateImageControls()
789
void HTMLImageElement::tryCreateImageControls()
- a/Source/WebCore/html/HTMLImageElement.h -1 / +4 lines
Lines 147-152 public: a/Source/WebCore/html/HTMLImageElement.h_sec1
147
    ReferrerPolicy referrerPolicy() const;
147
    ReferrerPolicy referrerPolicy() const;
148
148
149
    bool allowsOrientationOverride() const;
149
    bool allowsOrientationOverride() const;
150
    
151
#if ENABLE(SERVICE_CONTROLS)
152
    WEBCORE_EXPORT bool hasImageControls() const;
153
#endif
150
154
151
protected:
155
protected:
152
    HTMLImageElement(const QualifiedName&, Document&, HTMLFormElement* = nullptr);
156
    HTMLImageElement(const QualifiedName&, Document&, HTMLFormElement* = nullptr);
Lines 197-203 private: a/Source/WebCore/html/HTMLImageElement.h_sec2
197
    void updateImageControls();
201
    void updateImageControls();
198
    void tryCreateImageControls();
202
    void tryCreateImageControls();
199
    void destroyImageControls();
203
    void destroyImageControls();
200
    bool hasImageControls() const;
201
    bool childShouldCreateRenderer(const Node&) const override;
204
    bool childShouldCreateRenderer(const Node&) const override;
202
#endif
205
#endif
203
206
- a/Source/WebCore/html/shadow/mac/imageControlsMac.css -1 / +1 lines
Lines 39-45 div#image-controls button#image-controls-button { a/Source/WebCore/html/shadow/mac/imageControlsMac.css_sec1
39
    
39
    
40
    display: block;
40
    display: block;
41
41
42
    appearance: -internal-image-controls-button;
42
    appearance: auto;
43
43
44
    transition: opacity 0.25s;
44
    transition: opacity 0.25s;
45
    opacity: 0.0;
45
    opacity: 0.0;
- a/Source/WebCore/platform/ThemeTypes.h -4 / +9 lines
Lines 91-99 enum ControlPart { a/Source/WebCore/platform/ThemeTypes.h_sec1
91
    ContinuousCapacityLevelIndicatorPart,
91
    ContinuousCapacityLevelIndicatorPart,
92
    DiscreteCapacityLevelIndicatorPart,
92
    DiscreteCapacityLevelIndicatorPart,
93
    RatingLevelIndicatorPart,
93
    RatingLevelIndicatorPart,
94
#if ENABLE(SERVICE_CONTROLS)
95
    ImageControlsButtonPart,
96
#endif
97
#if ENABLE(APPLE_PAY)
94
#if ENABLE(APPLE_PAY)
98
    ApplePayButtonPart,
95
    ApplePayButtonPart,
99
#endif
96
#endif
Lines 108-114 enum ControlPart { a/Source/WebCore/platform/ThemeTypes.h_sec2
108
    AttachmentPart,
105
    AttachmentPart,
109
    BorderlessAttachmentPart,
106
    BorderlessAttachmentPart,
110
#endif
107
#endif
111
    CapsLockIndicatorPart
108
    CapsLockIndicatorPart,
109
    // Internal-only Values
110
#if ENABLE(SERVICE_CONTROLS)
111
    ImageControlsButtonPart,
112
    LargestControlPart = ImageControlsButtonPart
113
#else
114
    LargestControlPart = CapsLockIndicatorPart
115
#endif
116
    
112
};
117
};
113
118
114
enum SelectionPart {
119
enum SelectionPart {
- a/Source/WebCore/rendering/HitTestResult.cpp +9 lines
Lines 54-59 a/Source/WebCore/rendering/HitTestResult.cpp_sec1
54
#include "VisibleUnits.h"
54
#include "VisibleUnits.h"
55
#include "XLinkNames.h"
55
#include "XLinkNames.h"
56
56
57
#if ENABLE(SERVICE_CONTROLS)
58
#include "ImageControlsMac.h"
59
#endif
60
57
namespace WebCore {
61
namespace WebCore {
58
62
59
using namespace HTMLNames;
63
using namespace HTMLNames;
Lines 335-340 RefPtr<Node> HitTestResult::nodeForImageData() const a/Source/WebCore/rendering/HitTestResult.cpp_sec2
335
339
336
    if (ImageOverlay::isInsideOverlay(*m_innerNonSharedNode))
340
    if (ImageOverlay::isInsideOverlay(*m_innerNonSharedNode))
337
        return m_innerNonSharedNode->shadowHost();
341
        return m_innerNonSharedNode->shadowHost();
342
    
343
#if ENABLE(SERVICE_CONTROLS)
344
    if (ImageControlsMac::isInsideImageControls(*m_innerNonSharedNode))
345
        return m_innerNonSharedNode->shadowHost();
346
#endif
338
347
339
    return m_innerNonSharedNode;
348
    return m_innerNonSharedNode;
340
}
349
}
- a/Source/WebCore/rendering/RenderTheme.cpp +7 lines
Lines 57-62 a/Source/WebCore/rendering/RenderTheme.cpp_sec1
57
#include <wtf/NeverDestroyed.h>
57
#include <wtf/NeverDestroyed.h>
58
#include <wtf/text/StringConcatenateNumbers.h>
58
#include <wtf/text/StringConcatenateNumbers.h>
59
59
60
#if ENABLE(SERVICE_CONTROLS)
61
#include "ImageControlsMac.h"
62
#endif
60
63
61
#if ENABLE(DATALIST_ELEMENT)
64
#if ENABLE(DATALIST_ELEMENT)
62
#include "HTMLDataListElement.h"
65
#include "HTMLDataListElement.h"
Lines 296-301 ControlPart RenderTheme::autoAppearanceForElement(const Element* elementPtr) con a/Source/WebCore/rendering/RenderTheme.cpp_sec2
296
    if (!elementPtr)
299
    if (!elementPtr)
297
        return NoControlPart;
300
        return NoControlPart;
298
301
302
#if ENABLE(SERVICE_CONTROLS)
303
    if (isImageControl(elementPtr))
304
        return ImageControlsButtonPart;
305
#endif
299
    Ref element = *elementPtr;
306
    Ref element = *elementPtr;
300
307
301
    if (is<HTMLInputElement>(element)) {
308
    if (is<HTMLInputElement>(element)) {
- a/Source/WebCore/rendering/RenderTheme.h +1 lines
Lines 367-372 protected: a/Source/WebCore/rendering/RenderTheme.h_sec1
367
#if ENABLE(SERVICE_CONTROLS)
367
#if ENABLE(SERVICE_CONTROLS)
368
    virtual void adjustImageControlsButtonStyle(RenderStyle&, const Element*) const;
368
    virtual void adjustImageControlsButtonStyle(RenderStyle&, const Element*) const;
369
    virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
369
    virtual bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
370
    virtual bool isImageControl(const Element*) const { return false; }
370
#endif
371
#endif
371
372
372
    virtual void adjustProgressBarStyle(RenderStyle&, const Element*) const;
373
    virtual void adjustProgressBarStyle(RenderStyle&, const Element*) const;
- a/Source/WebCore/rendering/RenderThemeMac.h +1 lines
Lines 216-221 private: a/Source/WebCore/rendering/RenderThemeMac.h_sec1
216
#if ENABLE(SERVICE_CONTROLS)
216
#if ENABLE(SERVICE_CONTROLS)
217
    bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) final;
217
    bool paintImageControlsButton(const RenderObject&, const PaintInfo&, const IntRect&) final;
218
    IntSize imageControlsButtonSize() const final;
218
    IntSize imageControlsButtonSize() const final;
219
    bool isImageControl(const Element*) const final;
219
220
220
    NSServicesRolloverButtonCell *servicesRolloverButtonCell() const;
221
    NSServicesRolloverButtonCell *servicesRolloverButtonCell() const;
221
#endif
222
#endif
- a/Source/WebCore/rendering/RenderThemeMac.mm +11 lines
Lines 83-88 a/Source/WebCore/rendering/RenderThemeMac.mm_sec1
83
#import <wtf/StdLibExtras.h>
83
#import <wtf/StdLibExtras.h>
84
#import <wtf/text/StringBuilder.h>
84
#import <wtf/text/StringBuilder.h>
85
85
86
#if ENABLE(SERVICE_CONTROLS)
87
#include "ImageControlsMac.h"
88
#endif
89
86
// FIXME: This should go into an SPI.h file in the spi directory.
90
// FIXME: This should go into an SPI.h file in the spi directory.
87
@interface NSTextFieldCell ()
91
@interface NSTextFieldCell ()
88
- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus;
92
- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus;
Lines 2309-2314 IntSize RenderThemeMac::imageControlsButtonSize() const a/Source/WebCore/rendering/RenderThemeMac.mm_sec2
2309
{
2313
{
2310
    return IntSize(servicesRolloverButtonCell().cellSize);
2314
    return IntSize(servicesRolloverButtonCell().cellSize);
2311
}
2315
}
2316
2317
bool RenderThemeMac::isImageControl(const Element* elementPtr) const
2318
{
2319
    if (ImageControlsMac::isImageControlsButtonElement(*elementPtr))
2320
        return true;
2321
    return false;
2322
}
2312
#endif
2323
#endif
2313
2324
2314
#if ENABLE(ATTACHMENT_ELEMENT)
2325
#if ENABLE(ATTACHMENT_ELEMENT)
- a/Source/WebCore/rendering/style/RenderStyle.h -2 / +11 lines
Lines 1141-1148 public: a/Source/WebCore/rendering/style/RenderStyle.h_sec1
1141
    void setAccentColor(const Color& c) { SET_VAR(m_rareInheritedData, accentColor, c); SET_VAR(m_rareInheritedData, hasAutoAccentColor, false);  }
1141
    void setAccentColor(const Color& c) { SET_VAR(m_rareInheritedData, accentColor, c); SET_VAR(m_rareInheritedData, hasAutoAccentColor, false);  }
1142
    void setHasAutoAccentColor() { SET_VAR(m_rareInheritedData, hasAutoAccentColor, true); SET_VAR(m_rareInheritedData, accentColor, currentColor()); }
1142
    void setHasAutoAccentColor() { SET_VAR(m_rareInheritedData, hasAutoAccentColor, true); SET_VAR(m_rareInheritedData, accentColor, currentColor()); }
1143
    void setOpacity(float f) { float v = clampTo<float>(f, 0.f, 1.f); SET_VAR(m_rareNonInheritedData, opacity, v); }
1143
    void setOpacity(float f) { float v = clampTo<float>(f, 0.f, 1.f); SET_VAR(m_rareNonInheritedData, opacity, v); }
1144
    void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); SET_VAR(m_rareNonInheritedData, effectiveAppearance, a); }
1144
    void setAppearance(ControlPart a)
1145
    void setEffectiveAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, effectiveAppearance, a); }
1145
    {
1146
        static_assert(LargestControlPart < 1 << APPEARANCE_BIT_WIDTH, "Control part must fit in storage bits");
1147
        SET_VAR(m_rareNonInheritedData, appearance, a);
1148
        SET_VAR(m_rareNonInheritedData, effectiveAppearance, a);
1149
    }
1150
    void setEffectiveAppearance(ControlPart a)
1151
    {
1152
        static_assert(LargestControlPart < 1 << APPEARANCE_BIT_WIDTH, "Control part must fit in storage bits");
1153
        SET_VAR(m_rareNonInheritedData, effectiveAppearance, a);
1154
    }
1146
    // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
1155
    // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
1147
    void setBoxAlign(BoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, align, static_cast<unsigned>(a)); }
1156
    void setBoxAlign(BoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, align, static_cast<unsigned>(a)); }
1148
    void setBoxDirection(BoxDirection d) { m_inheritedFlags.boxDirection = static_cast<unsigned>(d); }
1157
    void setBoxDirection(BoxDirection d) { m_inheritedFlags.boxDirection = static_cast<unsigned>(d); }
- a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h -2 / +4 lines
Lines 66-71 class StyleTransformData; a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h_sec1
66
66
67
struct LengthSize;
67
struct LengthSize;
68
68
69
#define APPEARANCE_BIT_WIDTH 7
70
69
// Page size type.
71
// Page size type.
70
// StyleRareNonInheritedData::pageSize is meaningful only when
72
// StyleRareNonInheritedData::pageSize is meaningful only when
71
// StyleRareNonInheritedData::pageSizeType is PAGE_SIZE_RESOLVED.
73
// StyleRareNonInheritedData::pageSizeType is PAGE_SIZE_RESOLVED.
Lines 202-209 public: a/Source/WebCore/rendering/style/StyleRareNonInheritedData.h_sec2
202
    unsigned useSmoothScrolling : 1; // ScrollBehavior
204
    unsigned useSmoothScrolling : 1; // ScrollBehavior
203
    unsigned marginBeforeCollapse : 2; // MarginCollapse
205
    unsigned marginBeforeCollapse : 2; // MarginCollapse
204
    unsigned marginAfterCollapse : 2; // MarginCollapse
206
    unsigned marginAfterCollapse : 2; // MarginCollapse
205
    unsigned appearance : 6; // EAppearance
207
    unsigned appearance : APPEARANCE_BIT_WIDTH; // EAppearance
206
    unsigned effectiveAppearance : 6; // EAppearance
208
    unsigned effectiveAppearance : APPEARANCE_BIT_WIDTH; // EAppearance
207
    unsigned borderFit : 1; // BorderFit
209
    unsigned borderFit : 1; // BorderFit
208
    unsigned textCombine : 1; // CSS3 text-combine properties
210
    unsigned textCombine : 1; // CSS3 text-combine properties
209
211
- a/Source/WebCore/testing/Internals.cpp -1 / +8 lines
Lines 6397-6403 ExceptionOr<Internals::AttachmentThumbnailInfo> Internals::attachmentThumbnailIn a/Source/WebCore/testing/Internals.cpp_sec1
6397
#endif
6397
#endif
6398
}
6398
}
6399
6399
6400
#endif
6400
#if ENABLE(SERVICE_CONTROLS)
6401
bool Internals::hasImageControls(const HTMLImageElement& element) const
6402
{
6403
    return element.hasImageControls();
6404
}
6405
#endif // ENABLE(SERVICE_CONTROLS)
6406
6407
#endif // ENABLE(ATTACHMENT_ELEMENT)
6401
6408
6402
#if ENABLE(MEDIA_SESSION)
6409
#if ENABLE(MEDIA_SESSION)
6403
ExceptionOr<double> Internals::currentMediaSessionPosition(const MediaSession& session)
6410
ExceptionOr<double> Internals::currentMediaSessionPosition(const MediaSession& session)
- a/Source/WebCore/testing/Internals.h -1 / +4 lines
Lines 1184-1190 public: a/Source/WebCore/testing/Internals.h_sec1
1184
    };
1184
    };
1185
1185
1186
    ExceptionOr<AttachmentThumbnailInfo> attachmentThumbnailInfo(const HTMLAttachmentElement&);
1186
    ExceptionOr<AttachmentThumbnailInfo> attachmentThumbnailInfo(const HTMLAttachmentElement&);
1187
#endif
1187
#if ENABLE(SERVICE_CONTROLS)
1188
    bool hasImageControls(const HTMLImageElement&) const;
1189
#endif // ENABLE(SERVICE_CONTROLS)
1190
#endif // ENABLE(ATTACHMENT_ELEMENT)
1188
1191
1189
#if ENABLE(MEDIA_SESSION)
1192
#if ENABLE(MEDIA_SESSION)
1190
    ExceptionOr<double> currentMediaSessionPosition(const MediaSession&);
1193
    ExceptionOr<double> currentMediaSessionPosition(const MediaSession&);
- a/Source/WebCore/testing/Internals.idl +1 lines
Lines 1071-1076 enum HEVCParameterCodec { a/Source/WebCore/testing/Internals.idl_sec1
1071
    undefined setContentSizeCategory(ContentSizeCategory category);
1071
    undefined setContentSizeCategory(ContentSizeCategory category);
1072
1072
1073
    [Conditional=ATTACHMENT_ELEMENT] AttachmentThumbnailInfo attachmentThumbnailInfo(HTMLAttachmentElement element);
1073
    [Conditional=ATTACHMENT_ELEMENT] AttachmentThumbnailInfo attachmentThumbnailInfo(HTMLAttachmentElement element);
1074
    [Conditional=ATTACHMENT_ELEMENT, Conditional=SERVICE_CONTROLS] boolean hasImageControls(HTMLImageElement element);
1074
1075
1075
    [Conditional=MEDIA_SESSION] double currentMediaSessionPosition(MediaSession session);
1076
    [Conditional=MEDIA_SESSION] double currentMediaSessionPosition(MediaSession session);
1076
    [Conditional=MEDIA_SESSION] undefined sendMediaSessionAction(MediaSession session, MediaSessionActionDetails actionDetails);
1077
    [Conditional=MEDIA_SESSION] undefined sendMediaSessionAction(MediaSession session, MediaSessionActionDetails actionDetails);
- a/LayoutTests/ChangeLog +19 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2021-12-22  Megan Gardner  <megan_gardner@apple.com>
2
3
        Remove unneeded webkit specific CSS attribute for Image Control Menu.
4
        https://bugs.webkit.org/show_bug.cgi?id=234405
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        We need to move this test to be a mac specific one, as it now has mac specific 
9
        test harnessing.
10
11
        * TestExpectations:
12
        * fast/images/image-controls-basic-expected.txt: Removed.
13
        * fast/images/image-controls-basic.html: Removed.
14
        * fast/images/mac/image-controls-basic-expected.txt: Renamed from LayoutTests/platform/mac/fast/images/image-controls-basic-expected.txt.
15
        * fast/images/mac/image-controls-basic.html: Added.
16
        * platform/mac-catalina/fast/images/image-controls-basic-expected.txt: Removed.
17
        * platform/mac/TestExpectations:
18
        * platform/win/TestExpectations:
19
1
2021-12-20  Arcady Goldmints-Orlov  <agoldmints@igalia.com>
20
2021-12-20  Arcady Goldmints-Orlov  <agoldmints@igalia.com>
2
21
3
        [GLIB] Update test expectations for some fast/box-shadow tests.
22
        [GLIB] Update test expectations for some fast/box-shadow tests.
- a/LayoutTests/TestExpectations +1 lines
Lines 40-45 fast/forms/select/mac-wk2 [ Skip ] a/LayoutTests/TestExpectations_sec1
40
fast/forms/textarea/ios [ Skip ]
40
fast/forms/textarea/ios [ Skip ]
41
fast/forms/watchos [ Skip ]
41
fast/forms/watchos [ Skip ]
42
fast/images/text-recognition [ Skip ]
42
fast/images/text-recognition [ Skip ]
43
fast/images/mac [ Skip ]
43
fast/sandbox/ios [ Skip ]
44
fast/sandbox/ios [ Skip ]
44
fast/sandbox/mac [ Skip ]
45
fast/sandbox/mac [ Skip ]
45
fast/viewport/watchos [ Skip ]
46
fast/viewport/watchos [ Skip ]
- a/LayoutTests/fast/images/image-controls-basic-expected.txt -7 lines
Lines 1-7 a/LayoutTests/fast/images/image-controls-basic-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x600
4
  RenderBlock {HTML} at (0,0) size 800x600
5
    RenderBody {BODY} at (8,8) size 784x584
6
      RenderImage {IMG} at (0,0) size 256x256
7
      RenderText {#text} at (0,0) size 0x0
- a/LayoutTests/fast/images/image-controls-basic.html -8 lines
Lines 1-8 a/LayoutTests/fast/images/image-controls-basic.html_sec1
1
 <script>
2
if (window.internals)
3
	internals.settings.setImageControlsEnabled(true);
4
5
</script>
6
<body>
7
<img src="resources/green-256x256.jpg" x-webkit-imagemenu>
8
</body>
- a/LayoutTests/fast/images/mac/image-controls-basic-expected.txt +12 lines
Line 0 a/LayoutTests/fast/images/mac/image-controls-basic-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x276
4
  RenderBlock {HTML} at (0,0) size 800x276
5
    RenderBody {BODY} at (8,8) size 784x260
6
      RenderImage {IMG} at (0,0) size 256x256
7
      RenderText {#text} at (0,0) size 0x0
8
      RenderText {#text} at (0,0) size 0x0
9
layer at (8,8) size 256x256
10
  RenderBlock (relative positioned) {DIV} at (0,0) size 256x256 [color=#00000000]
11
layer at (215,30) size 27x26
12
  RenderButton {BUTTON} at (207,22) size 27x26 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
- a/LayoutTests/fast/images/mac/image-controls-basic.html +34 lines
Line 0 a/LayoutTests/fast/images/mac/image-controls-basic.html_sec1
1
<!DOCTYPE html><!-- webkit-test-runner [ AttachmentElementEnabled=true ] -->
2
<html>
3
<head>
4
<script>
5
if (window.testRunner) {
6
    testRunner.waitUntilDone();
7
}
8
if (window.internals) {
9
 	internals.settings.setImageControlsEnabled(true);
10
}
11
</script>
12
</head>
13
<body>
14
<img id="target" src="../resources/green-256x256.jpg">
15
<script>
16
	function hasImageControls(elem)
17
	{
18
		if (window.internals)
19
			return internals.hasImageControls(elem);
20
		return false;
21
	}
22
23
	jsTestIsAsync = true;
24
25
	var elem = document.getElementById("target");
26
	var ID = HTMLAttachmentElement.getAttachmentIdentifier(elem);
27
28
	setInterval(() => {
29
    if (hasImageControls(elem))
30
        testRunner.notifyDone();
31
	}, 200);
32
</script>
33
</body>
34
</html>
- a/LayoutTests/platform/mac-bigsur/fast/images/mac/image-controls-basic-expected.txt +12 lines
Line 0 a/LayoutTests/platform/mac-bigsur/fast/images/mac/image-controls-basic-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x276
4
  RenderBlock {HTML} at (0,0) size 800x276
5
    RenderBody {BODY} at (8,8) size 784x260
6
      RenderImage {IMG} at (0,0) size 256x256
7
      RenderText {#text} at (0,0) size 0x0
8
      RenderText {#text} at (0,0) size 0x0
9
layer at (8,8) size 256x256
10
  RenderBlock (relative positioned) {DIV} at (0,0) size 256x256 [color=#00000000]
11
layer at (214,30) size 28x26
12
  RenderButton {BUTTON} at (206,22) size 28x26 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
- a/LayoutTests/platform/mac-catalina/fast/images/image-controls-basic-expected.txt -11 lines
Lines 1-11 a/LayoutTests/platform/mac-catalina/fast/images/image-controls-basic-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x600
4
  RenderBlock {HTML} at (0,0) size 800x600
5
    RenderBody {BODY} at (8,8) size 784x584
6
      RenderImage {IMG} at (0,0) size 256x256
7
      RenderText {#text} at (0,0) size 0x0
8
layer at (8,8) size 256x256
9
  RenderBlock (relative positioned) {DIV} at (0,0) size 256x256 [color=#00000000]
10
layer at (215,30) size 27x26
11
  RenderButton {BUTTON} at (207,22) size 27x26 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
- a/LayoutTests/platform/mac/TestExpectations +1 lines
Lines 16-21 editing/pasteboard/mac [ Pass ] a/LayoutTests/platform/mac/TestExpectations_sec1
16
fast/dom/Range/mac [ Pass ]
16
fast/dom/Range/mac [ Pass ]
17
fast/scrolling/latching [ Pass ]
17
fast/scrolling/latching [ Pass ]
18
model-element [ Pass ]
18
model-element [ Pass ]
19
fast/images/mac [ Pass ]
19
20
20
# Disable plug-in tests on Apple Silicon
21
# Disable plug-in tests on Apple Silicon
21
[ arm64 ] compositing/plugins [ Skip ]
22
[ arm64 ] compositing/plugins [ Skip ]
- a/LayoutTests/platform/mac/fast/images/image-controls-basic-expected.txt -11 lines
Lines 1-11 a/LayoutTests/platform/mac/fast/images/image-controls-basic-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x600
4
  RenderBlock {HTML} at (0,0) size 800x600
5
    RenderBody {BODY} at (8,8) size 784x584
6
      RenderImage {IMG} at (0,0) size 256x256
7
      RenderText {#text} at (0,0) size 0x0
8
layer at (8,8) size 256x256
9
  RenderBlock (relative positioned) {DIV} at (0,0) size 256x256 [color=#00000000]
10
layer at (214,30) size 28x26
11
  RenderButton {BUTTON} at (206,22) size 28x26 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]

Return to Bug 234405