Changeset 203522 in webkit
- Timestamp:
- Jul 21, 2016 2:06:51 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203521 r203522 1 2016-07-21 Daniel Bates <dabates@apple.com> 2 3 REGRESSION: Plugin replaced YouTube Flash videos always have the same width 4 https://bugs.webkit.org/show_bug.cgi?id=159998 5 <rdar://problem/27462285> 6 7 Reviewed by Simon Fraser. 8 9 Unskip existing iOS layout tests, update tests and expected results. 10 11 * platform/ios-simulator/TestExpectations: 12 * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt: Updated expected result based on the 13 changes to test youtube-flash-plugin-iframe.html. 14 * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt: Updated expected result 15 based on the changes to test youtube-flash-plugin-iframe-no-height-or-width.html. 16 * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html: Modified to check the 17 width of each embedded YouTube video to ensure that we respect it (if specified). 18 * platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html: Substitute pseudo id -webkit-plugin-replacement 19 for -apple-youtube-shadow-iframe as the later was renamed to the former in <https://trac.webkit.org/changeset/168442>. 20 Fix misspelling of the word "embed" in a comment. 21 1 22 2016-07-21 Ryan Haddad <ryanhaddad@apple.com> 2 23 -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r203388 r203522 2557 2557 # iOS tests that assert: 2558 2558 platform/ios-simulator/ios/fast/text/combining-enclosing-keycap.html 2559 platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html2560 platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html2561 2559 2562 2560 # Kerning, Ligatures, and Printer Fonts caused these tests to fail. -
trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt
r178197 r203522 17 17 PASS objectNoEmbed.tagName is "OBJECT" 18 18 PASS document.querySelectorAll("iframe").length is 1 19 PASS internals.shadowPseudoId(normalEmbedShadowRoot.firstChild) is "- apple-youtube-shadow-iframe"19 PASS internals.shadowPseudoId(normalEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement" 20 20 PASS normalEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME" 21 PASS internals.shadowPseudoId(objectEmbedShadowRoot.firstChild) is "- apple-youtube-shadow-iframe"21 PASS internals.shadowPseudoId(objectEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement" 22 22 PASS objectEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME" 23 PASS internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild) is "- apple-youtube-shadow-iframe"23 PASS internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild) is "-webkit-plugin-replacement" 24 24 PASS objectNoEmbedShadowRoot.firstChild.firstChild.tagName is "IFRAME" 25 25 Normal Embed: -
trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt
r178197 r203522 13 13 14 14 TEST COMPLETE 15 PASS getComputedStyle(embedNoHeight).width is "425px" 15 16 PASS getComputedStyle(embedNoHeight).height is "150px" 16 17 PASS getComputedStyle(embedNoWidth).width is "300px" 18 PASS getComputedStyle(embedNoWidth).height is "350px" 17 19 PASS getComputedStyle(embedNoWidthHeight).width is "300px" 18 20 PASS getComputedStyle(embedNoWidthHeight).height is "150px" 21 PASS getComputedStyle(objectNoHeight).width is "425px" 19 22 PASS getComputedStyle(objectNoHeight).height is "150px" 20 23 PASS getComputedStyle(objectNoWidth).width is "300px" 24 PASS getComputedStyle(objectNoWidth).height is "350px" 21 25 PASS getComputedStyle(objectNoWidthHeight).width is "300px" 22 26 PASS getComputedStyle(objectNoWidthHeight).height is "150px" -
trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width.html
r178197 r203522 17 17 setTimeout(function() { 18 18 embedNoHeight = document.getElementById('embed-no-height'); 19 shouldBe('getComputedStyle(embedNoHeight).height', '"150px"') 19 shouldBe('getComputedStyle(embedNoHeight).width', '"425px"'); 20 shouldBe('getComputedStyle(embedNoHeight).height', '"150px"'); 20 21 21 22 embedNoWidth = document.getElementById('embed-no-width'); 22 shouldBe('getComputedStyle(embedNoWidth).width', '"300px"') 23 shouldBe('getComputedStyle(embedNoWidth).width', '"300px"'); 24 shouldBe('getComputedStyle(embedNoWidth).height', '"350px"'); 23 25 24 26 embedNoWidthHeight = document.getElementById('embed-no-width-or-height'); … … 27 29 28 30 objectNoHeight = document.getElementById('object-no-height'); 29 shouldBe('getComputedStyle(objectNoHeight).height', '"150px"') 31 shouldBe('getComputedStyle(objectNoHeight).width', '"425px"'); 32 shouldBe('getComputedStyle(objectNoHeight).height', '"150px"'); 30 33 31 34 objectNoWidth = document.getElementById('object-no-width'); 32 shouldBe('getComputedStyle(objectNoWidth).width', '"300px"') 35 shouldBe('getComputedStyle(objectNoWidth).width', '"300px"'); 36 shouldBe('getComputedStyle(objectNoWidth).height', '"350px"'); 33 37 34 38 objectNoWidthHeight = document.getElementById('object-no-width-or-height'); -
trunk/LayoutTests/platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html
r178197 r203522 21 21 objectNoEmbed = document.getElementById('object-no-embed'); 22 22 23 // Test we don't change any embe /object tag to iframe.23 // Test we don't change any embed/object tag to iframe. 24 24 shouldBe('normalEmbed.tagName', '"EMBED"'); 25 25 shouldBe('elinkEmbed.tagName', '"EMBED"'); … … 32 32 // Test we have the shadow root and the iframe player. 33 33 normalEmbedShadowRoot = internals.shadowRoot(normalEmbed); 34 shouldBe('internals.shadowPseudoId(normalEmbedShadowRoot.firstChild)', '"- apple-youtube-shadow-iframe"');34 shouldBe('internals.shadowPseudoId(normalEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"'); 35 35 shouldBe('normalEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"'); 36 36 37 37 objectEmbedShadowRoot = internals.shadowRoot(objectEmbed); 38 shouldBe('internals.shadowPseudoId(objectEmbedShadowRoot.firstChild)', '"- apple-youtube-shadow-iframe"');38 shouldBe('internals.shadowPseudoId(objectEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"'); 39 39 shouldBe('objectEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"'); 40 40 41 41 objectNoEmbedShadowRoot = internals.shadowRoot(objectNoEmbed); 42 shouldBe('internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild)', '"- apple-youtube-shadow-iframe"');42 shouldBe('internals.shadowPseudoId(objectNoEmbedShadowRoot.firstChild)', '"-webkit-plugin-replacement"'); 43 43 shouldBe('objectNoEmbedShadowRoot.firstChild.firstChild.tagName', '"IFRAME"'); 44 44 -
trunk/Source/WebCore/ChangeLog
r203520 r203522 1 2016-07-21 Daniel Bates <dabates@apple.com> 2 3 REGRESSION: Plugin replaced YouTube Flash videos always have the same width 4 https://bugs.webkit.org/show_bug.cgi?id=159998 5 <rdar://problem/27462285> 6 7 Reviewed by Simon Fraser. 8 9 Fixes an issue where the width of a plugin replaced YouTube video loaded via an HTML embed 10 element would always have the same width regardless of value of the width attribute. 11 12 For YouTube Flash videos the YouTube plugin replacement substitutes a shadow DOM subtree 13 for the default renderer of an HTML embed element. The root of this shadow DOM subtree 14 is an HTML div element. Currently we set inline styles on this <div> when it is instantiated. 15 In particular, we set inline display and position to "inline-block" and "relative", respectively, 16 and set an invalid height and width (we specify a font weight value instead of a CSS length value 17 - this causes an ASSERT_NOT_REACHED() assertion failure in StyleBuilderConverter::convertLengthSizing() 18 in a debug build). These styles never worked as intended and we ultimately created an inline 19 renderer (ignoring display "inline-block") that had auto width and height. Instead it is sufficient 20 to remove all these inline styles and create a RenderBlockFlow renderer for this <div> so that it 21 renders as a block, non-replaced element to achieve the intended illusion that the <embed> is a 22 single element. 23 24 * html/shadow/YouTubeEmbedShadowElement.cpp: Remove unused header HTMLEmbedElement.h and include 25 header RenderBlockFlow.h. Also update copyright in license block. 26 (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): Remove inline styles as these 27 never worked as intended. 28 (WebCore::YouTubeEmbedShadowElement::createElementRenderer): Override; create a block-flow 29 renderer for us so that we layout as a block, non-replaced element. 30 * html/shadow/YouTubeEmbedShadowElement.h: 31 1 32 2016-07-21 Myles C. Maxfield <mmaxfield@apple.com> 2 33 -
trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp
r183975 r203522 1 1 /* 2 * Copyright (C) 2012 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2012-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #include "YouTubeEmbedShadowElement.h" 28 28 29 #include " HTMLEmbedElement.h"29 #include "RenderBlockFlow.h" 30 30 31 31 namespace WebCore { … … 40 40 { 41 41 setPseudo(AtomicString("-webkit-plugin-replacement", AtomicString::ConstructFromLiteral)); 42 } 42 43 43 setInlineStyleProperty(CSSPropertyDisplay, CSSValueInlineBlock); 44 setInlineStyleProperty(CSSPropertyPosition, CSSValueRelative); 45 setInlineStyleProperty(CSSPropertyWidth, CSSValue100); 46 setInlineStyleProperty(CSSPropertyHeight, CSSValue100); 44 RenderPtr<RenderElement> YouTubeEmbedShadowElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) 45 { 46 return createRenderer<RenderBlockFlow>(*this, WTFMove(style)); 47 47 } 48 48 -
trunk/Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h
r183975 r203522 36 36 static Ref<YouTubeEmbedShadowElement> create(Document&); 37 37 38 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; 39 38 40 private: 39 41 YouTubeEmbedShadowElement(Document&);
Note: See TracChangeset
for help on using the changeset viewer.