Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script iframe intial load replaces about blank #18587

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Sep 21, 2017

When navigating from the initial about:blank, do it with replacement enabled.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #18564
  • These changes do not require tests because the existing tests do the job

This change is Reviewable

@highfive
Copy link

highfive commented Sep 21, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/htmliframeelement.rs
  • @KiChjang: components/script/dom/htmliframeelement.rs
@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

@highfive highfive assigned cbrewster and unassigned nox Sep 21, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

I did a first pass of updating the test expectations, but it's not perfect.

@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2017

Trying commit e527d7f with merge a4894e9...

bors-servo added a commit that referenced this pull request Sep 21, 2017
…about-blank, r=<try>

Script iframe intial load replaces about blank

<!-- Please describe your changes on the following line: -->

When navigating from the initial about:blank, do it with replacement enabled.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18564
- [X] These changes do not require tests because the existing tests do the job

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18587)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2017

💔 Test failed - linux-rel-wpt

@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

Only five failures!

@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

Hmm... fun with document loading:

$ RUST_LOG=script::document_loader ./mach test-wpt --debug-build --no-pause /fetch/api/request/multi-globals/url-parsing.html
...
 0:05.12 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) Full command: /home/ajeffrey/github/asajeffrey/servo/target/debug/servo -w --hard-fail -u Servo/wptrunner -Z replace-surrogates -z http://web-platform.test:8000/fetch/api/request/multi-globals/url-parsing.html --user-stylesheet /home/ajeffrey/github/asajeffrey/servo/resources/ahem.css --certificate-path /tmp/tmp7uTOtg/cacert.pem
(pid:20715) "VMware, Inc."
 0:05.12 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "Gallium 0.4 on softpipe"
 0:05.12 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "3.3 (Core Profile) Mesa 17.2.0-devel"
 0:05.27 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Initial blocking load Some("http://web-platform.test:8000/fetch/api/request/multi-globals/url-parsing.html")."
 0:05.27 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Adding blocking load Script("http://web-platform.test:8000/resources/testharness.js") (1)."
 0:05.35 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Adding blocking load Script("http://web-platform.test:8000/resources/testharnessreport.js") (2)."
 0:05.35 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load Script("http://web-platform.test:8000/resources/testharness.js") (3)."
 0:05.36 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Adding blocking load Subframe("about:blank") (2)."
 0:05.36 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Initial blocking load Some("about:blank")."
 0:05.36 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load PageSource("about:blank") (1)."
 0:05.36 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load Subframe("about:blank") (3)."
 0:05.36 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Adding blocking load Subframe("http://web-platform.test:8000/fetch/api/request/multi-globals/incumbent/incumbent.html") (2)."
 0:05.37 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load PageSource("http://web-platform.test:8000/fetch/api/request/multi-globals/url-parsing.html") (3)."
 0:06.11 LOG: Thread-TestrunnerManager-2 WARNING u'runner_teardown' ()
 0:06.11 LOG: Thread-TestrunnerManager-2 INFO No more tests
 0:06.11 LOG: Thread-TestrunnerManager-3 WARNING u'runner_teardown' ()
 0:06.11 LOG: Thread-TestrunnerManager-3 INFO No more tests
 0:06.37 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load Script("http://web-platform.test:8000/resources/testharnessreport.js") (2)."
 0:07.06 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Initial blocking load Some("http://web-platform.test:8000/fetch/api/request/multi-globals/incumbent/incumbent.html")."
 0:07.07 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Adding blocking load Subframe("about:blank") (1)."
 0:07.07 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Initial blocking load Some("about:blank")."
 0:07.07 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load PageSource("about:blank") (1)."
 0:07.07 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load Subframe("about:blank") (2)."
 0:07.07 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Adding blocking load Subframe("http://web-platform.test:8000/fetch/api/request/multi-globals/current/current.html") (1)."
 0:07.08 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load PageSource("http://web-platform.test:8000/fetch/api/request/multi-globals/incumbent/incumbent.html") (2)."
 0:08.44 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load Subframe("http://web-platform.test:8000/fetch/api/request/multi-globals/incumbent/incumbent.html") (1)."
 0:09.13 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Initial blocking load Some("http://web-platform.test:8000/fetch/api/request/multi-globals/current/current.html")."
 0:09.14 PROCESS_OUTPUT: Thread-TestrunnerManager-1 (pid:20715) "DEBUG:script::document_loader: Removing blocking load PageSource("http://web-platform.test:8000/fetch/api/request/multi-globals/current/current.html") (1)."
 0:09.20 TEST_END: Thread-TestrunnerManager-1 Harness OK. Subtests passed 0/1. Unexpected 1
