diff --git a/dom/base/ResponsiveImageSelector.cpp b/dom/base/ResponsiveImageSelector.cpp index 13f7f1867305..888077d505cf 100644 --- a/dom/base/ResponsiveImageSelector.cpp +++ b/dom/base/ResponsiveImageSelector.cpp @@ -39,8 +39,7 @@ ParseInteger(const nsAString& aString, int32_t& aInt) return !(parseResult & ( nsContentUtils::eParseHTMLInteger_Error | nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput | - nsContentUtils::eParseHTMLInteger_IsPercent | - nsContentUtils::eParseHTMLInteger_NonStandard )); + nsContentUtils::eParseHTMLInteger_IsPercent )); } ResponsiveImageSelector::ResponsiveImageSelector(nsIContent *aContent) @@ -621,13 +620,11 @@ ResponsiveImageCandidate::ConsumeDescriptors(nsAString::const_iterator& aIter, // End of current descriptor, consume it, skip spaces // ("After descriptor" state in spec) before continuing descriptors.AddDescriptor(Substring(currentDescriptor, iter)); - for (; iter != end && nsContentUtils::IsHTMLWhitespace(*iter); ++iter); + for (; iter != end && *iter == char16_t(' '); ++iter); if (iter == end) { break; } currentDescriptor = iter; - // Leave one whitespace so the loop advances to this position next iteration - iter--; } else if (*iter == char16_t('(')) { inParens = true; } diff --git a/dom/tests/mochitest/general/test_img_mutations.html b/dom/tests/mochitest/general/test_img_mutations.html index e2bc72d86416..5aa7408e4a68 100644 --- a/dom/tests/mochitest/general/test_img_mutations.html +++ b/dom/tests/mochitest/general/test_img_mutations.html @@ -69,7 +69,7 @@ ok(img.currentSrc.endsWith("non_existent_image.404"), "Should have synchronously selected source"); img.removeAttribute("src"); - is(img.currentSrc, '', "Should have dropped currentSrc"); + is(img.currentSrc, null, "Should have dropped currentSrc"); // Load another image while previous load is still pending img.src = testPNG200; diff --git a/dom/tests/mochitest/general/test_picture_mutations.html b/dom/tests/mochitest/general/test_picture_mutations.html index 7dee62456be9..58efbbc3c511 100644 --- a/dom/tests/mochitest/general/test_picture_mutations.html +++ b/dom/tests/mochitest/general/test_picture_mutations.html @@ -65,7 +65,7 @@ info("test 1"); img.srcset = testPNG100; img.src = testPNG50; - is(img.currentSrc, '', "Should not have synchronously selected source"); + is(img.currentSrc, null, "Should not have synchronously selected source"); // No events should have fired synchronously, now we should get just one load (and no 404 error) expectEvents(1, 0, nextTest); diff --git a/dom/webidl/HTMLImageElement.webidl b/dom/webidl/HTMLImageElement.webidl index fce3c7cdf488..c22c6bf1ad47 100644 --- a/dom/webidl/HTMLImageElement.webidl +++ b/dom/webidl/HTMLImageElement.webidl @@ -62,7 +62,7 @@ partial interface HTMLImageElement { [SetterThrows, Pref="dom.image.picture.enabled"] attribute DOMString sizes; [Pref="dom.image.srcset.enabled"] - readonly attribute DOMString currentSrc; + readonly attribute DOMString? currentSrc; }; // Mozilla extensions.