Title: [192132] trunk
Revision
192132
Author
cdu...@apple.com
Date
2015-11-07 15:48:08 -0800 (Sat, 07 Nov 2015)

Log Message

embed element without src and type attributes should represent nothing
https://bugs.webkit.org/show_bug.cgi?id=148853
<rdar://problem/22588235>

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

Rebaseline existing tests.

* web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-05-expected.txt:

Source/WebCore:

As per the HTML specification, an embed element without src and type
attributes should represent nothing:
https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-element

This patch fixes the issue by making sure we don't construct a
renderer for such embed elements.

The new behavior is consistent with Firefox but differs from Chrome.

No new tests, already covered by existing tests.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::rendererIsNeeded):

LayoutTests:

* TestExpectations:
Unskip 2 ref-tests that were previously failing.

* accessibility/inline-block-assertion-expected.txt:
* editing/execCommand/crash-140261-expected.txt:
* fast/block/float/4145535Crash-expected.txt:
* fast/dom/HTMLDocument/document-plugins-expected.txt:
* fast/dom/insertedIntoDocument-child-expected.txt:
* fast/dom/insertedIntoDocument-sibling-expected.txt:
* fast/dom/plugin-attributes-enumeration-expected.txt:
* fast/replaced/percent-height-in-anonymous-block-widget.html:
* fast/replaced/replaced-breaking.html:
* fast/replaced/table-percent-height.html:
* fast/text/international/embed-bidi-style-in-isolate-crash-expected.txt:
* imported/blink/fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item-expected.txt:
Rebaseline / update existing tests.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (192131 => 192132)


--- trunk/LayoutTests/ChangeLog	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/ChangeLog	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,3 +1,28 @@
+2015-11-07  Chris Dumez  <cdu...@apple.com>
+
+        embed element without src and type attributes should represent nothing
+        https://bugs.webkit.org/show_bug.cgi?id=148853
+        <rdar://problem/22588235>
+
+        Reviewed by Zalan Bujtas.
+
+        * TestExpectations:
+        Unskip 2 ref-tests that were previously failing.
+
+        * accessibility/inline-block-assertion-expected.txt:
+        * editing/execCommand/crash-140261-expected.txt:
+        * fast/block/float/4145535Crash-expected.txt:
+        * fast/dom/HTMLDocument/document-plugins-expected.txt:
+        * fast/dom/insertedIntoDocument-child-expected.txt:
+        * fast/dom/insertedIntoDocument-sibling-expected.txt:
+        * fast/dom/plugin-attributes-enumeration-expected.txt:
+        * fast/replaced/percent-height-in-anonymous-block-widget.html:
+        * fast/replaced/replaced-breaking.html:
+        * fast/replaced/table-percent-height.html:
+        * fast/text/international/embed-bidi-style-in-isolate-crash-expected.txt:
+        * imported/blink/fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item-expected.txt:
+        Rebaseline / update existing tests.
+
 2015-11-06  Scott Valentine  <svalent...@ikayzo.com>
 
         Adding new tests for exporting generated RSA keys.

Modified: trunk/LayoutTests/TestExpectations (192131 => 192132)


--- trunk/LayoutTests/TestExpectations	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/TestExpectations	2015-11-07 23:48:08 UTC (rev 192132)
@@ -294,8 +294,6 @@
 
 # New W3C ref tests that are failing.
 webkit.org/b/148847 imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-wbr-element/wbr-element.html [ ImageOnlyFailure ]
-webkit.org/b/148853 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-01.html [ ImageOnlyFailure ]
-webkit.org/b/148853 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-02.html [ ImageOnlyFailure ]
 webkit.org/b/148856 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_initially_paused.html [ ImageOnlyFailure ]
 
 # @supports W3C Failures

Modified: trunk/LayoutTests/accessibility/inline-block-assertion-expected.txt (192131 => 192132)


--- trunk/LayoutTests/accessibility/inline-block-assertion-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/accessibility/inline-block-assertion-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,4 +1,4 @@
- 
+
 Make sure that an inline block element is not cast incorrectly causing an assertion.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/LayoutTests/editing/execCommand/crash-140261-expected.txt (192131 => 192132)


--- trunk/LayoutTests/editing/execCommand/crash-140261-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/editing/execCommand/crash-140261-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,4 +1,4 @@
-  
+
 Test for crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock()
 
 This test passes if it doesn't crash.

Modified: trunk/LayoutTests/fast/block/float/4145535Crash-expected.txt (192131 => 192132)


--- trunk/LayoutTests/fast/block/float/4145535Crash-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/block/float/4145535Crash-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -3,6 +3,4 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock (anonymous) at (0,0) size 784x150
-        RenderEmbeddedObject {EMBED} at (0,0) size 300x150
-      RenderTable {TABLE} at (0,150) size 0x0
+      RenderTable {TABLE} at (0,0) size 0x0

Modified: trunk/LayoutTests/fast/dom/HTMLDocument/document-plugins-expected.txt (192131 => 192132)


--- trunk/LayoutTests/fast/dom/HTMLDocument/document-plugins-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/dom/HTMLDocument/document-plugins-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -3,5 +3,3 @@
 If the test passes, you will see a pass message below.
 
 PASS
-
- 

Modified: trunk/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt (192131 => 192132)


--- trunk/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,2 +1,2 @@
-PASS 
+PASS
 

Modified: trunk/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt (192131 => 192132)


--- trunk/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1 +1 @@
-PASS  
+PASS

Modified: trunk/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt (192131 => 192132)


--- trunk/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -35,4 +35,4 @@
 hspace
 object
 vspace
- 
+

Modified: trunk/LayoutTests/fast/replaced/percent-height-in-anonymous-block-widget.html (192131 => 192132)


