[Bug 18429] [Shadow]: Specify imperative API for node distribution

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18429

--- Comment #4 from Hayato Ito <hayato@chromium.org> ---
Inspired from the Dimitri's gist, here is yet another idea.
This is a kind of the mixture of 'Passive candidate array' and 'Selector-based
Routing'.
I'd have to say that this is a *very* rough idea.

Given the same DOM tree from the gist,

>> // Make sure that contentSummaryUI selects 'all' from the pool.
>> contentSummaryUI.setAttribute('select', '*')
>> contentSummaryUI.getDistributedNode()
[firstSummary, <p>]

>> // New API for insertion point: addDistributionCandidate(shadow_host, selector)
>> // addDistributionCandidate(..., ...) takes a shadow host and "selector" expression to select nodes from the children of the shadow host.
>> var distributionCandidate1 = contentSummaryUI.addDistributionCandidate(div, "summary:first-of-type");

>> // Supports also specifying a distributed node directly???
>> // var distributionCandidate1 = contentSummaryUI.addDistributionCandidate(firstSummary);

>> contentSummaryUI.distributionCandidates()
[distributionCandidate1]

>> // If an insertion point has a non-empty distributionCandidates, the pool is populated from the list of candidates.

>> contentSummaryUI.getDistributedNodes()
[firstSummary]

>> Does `DistributionCandidate` have an API?
>> distributionCandidate1.nodes()
[firstSummary]

>> contentSummaryUI.removeDistributionCandidate(distributionCandidate1)
>> contentSummaryUI.distributionCandidates()
[]
>> contentSummaryUI.getDistributedNodes();
[firstSummary, <p>]

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 11 April 2014 01:32:31 UTC