| Differences between
and this patch
- a/Source/WebCore/ChangeLog +22 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2019-12-19  Cathie Chen  <cathiechen@igalia.com>
2
3
        Mapping HTML attributes width/height to the default aspect ratio of img/video
4
        https://bugs.webkit.org/show_bug.cgi?id=201641
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        According to [1], if HTML width and height attribute have valid values, not a percentage, and non-zero,
9
        the value width/height is the default intrinsic aspect ratio for an img element. This will help to calculate
10
        img element's layout size before loading. The value will be overridden if img is loaded. Also see [2].
11
12
        [1]: https://html.spec.whatwg.org/multipage/rendering.html#attributes-for-embedded-content-and-images
13
        [2]: https://github.com/WICG/intrinsicsize-attribute/issues/16
14
15
        Tests: imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html
16
               imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html
17
               imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html
18
19
        * page/Settings.yaml:
20
        * rendering/RenderReplaced.cpp:
21
        (WebCore::RenderReplaced::computeIntrinsicRatioInformation const):
22
1
2019-12-19  youenn fablet  <youenn@apple.com>
23
2019-12-19  youenn fablet  <youenn@apple.com>
2
24
3
        Safari resumes autoplay audio elements after getUserMedia
25
        Safari resumes autoplay audio elements after getUserMedia
- a/Source/WebKit/ChangeLog +11 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2019-12-19  Cathie Chen  <cathiechen@igalia.com>
2
3
        Mapping HTML attributes width/height to the default aspect ratio of img/video
4
        https://bugs.webkit.org/show_bug.cgi?id=201641
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add experimental flag: AspectRatioFromWidthAndHeightEnabled.
9
10
        * Shared/WebPreferences.yaml:
11
1
2019-12-18  Sihui Liu  <sihui_liu@apple.com>
12
2019-12-18  Sihui Liu  <sihui_liu@apple.com>
2
13
3
        IndexedDB: perform IDBServer work only on background thread
14
        IndexedDB: perform IDBServer work only on background thread
- a/Source/WebKitLegacy/mac/ChangeLog +18 lines
Lines 1-3 a/Source/WebKitLegacy/mac/ChangeLog_sec1
1
2019-12-19  Cathie Chen  <cathiechen@igalia.com>
2
3
        Mapping HTML attributes width/height to the default aspect ratio of img/video
4
        https://bugs.webkit.org/show_bug.cgi?id=201641
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add experimental flag: AspectRatioFromWidthAndHeightEnabled.
9
10
        * WebView/WebPreferenceKeysPrivate.h:
11
        * WebView/WebPreferences.mm:
12
        (+[WebPreferences initialize]):
13
        (-[WebPreferences aspectRatioFromWidthAndHeightEnabled]):
14
        (-[WebPreferences setAspectRatioFromWidthAndHeightEnabled:]):
15
        * WebView/WebPreferencesPrivate.h:
16
        * WebView/WebView.mm:
17
        (-[WebView _preferencesChanged:]):
18
1
2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
19
2019-12-17  Kate Cheney  <katherine_cheney@apple.com>
2
20
3
        Add run-time flag for in-app browser privacy
21
        Add run-time flag for in-app browser privacy
- a/Source/WebKitLegacy/win/ChangeLog +19 lines
Lines 1-3 a/Source/WebKitLegacy/win/ChangeLog_sec1
1
2019-12-19  Cathie Chen  <cathiechen@igalia.com>
2
3
        Mapping HTML attributes width/height to the default aspect ratio of img/video
4
        https://bugs.webkit.org/show_bug.cgi?id=201641
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add experimental flag: AspectRatioFromWidthAndHeightEnabled.
9
10
        * Interfaces/IWebPreferencesPrivate.idl:
11
        * WebPreferenceKeysPrivate.h:
12
        * WebPreferences.cpp:
13
        (WebPreferences::initializeDefaultSettings):
14
        (WebPreferences::aspectRatioFromWidthAndHeightEnabled):
15
        (WebPreferences::setAspectRatioFromWidthAndHeightEnabled):
16
        * WebPreferences.h:
17
        * WebView.cpp:
18
        (WebView::notifyPreferencesChanged):
19
1
2019-12-13  Brady Eidson  <beidson@apple.com>
20
2019-12-13  Brady Eidson  <beidson@apple.com>
2
21
3
        Refactor ScriptController's proliferation of ExceptionDetails*.
22
        Refactor ScriptController's proliferation of ExceptionDetails*.
- a/Source/WebCore/page/Settings.yaml +3 lines
Lines 911-916 legacyGetUserMediaEnabled: a/Source/WebCore/page/Settings.yaml_sec1
911
isInAppBrowserPrivacyEnabled:
911
isInAppBrowserPrivacyEnabled:
912
  initial: false
912
  initial: false
913
913
914
aspectRatioFromWidthAndHeightEnabled:
915
  initial: false
916
914
# Deprecated
917
# Deprecated
915
918
916
iceCandidateFilteringEnabled:
919
iceCandidateFilteringEnabled:
- a/Source/WebCore/rendering/RenderReplaced.cpp -2 / +13 lines
Lines 29-34 a/Source/WebCore/rendering/RenderReplaced.cpp_sec1
29
#include "Frame.h"
29
#include "Frame.h"
30
#include "GraphicsContext.h"
30
#include "GraphicsContext.h"
31
#include "HTMLElement.h"
31
#include "HTMLElement.h"
32
#include "HTMLParserIdioms.h"
32
#include "InlineElementBox.h"
33
#include "InlineElementBox.h"
33
#include "LayoutRepainter.h"
34
#include "LayoutRepainter.h"
34
#include "RenderBlock.h"
35
#include "RenderBlock.h"
Lines 38-43 a/Source/WebCore/rendering/RenderReplaced.cpp_sec2
38
#include "RenderTheme.h"
39
#include "RenderTheme.h"
39
#include "RenderView.h"
40
#include "RenderView.h"
40
#include "RenderedDocumentMarker.h"
41
#include "RenderedDocumentMarker.h"
42
#include "Settings.h"
41
#include "VisiblePosition.h"
43
#include "VisiblePosition.h"
42
#include <wtf/IsoMallocInlines.h>
44
#include <wtf/IsoMallocInlines.h>
43
#include <wtf/StackStats.h>
45
#include <wtf/StackStats.h>
Lines 437-444 void RenderReplaced::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, a/Source/WebCore/rendering/RenderReplaced.cpp_sec3
437
    intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight());
439
    intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight());
438
440
439
    // Figure out if we need to compute an intrinsic ratio.
441
    // Figure out if we need to compute an intrinsic ratio.
440
    if (intrinsicSize.isEmpty() || !hasAspectRatio())
442
    if (intrinsicSize.isEmpty() || !hasAspectRatio()) {
441
        return;
443
        if (!settings().aspectRatioFromWidthAndHeightEnabled())
444
            return;
445
446
        if (!element()->hasAttribute(HTMLNames::widthAttr) || !element()->hasAttribute(HTMLNames::heightAttr))
447
            return;
448
        intrinsicSize.setWidth(parseValidHTMLFloatingPointNumber(element()->getAttribute(HTMLNames::widthAttr)).valueOr(0));
449
        intrinsicSize.setHeight(parseValidHTMLFloatingPointNumber(element()->getAttribute(HTMLNames::heightAttr)).valueOr(0));
450
        if (intrinsicSize.isEmpty())
451
            return;
452
    }
442
453
443
    intrinsicRatio = intrinsicSize.width() / intrinsicSize.height();
454
    intrinsicRatio = intrinsicSize.width() / intrinsicSize.height();
444
}
455
}
- a/Source/WebKit/Shared/WebPreferences.yaml +6 lines
Lines 1500-1505 CaptureVideoInUIProcessEnabled: a/Source/WebKit/Shared/WebPreferences.yaml_sec1
1500
  webcoreBinding: none
1500
  webcoreBinding: none
1501
  condition: ENABLE(MEDIA_STREAM)
1501
  condition: ENABLE(MEDIA_STREAM)
1502
1502
1503
AspectRatioFromWidthAndHeightEnabled:
1504
  type: bool
1505
  defaultValue: false
1506
  humanReadableName: "Aspect ratio from width and height"
1507
  humanReadableDescription: "Map HTML attributes width/height to the default aspect ratio of img/video"
1508
  category: experimental
1503
1509
1504
# For internal features:
1510
# For internal features:
1505
# The type should be boolean.
1511
# The type should be boolean.
- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h +1 lines
Lines 281-284 a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h_sec1
281
#define WebKitAsyncClipboardAPIEnabledPreferenceKey @"WebKitAsyncClipboardAPIEnabled"
281
#define WebKitAsyncClipboardAPIEnabledPreferenceKey @"WebKitAsyncClipboardAPIEnabled"
282
#define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
282
#define WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey @"WebKitLinkPreloadResponsiveImagesEnabled"
283
#define WebKitInAppBrowserPrivacyEnabledPreferenceKey @"WebKitInAppBrowserPrivacyEnabled"
283
#define WebKitInAppBrowserPrivacyEnabledPreferenceKey @"WebKitInAppBrowserPrivacyEnabled"
284
#define WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey @"AspectRatioFromWidthAndHeightEnabled"
284
285
- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm +10 lines
Lines 707-712 public: a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec1
707
        @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
707
        @NO, WebKitLinkPreloadResponsiveImagesEnabledPreferenceKey,
708
        @YES, WebKitCSSShadowPartsEnabledPreferenceKey,
708
        @YES, WebKitCSSShadowPartsEnabledPreferenceKey,
709
        @NO, WebKitInAppBrowserPrivacyEnabledPreferenceKey,
709
        @NO, WebKitInAppBrowserPrivacyEnabledPreferenceKey,
710
        @NO, WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey,
710
        nil];
711
        nil];
711
712
712
#if !PLATFORM(IOS_FAMILY)
713
#if !PLATFORM(IOS_FAMILY)
Lines 3611-3616 static NSString *classIBCreatorID = nil; a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm_sec2
3611
- (void)setInAppBrowserPrivacyEnabled:(BOOL)flag
3612
- (void)setInAppBrowserPrivacyEnabled:(BOOL)flag
3612
{
3613
{
3613
    [self _setBoolValue:flag forKey:WebKitInAppBrowserPrivacyEnabledPreferenceKey];
3614
    [self _setBoolValue:flag forKey:WebKitInAppBrowserPrivacyEnabledPreferenceKey];
3615
3616
- (BOOL)aspectRatioFromWidthAndHeightEnabled
3617
{
3618
    return [self _boolValueForKey:WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey];
3619
}
3620
3621
- (void)setAspectRatioFromWidthAndHeightEnabled:(BOOL)flag
3622
{
3623
    [self _setBoolValue:flag forKey:WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey];
3614
}
3624
}
3615
3625
3616
@end
3626
@end
- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h +1 lines
Lines 673-678 extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h_sec1
673
@property (nonatomic) BOOL requestIdleCallbackEnabled;
673
@property (nonatomic) BOOL requestIdleCallbackEnabled;
674
@property (nonatomic) BOOL asyncClipboardAPIEnabled;
674
@property (nonatomic) BOOL asyncClipboardAPIEnabled;
675
@property (nonatomic) BOOL linkPreloadResponsiveImagesEnabled;
675
@property (nonatomic) BOOL linkPreloadResponsiveImagesEnabled;
676
@property (nonatomic) BOOL aspectRatioFromWidthAndHeightEnabled;
676
677
677
#if TARGET_OS_IPHONE
678
#if TARGET_OS_IPHONE
678
@property (nonatomic) BOOL quickLookDocumentSavingEnabled;
679
@property (nonatomic) BOOL quickLookDocumentSavingEnabled;
- a/Source/WebKitLegacy/mac/WebView/WebView.mm +1 lines
Lines 3265-3270 static bool needsSelfRetainWhileLoadingQuirk() a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec1
3265
#if ENABLE(RESIZE_OBSERVER)
3265
#if ENABLE(RESIZE_OBSERVER)
3266
    settings.setResizeObserverEnabled([preferences resizeObserverEnabled]);
3266
    settings.setResizeObserverEnabled([preferences resizeObserverEnabled]);
3267
#endif
3267
#endif
3268
    settings.setAspectRatioFromWidthAndHeightEnabled([preferences aspectRatioFromWidthAndHeightEnabled]);
3268
}
3269
}
3269
3270
3270
static inline IMP getMethod(id o, SEL s)
3271
static inline IMP getMethod(id o, SEL s)
- a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl +2 lines
Lines 250-253 interface IWebPreferencesPrivate7 : IWebPreferencesPrivate6 a/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl_sec1
250
    HRESULT setAsyncClipboardAPIEnabled([in] BOOL enabled);
250
    HRESULT setAsyncClipboardAPIEnabled([in] BOOL enabled);
251
    HRESULT webAnimationsCompositeOperationsEnabled([out, retval] BOOL*);
251
    HRESULT webAnimationsCompositeOperationsEnabled([out, retval] BOOL*);
252
    HRESULT setWebAnimationsCompositeOperationsEnabled([in] BOOL enabled);
252
    HRESULT setWebAnimationsCompositeOperationsEnabled([in] BOOL enabled);
