Skip to content

Combine Page into BrowsingContext - #11044

Merged
bors-servo merged 3 commits into
servo:masterfrom
cbrewster:page_to_browsing_context
May 12, 2016
Merged

bors-servo merged 3 commits into
servo:masterfrom
cbrewster:page_to_browsing_context

Conversation

@cbrewster

@cbrewster cbrewster commented May 6, 2016 •

Copy link
Copy Markdown
Contributor

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

highfive commented May 6, 2016

Copy link
Copy Markdown

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

highfive commented May 6, 2016

Copy link
Copy Markdown

warning Warning warning

  • These commits modify script code, but no tests are modified.Please consider adding a test!

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

Copy link
Copy Markdown
Contributor Author

@bors-servo try

bors-servo pushed 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
Copy Markdown
Contributor

⌛ Trying commit 7165d3a with merge b7bcc25...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label May 6, 2016
@highfive

highfive commented May 6, 2016

Copy link
Copy Markdown
  ▶ 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
@cbrewster
cbrewster force-pushed the page_to_browsing_context branch from 7165d3a to a2faace Compare May 6, 2016 21:29
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label May 6, 2016
@highfive

highfive commented May 6, 2016

Copy link
Copy Markdown

New code was committed to pull request.

@cbrewster
cbrewster force-pushed the page_to_browsing_context branch from a2faace to 4cddf88 Compare May 6, 2016 21:30
@highfive

highfive commented May 6, 2016

Copy link
Copy Markdown

New code was committed to pull request.

@cbrewster

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 4cddf88 with merge fa7fd35...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - windows

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label May 6, 2016
@cbrewster
cbrewster force-pushed the page_to_browsing_context branch from 4cddf88 to 4e98f43 Compare May 6, 2016 23:54
@highfive

highfive commented May 6, 2016

Copy link
Copy Markdown

New code was committed to pull request.

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label May 6, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 4e98f43 with merge 834c782...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - mac-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label May 7, 2016
@highfive

highfive commented May 7, 2016

Copy link
Copy Markdown
  ▶ 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

cbrewster commented May 7, 2016 •

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

bors-servo pushed 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
Copy Markdown
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label May 11, 2016
@jdm jdm removed the S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. label May 11, 2016
Allow for adding history items

Fixed nested iframe test failure

Cleanup and small refactors

fixup
@cbrewster
cbrewster force-pushed the page_to_browsing_context branch from d323481 to cbc5ca6 Compare May 11, 2016 18:47
@cbrewster cbrewster removed the S-needs-rebase There are merge conflict errors. label May 11, 2016
@cbrewster

Copy link
Copy Markdown
Contributor Author

This should now be ready for review.

@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@jdm

jdm commented May 11, 2016

Copy link
Copy Markdown
Member

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

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 11, 2016
@highfive highfive removed the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label May 11, 2016
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

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

Copy link
Copy Markdown
Contributor Author

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

jdm commented May 11, 2016

Copy link
Copy Markdown
Member

@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
Copy Markdown
Contributor

📌 Commit e50eb2a has been approved by jdm

@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 May 11, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit e50eb2a with merge 685dc99...

bors-servo pushed 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
Copy Markdown
Contributor

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

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.

4 participants