Skip to content

History interface Go, Back, and Forward - #12552

Merged
bors-servo merged 1 commit into
servo:masterfrom
cbrewster:history_interface
Jul 22, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
cbrewster:history_interface

Conversation

@cbrewster

@cbrewster cbrewster commented Jul 22, 2016 •

Copy link
Copy Markdown
Contributor

r? @asajeffrey


  • There are tests for these changes OR
  • These changes do not require tests because _____

implement go, forward, back


This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/history.rs, components/script/dom/webidls/History.webidl, components/script/dom/mod.rs, components/script/dom/window.rs, components/script/dom/webidls/Window.webidl

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 22, 2016
@cbrewster

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 09ecfbb with merge 80d469d...

bors-servo pushed a commit that referenced this pull request Jul 22, 2016
History interface Go, Back, and Forward

<!-- Please describe your changes on the following line: -->
r? @asajeffrey

---
<!-- 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 #5670 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

implement go, forward, back
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 22, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor

Tests with unexpected results:
  ▶ Unexpected subtest result in /html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html:
  │ FAIL [expected PASS] Restoring window.name on cross-origin history traversal
  │   → f.contentWindow is null
  │ 
  │ steps<@http://web-platform.test:8000/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html:13:17
  │ steps</<@http://web-platform.test:8000/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html:25:72
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1402:20
  │ Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1426:20
  │ next<@http://web-platform.test:8000/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html:28:32
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1402:20
  └ Test.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1426:20

  ▶ Unexpected subtest result in /html/browsers/history/the-location-interface/location_assign_about_blank.html:
  └ PASS [expected FAIL] location.assign with initial about:blank browsing context

  ▶ Unexpected subtest result in /_mozilla/mozilla/interfaces.html:
  │ FAIL [expected PASS] Interfaces exposed on the window
  │   → assert_true: If this is failing: DANGER, are you sure you want to expose the new interface History to all webpages as a property on the global? Do not make a change to this file without review from jdm or Ms2ger for that specific change! expected true got false
  │ 
  │ test_interfaces/<@http://web-platform.test:8000/_mozilla/mozilla/interfaces.js:70:7
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1402:20
  │ test@http://web-platform.test:8000/resources/testharness.js:500:9
  │ test_interfaces@http://web-platform.test:8000/_mozilla/mozilla/interfaces.js:1:3
  └ @http://web-platform.test:8000/_mozilla/mozilla/interfaces.html:6:1

  ▶ Unexpected subtest result in /_mozilla/mozilla/interfaces.worker:
  │ FAIL [expected PASS] Untitled
  │   → assert_true: If this is failing: DANGER, are you sure you want to expose the new interface History to all webpages as a property on the global? Do not make a change to this file without review from jdm or Ms2ger for that specific change! expected true got false
  │ 
  │ test_interfaces/<@http://web-platform.test:8000/_mozilla/mozilla/interfaces.js:71:7
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1403:20
  │ test@http://web-platform.test:8000/resources/testharness.js:501:9
  │ test_interfaces@http://web-platform.test:8000/_mozilla/mozilla/interfaces.js:2:3
  └ @http://web-platform.test:8000/_mozilla/mozilla/interfaces.worker.js:9:1

The first fail is the interesting one, the second is good news. The other two are just reminding us to get @jdm or @Ms2ger to bless this PR.

@cbrewster
cbrewster force-pushed the history_interface branch from 09ecfbb to bec5a95 Compare July 22, 2016 15:10
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 22, 2016
@cbrewster cbrewster mentioned this pull request Jul 22, 2016
18 of 24 tasks
@cbrewster
cbrewster force-pushed the history_interface branch from bec5a95 to 7273f24 Compare July 22, 2016 15:35
@cbrewster

Copy link
Copy Markdown
Contributor Author

Updated test expectations

@asajeffrey

Copy link
Copy Markdown
Contributor

Reviewed 13 of 14 files at r1, 5 of 5 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/script/dom/webidls/History.webidl, line 10 [r2] (raw file):

[Exposed=(Window,Worker)]
interface History {
  // readonly attribute unsigned long length;

It would be nice to support length at some point, not necessarily this PR though.


Comments from Reviewable

@asajeffrey

Copy link
Copy Markdown
Contributor

LGTM, we need @jdm or @Ms2ger to bless it, then you can r=me.

@asajeffrey asajeffrey added S-awaiting-answer Someone asked a question that requires an answer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 22, 2016
@jdm

jdm commented Jul 22, 2016

Copy link
Copy Markdown
Member

History does not belong in worker scopes and shouldn't have any Exposed annotation.

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 7273f24 has been approved by asajeffrey

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-answer Someone asked a question that requires an answer. labels Jul 22, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7273f24 with merge 445152c...

bors-servo pushed a commit that referenced this pull request Jul 22, 2016
History interface Go, Back, and Forward

<!-- Please describe your changes on the following line: -->
r? @asajeffrey

---
<!-- 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 #5670 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

implement go, forward, back

<!-- 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/12552)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 22, 2016
@cbrewster

Copy link
Copy Markdown
Contributor Author

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 7273f24 with merge 629675a...

bors-servo pushed a commit that referenced this pull request Jul 22, 2016
History interface Go, Back, and Forward

<!-- Please describe your changes on the following line: -->
r? @asajeffrey

---
<!-- 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 #5670 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

implement go, forward, back

<!-- 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/12552)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 22, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 22, 2016
@highfive

Copy link
Copy Markdown
  ▶ Unexpected subtest result in /html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html:
  └ PASS [expected FAIL] Restoring window.name on cross-origin history traversal

@asajeffrey

Copy link
Copy Markdown
Contributor

Oh how ironic, this test is now intermittent, most likely due to the race condition between f.onload and the setTimeout.

@cbrewster

Copy link
Copy Markdown
Contributor Author

@asajeffrey sigh.. I wonder if there is a way we can make this pass in both Gecko and Servo regardless of the onload issue

@cbrewster

cbrewster commented Jul 22, 2016 •

Copy link
Copy Markdown
Contributor Author

Would it be ok to change: https://github.com/ConnorGBrewster/servo/blob/master/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html#L40

onload = setTimeout(next, 0);

to

next();

That makes it pass in Servo(as the onload callback is not called for about:blank) and I assume Gecko as well (Firefox gets mad about www.localhost and I don't have a local copy of Gecko, it would be nice if someone could double check this).

implement go, forward, back
@cbrewster
cbrewster force-pushed the history_interface branch from 7273f24 to 8d7a0c2 Compare July 22, 2016 20:08
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 22, 2016
@cbrewster

cbrewster commented Jul 22, 2016 •

Copy link
Copy Markdown
Contributor Author

Disabled browsing_context_name_cross_origin.html until we can get a fix for it.

@cbrewster

Copy link
Copy Markdown
Contributor Author

@bors-servo r=asajeffrey

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 8d7a0c2 has been approved by asajeffrey

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 22, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 8d7a0c2 with merge 0e887ca...

bors-servo pushed a commit that referenced this pull request Jul 22, 2016
History interface Go, Back, and Forward

<!-- Please describe your changes on the following line: -->
r? @asajeffrey

---
<!-- 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 #5670 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

implement go, forward, back

<!-- 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/12552)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo
bors-servo merged commit 8d7a0c2 into servo:master Jul 22, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 22, 2016
@emilio

emilio commented Jul 26, 2016

Copy link
Copy Markdown
Member

#12563 makes some changes to onload to make it more consistent, would be nice to see if those changes fix any of the races you see here.

@cbrewster

Copy link
Copy Markdown
Contributor Author

@emilio I tested locally and haven't hit any intermittent failures! 🎉 I will leave those issues open for a bit to make sure. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement History's back/forward APIs

6 participants