Skip to content

Commit

Permalink
Bug 1342258 - Refactor SetDomain to IsRegistrableDomainSuffixOfOrEqua…
Browse files Browse the repository at this point in the history
…lTo r=smaug

This commit refactors the SetDomain method in a Document to call a new function
IsRegistrableDomainSuffixOfOrEqualTo(), defined in HTML [1]. This commit tries
not to rename anything except input variables, so as to remain as clear as
possible. It likely should have various variables renamed, but given the
author's unfamiliarity with this module, review seems a good time to do that.
It's also duplicating comments a little bit; let me know which one(s) you'd like
to keep!

Note: Commentary on the HTML change is available in the PR [2], and the
rationale for this behavior in Web Auentication, where this algorithm will be
used, is also recorded [3].

Updates: Refactored two new protected methods to avoid code duplication.

[1] https://html.spec.whatwg.org/multipage/browsers.html#is-a-registrable-domain-suffix-of-or-is-equal-to
[2] whatwg/html#2365
[3] w3ctag/design-reviews#97 (comment)

MozReview-Commit-ID: 4Dr8yOMdhez

UltraBlame original commit: ffa2f50d49ce0356bbf02ea0940060283dcc007c
  • Loading branch information
marco-c committed Oct 1, 2019
1 parent d66642b commit 5f77b18
Show file tree
Hide file tree
Showing 2 changed files with 307 additions and 125 deletions.
Loading

0 comments on commit 5f77b18

Please sign in to comment.