This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22496 - "A host-including inclusive ancestor is either a..."
Summary: "A host-including inclusive ancestor is either a..."
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 20:13 UTC by Ian 'Hixie' Hickson
Modified: 2013-08-20 19:19 UTC (History)
4 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2013-06-27 20:13:09 UTC
http://dom.spec.whatwg.org/#interface-documentfragment

[[
A host-including inclusive ancestor is either an inclusive ancestor or a host-including inclusive ancestor of an object's root's host, if any
]]

I think I know what this is trying to say (it's trying to be a transitive definition through 'host', I assume), but I think this could do with being rephrased to be clearer. :-)
Comment 1 Anne 2013-06-28 10:01:27 UTC
Would it help if I repeat "object's root's host" (put it after inclusive ancestor)?
Comment 2 Ian 'Hixie' Hickson 2013-08-16 17:32:39 UTC
Even with that, I still have no idea what it's trying to say.

Replacing all the terms of art with "A" and "B" and so on, what's the sentence supposed to be? An A is either a B or an A of a C, if any"? I don't know what that would mean either, for any definition of A, B, and C.
Comment 3 Anne 2013-08-16 17:52:02 UTC
An A is either a B of C or an A of C, if any.
Comment 4 Gordon P. Hemsley 2013-08-16 18:44:08 UTC
I think adding "of an object's root's host" after "an inclusive ancestor" might clarify things a little bit, but I'm not clear on whether "if any" applies just to "an A of C" or if applies to the whole "a B of C or an A of C".
Comment 5 Ian 'Hixie' Hickson 2013-08-16 19:24:27 UTC
> An A is either a B of C or an A of C, if any.

"An A is ... an A" doesn't make sense. I think this is why this sentence is causing me trouble.
Comment 6 Gordon P. Hemsley 2013-08-16 19:41:43 UTC
(In reply to comment #5)
> > An A is either a B of C or an A of C, if any.
> 
> "An A is ... an A" doesn't make sense. I think this is why this sentence is
> causing me trouble.

Yeah... as I mentioned on IRC, recursive definitions don't work very well in plain English. However, you don't seem to have a problem with the definition of "root", which works the same way:

[[
The root of an object is itself, if its parent is null, or else it is the root of its parent.
]]
Comment 7 Gordon P. Hemsley 2013-08-16 19:45:04 UTC
Basically, this definition means (IIUC) that a "host-including inclusive ancestor" is like a regular "inclusive ancestor" except that when you climb up the tree to determine the ancestors, you also pop out of any "host" barrier you meet along the way and continue going up.
Comment 8 Ian 'Hixie' Hickson 2013-08-16 20:45:28 UTC
> The root of an object is itself, if its parent is null, or else it is
> the root of its parent.

That definition makes sense because it starts with "The A of a B is". Essentially, it's of the form:

   Object.Root == Object.Parent ? Object.Parent.Root : Object;

What's the equivalent here? The current definition starts with "The A is", but doesn't say the A of what, so there's nothing to refer to to recurse.
Comment 9 Gordon P. Hemsley 2013-08-16 23:37:41 UTC
(In reply to comment #8)
> What's the equivalent here? The current definition starts with "The A is",
> but doesn't say the A of what, so there's nothing to refer to to recurse.

I think it's more like:

def hostIncludingInclusiveAncestor(object):
  if object.Root.Host:
    return hostIncludingInclusiveAncestory(object.Root.Host)
  else:
    return object.Root
Comment 10 Ian 'Hixie' Hickson 2013-08-17 02:59:11 UTC
Then the definition should be:

"The host-including inclusive ancestor of an object is the object's root's host's host-including inclusive ancestor if the object's root has a host, otherwise, it is the object's root."

...or some such.
Comment 11 Anne 2013-08-20 14:44:15 UTC
I think this is it: "An object /A/ is a host-including inclusive ancestor of an object /B/ if either /A/ is an inclusive ancestor of /B/, or if /B/'s root has an associated host and /A/ is a host-including inclusive ancestor of /B/'s root's host."
Comment 12 Ian 'Hixie' Hickson 2013-08-20 17:08:22 UTC
Yeah, that's way better. Thanks.