Title: [210721] branches/safari-603-branch

Diff

Modified: branches/safari-603-branch/LayoutTests/ChangeLog (210720 => 210721)


--- branches/safari-603-branch/LayoutTests/ChangeLog	2017-01-13 07:05:03 UTC (rev 210720)
+++ branches/safari-603-branch/LayoutTests/ChangeLog	2017-01-13 07:05:07 UTC (rev 210721)
@@ -1,5 +1,22 @@
 2017-01-12  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r210536. rdar://problem/29939970
+
+    2017-01-09  Chris Dumez  <cdu...@apple.com>
+
+            REGRESSION(r189555): ImageDocument title no longer includes the size of the image
+            https://bugs.webkit.org/show_bug.cgi?id=166876
+            <rdar://problem/29939970>
+
+            Reviewed by Tim Horton.
+
+            Add layout test coverage.
+
+            * fast/images/imageDocument-title-expected.txt: Added.
+            * fast/images/imageDocument-title.html: Added.
+
+2017-01-12  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r210399. rdar://problem/29019333
 
     2017-01-05  Myles C. Maxfield  <mmaxfi...@apple.com>

Added: branches/safari-603-branch/LayoutTests/fast/images/imageDocument-title-expected.txt (0 => 210721)


--- branches/safari-603-branch/LayoutTests/fast/images/imageDocument-title-expected.txt	                        (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/images/imageDocument-title-expected.txt	2017-01-13 07:05:07 UTC (rev 210721)
@@ -0,0 +1,11 @@
+Tests that the title of an ImageDocument is properly set.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS f.contentDocument.title is "green-24x24.jpg 24×24 pixels"
+PASS f.contentDocument.head.getElementsByTagName('title')[0].textContent is "green-24x24.jpg 24×24 pixels"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-603-branch/LayoutTests/fast/images/imageDocument-title.html (0 => 210721)


--- branches/safari-603-branch/LayoutTests/fast/images/imageDocument-title.html	                        (rev 0)
+++ branches/safari-603-branch/LayoutTests/fast/images/imageDocument-title.html	2017-01-13 07:05:07 UTC (rev 210721)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+</head>
+<body>
+<script src=""
+<script>
+description("Tests that the title of an ImageDocument is properly set.");
+jsTestIsAsync = true;
+
+var f = document.createElement("iframe");
+f._onload_ = function() {
+    shouldBeEqualToString("f.contentDocument.title", "green-24x24.jpg 24×24 pixels");
+    shouldBeEqualToString("f.contentDocument.head.getElementsByTagName('title')[0].textContent", "green-24x24.jpg 24×24 pixels");
+    finishJSTest();
+}
+
+f.src = ""
+document.body.appendChild(f);
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (210720 => 210721)


--- branches/safari-603-branch/Source/WebCore/ChangeLog	2017-01-13 07:05:03 UTC (rev 210720)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog	2017-01-13 07:05:07 UTC (rev 210721)
@@ -1,5 +1,28 @@
 2017-01-12  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r210536. rdar://problem/29939970
+
+    2017-01-09  Chris Dumez  <cdu...@apple.com>
+
+            REGRESSION(r189555): ImageDocument title no longer includes the size of the image
+            https://bugs.webkit.org/show_bug.cgi?id=166876
+            <rdar://problem/29939970>
+
+            Reviewed by Tim Horton.
+
+            ImageDocument title no longer included the size of the image after r189555.
+            This is because Document::setTitle() is a no-op if the document does not
+            have a <head> element. To address the issue, we now include a <head>
+            element in ImageDocuments so that their title element properly gets added
+            to it.
+
+            Test: fast/images/imageDocument-title.html
+
+            * html/ImageDocument.cpp:
+            (WebCore::ImageDocument::createDocumentStructure):
+
+2017-01-12  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r210689. rdar://problem/29985957
 
     2017-01-12  Chris Dumez  <cdu...@apple.com>

Modified: branches/safari-603-branch/Source/WebCore/html/ImageDocument.cpp (210720 => 210721)


--- branches/safari-603-branch/Source/WebCore/html/ImageDocument.cpp	2017-01-13 07:05:03 UTC (rev 210720)
+++ branches/safari-603-branch/Source/WebCore/html/ImageDocument.cpp	2017-01-13 07:05:07 UTC (rev 210721)
@@ -35,6 +35,7 @@
 #include "FrameLoaderClient.h"
 #include "FrameView.h"
 #include "HTMLBodyElement.h"
+#include "HTMLHeadElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLImageElement.h"
 #include "HTMLNames.h"
@@ -215,6 +216,9 @@
 
     frame()->injectUserScripts(InjectAtDocumentStart);
 
+    auto head = HTMLHeadElement::create(*this);
+    rootElement->appendChild(head);
+
     auto body = HTMLBodyElement::create(*this);
     body->setAttribute(styleAttr, "margin: 0px");
     if (MIMETypeRegistry::isPDFMIMEType(document().loader()->responseMIMEType()))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to