253
    HRESULT aspectRatioFromWidthAndHeightEnabled([out, retval] BOOL*);
254
    HRESULT setAspectRatioFromWidthAndHeightEnabled([in] BOOL enabled);
253
}
255
}
- a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h +2 lines
Lines 217-219 a/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h_sec1
217
#define WebKitRequestIdleCallbackEnabledPreferenceKey "WebKitRequestIdleCallbackEnabled"
217
#define WebKitRequestIdleCallbackEnabledPreferenceKey "WebKitRequestIdleCallbackEnabled"
218
218
219
#define WebKitAsyncClipboardAPIEnabledPreferenceKey "WebKitAsyncClipboardAPIEnabled"
219
#define WebKitAsyncClipboardAPIEnabledPreferenceKey "WebKitAsyncClipboardAPIEnabled"
220
221
#define WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey "WebKitAspectRatioFromWidthAndHeightEnabled"
- a/Source/WebKitLegacy/win/WebPreferences.cpp +16 lines
Lines 345-350 void WebPreferences::initializeDefaultSettings() a/Source/WebKitLegacy/win/WebPreferences.cpp_sec1
345
345
346
    CFDictionaryAddValue(defaults, CFSTR(WebKitAsyncClipboardAPIEnabledPreferenceKey), kCFBooleanFalse);
346
    CFDictionaryAddValue(defaults, CFSTR(WebKitAsyncClipboardAPIEnabledPreferenceKey), kCFBooleanFalse);
347
347
348
    CFDictionaryAddValue(defaults, CFSTR(WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey), kCFBooleanFalse);
349
348
    defaultSettings = defaults;
350
    defaultSettings = defaults;
349
#endif
351
#endif
350
}
352
}
Lines 2402-2404 HRESULT WebPreferences::setResizeObserverEnabled(BOOL enabled) a/Source/WebKitLegacy/win/WebPreferences.cpp_sec2
2402
    setBoolValue(WebKitResizeObserverEnabledPreferenceKey, enabled);
2404
    setBoolValue(WebKitResizeObserverEnabledPreferenceKey, enabled);
2403
    return S_OK;
2405
    return S_OK;
2404
}
2406
}
2407
2408
HRESULT WebPreferences::aspectRatioFromWidthAndHeightEnabled(_Out_ BOOL* enabled)
2409
{
2410
    if (!enabled)
2411
        return E_POINTER;
2412
    *enabled = boolValueForKey(WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey);
2413
    return S_OK;
2414
}
2415
2416
HRESULT WebPreferences::setAspectRatioFromWidthAndHeightEnabled(BOOL enabled)
2417
{
2418
    setBoolValue(WebKitAspectRatioFromWidthAndHeightEnabledPreferenceKey, enabled);
2419
    return S_OK;
2420
}
- a/Source/WebKitLegacy/win/WebPreferences.h +2 lines
Lines 295-300 public: a/Source/WebKitLegacy/win/WebPreferences.h_sec1
295
    virtual HRESULT STDMETHODCALLTYPE setAsyncClipboardAPIEnabled(BOOL);
295
    virtual HRESULT STDMETHODCALLTYPE setAsyncClipboardAPIEnabled(BOOL);
296
    virtual HRESULT STDMETHODCALLTYPE webAnimationsCompositeOperationsEnabled(_Out_ BOOL*);
296
    virtual HRESULT STDMETHODCALLTYPE webAnimationsCompositeOperationsEnabled(_Out_ BOOL*);
297
    virtual HRESULT STDMETHODCALLTYPE setWebAnimationsCompositeOperationsEnabled(BOOL);
297
    virtual HRESULT STDMETHODCALLTYPE setWebAnimationsCompositeOperationsEnabled(BOOL);
298
    virtual HRESULT STDMETHODCALLTYPE aspectRatioFromWidthAndHeightEnabled(_Out_ BOOL*);
299
    virtual HRESULT STDMETHODCALLTYPE setAspectRatioFromWidthAndHeightEnabled(BOOL);
298
300
299
    // WebPreferences
301
    // WebPreferences
300
302
- a/Source/WebKitLegacy/win/WebView.cpp +5 lines
Lines 5638-5643 HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) a/Source/WebKitLegacy/win/WebView.cpp_sec1
5638
        return hr;
5638
        return hr;
5639
    settings.setAsyncClipboardAPIEnabled(!!enabled);
5639
    settings.setAsyncClipboardAPIEnabled(!!enabled);
5640
5640
5641
    hr = prefsPrivate->aspectRatioFromWidthAndHeightEnabled(&enabled);
5642
    if (FAILED(hr))
5643
        return hr;
5644
    settings.setAspectRatioFromWidthAndHeightEnabled(!!enabled);
5645
5641
    return S_OK;
5646
    return S_OK;
5642
}
5647
}
5643
5648
- a/LayoutTests/imported/w3c/ChangeLog +36 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2019-12-19  Cathie Chen  <cathiechen@igalia.com>
2
3
        Mapping HTML attributes width/height to the default aspect ratio of img/video
4
        https://bugs.webkit.org/show_bug.cgi?id=201641
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Import test cases.
9
10
        * resources/import-expectations.json:
11
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt: Added.
12
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html: Added.
13
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt: Added.
14
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html: Added.
15
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative-expected.txt: Removed.
16
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative.html: Removed.
17
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt: Added.
18
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html: Added.
19
        * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log:
20
        * web-platform-tests/media/1x1-green.png: Added.
21
        * web-platform-tests/media/2x2-green.mp4: Added.
22
        * web-platform-tests/media/2x2-green.ogv: Added.
23
        * web-platform-tests/media/400x300-red-resize-200x150-green.mp4: Added.
24
        * web-platform-tests/media/400x300-red-resize-200x150-green.webm: Added.
25
        * web-platform-tests/media/META.yml: Added.
26
        * web-platform-tests/media/OWNERS: Removed.
27
        * web-platform-tests/media/counting.mp4: Added.
28
        * web-platform-tests/media/counting.ogv: Added.
29
        * web-platform-tests/media/foo-no-cors.vtt: Added.
30
        * web-platform-tests/media/sound_0.mp3: Added.
31
        * web-platform-tests/media/sound_0.oga: Added.
32
        * web-platform-tests/media/test.mp4: Added.
33
        * web-platform-tests/media/test.ogv: Added.
34
        * web-platform-tests/media/video.ogv: Added.
35
        * web-platform-tests/media/w3c-import.log:
36
1
2019-12-18  Chris Dumez  <cdumez@apple.com>
37
2019-12-18  Chris Dumez  <cdumez@apple.com>
2
38
3
        Resync web-platform-tests/dom tests from upstream
39
        Resync web-platform-tests/dom tests from upstream
- a/LayoutTests/imported/w3c/resources/import-expectations.json +2 lines
Lines 220-225 a/LayoutTests/imported/w3c/resources/import-expectations.json_sec1
220
    "web-platform-tests/html/interaction/focus/the-autofocus-attribute": "import", 
220
    "web-platform-tests/html/interaction/focus/the-autofocus-attribute": "import", 
221
    "web-platform-tests/html/obsolete": "skip", 
221
    "web-platform-tests/html/obsolete": "skip", 
222
    "web-platform-tests/html/rendering": "skip", 
222
    "web-platform-tests/html/rendering": "skip", 
223
    "web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/": "import", 
223
    "web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives": "skip", 
224
    "web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives": "skip", 
224
    "web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh": "import", 
225
    "web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh": "import", 
225
    "web-platform-tests/html/semantics/embedded-content": "import", 
226
    "web-platform-tests/html/semantics/embedded-content": "import", 
Lines 290-295 a/LayoutTests/imported/w3c/resources/import-expectations.json_sec2
290
    "web-platform-tests/longtask-timing": "skip", 
291
    "web-platform-tests/longtask-timing": "skip", 
291
    "web-platform-tests/magnetometer": "skip", 
292
    "web-platform-tests/magnetometer": "skip", 
292
    "web-platform-tests/mathml": "import", 
293
    "web-platform-tests/mathml": "import", 
294
    "web-platform-tests/media": "import", 
293
    "web-platform-tests/media-capabilities": "skip", 
295
    "web-platform-tests/media-capabilities": "skip", 
294
    "web-platform-tests/media-source": "import", 
296
    "web-platform-tests/media-source": "import", 
295
    "web-platform-tests/mediacapture-image": "skip", 
297
    "web-platform-tests/mediacapture-image": "skip", 
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt +3 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt_sec1
1
2
PASS Canvas width and height attributes are used to infer aspect-ratio 
3
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html +30 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html_sec1
1
<!doctype html><!-- webkit-test-runner [ experimental:AspectRatioFromWidthAndHeightEnabled=true ] -->
2
<title>Canvas width and height attributes are used to infer aspect-ratio</title>
3
<script src="/resources/testharness.js"></script>
4
<script src="/resources/testharnessreport.js"></script>
5
<style>
6
  canvas {
7
    width: 100%;
8
    max-width: 100px;
9
    height: auto;
10
  }
