Title: [207910] trunk
Revision
207910
Author
[email protected]
Date
2016-10-26 13:39:04 -0700 (Wed, 26 Oct 2016)

Log Message

When pasting web archive, width specifiers in srcset attribute change into density specifiers
https://bugs.webkit.org/show_bug.cgi?id=164027
<rdar://problem/28964948>

Reviewed by Tim Horton.

Source/WebCore:

Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
  specifier.

LayoutTests:

* editing/pasteboard/img-srcset-copy-paste-canonicalization-expected.txt: Updated.
* editing/pasteboard/img-srcset-copy-paste-canonicalization.html: Changed to expect a 200w
  specifier to round-trip.
* editing/pasteboard/resources/img-srcset-copy-paste-canonicalization-iframe.html: Changed
  a 1x specifier to 200w.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207909 => 207910)


--- trunk/LayoutTests/ChangeLog	2016-10-26 20:26:00 UTC (rev 207909)
+++ trunk/LayoutTests/ChangeLog	2016-10-26 20:39:04 UTC (rev 207910)
@@ -1,3 +1,17 @@
+2016-10-26  Dan Bernstein  <[email protected]>
+
+        When pasting web archive, width specifiers in srcset attribute change into density specifiers
+        https://bugs.webkit.org/show_bug.cgi?id=164027
+        <rdar://problem/28964948>
+
+        Reviewed by Tim Horton.
+
+        * editing/pasteboard/img-srcset-copy-paste-canonicalization-expected.txt: Updated.
+        * editing/pasteboard/img-srcset-copy-paste-canonicalization.html: Changed to expect a 200w
+          specifier to round-trip.
+        * editing/pasteboard/resources/img-srcset-copy-paste-canonicalization-iframe.html: Changed
+          a 1x specifier to 200w.
+
 2016-10-26  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Media Controller: playback support

Modified: trunk/LayoutTests/editing/pasteboard/img-srcset-copy-paste-canonicalization-expected.txt (207909 => 207910)


--- trunk/LayoutTests/editing/pasteboard/img-srcset-copy-paste-canonicalization-expected.txt	2016-10-26 20:26:00 UTC (rev 207909)
+++ trunk/LayoutTests/editing/pasteboard/img-srcset-copy-paste-canonicalization-expected.txt	2016-10-26 20:39:04 UTC (rev 207910)
@@ -9,8 +9,8 @@
 PASS destinationImageSegments.length is 4
 PASS sourceImageSegments[1] is "2x,"
 PASS destinationImageSegments[1] is "2x,"
-PASS sourceImageSegments[3] is "1x"
-PASS destinationImageSegments[3] is "1x"
+PASS sourceImageSegments[3] is "200w"
+PASS destinationImageSegments[3] is "200w"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/editing/pasteboard/img-srcset-copy-paste-canonicalization.html (207909 => 207910)


--- trunk/LayoutTests/editing/pasteboard/img-srcset-copy-paste-canonicalization.html	2016-10-26 20:26:00 UTC (rev 207909)
+++ trunk/LayoutTests/editing/pasteboard/img-srcset-copy-paste-canonicalization.html	2016-10-26 20:39:04 UTC (rev 207910)
@@ -74,8 +74,8 @@
         shouldBe("destinationImageSegments.length", "4");
         shouldBe("sourceImageSegments[1]", "\"2x,\"");
         shouldBe("destinationImageSegments[1]", "\"2x,\"");
-        shouldBe("sourceImageSegments[3]", "\"1x\"");
-        shouldBe("destinationImageSegments[3]", "\"1x\"");
+        shouldBe("sourceImageSegments[3]", "\"200w\"");
+        shouldBe("destinationImageSegments[3]", "\"200w\"");
         maybeFinishTest();
     }
 </script>

Modified: trunk/LayoutTests/editing/pasteboard/resources/img-srcset-copy-paste-canonicalization-iframe.html (207909 => 207910)


--- trunk/LayoutTests/editing/pasteboard/resources/img-srcset-copy-paste-canonicalization-iframe.html	2016-10-26 20:26:00 UTC (rev 207909)
+++ trunk/LayoutTests/editing/pasteboard/resources/img-srcset-copy-paste-canonicalization-iframe.html	2016-10-26 20:39:04 UTC (rev 207910)
@@ -4,7 +4,7 @@
 </head>
 <body _onload_="window.parent.runTests(window.location.href);">
 <div id="source" contenteditable="true">
-    <img id="image" src="" srcset="../../../fast/hidpi/resources/green-400-px-square.png 2x, ../../../fast/hidpi/resources/green-200-px-square.png 1x">
+    <img id="image" src="" srcset="../../../fast/hidpi/resources/green-400-px-square.png 2x, ../../../fast/hidpi/resources/green-200-px-square.png 200w">
 </div>
 </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (207909 => 207910)


--- trunk/Source/WebCore/ChangeLog	2016-10-26 20:26:00 UTC (rev 207909)
+++ trunk/Source/WebCore/ChangeLog	2016-10-26 20:39:04 UTC (rev 207910)
@@ -1,3 +1,17 @@
+2016-10-26  Dan Bernstein  <[email protected]>
+
+        When pasting web archive, width specifiers in srcset attribute change into density specifiers
+        https://bugs.webkit.org/show_bug.cgi?id=164027
+        <rdar://problem/28964948>
+
+        Reviewed by Tim Horton.
+
+        Updated editing/pasteboard/img-srcset-copy-paste-canonicalization.html.
+
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::completeURLsInAttributeValue): Use 'w' when writing out a width
+          specifier.
+
 2016-10-26  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Media Controller: playback support

Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (207909 => 207910)


--- trunk/Source/WebCore/html/HTMLImageElement.cpp	2016-10-26 20:26:00 UTC (rev 207909)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp	2016-10-26 20:39:04 UTC (rev 207910)
@@ -475,7 +475,7 @@
             if (candidate.resourceWidth != UninitializedDescriptor) {
                 result.append(' ');
                 result.appendNumber(candidate.resourceWidth);
-                result.append('x');
+                result.append('w');
             }
         }
         return result.toString();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to