Diff
Modified: branches/safari-602-branch/LayoutTests/ChangeLog (207194 => 207195)
--- branches/safari-602-branch/LayoutTests/ChangeLog 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/LayoutTests/ChangeLog 2016-10-12 08:40:49 UTC (rev 207195)
@@ -1,5 +1,30 @@
2016-10-11 Matthew Hanson <[email protected]>
+ Merge r203522. rdar://problem/28476959
+
+ 2016-07-21 Daniel Bates <[email protected]>
+
+ REGRESSION: Plugin replaced YouTube Flash videos always have the same width
+ https://bugs.webkit.org/show_bug.cgi?id=159998
+ <rdar://problem/27462285>
+
+ Reviewed by Simon Fraser.
+
+ Unskip existing iOS layout tests, update tests and expected results.
+
+ * platform/ios-simulator/TestExpectations:
+ * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt: Updated expected result based on the
+ changes to test youtube-flash-plugin-iframe.html.
+ * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt: Updated expected result
+ based on the changes to test youtube-flash-plugin-iframe-no-height-or-width.html.
+ * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html: Modified to check the
+ width of each embedded YouTube video to ensure that we respect it (if specified).
+ * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html: Substitute pseudo id -webkit-plugin-replacement
+ for -apple-youtube-shadow-iframe as the later was renamed to the former in <https://trac.webkit.org/changeset/168442>.
+ Fix misspelling of the word "embed" in a comment.
+
+2016-10-11 Matthew Hanson <[email protected]>
+
Merge r203383. rdar://problem/28216264
2016-07-18 Brent Fulgham <[email protected]>
Modified: branches/safari-602-branch/LayoutTests/platform/ios-simulator/TestExpectations (207194 => 207195)
--- branches/safari-602-branch/LayoutTests/platform/ios-simulator/TestExpectations 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/LayoutTests/platform/ios-simulator/TestExpectations 2016-10-12 08:40:49 UTC (rev 207195)
@@ -2555,8 +2555,6 @@
# iOS tests that assert:
platform/ios-simulator/ios/fast/text/combining-enclosing-keycap.html
-platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html
-platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html
# Kerning, Ligatures, and Printer Fonts caused these tests to fail.
# The following tests are reftests (and also fail on Mac):
Modified: branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt (207194 => 207195)
--- branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt 2016-10-12 08:40:49 UTC (rev 207195)
@@ -16,11 +16,11 @@
PASS objectEmbed.tagName is "EMBED"
PASS objectNoEmbed.tagName is "OBJECT"
PASS document.querySelectorAll("iframe").length is 1
-PASS internals.shadowPseudoId(normalEmbedShadowRoot.firstChild) is "-apple-youtube-shadow-iframe"
+PASS internals.shadowPseudoId(normalEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement"
PASS normalEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME"
-PASS internals.shadowPseudoId(objectEmbedShadowRoot.firstChild) is "-apple-youtube-shadow-iframe"
+PASS internals.shadowPseudoId(objectEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement"
PASS objectEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME"
-PASS internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild) is "-apple-youtube-shadow-iframe"
+PASS internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement"
PASS objectNoEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME"
Normal Embed:
Modified: branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt (207194 => 207195)
--- branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt 2016-10-12 08:40:49 UTC (rev 207195)
@@ -12,12 +12,16 @@
PASS successfullyParsed is true
TEST COMPLETE
+PASS getComputedStyle(embedNoHeight).width is "425px"
PASS getComputedStyle(embedNoHeight).height is "150px"
PASS getComputedStyle(embedNoWidth).width is "300px"
+PASS getComputedStyle(embedNoWidth).height is "350px"
PASS getComputedStyle(embedNoWidthHeight).width is "300px"
PASS getComputedStyle(embedNoWidthHeight).height is "150px"
+PASS getComputedStyle(objectNoHeight).width is "425px"
PASS getComputedStyle(objectNoHeight).height is "150px"
PASS getComputedStyle(objectNoWidth).width is "300px"
+PASS getComputedStyle(objectNoWidth).height is "350px"
PASS getComputedStyle(objectNoWidthHeight).width is "300px"
PASS getComputedStyle(objectNoWidthHeight).height is "150px"
Embed without height:
Modified: branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html (207194 => 207195)
--- branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html 2016-10-12 08:40:49 UTC (rev 207195)
@@ -16,10 +16,12 @@
{
setTimeout(function() {
embedNoHeight = document.getElementById('embed-no-height');
- shouldBe('getComputedStyle(embedNoHeight).height', '"150px"')
+ shouldBe('getComputedStyle(embedNoHeight).width', '"425px"');
+ shouldBe('getComputedStyle(embedNoHeight).height', '"150px"');
embedNoWidth = document.getElementById('embed-no-width');
- shouldBe('getComputedStyle(embedNoWidth).width', '"300px"')
+ shouldBe('getComputedStyle(embedNoWidth).width', '"300px"');
+ shouldBe('getComputedStyle(embedNoWidth).height', '"350px"');
embedNoWidthHeight = document.getElementById('embed-no-width-or-height');
shouldBe('getComputedStyle(embedNoWidthHeight).width', '"300px"');
@@ -26,10 +28,12 @@
shouldBe('getComputedStyle(embedNoWidthHeight).height', '"150px"');
objectNoHeight = document.getElementById('object-no-height');
- shouldBe('getComputedStyle(objectNoHeight).height', '"150px"')
+ shouldBe('getComputedStyle(objectNoHeight).width', '"425px"');
+ shouldBe('getComputedStyle(objectNoHeight).height', '"150px"');
objectNoWidth = document.getElementById('object-no-width');
- shouldBe('getComputedStyle(objectNoWidth).width', '"300px"')
+ shouldBe('getComputedStyle(objectNoWidth).width', '"300px"');
+ shouldBe('getComputedStyle(objectNoWidth).height', '"350px"');
objectNoWidthHeight = document.getElementById('object-no-width-or-height');
shouldBe('getComputedStyle(objectNoWidthHeight).width', '"300px"');
Modified: branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html (207194 => 207195)
--- branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html 2016-10-12 08:40:49 UTC (rev 207195)
@@ -20,7 +20,7 @@
objectEmbed = document.getElementById('object-embed');
objectNoEmbed = document.getElementById('object-no-embed');
- // Test we don't change any embe/object tag to iframe.
+ // Test we don't change any embed/object tag to iframe.
shouldBe('normalEmbed.tagName', '"EMBED"');
shouldBe('elinkEmbed.tagName', '"EMBED"');
shouldBe('objectEmbed.tagName', '"EMBED"');
@@ -31,15 +31,15 @@
// Test we have the shadow root and the iframe player.
normalEmbedShadowRoot = internals.shadowRoot(normalEmbed);
- shouldBe('internals.shadowPseudoId(normalEmbedShadowRoot.firstChild)', '"-apple-youtube-shadow-iframe"');
+ shouldBe('internals.shadowPseudoId(normalEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"');
shouldBe('normalEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
objectEmbedShadowRoot = internals.shadowRoot(objectEmbed);
- shouldBe('internals.shadowPseudoId(objectEmbedShadowRoot.firstChild)', '"-apple-youtube-shadow-iframe"');
+ shouldBe('internals.shadowPseudoId(objectEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"');
shouldBe('objectEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
objectNoEmbedShadowRoot = internals.shadowRoot(objectNoEmbed);
- shouldBe('internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild)', '"-apple-youtube-shadow-iframe"');
+ shouldBe('internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"');
shouldBe('objectNoEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"');
var successfullyParsed = true;
Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (207194 => 207195)
--- branches/safari-602-branch/Source/WebCore/ChangeLog 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog 2016-10-12 08:40:49 UTC (rev 207195)
@@ -1,5 +1,40 @@
2016-10-11 Matthew Hanson <[email protected]>
+ Merge r203522. rdar://problem/28476959
+
+ 2016-07-21 Daniel Bates <[email protected]>
+
+ REGRESSION: Plugin replaced YouTube Flash videos always have the same width
+ https://bugs.webkit.org/show_bug.cgi?id=159998
+ <rdar://problem/27462285>
+
+ Reviewed by Simon Fraser.
+
+ Fixes an issue where the width of a plugin replaced YouTube video loaded via an HTML embed
+ element would always have the same width regardless of value of the width attribute.
+
+ For YouTube Flash videos the YouTube plugin replacement substitutes a shadow DOM subtree
+ for the default renderer of an HTML embed element. The root of this shadow DOM subtree
+ is an HTML div element. Currently we set inline styles on this <div> when it is instantiated.
+ In particular, we set inline display and position to "inline-block" and "relative", respectively,
+ and set an invalid height and width (we specify a font weight value instead of a CSS length value
+ - this causes an ASSERT_NOT_REACHED() assertion failure in StyleBuilderConverter::convertLengthSizing()
+ in a debug build). These styles never worked as intended and we ultimately created an inline
+ renderer (ignoring display "inline-block") that had auto width and height. Instead it is sufficient
+ to remove all these inline styles and create a RenderBlockFlow renderer for this <div> so that it
+ renders as a block, non-replaced element to achieve the intended illusion that the <embed> is a
+ single element.
+
+ * html/shadow/YouTubeEmbedShadowElement.cpp: Remove unused header HTMLEmbedElement.h and include
+ header RenderBlockFlow.h. Also update copyright in license block.
+ (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): Remove inline styles as these
+ never worked as intended.
+ (WebCore::YouTubeEmbedShadowElement::createElementRenderer): Override; create a block-flow
+ renderer for us so that we layout as a block, non-replaced element.
+ * html/shadow/YouTubeEmbedShadowElement.h:
+
+2016-10-11 Matthew Hanson <[email protected]>
+
Merge r203383. rdar://problem/28216264
2016-07-18 Brent Fulgham <[email protected]>
Modified: branches/safari-602-branch/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp (207194 => 207195)
--- branches/safari-602-branch/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp 2016-10-12 08:40:49 UTC (rev 207195)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,7 @@
#include "config.h"
#include "YouTubeEmbedShadowElement.h"
-#include "HTMLEmbedElement.h"
+#include "RenderBlockFlow.h"
namespace WebCore {
@@ -39,11 +39,11 @@
: HTMLDivElement(HTMLNames::divTag, document)
{
setPseudo(AtomicString("-webkit-plugin-replacement", AtomicString::ConstructFromLiteral));
+}
- setInlineStyleProperty(CSSPropertyDisplay, CSSValueInlineBlock);
- setInlineStyleProperty(CSSPropertyPosition, CSSValueRelative);
- setInlineStyleProperty(CSSPropertyWidth, CSSValue100);
- setInlineStyleProperty(CSSPropertyHeight, CSSValue100);
+RenderPtr<RenderElement> YouTubeEmbedShadowElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
+{
+ return createRenderer<RenderBlockFlow>(*this, WTFMove(style));
}
}
Modified: branches/safari-602-branch/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h (207194 => 207195)
--- branches/safari-602-branch/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h 2016-10-12 08:40:43 UTC (rev 207194)
+++ branches/safari-602-branch/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h 2016-10-12 08:40:49 UTC (rev 207195)
@@ -35,6 +35,8 @@
public:
static Ref<YouTubeEmbedShadowElement> create(Document&);
+ RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
+
private:
YouTubeEmbedShadowElement(Document&);
};