Bug 253409
| Summary: | maxlength test for <textarea> failing when ran in a third-party iframe | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | akeerthi, cdumez, karlcow, simon.fraser, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=235670 | ||
Ahmad Saleem
Hi Team,
I came across following two tests from Blink repo / Chromium Source and noted that WebKit ToT (261243@main) are failing some of them:
Test (max length): https://jsfiddle.net/pLahgb8q/show (Firefox Nightly 112 only fails two while WebKit / Safari fails a lot more)
Test (min length): https://jsfiddle.net/ts7ad8zp/show. (Firefox Nightly 112 fails both same test as of Safari / WebKit)
^ Chrome Canary 113 passes all of above tests.
Just wanted to raise so we can track them.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Chris Dumez
https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2 failures are not real failures, the exception name matches, only the exception string doesn't. We can choose whatever string/description we want for exceptions.
https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures though. Firefox and Chrome pass all the tests, we don't.
Chris Dumez
(In reply to Chris Dumez from comment #1)
> https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> failures are not real failures, the exception name matches, only the
> exception string doesn't. We can choose whatever string/description we want
> for exceptions.
>
> https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> though. Firefox and Chrome pass all the tests, we don't.
The weird thing though is I thought I had imported https://jsfiddle.net/pLahgb8q/show as layout test as LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all the checks for this test.
Ahmad Saleem
(In reply to Chris Dumez from comment #2)
> (In reply to Chris Dumez from comment #1)
> > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > failures are not real failures, the exception name matches, only the
> > exception string doesn't. We can choose whatever string/description we want
> > for exceptions.
> >
> > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > though. Firefox and Chrome pass all the tests, we don't.
>
> The weird thing though is I thought I had imported
> https://jsfiddle.net/pLahgb8q/show as layout test as
> LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> the checks for this test.
I took updated copy of test from https://source.chromium.org/.
Chris Dumez
(In reply to Ahmad Saleem from comment #3)
> (In reply to Chris Dumez from comment #2)
> > (In reply to Chris Dumez from comment #1)
> > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > failures are not real failures, the exception name matches, only the
> > > exception string doesn't. We can choose whatever string/description we want
> > > for exceptions.
> > >
> > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > though. Firefox and Chrome pass all the tests, we don't.
> >
> > The weird thing though is I thought I had imported
> > https://jsfiddle.net/pLahgb8q/show as layout test as
> > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > the checks for this test.
>
> I took updated copy of test from https://source.chromium.org/.
LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
Ahmad Saleem
(In reply to Chris Dumez from comment #4)
> (In reply to Ahmad Saleem from comment #3)
> > (In reply to Chris Dumez from comment #2)
> > > (In reply to Chris Dumez from comment #1)
> > > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > > failures are not real failures, the exception name matches, only the
> > > > exception string doesn't. We can choose whatever string/description we want
> > > > for exceptions.
> > > >
> > > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > > though. Firefox and Chrome pass all the tests, we don't.
> > >
> > > The weird thing though is I thought I had imported
> > > https://jsfiddle.net/pLahgb8q/show as layout test as
> > > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > > the checks for this test.
> >
> > I took updated copy of test from https://source.chromium.org/.
>
> LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
> web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
You are right. I just did 'diffcheck' on both test and except 'Error String' and one comment, there is no difference in both.
Weird - if these tests are failing in JSFiddle but passing via Test Runner.
Chris Dumez
(In reply to Ahmad Saleem from comment #5)
> (In reply to Chris Dumez from comment #4)
> > (In reply to Ahmad Saleem from comment #3)
> > > (In reply to Chris Dumez from comment #2)
> > > > (In reply to Chris Dumez from comment #1)
> > > > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > > > failures are not real failures, the exception name matches, only the
> > > > > exception string doesn't. We can choose whatever string/description we want
> > > > > for exceptions.
> > > > >
> > > > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > > > though. Firefox and Chrome pass all the tests, we don't.
> > > >
> > > > The weird thing though is I thought I had imported
> > > > https://jsfiddle.net/pLahgb8q/show as layout test as
> > > > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > > > the checks for this test.
> > >
> > > I took updated copy of test from https://source.chromium.org/.
> >
> > LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
> > web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
>
> You are right. I just did 'diffcheck' on both test and except 'Error String'
> and one comment, there is no difference in both.
>
> Weird - if these tests are failing in JSFiddle but passing via Test Runner.
Indeed! Might be a behavior difference when running in a third-party iframe (since that's how jsFiddle runs the test case).
Ahmad Saleem
(In reply to Chris Dumez from comment #6)
> (In reply to Ahmad Saleem from comment #5)
> > (In reply to Chris Dumez from comment #4)
> > > (In reply to Ahmad Saleem from comment #3)
> > > > (In reply to Chris Dumez from comment #2)
> > > > > (In reply to Chris Dumez from comment #1)
> > > > > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > > > > failures are not real failures, the exception name matches, only the
> > > > > > exception string doesn't. We can choose whatever string/description we want
> > > > > > for exceptions.
> > > > > >
> > > > > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > > > > though. Firefox and Chrome pass all the tests, we don't.
> > > > >
> > > > > The weird thing though is I thought I had imported
> > > > > https://jsfiddle.net/pLahgb8q/show as layout test as
> > > > > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > > > > the checks for this test.
> > > >
> > > > I took updated copy of test from https://source.chromium.org/.
> > >
> > > LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
> > > web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
> >
> > You are right. I just did 'diffcheck' on both test and except 'Error String'
> > and one comment, there is no difference in both.
> >
> > Weird - if these tests are failing in JSFiddle but passing via Test Runner.
>
> Indeed! Might be a behavior difference when running in a third-party iframe
> (since that's how jsFiddle runs the test case).
Let me make local HTML and then run them on WebKit ToT local build.
Ahmad Saleem
(In reply to Ahmad Saleem from comment #7)
> (In reply to Chris Dumez from comment #6)
> > (In reply to Ahmad Saleem from comment #5)
> > > (In reply to Chris Dumez from comment #4)
> > > > (In reply to Ahmad Saleem from comment #3)
> > > > > (In reply to Chris Dumez from comment #2)
> > > > > > (In reply to Chris Dumez from comment #1)
> > > > > > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > > > > > failures are not real failures, the exception name matches, only the
> > > > > > > exception string doesn't. We can choose whatever string/description we want
> > > > > > > for exceptions.
> > > > > > >
> > > > > > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > > > > > though. Firefox and Chrome pass all the tests, we don't.
> > > > > >
> > > > > > The weird thing though is I thought I had imported
> > > > > > https://jsfiddle.net/pLahgb8q/show as layout test as
> > > > > > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > > > > > the checks for this test.
> > > > >
> > > > > I took updated copy of test from https://source.chromium.org/.
> > > >
> > > > LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
> > > > web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
> > >
> > > You are right. I just did 'diffcheck' on both test and except 'Error String'
> > > and one comment, there is no difference in both.
> > >
> > > Weird - if these tests are failing in JSFiddle but passing via Test Runner.
> >
> > Indeed! Might be a behavior difference when running in a third-party iframe
> > (since that's how jsFiddle runs the test case).
>
> Let me make local HTML and then run them on WebKit ToT local build.
Yes - it is JSFiddle playing around. Using local copy on WebKit ToT, we pass all tests.
Chris Dumez
(In reply to Ahmad Saleem from comment #8)
> (In reply to Ahmad Saleem from comment #7)
> > (In reply to Chris Dumez from comment #6)
> > > (In reply to Ahmad Saleem from comment #5)
> > > > (In reply to Chris Dumez from comment #4)
> > > > > (In reply to Ahmad Saleem from comment #3)
> > > > > > (In reply to Chris Dumez from comment #2)
> > > > > > > (In reply to Chris Dumez from comment #1)
> > > > > > > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > > > > > > failures are not real failures, the exception name matches, only the
> > > > > > > > exception string doesn't. We can choose whatever string/description we want
> > > > > > > > for exceptions.
> > > > > > > >
> > > > > > > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > > > > > > though. Firefox and Chrome pass all the tests, we don't.
> > > > > > >
> > > > > > > The weird thing though is I thought I had imported
> > > > > > > https://jsfiddle.net/pLahgb8q/show as layout test as
> > > > > > > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > > > > > > the checks for this test.
> > > > > >
> > > > > > I took updated copy of test from https://source.chromium.org/.
> > > > >
> > > > > LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
> > > > > web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
> > > >
> > > > You are right. I just did 'diffcheck' on both test and except 'Error String'
> > > > and one comment, there is no difference in both.
> > > >
> > > > Weird - if these tests are failing in JSFiddle but passing via Test Runner.
> > >
> > > Indeed! Might be a behavior difference when running in a third-party iframe
> > > (since that's how jsFiddle runs the test case).
> >
> > Let me make local HTML and then run them on WebKit ToT local build.
>
> Yes - it is JSFiddle playing around. Using local copy on WebKit ToT, we pass
> all tests.
Looking at the test case, I bet this is a focus behavior difference. I suspect the JS is not able to focus the fields in the third-party iframe and thus we end up with empty fields.
Ahmad Saleem
(In reply to Chris Dumez from comment #9)
> (In reply to Ahmad Saleem from comment #8)
> > (In reply to Ahmad Saleem from comment #7)
> > > (In reply to Chris Dumez from comment #6)
> > > > (In reply to Ahmad Saleem from comment #5)
> > > > > (In reply to Chris Dumez from comment #4)
> > > > > > (In reply to Ahmad Saleem from comment #3)
> > > > > > > (In reply to Chris Dumez from comment #2)
> > > > > > > > (In reply to Chris Dumez from comment #1)
> > > > > > > > > https://jsfiddle.net/ts7ad8zp/show is already fully passing on trunk. The 2
> > > > > > > > > failures are not real failures, the exception name matches, only the
> > > > > > > > > exception string doesn't. We can choose whatever string/description we want
> > > > > > > > > for exceptions.
> > > > > > > > >
> > > > > > > > > https://jsfiddle.net/pLahgb8q/show does have a few legit-looking failures
> > > > > > > > > though. Firefox and Chrome pass all the tests, we don't.
> > > > > > > >
> > > > > > > > The weird thing though is I thought I had imported
> > > > > > > > https://jsfiddle.net/pLahgb8q/show as layout test as
> > > > > > > > LayoutTests/fast/forms/textarea-maxlength.html. However, we are passing all
> > > > > > > > the checks for this test.
> > > > > > >
> > > > > > > I took updated copy of test from https://source.chromium.org/.
> > > > > >
> > > > > > LayoutTests/fast/forms/textarea-maxlength.html is a straight copy of Blink's
> > > > > > web_tests/fast/forms/textarea/textarea-maxlength.html as far as I can tell.
> > > > >
> > > > > You are right. I just did 'diffcheck' on both test and except 'Error String'
> > > > > and one comment, there is no difference in both.
> > > > >
> > > > > Weird - if these tests are failing in JSFiddle but passing via Test Runner.
> > > >
> > > > Indeed! Might be a behavior difference when running in a third-party iframe
> > > > (since that's how jsFiddle runs the test case).
> > >
> > > Let me make local HTML and then run them on WebKit ToT local build.
> >
> > Yes - it is JSFiddle playing around. Using local copy on WebKit ToT, we pass
> > all tests.
>
> Looking at the test case, I bet this is a focus behavior difference. I
> suspect the JS is not able to focus the fields in the third-party iframe and
> thus we end up with empty fields.
Should we mark this as "RESOLVED INVALID" or rename title to something along the lines of 'focus' issue in third party iframes?
Chris Dumez
In Element::focus(), we have:
```
if (!frame.hasHadUserInteraction() && !frame.isMainFrame() && !document->topOrigin().isSameOriginDomain(document->securityOrigin()))
return;
```
Which means that we don't allow elements in third-party frames to get focus in JS without a user interaction. This behavior appears to be stricter than both Chrome and Firefox so it may be a compatibility risk
I am adding a few people in CC would know more about focus than I do to see if we should update our behavior.
Radar WebKit Bug Importer
<rdar://problem/106615378>
Ahmad Saleem
*** Bug 249907 has been marked as a duplicate of this bug. ***
Ahmad Saleem
*** Bug 250650 has been marked as a duplicate of this bug. ***
Ahmad Saleem
*** Bug 265282 has been marked as a duplicate of this bug. ***