Skip to content

Implement document.domain getter - #6840

Closed
evilpie wants to merge 1 commit into
servo:masterfrom
evilpie:document-domain
Closed

evilpie wants to merge 1 commit into
servo:masterfrom
evilpie:document-domain

Conversation

@evilpie

@evilpie evilpie commented Jul 29, 2015

Copy link
Copy Markdown
Contributor

I think this might have the downside that assigning to document.domain will now throw in strict-mode.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 29, 2015
@Ms2ger

Ms2ger commented Jul 30, 2015

Copy link
Copy Markdown
Contributor

You missed the special case for IPv6 hosts, but more importantly, this needs to get the origin, not just the url, and I'm not quite sure how those differ.

@evilpie

evilpie commented Jul 30, 2015

Copy link
Copy Markdown
Contributor Author

The domain of a Document is the host part of the document's origin, if the value of that origin is a scheme/host/port tuple.

I looks like the window's url seems the closest thing to an origin in Servo.

@metajack metajack 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 Jul 30, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Jul 30, 2015
@jdm

jdm commented Aug 8, 2015

Copy link
Copy Markdown
Member

The test for new Document contradicts the spec: "unless the Document has no browsing context, in which case it must return the empty string." That being said, Firefox returns undefined.

@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Aug 11, 2015
@frewsxcv

frewsxcv commented Nov 3, 2015

Copy link
Copy Markdown
Contributor

Any updates on this?

@jdm jdm unassigned Ms2ger Nov 12, 2015
@jdm jdm added the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label Nov 12, 2015
@jdm jdm self-assigned this Nov 12, 2015
@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 12, 2015
@jdm

jdm commented Nov 12, 2015

Copy link
Copy Markdown
Member

There are a couple small changes we should make, but otherwise I'm fine with this implementation!
+@jdm -S-awaiting-review +S-needs-code-changes


Reviewed 2 of 2 files at r1, 2 of 2 files at r2, 1 of 1 files at r3, 1 of 1 files at r4.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


components/script/dom/document.rs, line 1186 [r1] (raw file):
Let's add a TODO comment to use an origin concept when it's available.


tests/wpt/mozilla/tests/mozilla/document_domain.html, line 21 [r3] (raw file):
Let's add a test for (new Document()).domain being the empty string, and mark ourselves as failing it.


Comments from the review on Reviewable.io

@evilpie

evilpie commented Nov 12, 2015

Copy link
Copy Markdown
Contributor Author

Thanks jdm, I will look into this over the weekend.

@jdm

jdm commented Nov 12, 2015

Copy link
Copy Markdown
Member

Apologies for dragging this out for so long!

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Nov 14, 2015
@evilpie

evilpie commented Nov 16, 2015

Copy link
Copy Markdown
Contributor Author

@jdm Ugh should not have squashed it, I guess. But it screwed up the rebase so the commits looked really funny.

@jdm

jdm commented Nov 16, 2015

Copy link
Copy Markdown
Member

@bors-servo: r+
Thanks! Squashing is fine, too.


Reviewed 5 of 5 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from the review on Reviewable.io

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 6342fa4 has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6342fa4 with merge f9a505e...

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 16, 2015
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-needs-rebase There are merge conflict errors. labels Nov 16, 2015
bors-servo pushed a commit that referenced this pull request Nov 16, 2015
Implement document.domain getter

I think this might have the downside that assigning to document.domain will now throw in strict-mode.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6840)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-wpt

@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 Nov 16, 2015
@jdm

jdm commented Nov 16, 2015

Copy link
Copy Markdown
Member
Tests with unexpected results:
  ▶ Unexpected subtest result in /XMLHttpRequest/send-after-setting-document-domain.htm:
  └ PASS [expected FAIL] loading documents from original origin after setting document.domain

  ▶ Unexpected subtest result in /html/dom/interfaces.html:
  └ PASS [expected FAIL] Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type (35)

@jdm

jdm commented Nov 23, 2015

Copy link
Copy Markdown
Member

Rebased in #8655.

@jdm jdm closed this Nov 23, 2015
bors-servo pushed a commit that referenced this pull request Nov 23, 2015
bors-servo pushed a commit that referenced this pull request Nov 23, 2015
bors-servo pushed a commit that referenced this pull request Nov 23, 2015
bors-servo pushed a commit that referenced this pull request Nov 24, 2015
@SimonSapin SimonSapin removed the S-tests-failed The changes caused existing tests to fail. label Jan 27, 2016
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.

8 participants