should parse the URL relative to the current settings object
------------------------------------------------------------
Expected PASS, got FAIL
promise_test: Unhandled rejection with value: object "TypeError: Url could not be parsed"
 0:09.20 LOG: Thread-TestrunnerManager-1 WARNING u'runner_teardown' ()
 0:09.20 LOG: Thread-TestrunnerManager-1 INFO No more tests
 0:10.21 LOG: Thread-TestrunnerManager-1 INFO Test runner process shut down
 0:10.21 LOG: Thread-TestrunnerManager-1 WARNING More tests found, but runner process died, restarting
 0:10.21 LOG: Thread-TestrunnerManager-1 INFO No more tests
 0:10.21 LOG: MainThread INFO Got 1 unexpected results
 0:10.21 SUITE_END: MainThread 
Summary
=======

Ran 2 tests (1 parents, 1 subtests)
Expected results: 1
Unexpected results: 1 (FAIL: 1)

Unexpected Results
==================

/fetch/api/request/multi-globals/url-parsing.html
-------------------------------------------------
FAIL should parse the URL relative to the current settings object
 0:10.25 LOG: MainThread INFO Closing logging queue
 0:10.25 LOG: MainThread INFO queue closed

The document loader for incumbent.html completes before the loader for current.html starts. Not good.

@asajeffrey asajeffrey force-pushed the asajeffrey:script-iframe-intial-load-replaces-about-blank branch from e527d7f to 00af5ba Sep 21, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

IRC conversation with @cbrewster: http://logs.glob.uno/?c=mozilla%23servo&s=21+Sep+2017&e=21+Sep+2017#c756805

TL;DR:

// Only terminate the load blocker if the pipeline id was updated due to a traversal.
// The load blocker will be terminated for a navigation in iframe_load_event_steps.
if reason == UpdatePipelineIdReason::Traversal {
let mut blocker = self.load_blocker.borrow_mut();
LoadBlocker::terminate(&mut blocker);
}

Dubious, as an experiment I'm removing it, but @cbrewster reports that @jdm might not be happy about this.

@bors-servo: try

bors-servo added a commit that referenced this pull request Sep 21, 2017
…about-blank, r=<try>

Script iframe intial load replaces about blank

<!-- Please describe your changes on the following line: -->

When navigating from the initial about:blank, do it with replacement enabled.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18564
- [X] These changes do not require tests because the existing tests do the job

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18587)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2017

Trying commit 00af5ba with merge 638c98a...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2017

💔 Test failed - mac-rel-wpt1

@asajeffrey asajeffrey force-pushed the asajeffrey:script-iframe-intial-load-replaces-about-blank branch from 00af5ba to c6e2460 Sep 21, 2017
@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

We were sending a mozbrowserlocationchange event when changing the session history:

self.trigger_mozbrowserlocationchange(change.top_level_browsing_context_id);

even though we were traversing the history in the case of a navigation with replacement enabled:

self.traverse_to_entry(entry);

which already triggered a location change event:

self.trigger_mozbrowserlocationchange(top_level_id);

This was triggering 2 mozbrowserlocationchange events.

@asajeffrey
Copy link
Member Author

asajeffrey commented Sep 21, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2017

Trying commit c6e2460 with merge 03111d5...

bors-servo added a commit that referenced this pull request Sep 21, 2017
…about-blank, r=<try>

Script iframe intial load replaces about blank

<!-- Please describe your changes on the following line: -->

When navigating from the initial about:blank, do it with replacement enabled.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18564
- [X] These changes do not require tests because the existing tests do the job

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18587)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2017

@@ -2504,7 +2504,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>

// If the navigation is for a top-level browsing context, inform mozbrowser
if change.browsing_context_id == change.top_level_browsing_context_id {
self.trigger_mozbrowserlocationchange(change.top_level_browsing_context_id);
// If this is a replacement then we've already triggered the event in traverse_to_entry

This comment has been minimized.

Copy link
@cbrewster

cbrewster Sep 25, 2017

Member

Should we just return early when calling traverse_to_entry?

@asajeffrey
Copy link
Member Author

asajeffrey commented Nov 29, 2017

On thinking about it, it seems like this PR is just a band-aid, and really we need to have a good look at our whole iframe loading story, with an eye to trying to align it better to the spec.

@asajeffrey asajeffrey closed this Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.