--- trunk/LayoutTests/fast/replaced/percent-height-in-anonymous-block-widget.html	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/replaced/percent-height-in-anonymous-block-widget.html	2015-11-07 23:48:08 UTC (rev 192132)
@@ -5,7 +5,7 @@
     </p>
     <div style="height: 50px; background: blue; width: 100px;" id="target">
         <div></div>
-        <embed id="object" style="height: 100%;">
+        <embed id="object" type="video/quicktime" style="height: 100%;">
     </div>
 </body>
 <script>

Modified: trunk/LayoutTests/fast/replaced/replaced-breaking.html (192131 => 192132)


--- trunk/LayoutTests/fast/replaced/replaced-breaking.html	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/replaced/replaced-breaking.html	2015-11-07 23:48:08 UTC (rev 192132)
@@ -15,7 +15,7 @@
         <input type="checkbox"><input type="checkbox">
         <input type="radio"><input type="radio">
         <iframe></iframe><iframe></iframe>
-        <embed></embed><embed></embed>
+        <embed type="video/quicktime"></embed><embed type="video/quicktime"></embed>
     </div>
 </body>
 </html>

Modified: trunk/LayoutTests/fast/replaced/table-percent-height.html (192131 => 192132)


--- trunk/LayoutTests/fast/replaced/table-percent-height.html	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/replaced/table-percent-height.html	2015-11-07 23:48:08 UTC (rev 192132)
@@ -143,8 +143,8 @@
 <table><tr><td><canvas id="canvas-75" style="background-color: #00ff00; height: 75%;"></canvas></td></tr></table>
 <table><tr><td><canvas id="canvas-100" style="background-color: #00ff00; height: 100%;"></canvas></td></tr></table>
 
-<table><tr><td><embed id="embed-75" style="background-color: #00ff00; height: 75%;"></embed></td></tr></table>
-<table><tr><td><embed id="embed-100" style="background-color: #00ff00; height: 100%;"></embed></td></tr></table>
+<table><tr><td><embed id="embed-75" type="video/quicktime" style="background-color: #00ff00; height: 75%;"></embed></td></tr></table>
+<table><tr><td><embed id="embed-100" type="video/quicktime" style="background-color: #00ff00; height: 100%;"></embed></td></tr></table>
 
 <table><tr><td><img id="img-75" src="" style="height: 75%;"></td></tr></table>
 <table><tr><td><img id="img-100" src="" style="height: 100%;"></td></tr></table>

Modified: trunk/LayoutTests/fast/text/international/embed-bidi-style-in-isolate-crash-expected.txt (192131 => 192132)


--- trunk/LayoutTests/fast/text/international/embed-bidi-style-in-isolate-crash-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/fast/text/international/embed-bidi-style-in-isolate-crash-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1 +1 @@
-PASS, if no exception or crash in debug  
+PASS, if no exception or crash in debug

Modified: trunk/LayoutTests/imported/blink/fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item-expected.txt (192131 => 192132)


--- trunk/LayoutTests/imported/blink/fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/imported/blink/fast/css-grid-layout/grid-add-positioned-block-item-after-inline-item-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,3 +1,3 @@
 This test checks that adding a positioned block grid item after an inline grid item (which inserts it inside the existing anonymous block wrapping the inline item) does not crash on debug.
 
-test 
+test

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (192131 => 192132)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,3 +1,16 @@
+2015-11-07  Chris Dumez  <cdu...@apple.com>
+
+        embed element without src and type attributes should represent nothing
+        https://bugs.webkit.org/show_bug.cgi?id=148853
+        <rdar://problem/22588235>
+
+        Reviewed by Zalan Bujtas.
+
+        Rebaseline existing tests.
+
+        * web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt:
+        * web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-05-expected.txt:
+
 2015-11-03  Dean Jackson  <d...@apple.com>
 
         Accept 8 and 4 value hex colors (#RRGGBBAA)

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt (192131 => 192132)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,4 +1,4 @@
-      
+    
   
 
 PASS getElementsByName and newly introduced HTML elements 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-05-expected.txt (192131 => 192132)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-05-expected.txt	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-05-expected.txt	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,4 +1,3 @@
-              
 
 PASS If there is one embed, it should be returned (name) 
 PASS If there are two embeds, a collection should be returned. (name) 

Modified: trunk/Source/WebCore/ChangeLog (192131 => 192132)


--- trunk/Source/WebCore/ChangeLog	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/Source/WebCore/ChangeLog	2015-11-07 23:48:08 UTC (rev 192132)
@@ -1,3 +1,25 @@
+2015-11-07  Chris Dumez  <cdu...@apple.com>
+
+        embed element without src and type attributes should represent nothing
+        https://bugs.webkit.org/show_bug.cgi?id=148853
+        <rdar://problem/22588235>
+
+        Reviewed by Zalan Bujtas.
+
+        As per the HTML specification, an embed element without src and type
+        attributes should represent nothing:
+        https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-element
+
+        This patch fixes the issue by making sure we don't construct a
+        renderer for such embed elements.
+
+        The new behavior is consistent with Firefox but differs from Chrome.
+
+        No new tests, already covered by existing tests.
+
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::rendererIsNeeded):
+
 2015-11-07  Michael Catanzaro  <mcatanz...@igalia.com>
 
         Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code

Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (192131 => 192132)


--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp	2015-11-07 18:11:39 UTC (rev 192131)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp	2015-11-07 23:48:08 UTC (rev 192132)
@@ -183,6 +183,9 @@
 
 bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style)
 {
+    if (!fastHasAttribute(typeAttr) && !fastHasAttribute(srcAttr))
+        return false;
+
     if (isImageType())
         return HTMLPlugInImageElement::rendererIsNeeded(style);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to