11
</style>
12
<body>
13
<script>
14
let t = async_test("Canvas width and height attributes are used to infer aspect-ratio");
15
function assert_ratio(img, expected) {
16
  let epsilon = 0.001;
17
  assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon);
18
}
19
// Create and append a new canvas and immediately check the ratio.
20
t.step(function() {
21
  var canvas = document.createElement("canvas");
22
  canvas.setAttribute("width", "250");
23
  canvas.setAttribute("height", "100");
24
  document.body.appendChild(canvas);
25
  // Canvases always use the aspect ratio from their surface size.
26
  assert_ratio(canvas, 2.5);
27
28
  t.done();
29
});
30
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt +4 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio-expected.txt_sec1
1
   
2
3
FAIL Image width and height attributes are used to infer aspect-ratio assert_approx_equals: expected 1.266 +/- 0.001 but got 1.25
4
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html +55 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html_sec1
1
<!doctype html><!-- webkit-test-runner [ experimental:AspectRatioFromWidthAndHeightEnabled=true ] -->
2
<title>Image width and height attributes are used to infer aspect-ratio</title>
3
<script src="/resources/testharness.js"></script>
4
<script src="/resources/testharnessreport.js"></script>
5
<style>
6
  img {
7
    width: 100%;
8
    max-width: 100px;
9
    height: auto;
10
  }
11
</style>
12
<img src="/images/green.png">
13
<img src="/images/green.png" width=100 height=125>
14
<img src="" width=100 height=125>
15
<script>
16
let t = async_test("Image width and height attributes are used to infer aspect-ratio");
17
function assert_ratio(img, expected) {
18
  let epsilon = 0.001;
19
  assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon);
20
}
21
// Create and append a new image and immediately check the ratio.
22
// This is not racy because the spec requires the user agent to queue a task:
23
// https://html.spec.whatwg.org/multipage/images.html#updating-the-image-data
24
t.step(function() {
25
  var img = new Image();
26
  img.width = 250;
27
  img.height = 100;
28
  img.src = "/images/blue.png";
29
  document.body.appendChild(img);
30
  assert_ratio(img, 2.5);
31
32
  img = new Image();
33
  img.setAttribute("width", "0.8");
34
  img.setAttribute("height", "0.2");
35
  img.src = "/images/blue.png";
36
  document.body.appendChild(img);
37
  assert_ratio(img, 4);
38
39
  img = new Image();
40
  img.setAttribute("width", "50%");
41
  img.setAttribute("height", "25%");
42
  img.src = "/images/blue.png";
43
  document.body.appendChild(img);
44
  // Percentages should be  ignored.
45
  assert_equals(getComputedStyle(img).height, "0px");
46
});
47
48
onload = t.step_func_done(function() {
49
  let images = document.querySelectorAll("img");
50
  assert_ratio(images[3], 1.266); // 1.266 is the original aspect ratio of blue.png
51
  assert_equals(getComputedStyle(images[2]).height, "0px"); // aspect-ratio doesn't override intrinsic size of images that don't have any src.
52
  assert_ratio(images[1], 2.0); // 2.0 is the original aspect ratio of green.png
53
  assert_ratio(images[0], 2.0); // Loaded image's aspect ratio, at least by default, overrides width / height ratio.
54
});
55
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative-expected.txt -4 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative-expected.txt_sec1
1
  
2
3
FAIL Image width and height attributes are used to infer aspect-ratio assert_approx_equals: expected 0.8 +/- 0.001 but got 1
4
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative.html -27 lines
Lines 1-27 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative.html_sec1
1
<!doctype html>
2
<title>Image width and height attributes are used to infer aspect-ratio</title>
3
<script src="/resources/testharness.js"></script>
4
<script src="/resources/testharnessreport.js"></script>
5
<style>
6
  img {
7
    width: 100%;
8
    max-width: 100px;
9
    height: auto;
10
  }
11
</style>
12
<img src=broken width=100 height=125>
13
<img src="/images/green.png">
14
<img src="/images/green.png" width=100 height=125>
15
<script>
16
let t = async_test("Image width and height attributes are used to infer aspect-ratio");
17
function assert_ratio(img, expected) {
18
  let epsilon = 0.001;
19
  assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon);
