Commit 424c1c64 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

input[type=file] should provide baseline regardless of 'overflow' CSS value

- New behavior matches to Firefox.
- File upload controls in LayoutNG will have overflow:hidden by
  default. The new behavior will be necessary for site compatibility.

Bug: 1040826
Change-Id: I1c620f98806a1751252b4f5a96545609fa90cc1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2102997Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750473}
parent 31b0ce21
......@@ -202,6 +202,10 @@ void FileInputType::HandleDOMActivateEvent(Event& event) {
event.SetDefaultHandled();
}
void FileInputType::CustomStyleForLayoutObject(ComputedStyle& style) {
style.SetShouldIgnoreOverflowPropertyForInlineBlockBaseline();
}
bool FileInputType::TypeShouldForceLegacyLayout() const {
return true;
}
......
......@@ -72,6 +72,7 @@ class CORE_EXPORT FileInputType final : public InputType,
bool ValueMissing(const String&) const override;
String ValueMissingText() const override;
void HandleDOMActivateEvent(Event&) override;
void CustomStyleForLayoutObject(ComputedStyle& style) override;
bool TypeShouldForceLegacyLayout() const override;
LayoutObject* CreateLayoutObject(const ComputedStyle&,
LegacyLayout) const override;
......
This is a testharness.js-based test.
Found 132 tests; 102 PASS, 30 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 132 tests; 106 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <input type="text" value="x" style="overflow: visible; appearance: auto;">
PASS <input type="text" value="x" style="overflow: hidden; appearance: auto;">
PASS <input type="text" value="x" style="overflow: scroll; appearance: auto;">
......@@ -97,11 +97,11 @@ PASS <input type="radio" style="overflow: visible; appearance: none;">
PASS <input type="radio" style="overflow: hidden; appearance: none;">
PASS <input type="radio" style="overflow: scroll; appearance: none;">
PASS <input type="file" style="overflow: visible; appearance: auto;">
FAIL <input type="file" style="overflow: hidden; appearance: auto;"> assert_approx_equals: <span>.offsetTop expected 25 +/- 3 but got 70
FAIL <input type="file" style="overflow: scroll; appearance: auto;"> assert_approx_equals: <span>.offsetTop expected 25 +/- 3 but got 70
PASS <input type="file" style="overflow: hidden; appearance: auto;">
PASS <input type="file" style="overflow: scroll; appearance: auto;">
PASS <input type="file" style="overflow: visible; appearance: none;">
FAIL <input type="file" style="overflow: hidden; appearance: none;"> assert_approx_equals: <span>.offsetTop expected 25 +/- 3 but got 70
FAIL <input type="file" style="overflow: scroll; appearance: none;"> assert_approx_equals: <span>.offsetTop expected 25 +/- 3 but got 70
PASS <input type="file" style="overflow: hidden; appearance: none;">
PASS <input type="file" style="overflow: scroll; appearance: none;">
PASS <input type="submit" value="x" style="overflow: visible; appearance: auto;">
PASS <input type="submit" value="x" style="overflow: hidden; appearance: auto;">
FAIL <input type="submit" value="x" style="overflow: scroll; appearance: auto;"> assert_approx_equals: <span>.offsetTop expected 34 +/- 3 but got 26
......
This is a testharness.js-based test.
Found 132 tests; 102 PASS, 30 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 132 tests; 106 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS <input type="text" value="x" style="overflow: visible; appearance: auto;">
PASS <input type="text" value="x" style="overflow: hidden; appearance: auto;">
PASS <input type="text" value="x" style="overflow: scroll; appearance: auto;">
......@@ -97,11 +97,11 @@ PASS <input type="radio" style="overflow: visible; appearance: none;">
PASS <input type="radio" style="overflow: hidden; appearance: none;">
PASS <input type="radio" style="overflow: scroll; appearance: none;">
PASS <input type="file" style="overflow: visible; appearance: auto;">
FAIL <input type="file" style="overflow: hidden; appearance: auto;"> assert_approx_equals: <span>.offsetTop expected 26 +/- 3 but got 70
FAIL <input type="file" style="overflow: scroll; appearance: auto;"> assert_approx_equals: <span>.offsetTop expected 26 +/- 3 but got 70
PASS <input type="file" style="overflow: hidden; appearance: auto;">
PASS <input type="file" style="overflow: scroll; appearance: auto;">
PASS <input type="file" style="overflow: visible; appearance: none;">
FAIL <input type="file" style="overflow: hidden; appearance: none;"> assert_approx_equals: <span>.offsetTop expected 26 +/- 3 but got 70
FAIL <input type="file" style="overflow: scroll; appearance: none;"> assert_approx_equals: <span>.offsetTop expected 26 +/- 3 but got 70
PASS <input type="file" style="overflow: hidden; appearance: none;">
PASS <input type="file" style="overflow: scroll; appearance: none;">
PASS <input type="submit" value="x" style="overflow: visible; appearance: auto;">
PASS <input type="submit" value="x" style="overflow: hidden; appearance: auto;">
FAIL <input type="submit" value="x" style="overflow: scroll; appearance: auto;"> assert_approx_equals: <span>.offsetTop expected 34 +/- 3 but got 27
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment