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

Combine Page into BrowsingContext #11044

Merged
merged 3 commits into from May 12, 2016

Conversation

@cbrewster
Copy link
Member

cbrewster commented May 6, 2016

Fixes #11031.

Page and BrowsingContext have similar use cases and we decided it would be best to join the two.

This is the ground work for actually using session history in the BrowsingContext to implement the History API.

r? @jdm


This change is Reviewable

@highfive
Copy link

highfive commented May 6, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/lib.rs, components/script/webdriver_handlers.rs, components/script/dom/storage.rs, components/script/dom/browsingcontext.rs, components/script/page.rs, components/script/script_thread.rs, components/script/dom/window.rs, components/script/devtools.rs
@highfive
Copy link

highfive commented May 6, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified.Please consider adding a test!
@cbrewster
Copy link
Member Author

cbrewster commented May 6, 2016

bors-servo added a commit that referenced this pull request May 6, 2016
Combine Page into BrowsingContext

Fixes #11031.

`Page` and `BrowsingContext` have similar use cases and we decided it would be best to join the two.

This is the ground work for actually using session history in the `BrowsingContext` to implement the History API.

r? @jdm

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

bors-servo commented May 6, 2016

Trying commit 7165d3a with merge b7bcc25...

@bors-servo
Copy link
Contributor

bors-servo commented May 6, 2016

💔 Test failed - mac-rel-css

@highfive
Copy link

highfive commented May 6, 2016

  ▶ TIMEOUT [expected FAIL] /css-transforms-1_dev/html/iframe-001.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ TIMEOUT [expected PASS] /css-transforms-1_dev/html/transform-iframe-001.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected FAIL] /css21_dev/html4/font-size-121.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ TIMEOUT [expected FAIL] /css21_dev/html4/min-width-tables-001.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified
@cbrewster cbrewster mentioned this pull request May 6, 2016
18 of 24 tasks complete
@cbrewster cbrewster force-pushed the cbrewster:page_to_browsing_context branch from 7165d3a to a2faace May 6, 2016
@highfive highfive removed the S-tests-failed label May 6, 2016
@highfive
Copy link

highfive commented May 6, 2016

New code was committed to pull request.

@cbrewster cbrewster force-pushed the cbrewster:page_to_browsing_context branch from a2faace to 4cddf88 May 6, 2016
@highfive
Copy link

highfive commented May 6, 2016

New code was committed to pull request.

@cbrewster
Copy link
Member Author

cbrewster commented May 6, 2016

@bors-servo
Copy link
Contributor

bors-servo commented May 6, 2016

Trying commit 4cddf88 with merge fa7fd35...

bors-servo added a commit that referenced this pull request May 6, 2016
Combine Page into BrowsingContext

Fixes #11031.

`Page` and `BrowsingContext` have similar use cases and we decided it would be best to join the two.

This is the ground work for actually using session history in the `BrowsingContext` to implement the History API.

r? @jdm

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

bors-servo commented May 6, 2016

💔 Test failed - windows

@cbrewster cbrewster force-pushed the cbrewster:page_to_browsing_context branch from 4cddf88 to 4e98f43 May 6, 2016
@highfive
Copy link

highfive commented May 6, 2016

New code was committed to pull request.

@highfive highfive removed the S-tests-failed label May 6, 2016
@bors-servo
Copy link
Contributor

bors-servo commented May 6, 2016

Trying commit 4e98f43 with merge 834c782...

bors-servo added a commit that referenced this pull request May 6, 2016
Combine Page into BrowsingContext

Fixes #11031.

`Page` and `BrowsingContext` have similar use cases and we decided it would be best to join the two.

This is the ground work for actually using session history in the `BrowsingContext` to implement the History API.

r? @jdm

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

bors-servo commented May 7, 2016

💔 Test failed - mac-rel-css

@highfive
Copy link

highfive commented May 7, 2016

  ▶ TIMEOUT [expected FAIL] /css-transforms-1_dev/html/iframe-001.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected FAIL] /css21_dev/html4/c5510-ipadn-000.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected PASS] /css21_dev/html4/font-size-081.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected PASS] /css21_dev/html4/padding-bottom-applies-to-002.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected FAIL] /css21_dev/html4/replaced-intrinsic-003.htm
  │ 
  │ Shutting down the Constellation after generating an output file or exit flag specified
  └ Shutting down the Constellation after generating an output file or exit flag specified

  ▶ CRASH [expected PASS] /css21_dev/html4/width-045.htm
  │ 
  └ Shutting down the Constellation after generating an output file or exit flag specified
@cbrewster
Copy link
Member Author

cbrewster commented May 7, 2016

@bors-servo retry

bors-servo added a commit that referenced this pull request May 11, 2016
Trace and finalize BrowsingContext

This is a prerequisite for merging #11044, and is an important correctness fix on its own.

r? @Ms2ger

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

bors-servo commented May 11, 2016

The latest upstream changes (presumably #11113) made this pull request unmergeable. Please resolve the merge conflicts.

Allow for adding history items

Fixed nested iframe test failure

Cleanup and small refactors

fixup
@cbrewster cbrewster force-pushed the cbrewster:page_to_browsing_context branch from d323481 to cbc5ca6 May 11, 2016
@cbrewster
Copy link
Member Author

cbrewster commented May 11, 2016

This should now be ready for review.

@highfive
Copy link

highfive commented May 11, 2016

New code was committed to pull request.

@jdm
Copy link
Member

jdm commented May 11, 2016

This is great! I'm so please to see Page totally gone :)
-S-awaiting-review +S-needs-code-changes

Previously, highfive wrote…

New code was committed to pull request.


Reviewed 9 of 9 files at r1, 14 of 14 files at r2, 12 of 12 files at r3, 1 of 1 files at r4, 3 of 3 files at r5, 1 of 1 files at r6, 3 of 3 files at r7, 2 of 2 files at r8, 3 of 3 files at r9, 18 of 18 files at r10, 13 of 13 files at r11, 3 of 3 files at r12, 3 of 3 files at r13.
Review status: all files reviewed at latest revision, 5 unresolved discussions.


components/script/script_thread.rs, line 627 [r1] (raw file):

        let mut resizes = vec!();

        {

We can get rid of the extra scope now that there's no borrowing.


components/script/script_thread.rs, line 1398 [r1] (raw file):

            chan.send(ConstellationMsg::SetFinalUrl(incomplete.pipeline_id, final_url.clone())).unwrap();
        }
        debug!("ScriptThread: loading {} on context {:?}", incomplete.url, incomplete.pipeline_id);

I think pipeline would make more sense here.


components/script/dom/browsingcontext.rs, line 190 [r1] (raw file):

            self.stack.extend(context.children.borrow()
                                              .iter()
                                              .cloned()

Why is this cloned necessary?


components/script/dom/browsingcontext.rs, line 104 [r10] (raw file):

        history.push(SessionHistoryEntry::new(document, document.url().clone(), document.Title()));
        self.active_index.set(self.active_index.get() + 1);
    }

Let's add assert_eq!(self.active_index.get(), history.len() - 1).


components/script/dom/browsingcontext.rs, line 130 [r10] (raw file):

                             .position(|context| context.id == id);
        match remove_idx {
            Some(idx) => Some(Root::from_ref(&*self.children.borrow_mut().remove(idx))),

Is the Root::from_ref even necessary here?


Comments from Reviewable

@highfive
Copy link

highfive commented May 11, 2016

New code was committed to pull request.

@cbrewster
Copy link
Member Author

cbrewster commented May 11, 2016

Review status: all files reviewed at latest revision, 5 unresolved discussions.


components/script/script_thread.rs, line 627 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

We can get rid of the extra scope now that there's no borrowing.


Done.


components/script/script_thread.rs, line 1398 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

I think pipeline would make more sense here.


Done.


components/script/dom/browsingcontext.rs, line 190 [r1] (raw file):

Previously, jdm (Josh Matthews) wrote…

Why is this cloned necessary?


Done.


components/script/dom/browsingcontext.rs, line 104 [r10] (raw file):

Previously, jdm (Josh Matthews) wrote…

Let's add assert_eq!(self.active_index.get(), history.len() - 1).


Done.


components/script/dom/browsingcontext.rs, line 130 [r10] (raw file):

Previously, jdm (Josh Matthews) wrote…

Is the Root::from_ref even necessary here?


The Vec stores JS<BrowsingContext> and the function returns a Option<Root<BrowsingContext>>. I have that to change the JS to Root. Is that ok? or is there a better way to handle this?


Comments from Reviewable

@jdm
Copy link
Member

jdm commented May 11, 2016

@bors-servo: r+
Yay!

Previously, highfive wrote…

New code was committed to pull request.


Reviewed 2 of 2 files at r14.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2016

📌 Commit e50eb2a has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented May 12, 2016

Testing commit e50eb2a with merge 685dc99...

bors-servo added a commit that referenced this pull request May 12, 2016
Combine Page into BrowsingContext

Fixes #11031.

`Page` and `BrowsingContext` have similar use cases and we decided it would be best to join the two.

This is the ground work for actually using session history in the `BrowsingContext` to implement the History API.

r? @jdm

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

bors-servo commented May 12, 2016

@bors-servo bors-servo merged commit e50eb2a into servo:master May 12, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.

None yet

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