20
}
21
onload = t.step_func_done(function() {
22
  let images = document.querySelectorAll("img");
23
  assert_ratio(images[0], 0.8);
24
  assert_ratio(images[2], 2.0); // 2.0 is the original aspect ratio of green.png
25
  assert_ratio(images[1], 2.0); // Loaded image's aspect ratio, at least by default, overrides width / height ratio.
26
});
27
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt +4 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt_sec1
1
2
3
PASS Video width and height attributes are not used to infer aspect-ratio 
4
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html +39 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html_sec1
1
<!doctype html><!-- webkit-test-runner [ experimental:AspectRatioFromWidthAndHeightEnabled=true ] -->
2
<title>Video width and height attributes are not used to infer aspect-ratio</title>
3
<script src="/resources/testharness.js"></script>
4
<script src="/resources/testharnessreport.js"></script>
5
<script src="/common/media.js"></script>
6
<style>
7
  video {
8
    width: 100%;
9
    max-width: 100px;
10
    height: auto;
11
  }
12
</style>
13
<body>
14
<script>
15
let t = async_test("Video width and height attributes are not used to infer aspect-ratio");
16
function assert_ratio(img, expected) {
17
  let epsilon = 0.001;
18
  assert_approx_equals(parseInt(getComputedStyle(img).width, 10) / parseInt(getComputedStyle(img).height, 10), expected, epsilon);
19
}
20
// Create and append a new video and immediately check the ratio.
21
// This is not racy because the spec requires the user agent to queue a task:
22
// https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm
23
t.step(function() {
24
  var video = document.createElement("video");
25
  video.setAttribute("width", "250");
26
  video.setAttribute("height", "100");
27
  video.src = getVideoURI('/media/2x2-green');
28
  document.body.appendChild(video);
29
  // Videos default to a size of 300x150px and calculate their aspect ratio
30
  // based on that before the video is loaded. So this should be 2, ignoring
31
  // the 2.5 that it would be based on the attributes.
32
  assert_ratio(video, 2);
33
34
  video.onloadeddata = t.step_func_done(function() {
35
    // When loaded this video is square.
36
    assert_ratio(video, 1);
37
  });
38
});
39
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log -1 / +3 lines
Lines 15-21 None a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log_sec1
15
------------------------------------------------------------------------
15
------------------------------------------------------------------------
16
List of files:
16
List of files:
17
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/align.html
17
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/align.html
18
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.tentative.html
18
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html
19
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-aspect-ratio.html
19
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim-expected.html
20
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim-expected.html
20
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html
21
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-dim.html
21
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-no-alt-replaced.html
22
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/img-no-alt-replaced.html
Lines 32-34 List of files: a/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/w3c-import.log_sec2
32
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml
33
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_perc.xhtml
33
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml
34
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel-expected.xhtml
34
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml
35
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/object_border_pixel.xhtml
36
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio.html
- a/LayoutTests/imported/w3c/web-platform-tests/media/META.yml +3 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/media/META.yml_sec1
1
suggested_reviewers:
2
  - hillbrad
3
  - gsnedders
- a/LayoutTests/imported/w3c/web-platform-tests/media/OWNERS -2 lines
Lines 1-2 a/LayoutTests/imported/w3c/web-platform-tests/media/OWNERS_sec1
1
@hillbrad
2
@gsnedders
- a/LayoutTests/imported/w3c/web-platform-tests/media/foo-no-cors.vtt +4 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/media/foo-no-cors.vtt_sec1
1
WEBVTT
2
3
00:00:00.000 --> 00:00:05.000
4
Foo
- a/LayoutTests/imported/w3c/web-platform-tests/media/w3c-import.log -2 / +15 lines
Lines 1-7 a/LayoutTests/imported/w3c/web-platform-tests/media/w3c-import.log_sec1
1
The tests in this directory were imported from the W3C repository.
1
The tests in this directory were imported from the W3C repository.
2
Do NOT modify these tests directly in WebKit.
2
Do NOT modify these tests directly in WebKit.
3
Instead, create a pull request on the WPT github:
3
Instead, create a pull request on the WPT github:
4
	https://github.com/w3c/web-platform-tests
4
	https://github.com/web-platform-tests/wpt
