| Index: third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
|
| index 842676fb717292ef5d9e3a5e5a3593b4f4c2d903..27dc1c6c58c3e139f572f5bbfcee5b5c120a0c70 100644
|
| --- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
|
| +++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
|
| @@ -198,6 +198,15 @@ bool SharedStyleFinder::sharingCandidateCanShareHostStyles(
|
| return elementShadow->hasSameStyles(*candidateShadow);
|
| }
|
|
|
| +bool SharedStyleFinder::sharingCandidateAssignedToSameSlot(
|
| + Element& candidate) const {
|
| + HTMLSlotElement* elementSlot = element().assignedSlot();
|
| + HTMLSlotElement* candidateSlot = candidate.assignedSlot();
|
| + if (!elementSlot && !candidateSlot)
|
| + return true;
|
| + return elementSlot == candidateSlot;
|
| +}
|
| +
|
| bool SharedStyleFinder::sharingCandidateDistributedToSameInsertionPoint(
|
| Element& candidate) const {
|
| HeapVector<Member<InsertionPoint>, 8> insertionPoints,
|
| @@ -251,6 +260,10 @@ bool SharedStyleFinder::canShareStyleWithElement(Element& candidate) const {
|
| return false;
|
| if (!sharingCandidateCanShareHostStyles(candidate))
|
| return false;
|
| + // For Shadow DOM V1
|
| + if (!sharingCandidateAssignedToSameSlot(candidate))
|
| + return false;
|
| + // For Shadow DOM V0
|
| if (!sharingCandidateDistributedToSameInsertionPoint(candidate))
|
| return false;
|
| if (candidate.isInTopLayer() != element().isInTopLayer())
|
|
|