Input: Load <input type=image> image even before LayoutObject created. [chromium/src : main]

0 views
Skip to first unread message

Vladimir Levin (Gerrit)

unread,
Mar 21, 2023, 9:47:56 AM3/21/23
to Chris Harrelson, blink-rev...@chromium.org, blink-...@chromium.org, Joey Arhar

Attention is currently required from: Chris Harrelson, Joey Arhar.

Vladimir Levin would like Chris Harrelson to review this change.

View Change

Input: Load <input type=image> image even before LayoutObject created.

This patch removes an early out for no-layout object when processing
a src change. We may not have a layout object because of c-v, but we
should still load the image and fire the load event.

R=jar...@chromium.org

Fixed: 1247844
Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
---
M third_party/blink/renderer/core/html/forms/image_input_type.cc
M third_party/blink/web_tests/TestExpectations
2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/third_party/blink/renderer/core/html/forms/image_input_type.cc b/third_party/blink/renderer/core/html/forms/image_input_type.cc
index 51a2518..ae647bd 100644
--- a/third_party/blink/renderer/core/html/forms/image_input_type.cc
+++ b/third_party/blink/renderer/core/html/forms/image_input_type.cc
@@ -130,8 +130,6 @@
}

void ImageInputType::SrcAttributeChanged() {
- if (!GetElement().GetLayoutObject())
- return;
GetElement().EnsureImageLoader().UpdateFromElement(
ImageLoader::kUpdateIgnorePreviousError);
}
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations
index 4b817c6..92714e7 100644
--- a/third_party/blink/web_tests/TestExpectations
+++ b/third_party/blink/web_tests/TestExpectations
@@ -4678,8 +4678,6 @@
# Temporarily disabled to unblock https://crrev.com/c/2979697
crbug.com/1222114 http/tests/devtools/console/console-dir.js [ Failure Pass ]

-crbug.com/1247844 external/wpt/css/css-contain/content-visibility/content-visibility-input-image.html [ Crash Failure Pass Timeout ]
-
# Expected to fail with SuppressDifferentOriginSubframeJSDialogs feature disabled, tested in VirtualTestSuite
crbug.com/1065085 external/wpt/html/webappapis/user-prompts/cannot-show-simple-dialogs/confirm-different-origin-frame.sub.html [ Failure ]
crbug.com/1065085 external/wpt/html/webappapis/user-prompts/cannot-show-simple-dialogs/prompt-different-origin-frame.sub.html [ Failure ]

To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
Gerrit-Change-Number: 4355259
Gerrit-PatchSet: 2
Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-MessageType: newchange

Vladimir Levin (Gerrit)

unread,
Mar 21, 2023, 9:48:00 AM3/21/23
to blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, Joey Arhar, chromium...@chromium.org

Attention is currently required from: Chris Harrelson, Joey Arhar.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      Please take a look. It seems the bots are happy with this change. I'm not sure if you know of any negative implications here. We're basically potentially starting the image load before we create a layout object. We need this for input to fire onload in a c-v hidden subtree, but it of course affects all cases where we don't have a layout object.

To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
Gerrit-Change-Number: 4355259
Gerrit-PatchSet: 2
Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Mar 2023 13:47:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Joey Arhar (Gerrit)

unread,
Mar 21, 2023, 9:56:21 AM3/21/23
to Vladimir Levin, blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Chris Harrelson, Vladimir Levin.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      Please take a look. It seems the bots are happy with this change. […]

      Thanks for working on this!
      Does this affect display:none? I don't know what the behavior is, but if it does then maybe it shouldn't...

To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
Gerrit-Change-Number: 4355259
Gerrit-PatchSet: 2
Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Mar 2023 13:56:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Vladimir Levin <vmp...@chromium.org>
Gerrit-MessageType: comment

Vladimir Levin (Gerrit)

unread,
Mar 21, 2023, 10:41:37 AM3/21/23
to blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, Joey Arhar, chromium...@chromium.org

Attention is currently required from: Chris Harrelson, Joey Arhar.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      Thanks for working on this! […]

      It definitely does affect display: none behavior, which is why I ran the bots to see if there are any problems. My concern is that <img src=...> still fires onload under display none. In fact, https://html.spec.whatwg.org/multipage/input.html#image-button-state-(type=image) doesn't really talk about style or rendering or layout objects. It only alludes that this step can be skipped if "the user agent only fetches images on demand".

      However, if that's the case, then maybe the bug is WontFix, because we don't have to fetch the image in c-v hidden :)

      What I'm trying to say is that we should either align <img> with <input type=image> or align behavior of c-v: hidden with behavior of display: none when it comes to <input type=image> and those two approaches are either this patch, or no patch. WDYT?

To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
Gerrit-Change-Number: 4355259
Gerrit-PatchSet: 2
Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Mar 2023 14:41:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Vladimir Levin <vmp...@chromium.org>
Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
Gerrit-MessageType: comment

Joey Arhar (Gerrit)

unread,
Mar 21, 2023, 10:43:28 AM3/21/23
to Vladimir Levin, blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Chris Harrelson, Vladimir Levin.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      It definitely does affect display: none behavior, which is why I ran the bots to see if there are an […]

      Yeah I guess input type=image is probably not very important compared to img elements and we can follow the same behavior. Want to just put it behind a RuntimeEnabledFeature in case it blows up the internet?

To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
Gerrit-Change-Number: 4355259
Gerrit-PatchSet: 2
Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Mar 2023 14:43:08 +0000

Vladimir Levin (Gerrit)

unread,
Mar 21, 2023, 1:50:34 PM3/21/23
to blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, Joey Arhar, chromium...@chromium.org

Attention is currently required from: Chris Harrelson, Joey Arhar.

View Change

2 comments:

  • Patchset:

    • Patch Set #2:

      Yeah I guess input type=image is probably not very important compared to img elements and we can fol […]

      Good idea! Done.

  • Patchset:

To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
Gerrit-Change-Number: 4355259
Gerrit-PatchSet: 3
Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Tue, 21 Mar 2023 17:50:27 +0000

Joey Arhar (Gerrit)

unread,
Mar 21, 2023, 3:56:31 PM3/21/23
to Vladimir Levin, blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Chris Harrelson, Vladimir Levin.

Patch set 3:Code-Review +1

View Change

    To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
    Gerrit-Change-Number: 4355259
    Gerrit-PatchSet: 3
    Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
    Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
    Gerrit-Attention: Vladimir Levin <vmp...@chromium.org>
    Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Mar 2023 19:56:23 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Vladimir Levin (Gerrit)

    unread,
    Mar 21, 2023, 4:03:44 PM3/21/23
    to blink-rev...@chromium.org, blink-...@chromium.org, Chris Harrelson, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Chris Harrelson.

    Patch set 3:Commit-Queue +2

    View Change

      To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
      Gerrit-Change-Number: 4355259
      Gerrit-PatchSet: 3
      Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
      Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
      Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
      Gerrit-Comment-Date: Tue, 21 Mar 2023 20:03:36 +0000

      Chromium LUCI CQ (Gerrit)

      unread,
      Mar 21, 2023, 4:05:46 PM3/21/23
      to Vladimir Levin, blink-rev...@chromium.org, blink-...@chromium.org, Joey Arhar, Chris Harrelson, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change

      Approvals: Joey Arhar: Looks good to me Vladimir Levin: Commit
      Input: Load <input type=image> image even before LayoutObject created.

      This patch removes an early out for no-layout object when processing
      a src change. We may not have a layout object because of c-v, but we
      should still load the image and fire the load event.

      R=jar...@chromium.org

      Fixed: 1247844
      Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4355259
      Reviewed-by: Joey Arhar <jar...@chromium.org>
      Commit-Queue: Vladimir Levin <vmp...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#1120142}
      ---
      M third_party/blink/renderer/core/html/forms/image_input_type.cc
      M third_party/blink/renderer/platform/runtime_enabled_features.json5
      M third_party/blink/web_tests/TestExpectations
      3 files changed, 11 insertions(+), 3 deletions(-)


      To view, visit change 4355259. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I6a3c102be669c5d821da87caab613d89145d2c05
      Gerrit-Change-Number: 4355259
      Gerrit-PatchSet: 4
      Gerrit-Owner: Vladimir Levin <vmp...@chromium.org>
      Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Vladimir Levin <vmp...@chromium.org>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages