An <img> with no 'src', no 'alt' but 'srcset' represents nothing

Based on [1], it would seem that we should treat the case where we have
no image candidate as representing nothing - this apparently also
matches what other UAs do.

Simplify the NoImageSourceSpecified helper function a bit. (IsNull
implies IsEmpty and !hasAttribute.)

[1] https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:the-img-element-5

Bug: 897033
Change-Id: I37ecad8faea2b929e8cf35ce7c746313b2d3b915
Reviewed-on: https://chromium-review.googlesource.com/c/1293574
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#601648}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/current-pixel-density/basic-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/current-pixel-density/basic-expected.txt
deleted file mode 100644
index 16f3604..0000000
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/current-pixel-density/basic-expected.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-This is a testharness.js-based test.
-PASS <img src="/images/green-256x256.png" data-expect="256">
-PASS <img srcset="/images/green-256x256.png 1x" data-expect="256">
-PASS <img srcset="/images/green-256x256.png 1.6x" data-expect="160">
-PASS <img srcset="/images/green-256x256.png 2x" data-expect="128">
-PASS <img srcset="/images/green-256x256.png 10000x" data-expect="0">
-FAIL <img srcset="/images/green-256x256.png 9e99999999999999999999999x" data-expect="0"> assert_equals: width expected 0 but got 16
-PASS <img srcset="/images/green-256x256.png 256w" sizes="256px" data-expect="256">
-PASS <img srcset="/images/green-256x256.png 512w" sizes="256px" data-expect="128">
-PASS <img srcset="/images/green-256x256.png 256w" sizes="512px" data-expect="512">
-PASS <img srcset="/images/green-256x256.png 256w" sizes="1px" data-expect="1">
-PASS <img srcset="/images/green-256x256.png 256w" sizes="0px" data-expect="0">
-PASS <img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10">
-PASS <img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'><circle%20r='1'/></svg> 2x" data-expect="10">
-PASS <img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10">
-Harness: the test ran to completion.
-
diff --git a/third_party/blink/renderer/core/html/html_image_fallback_helper.cc b/third_party/blink/renderer/core/html/html_image_fallback_helper.cc
index c73fb09..4801ad7 100644
--- a/third_party/blink/renderer/core/html/html_image_fallback_helper.cc
+++ b/third_party/blink/renderer/core/html/html_image_fallback_helper.cc
@@ -23,12 +23,7 @@
 using namespace HTMLNames;
 
 static bool NoImageSourceSpecified(const Element& element) {
-  bool no_src_specified = !element.hasAttribute(srcAttr) ||
-                          element.getAttribute(srcAttr).IsNull() ||
-                          element.getAttribute(srcAttr).IsEmpty();
-  bool no_srcset_specified = !element.hasAttribute(srcsetAttr) ||
-                             element.getAttribute(srcsetAttr).IsNull();
-  return no_src_specified && no_srcset_specified;
+  return element.getAttribute(srcAttr).IsEmpty();
 }
 
 static bool ElementRepresentsNothing(const Element& element) {