Title: [172763] branches/safari-600.1-branch/Source/WebCore
Revision
172763
Author
[email protected]
Date
2014-08-19 14:39:23 -0700 (Tue, 19 Aug 2014)

Log Message

Merged r172600.  <rdar://problem/18021928>

Modified Paths

Diff

Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (172762 => 172763)


--- branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-08-19 21:34:32 UTC (rev 172762)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog	2014-08-19 21:39:23 UTC (rev 172763)
@@ -1,5 +1,31 @@
 2014-08-19  Dana Burkart  <[email protected]>
 
+        Merge r172600
+
+    2014-08-14  Yoav Weiss  <[email protected]>
+
+            srcset with w descriptor doesn't behave as expected when sizes is not supported.
+            https://bugs.webkit.org/show_bug.cgi?id=135935
+
+            Reviewed by Dean Jackson.
+
+            In current implementation, if sizes is not supported, when authors would write
+            markup such as `<img src="" srcset="100px.jpg 100w, 400px.jpg 400w">`
+            the first candidate in srcset would be picked, regardless of its dimensions 
+            That is likely to be confusing for authors.
+            Dropping these "not yet supported" candidates is likely to be less confusing,
+            and will result in the "fallback.jpg" candidate being picked.
+
+            No new tests since this change only concerns builds that are built
+            with the PICTURE_SIZES compile flag turned off.
+
+            * html/parser/HTMLSrcsetParser.cpp:
+            (WebCore::parseDescriptors):
+            Drop candidates that include either 'w' or 'h' descriptors when the
+            sizes feature is not supported.
+
+2014-08-19  Dana Burkart  <[email protected]>
+
         Merge r172502
 
     2014-08-12  Pratik Solanki  <[email protected]>

Modified: branches/safari-600.1-branch/Source/WebCore/html/parser/HTMLSrcsetParser.cpp (172762 => 172763)


--- branches/safari-600.1-branch/Source/WebCore/html/parser/HTMLSrcsetParser.cpp	2014-08-19 21:34:32 UTC (rev 172762)
+++ branches/safari-600.1-branch/Source/WebCore/html/parser/HTMLSrcsetParser.cpp	2014-08-19 21:39:23 UTC (rev 172763)
@@ -140,13 +140,18 @@
                 return false;
             result.setDensity(density);
         } else if (descriptorChar == 'w') {
+#if ENABLE(PICTURE_SIZES)
             if (result.hasDensity() || result.hasWidth())
                 return false;
             int resourceWidth = descriptor.toInt(isValid);
             if (!isValid || resourceWidth <= 0)
                 return false;
             result.setResourceWidth(resourceWidth);
+#else
+            return false;
+#endif
         } else if (descriptorChar == 'h') {
+#if ENABLE(PICTURE_SIZES)
             // This is here only for future compat purposes.
             // The value of the 'h' descriptor is not used.
             if (result.hasDensity() || result.hasHeight())
@@ -155,6 +160,9 @@
             if (!isValid || resourceHeight <= 0)
                 return false;
             result.setResourceHeight(resourceHeight);
+#else
+            return false;
+#endif
         }
     }
     return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to