5
5
6
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
6
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
7
7
Lines 14-23 Property values requiring vendor prefixes: a/LayoutTests/imported/w3c/web-platform-tests/media/w3c-import.log_sec2
14
None
14
None
15
------------------------------------------------------------------------
15
------------------------------------------------------------------------
16
List of files:
16
List of files:
17
/LayoutTests/imported/w3c/web-platform-tests/media/1x1-green.png
17
/LayoutTests/imported/w3c/web-platform-tests/media/2048x1360-random.jpg
18
/LayoutTests/imported/w3c/web-platform-tests/media/2048x1360-random.jpg
19
/LayoutTests/imported/w3c/web-platform-tests/media/2x2-green.mp4
20
/LayoutTests/imported/w3c/web-platform-tests/media/2x2-green.ogv
21
/LayoutTests/imported/w3c/web-platform-tests/media/400x300-red-resize-200x150-green.mp4
22
/LayoutTests/imported/w3c/web-platform-tests/media/400x300-red-resize-200x150-green.webm
18
/LayoutTests/imported/w3c/web-platform-tests/media/A4.mp4
23
/LayoutTests/imported/w3c/web-platform-tests/media/A4.mp4
19
/LayoutTests/imported/w3c/web-platform-tests/media/A4.ogv
24
/LayoutTests/imported/w3c/web-platform-tests/media/A4.ogv
20
/LayoutTests/imported/w3c/web-platform-tests/media/OWNERS
25
/LayoutTests/imported/w3c/web-platform-tests/media/META.yml
26
/LayoutTests/imported/w3c/web-platform-tests/media/counting.mp4
27
/LayoutTests/imported/w3c/web-platform-tests/media/counting.ogv
28
/LayoutTests/imported/w3c/web-platform-tests/media/foo-no-cors.vtt
21
/LayoutTests/imported/w3c/web-platform-tests/media/foo.vtt
29
/LayoutTests/imported/w3c/web-platform-tests/media/foo.vtt
22
/LayoutTests/imported/w3c/web-platform-tests/media/foo.vtt.headers
30
/LayoutTests/imported/w3c/web-platform-tests/media/foo.vtt.headers
23
/LayoutTests/imported/w3c/web-platform-tests/media/green-at-15.mp4
31
/LayoutTests/imported/w3c/web-platform-tests/media/green-at-15.mp4
Lines 27-36 List of files: a/LayoutTests/imported/w3c/web-platform-tests/media/w3c-import.log_sec3
27
/LayoutTests/imported/w3c/web-platform-tests/media/movie_5.mp4
35
/LayoutTests/imported/w3c/web-platform-tests/media/movie_5.mp4
28
/LayoutTests/imported/w3c/web-platform-tests/media/movie_5.ogv
36
/LayoutTests/imported/w3c/web-platform-tests/media/movie_5.ogv
29
/LayoutTests/imported/w3c/web-platform-tests/media/poster.png
37
/LayoutTests/imported/w3c/web-platform-tests/media/poster.png
38
/LayoutTests/imported/w3c/web-platform-tests/media/sound_0.mp3
39
/LayoutTests/imported/w3c/web-platform-tests/media/sound_0.oga
30
/LayoutTests/imported/w3c/web-platform-tests/media/sound_5.mp3
40
/LayoutTests/imported/w3c/web-platform-tests/media/sound_5.mp3
31
/LayoutTests/imported/w3c/web-platform-tests/media/sound_5.oga
41
/LayoutTests/imported/w3c/web-platform-tests/media/sound_5.oga
32
/LayoutTests/imported/w3c/web-platform-tests/media/test-a-128k-44100Hz-1ch.webm
42
/LayoutTests/imported/w3c/web-platform-tests/media/test-a-128k-44100Hz-1ch.webm
33
/LayoutTests/imported/w3c/web-platform-tests/media/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr.webm
43
/LayoutTests/imported/w3c/web-platform-tests/media/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr.webm
34
/LayoutTests/imported/w3c/web-platform-tests/media/test-v-128k-320x240-24fps-8kfr.webm
44
/LayoutTests/imported/w3c/web-platform-tests/media/test-v-128k-320x240-24fps-8kfr.webm
45
/LayoutTests/imported/w3c/web-platform-tests/media/test.mp4
46
/LayoutTests/imported/w3c/web-platform-tests/media/test.ogv
47
/LayoutTests/imported/w3c/web-platform-tests/media/video.ogv
35
/LayoutTests/imported/w3c/web-platform-tests/media/white.mp4
48
/LayoutTests/imported/w3c/web-platform-tests/media/white.mp4
36
/LayoutTests/imported/w3c/web-platform-tests/media/white.webm
49
/LayoutTests/imported/w3c/web-platform-tests/media/white.webm

Return to Bug 201641