Bug 1641284 [wpt PR 23798] - Fixes input image type fallback content to respect display property., a=testonly
authorYu Han <yuzhehan@chromium.org>
Mon, 22 Jun 2020 10:41:38 +0000
changeset 536834 2b3d5e91ef77dc3ec3db0016cb6b59a89313c011
parent 536833 5e1ec38dd7a121a93b8831c899102e13d69fd377
child 536835 a824c0e02cfd985e0dabbc1551b29193b79c6d0c
push id119680
push userwptsync@mozilla.com
push dateTue, 23 Jun 2020 11:08:22 +0000
treeherderautoland@7ca3d4bada73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1641284, 23798, 948066, 2212963, 779108
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1641284 [wpt PR 23798] - Fixes input image type fallback content to respect display property., a=testonly Automatic update from web-platform-tests Fixes input image type fallback content to respect display property. Prior to this CL, image input type will always use a Block layout when the image src can't be loaded. This prevents web developers from changing the layout via CSS display property. This CL fixes the issue by creating a Layout object based on the CSS computed styles. Web developers can change image's fallback text layout via CSS display property. If none is passed in, it defaults to inline-block, which is the default layout of the input image type. Spec: https://html.spec.whatwg.org/multipage/rendering.html#images-3:represents-5 Bug: 948066 Change-Id: I907432485472c472608b9d84d36fa2df29412f7c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212963 Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Yu Han <yuzhehan@chromium.org> Cr-Commit-Position: refs/heads/master@{#779108} -- wpt-commits: 06fdf531b436b283cb6bb0f4d33ceffb904a9184 wpt-pr: 23798
testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-image-inline-alt-ref.html
testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-image-inline-alt.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-image-inline-alt-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>Input image type fallback content should respect display property.</title>
+<meta name="author" title="Yu Han" href="mailto:yuzhehan@chromium.org">
+<style>
+  div {
+    border:1px dashed blue;
+    line-height: 1em;
+    height: 100px;
+    width: 150px;
+  }
+  input {
+    font: 1em monospace;
+    line-height: 1em;
+  }
+</style>
+<div>
+  <input alt="This is a long ALT text which takes up few lines to display. And additional text to be inlined." type="image">
+</div>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/input-image-inline-alt.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<title>Input image type fallback content should respect display property.</title>
+<meta name="author" title="Yu Han" href="mailto:yuzhehan@chromium.org">
+<link rel="match" href="input-image-inline-alt-ref.html">
+<link ref="help" href="https://html.spec.whatwg.org/multipage/rendering.html#images-3:represents-5">
+<style>
+  div {
+    border:1px dashed blue;
+    font: 1em monospace;
+    line-height: 1em;
+    height: 100px;
+    width: 150px;
+  }
+  input {
+    display: inline;
+    font: 1em monospace;
+    line-height: 1em;
+  }
+</style>
+<div>
+  <input alt="This is a long ALT text which takes up few lines to display." type="image">
+  And additional text to be inlined.
+</div>